Submission #1281477


Source Code Expand

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int N, K;
int C[100001];
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N >> K;
  vector<P> q;
  rep(i, N) {
    int a, b;
    cin >> a >> b;
    C[a] += b;
  }
  for (int i=1; i<=100000; i++) {
    K -= C[i];
    if (K <= 0) {
      cout << i << "\n";
      return 0;
    }
  }
  return 1;
}

Submission Info

Submission Time
Task C - Big Array
User funcsr
Language C++14 (GCC 5.4.1)
Score 0
Code Size 798 Byte
Status RE
Exec Time 16 ms
Memory 640 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 11
RE × 6
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All sample_01.txt, sample_02.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_2.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt
Case Name Status Exec Time Memory
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
subtask_1_1.txt AC 1 ms 640 KB
subtask_1_10.txt RE 3 ms 256 KB
subtask_1_11.txt RE 3 ms 256 KB
subtask_1_12.txt RE 3 ms 256 KB
subtask_1_13.txt RE 3 ms 256 KB
subtask_1_14.txt RE 3 ms 256 KB
subtask_1_15.txt RE 3 ms 256 KB
subtask_1_2.txt AC 2 ms 640 KB
subtask_1_3.txt AC 6 ms 640 KB
subtask_1_4.txt AC 11 ms 640 KB
subtask_1_5.txt AC 16 ms 640 KB
subtask_1_6.txt AC 1 ms 256 KB
subtask_1_7.txt AC 1 ms 640 KB
subtask_1_8.txt AC 2 ms 640 KB
subtask_1_9.txt AC 8 ms 640 KB