criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, k, h, g;
  in2(n, k);
  h = 0;
  vector<pair<ll>> c(n);
  rep(i, n)
    in2(c[i].first, c[i].second);
  sort(all(c));
  g = 0;
  while(h < k){
    h = h + c[g].first * c[g].second;
    g++;
    if(h >= k){
      out(c[g].first);
      memi;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: wrong number of template arguments (1, should be 2)
   21 |   vector<pair<ll>> c(n);
      |               ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc:21:17: error: template argument 1 is invalid
   21 |   vector<pair<ll>> c(n);
      |                 ^~
a.cc:21:17: error: template argument 2 is invalid
a.cc:23:10: error: invalid types 'int[ll {aka long long int}]' for array subscript
   23 |     in2(c[i].first, c[i].second);
      |          ^
a.cc:12:26: note: in definition of macro 'in2'
   12 | #define in2(n, m) cin >> n >> m
      |                          ^
a.cc:23:22: error: invalid types 'int[ll {aka long long int}]' for array subscript
   23 |     in2(c[i].first, c[i].second);
      |                      ^
a.cc:12:31: note: in definition of macro 'in2'
   12 | #define in2(n, m) cin >> n >> m
      |                               ^
a.cc:8:20: error: request for member 'begin' in 'c', which is of non-class type 'int'
    8 | #define all(c) (c).begin(), (c).end()
      |                    ^~~~~
a.cc:24:8: note: in expansion of macro 'all'
   24 |   sort(all(c));
      |        ^~~
a.cc:8:33: error: request for member 'end' in 'c', which is of non-class type 'int'
    8 | #define all(c) (c).begin(), (c).end()
      |                                 ^~~
a.cc:24:8: note: in expansion of macro 'all'
   24 |   sort(all(c));
      |        ^~~
a.cc:27:14: error: invalid types 'int[ll {aka long long int}]' for array subscript
   27 |     h = h + c[g].first * c[g].second;
      |              ^
a.cc:27:27: error: invalid types 'int[ll {aka long long int}]' for array subscript
   27 |     h = h + c[g].first * c[g].second;
      |                           ^
a.cc:30:12: error: invalid types 'int[ll {aka long long int}]' for array subscript
   30 |       out(c[g].first);
      |            ^
a.cc:14:24: note: in definition of macro 'out'
   14 | #define out(n) cout << n
      |                        ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(); 
        int b = sc.nextLong();
        int c = b-b;
        double ans = 0;
        double d;
		double [] in1 = new double [a];
        int f,g;      
        for(int i=0;i<a;i++){f = sc.nextInt();
                             g = sc.nextInt();
                             in1[i] = f+g*0.000001;                           
                            }
		Arrays.sort(in1);       		
        for(int i=0;i<a;i++){d = Math.floor(in1[i]);
                             c+=(in1[i]-d)*1000000;
                             if(c>=b){ans=d;break;}
                            }                                                      
		System.out.println(ans);
	}
}


Compiler output:
Main.java:6: error: incompatible types: possible lossy conversion from long to int
        int b = sc.nextLong();
                           ^
1 error
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(); 
        Long b = sc.nextLong();
        Long c = b-b;
        int ans = 0;
        double d;
		double [] in1 = new double [a];
        int f,g;      
        for(int i=0;i<a;i++){f = sc.nextInt();
                             g = sc.nextInt();
                             in1[i] = f+g*0.000001;                           
                            }
		Arrays.sort(in1);       		
        for(int i=0;i<a;i++){d = Math.floor(in1[i]);
                             c+=(in1[i]-d)*1000000;
                             if(c>=b){ans=d;break;}
                            }                                                      
		System.out.println(ans);
	}
}


Compiler output:
Main.java:18: error: incompatible types: double cannot be converted to Long
                             c+=(in1[i]-d)*1000000;
                                          ^
Main.java:19: error: incompatible types: possible lossy conversion from double to int
                             if(c>=b){ans=d;break;}
                                          ^
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(); 
        Long b = sc.nextLong();
        Long c = b-b;
        int ans = 0;
        int d;
		double [] in1 = new double [a];
        int f,g;      
        for(int i=0;i<a;i++){f = sc.nextInt();
                             g = sc.nextInt();
                             in1[i] = d+ge-6;                           
                            }
		Arrays.sort(in1);       		
        for(int i=0;i<a;i++){d = Math.floor(in1[i]);
                             c+=(in1[i]-d)*1000000;
                             if(c>=b){ans=d;break;}
                            }                                                      
		System.out.println(ans);
	}
}


Compiler output:
Main.java:14: error: cannot find symbol
                             in1[i] = d+ge-6;                           
                                        ^
  symbol:   variable ge
  location: class Main
Main.java:17: error: incompatible types: possible lossy conversion from double to int
        for(int i=0;i<a;i++){d = Math.floor(in1[i]);
                                           ^
Main.java:18: error: incompatible types: double cannot be converted to Long
                             c+=(in1[i]-d)*1000000;
                                          ^
3 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(); 
        Long b = sc.nextLong();
        Long c = b-b;
        int ans = 0;
        int d;
		double [] in1 = new double [a];
        int f,g;      
        for(int i=0;i<a;i++){f = sc.nextInt();
                             g = sc.nextInt();
                             in1[i] = d+ge-6;                           
                            }
		Arrays.sort(in1);       		
        for(int i=0;i<a;i++){d = Math.floor(in1[i]);
                             c+=(in1[i]-d)*1000000;
                             if(c>=b){ans=d;break;}
                            }                                      
                            }                    
		System.out.println(ans);
	}
}


Compiler output:
Main.java:22: error: <identifier> expected
		System.out.println(ans);
		                  ^
Main.java:22: error: <identifier> expected
		System.out.println(ans);
		                      ^
Main.java:24: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(); 
        Long b = sc.nextLong();
        Long c = b-b;
        int ans = 0;
        int d;
		double [] in1 = new double [a];
        int f,g;      
        for(int i=0;i<a;i++){f = sc.nextInt();
                             g = sc.nextInt();
                             in1[i] = d+ge-6                           
                            }
		Arrays.sort(in1);       		
        for(int i=0;i<a;i++){d = Math.floor(in1[i]);
                             c+=(in1[i]-d)*1000000;
                             if(c>=b){ans=d;break;}
                            }                                      
                            }                    
		System.out.println(ans);
	}
}


Compiler output:
Main.java:14: error: ';' expected
                             in1[i] = d+ge-6                           
                                            ^
Main.java:22: error: <identifier> expected
		System.out.println(ans);
		                  ^
Main.java:22: error: <identifier> expected
		System.out.println(ans);
		                      ^
Main.java:24: error: class, interface, enum, or record expected
}
^
4 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(); 
        int b = sc.nextInt();
        int c = 0;
        int ans = 0;
		int [] in1 = new int [a];
        int [] in2 = new int [a];
        int [] in3 = new int [a];
        
        for(int i=0;i<a;i++){in1[i] = sc.nextInt();
                             in2[i] = sc.nextInt();
                             in3[i] = in1[i];
                            }
		Arrays.sort(in1);       		
        while(ans==0){for(int i=0;i<a;i++){
        for(int j=0;j<a;j++){if(in1[i] = in3[j]){c+=in2[j];}
                             if(c>=b){ans=in1[i];}
                            }                                      
                            }
                     }
		System.out.println(ans);
	}
}


Compiler output:
Main.java:19: error: incompatible types: int cannot be converted to boolean
        for(int j=0;j<a;j++){if(in1[i] = in3[j]){c+=in2[j];}
                                       ^
1 error
Language: C++

using ll = long long;
 const int AMAX = 100000;
 ll cnt[AMAX + 1];

 int main(void) {
 int N;
 ll K;
 cin >> N >> K;

 for (int i = 0; i < N; ++i) {
 int A, B;
 cin >> A >> B;
 cnt[A] += B;
 }

 for (int ans = 1; ans <= AMAX; ++ans){
 if (K <= cnt[ans]) {
 cout << ans << endl;
 break;
 }
 K -= cnt[ans];
 }

 return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:2: error: 'cin' was not declared in this scope
    8 |  cin >> N >> K;
      |  ^~~
a.cc:18:2: error: 'cout' was not declared in this scope
   18 |  cout << ans << endl;
      |  ^~~~
a.cc:18:17: error: 'endl' was not declared in this scope
   18 |  cout << ans << endl;
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int max_n = 1e6;
map<int,int> table;
int n;
typedef long long l;
ll k;
int main(){
  cin >> n >> k;
  vector<pair<ll, ll> > v(n);
  for(int i=0 ; i<n ; i++){
    cin >> v[i].first >> v[i].second;
  }
  sort(v.begin(), v.end());
  ll sum = 0;
  ll res = 0;
  for(int i=0 ; i<n ; i++){
    sum += v[i].second;
    if(sum >= k){
      res = v[i].first;
      break;
    }
  }
  cout << res << endl;
  return 0;
}


Compiler output:
a.cc:7:1: error: 'll' does not name a type; did you mean 'l'?
    7 | ll k;
      | ^~
      | l
a.cc: In function 'int main()':
a.cc:9:15: error: 'k' was not declared in this scope
    9 |   cin >> n >> k;
      |               ^
a.cc:10:15: error: 'll' was not declared in this scope; did you mean 'l'?
   10 |   vector<pair<ll, ll> > v(n);
      |               ^~
      |               l
a.cc:10:21: error: template argument 1 is invalid
   10 |   vector<pair<ll, ll> > v(n);
      |                     ^
a.cc:10:23: error: template argument 1 is invalid
   10 |   vector<pair<ll, ll> > v(n);
      |                       ^
a.cc:10:23: error: template argument 2 is invalid
a.cc:12:13: error: invalid types 'int[int]' for array subscript
   12 |     cin >> v[i].first >> v[i].second;
      |             ^
a.cc:12:27: error: invalid types 'int[int]' for array subscript
   12 |     cin >> v[i].first >> v[i].second;
      |                           ^
a.cc:14:10: error: request for member 'begin' in 'v', which is of non-class type 'int'
   14 |   sort(v.begin(), v.end());
      |          ^~~~~
a.cc:14:21: error: request for member 'end' in 'v', which is of non-class type 'int'
   14 |   sort(v.begin(), v.end());
      |                     ^~~
a.cc:15:5: error: expected ';' before 'sum'
   15 |   ll sum = 0;
      |     ^~~~
      |     ;
a.cc:16:5: error: expected ';' before 'res'
   16 |   ll res = 0;
      |     ^~~~
      |     ;
a.cc:18:5: error: 'sum' was not declared in this scope
   18 |     sum += v[i].second;
      |     ^~~
a.cc:18:13: error: invalid types 'int[int]' for array subscript
   18 |     sum += v[i].second;
      |             ^
a.cc:20:7: error: 'res' was not declared in this scope
   20 |       res = v[i].first;
      |       ^~~
a.cc:20:14: error: invalid types 'int[int]' for array subscript
   20 |       res = v[i].first;
      |              ^
a.cc:24:11: error: 'res' was not declared in this scope
   24 |   cout << res << endl;
      |           ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int64_t abs(int64_t n) {
  if (n < 0) {
    n = -n;
  }
  return n;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}

int main() [
  int64_t n, k;
  cin >> n >> k;
  vector <pair <int, int>> v(n);
  rep(i, n) cin >> v.at(i).first >> v.at(i).second;
  sort(v.begin(), v.end());
  rep(i, n) {
    if (k > v.at(i).second) {
      k -= v.at(i).second;
    } else {
      cout << v.at(i).first << endl;
      break;
    }
  }
}

Compiler output:
a.cc:33:11: error: expected primary-expression before 'n'
   33 |   int64_t n, k;
      |           ^
a.cc:33:10: error: expected ']' before 'n'
   33 |   int64_t n, k;
      |          ^~
      |          ]
a.cc:34:3: error: 'cin' does not name a type
   34 |   cin >> n >> k;
      |   ^~~
a.cc:35:30: error: 'n' was not declared in this scope; did you mean 'yn'?
   35 |   vector <pair <int, int>> v(n);
      |                              ^
      |                              yn
a.cc:4:19: error: expected unqualified-id before 'for'
    4 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                   ^~~
a.cc:36:3: note: in expansion of macro 'rep'
   36 |   rep(i, n) cin >> v.at(i).first >> v.at(i).second;
      |   ^~~
a.cc:36:7: error: 'i' does not name a type
   36 |   rep(i, n) cin >> v.at(i).first >> v.at(i).second;
      |       ^
a.cc:4:35: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                   ^
a.cc:36:7: error: 'i' does not name a type
   36 |   rep(i, n) cin >> v.at(i).first >> v.at(i).second;
      |       ^
a.cc:4:49: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                                 ^
a.cc:37:7: error: expected constructor, destructor, or type conversion before '(' token
   37 |   sort(v.begin(), v.end());
      |       ^
a.cc:4:19: error: expected unqualified-id before 'for'
    4 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                   ^~~
a.cc:38:3: note: in expansion of macro 'rep'
   38 |   rep(i, n) {
      |   ^~~
a.cc:38:7: error: 'i' does not name a type
   38 |   rep(i, n) {
      |       ^
a.cc:4:35: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                   ^
a.cc:38:7: error: 'i' does not name a type
   38 |   rep(i, n) {
      |       ^
a.cc:4:49: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                                 ^
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^
Language: C++

#include<bits/stdc+.h>
using namespace std;
using ll = long long;

int main()
{
  ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0);
  ll n, k, a, b;
  cin >> n >> k;
  
  map<ll, ll> freq;
  
  for(int i = 0; i < n; i++)
  {
    cin >> a >> b;
    freq[a] += b;
  }
  
  for(pair<ll, ll>& x: freq)
  {
    if(x.second < k)
      k -= x.second;
    else
    {
      cout << x.first << endl;
      return 0;
    }
  }
  return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc+.h: No such file or directory
    1 | #include<bits/stdc+.h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

from operator import itemgetter
import sys

def read():
    return sys.stdin.readline().rstrip()

n, k = map(int, input().split())
ab = sorted([[int(i) for i in read().split()] for _ in range(n)], key=itemgetter(0))
c = 0
for a, b in ab:
    c += b
    if c >= k:
        print(a)
        break

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from operator import itemgetter
      | ^~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
typedef long long ll;
#define fup(i,a,b) for(register int i=a;i<b;++i)
#define dint __int128

dint read()
{
dint x;char a;while((a=getchar())<48||a>57);
for(x=a-48;(a=getchar())>47&&a<58;x=(x<<3)+(x<<1)+(a^48))
return x;
}
struct node{
    int a,b;
}s[105004];
bool cmp(node x,node y)
{return x.a<y.a;}
void Main()
{
    int n;
    scanf("%d",&n);b
    dint k=read();
    fup(i,0,n)scanf("%d%d",&s[i].a,&s[i].b);
    sort(s,s+n,cmp);
    int i=0;
    while(k>=0)k-=s[i++].b;
    printf("%d",s[i-1].a);
}

int main()
{
Main();
return 0;
}

Compiler output:
a.cc: In function 'void Main()':
a.cc:24:20: error: 'b' was not declared in this scope
   24 |     scanf("%d",&n);b
      |                    ^
a.cc:26:9: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   26 |     fup(i,0,n)scanf("%d%d",&s[i].a,&s[i].b);
      |         ^
a.cc:7:37: note: in definition of macro 'fup'
    7 | #define fup(i,a,b) for(register int i=a;i<b;++i)
      |                                     ^
a.cc:29:11: error: 'k' was not declared in this scope
   29 |     while(k>=0)k-=s[i++].b;
      |           ^
a.cc: In function '__int128 read()':
a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    /*
    i1 i2 i3 i4 ... iN
    7 5
    7 7 7 7 7
    6 2
    6 6
    */
    ios::sync_with_stdio(0); cin.tie(0);
    
    ll N, K; cin >> N >> K;
    ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
    for(int i = 1; i <= N; i++){
        int a, b; cin >> a >> b;
        Area[a] += b;
    }
    
    ll Ans = 0;
    for(int i = 1; K > 0; i++){
        Ans = i;
        K -= Area[i];
    }
    
    cout << Ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: expected identifier before numeric constant
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                           ^
a.cc: In lambda function:
a.cc:16:37: error: expected '{' before '=' token
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                     ^
a.cc: In function 'int main()':
a.cc:16:39: error: no match for 'operator=' (operand types are 'main()::<lambda()>' and 'int')
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                       ^
a.cc:16:35: note: candidate: 'main()::<lambda()>& main()::<lambda()>::operator=(const main()::<lambda()>&)' (deleted)
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                   ^
a.cc:16:35: note:   no known conversion for argument 1 from 'int' to 'const main()::<lambda()>&'
a.cc:16:43: error: expected identifier before numeric constant
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                           ^~
a.cc: In lambda function:
a.cc:16:58: error: expected '{' before '=' token
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                                          ^
a.cc: In function 'int main()':
a.cc:16:60: error: no match for 'operator=' (operand types are 'main()::<lambda()>' and 'int')
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                                            ^
a.cc:16:56: note: candidate: 'main()::<lambda()>& main()::<lambda()>::operator=(const main()::<lambda()>&)' (deleted)
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                                        ^
a.cc:16:56: note:   no known conversion for argument 1 from 'int' to 'const main()::<lambda()>&'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    /*
    i1 i2 i3 i4 ... iN
    7 5
    7 7 7 7 7
    6 2
    6 6
    */
    ios::sync_with_stdio(0); cin.tie(0);
    
    ll N, K; cin >> N >> K;
    ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
    for(int i = 0; i < N; i++){
        int a, b; cin >> a >> b;
        Area[a] += b;
    }
    
    ll Ans = 0;
    for(int i = 0; K > 0; i++){
        Ans = i;
        K -= Area[i];
    }
    
    cout << Ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: expected identifier before numeric constant
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                           ^
a.cc: In lambda function:
a.cc:16:37: error: expected '{' before '=' token
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                     ^
a.cc: In function 'int main()':
a.cc:16:39: error: no match for 'operator=' (operand types are 'main()::<lambda()>' and 'int')
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                       ^
a.cc:16:35: note: candidate: 'main()::<lambda()>& main()::<lambda()>::operator=(const main()::<lambda()>&)' (deleted)
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                   ^
a.cc:16:35: note:   no known conversion for argument 1 from 'int' to 'const main()::<lambda()>&'
a.cc:16:43: error: expected identifier before numeric constant
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                           ^~
a.cc: In lambda function:
a.cc:16:58: error: expected '{' before '=' token
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                                          ^
a.cc: In function 'int main()':
a.cc:16:60: error: no match for 'operator=' (operand types are 'main()::<lambda()>' and 'int')
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                                            ^
a.cc:16:56: note: candidate: 'main()::<lambda()>& main()::<lambda()>::operator=(const main()::<lambda()>&)' (deleted)
   16 |     ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
      |                                                        ^
a.cc:16:56: note:   no known conversion for argument 1 from 'int' to 'const main()::<lambda()>&'
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N
  long long K;
  cin >> N >> K;
  vector<pair<int, int>> AB(N);
  for (int i = 0, a, b; i < N && cin >> a >> b; i++) AB.at(i) = {a, b};
  sort(AB.begin(), AB.end());

  int ans = 0
  long long sum = 0;
  for (int i = 0; i < N; i++) {
    sum += AB.at(i).second;
    if (sum >= K) {
      cout << AB.at(i).first << "\n";
      break;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'long'
    6 |   long long K;
      |   ^~~~
a.cc:7:10: error: 'N' was not declared in this scope
    7 |   cin >> N >> K;
      |          ^
a.cc:7:15: error: 'K' was not declared in this scope
    7 |   cin >> N >> K;
      |               ^
a.cc:13:3: error: expected ',' or ';' before 'long'
   13 |   long long sum = 0;
      |   ^~~~
a.cc:15:5: error: 'sum' was not declared in this scope
   15 |     sum += AB.at(i).second;
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

// 最小公倍数
unsigned lcm(unsigned a, unsigned b){
    return a / gcd(a, b) * b; 
}

int main(){
  int N, K;
  cin >> N >> K;
  map<ll, ll>A;
  REP(i, N){
    int x, y;
    cin >> x >> y;
    A[x] += y;
  }

  for(auto G : A){
    if(K <= G.second) {
      print(G.first);
      break;
    }
  K -= G.second;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:2: error: expected '}' at end of input
   54 | }
      |  ^
a.cc:38:11: note: to match this '{'
   38 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

// 最小公倍数
unsigned lcm(unsigned a, unsigned b){
    return a / gcd(a, b) * b; 
}

int main(){
  int N, K;
  cin >> N >> K;
  map<ll, ll>A;
  REP(i, N){
    int x, y;
    cin >> x >> y;
    A[x] += y;
  }

  for(auto G : A){
    if(K <= G.second) {
      print(G.first)
      break;
    }
  K -= G.second;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:7: error: expected ';' before 'break'
   51 |       break;
      |       ^~~~~
a.cc:54:2: error: expected '}' at end of input
   54 | }
      |  ^
a.cc:38:11: note: to match this '{'
   38 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  int N,K; cin>>N>>K;
  vector<pii> A(N);
  rep(_,0,N) cin>>A[i].first>>A[i].second;
  sort(ALL(A));
  int sum=0;
  rep(i,0,N){
    sum+=A[i].second;
    if(sum>=K){
      cout<<A[i].first;
      break;
    }
  }
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: 'i' was not declared in this scope
   18 |   rep(_,0,N) cin>>A[i].first>>A[i].second;
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define MAX 1000000007
int main(){
    int n
    long long k; cin >> n >> k;
    pair<int, long long> p[n];
    for(int i = 0; i < n; i++){
        int a,b; cin >> a >> b;
        p[i] = make_pair(a,b);
    }
    for(int i = 0; i < n; i++){
        if(p[i].second < k){
            k -= p[i].second;
        }else{
            cout << p[i].first << endl;
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'long'
    6 |     long long k; cin >> n >> k;
      |     ^~~~
a.cc:6:25: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |     long long k; cin >> n >> k;
      |                         ^
      |                         yn
a.cc:6:30: error: 'k' was not declared in this scope
    6 |     long long k; cin >> n >> k;
      |                              ^
a.cc:10:9: error: 'p' was not declared in this scope
   10 |         p[i] = make_pair(a,b);
      |         ^
a.cc:13:12: error: 'p' was not declared in this scope
   13 |         if(p[i].second < k){
      |            ^
Language: C++

//#include<iostream>
//#include<algorithm>
//#include<string>
//#include <cmath>
//#include <vector>
#include <bits/stdc++.h>

#define ll long long
#define REP(x,n) for(int x=0;x<n;x++)

// vector 操作   size(), empty(), insert(itr,値), erase(itr) (first,last),
// sort(itr), find(all(x),値),reverse(itr)
#define vei vector<int> 
#define velli vector<long long int> 
#define pb(x) push_back(x) // 末尾にxを加える
#define pb2 pop_back() // 末尾削除
#define all(x) (x).begin(),(x).end() //イテレーター

using namespace std;

int main (){
    ll int n, k;
    cin >> n >> k;
    velli a(n);
    velli b(n);
    velli v;

    for (int i=0; i<n; i++){
        cin >> a[i]; 
        cin >> b[i];
    }

    for (int i=0;i<n; i++){
        for (int j=0;j<b[i];j++){
            v.pb(a[i]);
        }
    }
    sort(all(v));

    cout << v[k-1] << endl;

    //REP(i,v.size()){
    //cout << v[i] << endl;
    }
}

Compiler output:
a.cc:45:1: error: expected declaration before '}' token
   45 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll long long;
int main(){
    ll N,K;
    vector<ll> v;
    map<ll,ll> m;
    cin >> N >> K;
    for (ll i=0;i<(N);i++){
        ll ai,bi;
            cin >> ai >> bi;
            for(ll j=0;j<bi;j++){
                v.push_back(ai);
            }
    }
    sort(v.begin(),v.end());
    cout << v.at(K-1) << endl;

}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'll'
    3 | using ll long long;
      |       ^~
a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
    5 |     ll N,K;
      |     ^~
a.cc:6:14: error: template argument 2 is invalid
    6 |     vector<ll> v;
      |              ^
a.cc:7:14: error: template argument 3 is invalid
    7 |     map<ll,ll> m;
      |              ^
a.cc:7:14: error: template argument 4 is invalid
a.cc:8:12: error: 'N' was not declared in this scope
    8 |     cin >> N >> K;
      |            ^
a.cc:8:17: error: 'K' was not declared in this scope
    8 |     cin >> N >> K;
      |                 ^
a.cc:9:12: error: expected ';' before 'i'
    9 |     for (ll i=0;i<(N);i++){
      |            ^~
      |            ;
a.cc:9:17: error: 'i' was not declared in this scope
    9 |     for (ll i=0;i<(N);i++){
      |                 ^
a.cc:10:11: error: expected ';' before 'ai'
   10 |         ll ai,bi;
      |           ^~~
      |           ;
a.cc:11:20: error: 'ai' was not declared in this scope
   11 |             cin >> ai >> bi;
      |                    ^~
a.cc:11:26: error: 'bi' was not declared in this scope
   11 |             cin >> ai >> bi;
      |                          ^~
a.cc:12:19: error: expected ';' before 'j'
   12 |             for(ll j=0;j<bi;j++){
      |                   ^~
      |                   ;
a.cc:12:24: error: 'j' was not declared in this scope
   12 |             for(ll j=0;j<bi;j++){
      |                        ^
a.cc:13:19: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   13 |                 v.push_back(ai);
      |                   ^~~~~~~~~
a.cc:16:12: error: request for member 'begin' in 'v', which is of non-class type 'int'
   16 |     sort(v.begin(),v.end());
      |            ^~~~~
a.cc:16:22: error: request for member 'end' in 'v', which is of non-class type 'int'
   16 |     sort(v.begin(),v.end());
      |                      ^~~
a.cc:17:15: error: request for member 'at' in 'v', which is of non-class type 'int'
   17 |     cout << v.at(K-1) << endl;
      |               ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int N, K;

int main(){
  cin >> N >> K;
  vector<ll> ab(100010, 0);

  ll a, b;
  for(int i = 1; i <= N; i++){
    cin >> a >> b;
    ab[a] += b;
  }

  ll sum = 0; int j = 1;
  while(sum < K) sum += ab[j++]

  cout << j-1 << endl;
  return 0;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:18:32: error: expected ';' before 'cout'
   18 |   while(sum < K) sum += ab[j++]
      |                                ^
      |                                ;
   19 | 
   20 |   cout << j-1 << endl;
      |   ~~~~
Language: C++

#include <iostream>

using namespace std;

int main() {
    int n, k;   cin >> n >> k;
    int *cnt = new int[100010];
    int a, b;
    for (int i = 0; i < n; i++) {
        cin >> a >> b;
        cnt[a] += b;
    }

    int c = 0;
    for (int i = 1; i <= 100000; i++) {
        if (c+cnt[i] >= k) {
            cout << i << endl;
            return 0;
        }
        c += b[i];
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: invalid types 'int[int]' for array subscript
   20 |         c += b[i];
      |               ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main() {
  int N, K;
  cin >> N >> K;
  vector<pair<int, int> > v;
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    v.push_back(make_pair(a, b));
  }

  sort(v.begin(), v.end());
  long long sum = 0;
  for (int i = 0; i < N; i++) {
    sum += v[i].second;
    if (sum >= K) {
      cout << v[i].first << endl;
      break;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
Language: C++

//ABC061C
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
#include <unordered_map>
using namespace std;

int main(){
	int n
	long long int k;
	cin >> n >> k;
	vector<int> a(n), b(n), x(100000);
	for(int i=0;i<100000;i++){
		x.at(i) = 0;
	}
	for(int i=0;i<n;i++){
		cin >> a.at(i) >> b.at(i);
		x.at(a.at(i)-1) += b.at(i);
	}
	int count = 0;
	for(int i=0;i<100000;i++){
		count += x.at(i);
		if(count >= k){
			cout << i+1 << endl;
			return 0;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: expected initializer before 'long'
   16 |         long long int k;
      |         ^~~~
a.cc:17:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   17 |         cin >> n >> k;
      |                ^
      |                yn
a.cc:17:21: error: 'k' was not declared in this scope
   17 |         cin >> n >> k;
      |                     ^
Language: C++

int main(void){
    int n;
    int k;
    long long sum=0;
    
    scanf("%d %d",&n,&k);
    int data[n][2];
    for(int i=0;i<n;i++){
       scanf("%d %d",&data[i][0],&data[i][1]);
      
    }
    

    
    qsort(data, n, sizeof(data[0]), compare_int);//ソート関数（配列めい、総数、固定、比較方法）
    for(int i=0;i<n;i++){
      //  printf("%d %d\n",data[i][0],data[i][1]);
    }
    for(int i=0;i<n;i++){
        
    sum+=data[i][1];
    if(sum >=k){
        printf("%d\n",data[i][0]);
        break;
    }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'scanf' was not declared in this scope
    6 |     scanf("%d %d",&n,&k);
      |     ^~~~~
a.cc:15:37: error: 'compare_int' was not declared in this scope
   15 |     qsort(data, n, sizeof(data[0]), compare_int);//ソート関数（配列めい、総数、固定、比較方法）
      |                                     ^~~~~~~~~~~
a.cc:15:5: error: 'qsort' was not declared in this scope
   15 |     qsort(data, n, sizeof(data[0]), compare_int);//ソート関数（配列めい、総数、固定、比較方法）
      |     ^~~~~
a.cc:23:9: error: 'printf' was not declared in this scope
   23 |         printf("%d\n",data[i][0]);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void){
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))

#define INF 2e9
#define INF_LL 1LL<<60
#define ll long long

typedef pair<ll, ll> P;

int main(){
    ll n, k;
    cin >> n >> k;
    vector<P> suji(n);
    REP(i, n) {
        cin >> suji[i].first >> suji[i].second;
    }
    sort(suji.begin(), suji.end())
    ll wa = 0, idx = 0;
    ll ans = 0;
    while(k > wa) {
        wa += suji[idx].second;
        ans = suji[idx].first;
        idx++;
    }

    cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:35: error: expected ';' before 'long'
   22 |     sort(suji.begin(), suji.end())
      |                                   ^
      |                                   ;
a.cc:25:15: error: 'wa' was not declared in this scope
   25 |     while(k > wa) {
      |               ^~
a.cc:26:20: error: 'idx' was not declared in this scope
   26 |         wa += suji[idx].second;
      |                    ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  long k;
  cin >> n >> k;
  int a[n];
  int b[n];
  int i;
  for(i=0;i<n;i++){
    cin >> a[i] >> b[i];
  }
  vector<pair<int,int>> p(n);
  for(i=0;i<n;i++){
    p[i] = make_pair(a[i],b[i]);
  }
  sort(p.begin(),p.end());
  int cnt = 0;
  int tmp = 0;
  for(i=0;i<n&&cnt < k;i++){
    cnt += p.second;
    tmp = i;
  }
  cout << i;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   21 |     cnt += p.second;
      |              ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  long k;
  cin >> n >> k;
  int a[n];
  int b[n];
  int i;
  for(i=0;i<n;i++){
    cin >> a[i] >> b[i];
  }
  vector<pair<int,int>> p(n);
  for(i=0;i<n;i++){
    p[i] = make_pair(a[i],b[i]);
  }
  sort(p.begin(),p.end());
  int cnt = 0;
  int tmp = 0;
  for(i=0;i<n&&cnt < k;i++){
    cnt += p.second();
    tmp = i;
  }
  cout << i;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   21 |     cnt += p.second();
      |              ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  long k;
  cin >> n >> k;
  int a[n];
  int b[n];
  int i;
  for(i=0;i<n;i++){
    cin >> a[i] >> b[i];
  }
  pair<int,int> p[n];
  for(i=0;i<n;i++){
    p[i] = make_pair(a[i],b[i]);
  }
  sort(p.begin(),p.end());
  int cnt = 0;
  int tmp = 0;
  for(i=0;i<n&&cnt < k;i++){
    cnt += p.second();
    tmp = i;
  }
  cout << i;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: request for member 'begin' in 'p', which is of non-class type 'std::pair<int, int> [n]'
   17 |   sort(p.begin(),p.end());
      |          ^~~~~
a.cc:17:20: error: request for member 'end' in 'p', which is of non-class type 'std::pair<int, int> [n]'
   17 |   sort(p.begin(),p.end());
      |                    ^~~
a.cc:21:14: error: request for member 'second' in 'p', which is of non-class type 'std::pair<int, int> [n]'
   21 |     cnt += p.second();
      |              ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define F(n) for(long i=0;i<n;++i)

long main()
{
    long n,k;
    cin >> n >> k;
    long a,b;
    vector<pair<long,long> > v; 
    F(n){
        cin >> a >> b;
        v.push_back(make_pair(a,b));
    }
    sort(v.begin(),v.end());
    long ans=0,cnt=0;
    F(v.size()){
        cnt += v[i].second;
        if(cnt>=k){
            ans = v[i].first;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数：優先度付きキュー　最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector>
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define rep1(i,n)  for(ll i=1; i<=n; i++)
#define rrep1(i,n) for(ll i=n; 1<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF 1e18
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
  int n; ll k;  cin >> n >> k;
  vector<make_pair<int,int>> p,cnt(n);
  rep0(i,n){
    cin >> p.first >> p.second;
  }
  sort(all(p));
  rep0(i,n){
    cnt[i+1] = cnt[i]+b[i];
  }
  rep0(i,n){
    if(cnt[i+1] >= k){
      cout << a[i] << endl;
      return 0;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:27: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
   29 |   vector<make_pair<int,int>> p,cnt(n);
      |                           ^~
a.cc:29:27: note:   expected a type, got 'make_pair<int, int>'
a.cc:29:27: error: template argument 2 is invalid
a.cc:31:14: error: request for member 'first' in 'p', which is of non-class type 'int'
   31 |     cin >> p.first >> p.second;
      |              ^~~~~
a.cc:31:25: error: request for member 'second' in 'p', which is of non-class type 'int'
   31 |     cin >> p.first >> p.second;
      |                         ^~~~~~
a.cc:20:20: error: request for member 'begin' in 'p', which is of non-class type 'int'
   20 | #define all(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:33:8: note: in expansion of macro 'all'
   33 |   sort(all(p));
      |        ^~~
a.cc:20:32: error: request for member 'end' in 'p', which is of non-class type 'int'
   20 | #define all(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:33:8: note: in expansion of macro 'all'
   33 |   sort(all(p));
      |        ^~~
a.cc:35:8: error: invalid types 'int[ll {aka long long int}]' for array subscript
   35 |     cnt[i+1] = cnt[i]+b[i];
      |        ^
a.cc:35:19: error: invalid types 'int[ll {aka long long int}]' for array subscript
   35 |     cnt[i+1] = cnt[i]+b[i];
      |                   ^
a.cc:35:23: error: 'b' was not declared in this scope
   35 |     cnt[i+1] = cnt[i]+b[i];
      |                       ^
a.cc:38:11: error: invalid types 'int[ll {aka long long int}]' for array subscript
   38 |     if(cnt[i+1] >= k){
      |           ^
a.cc:39:15: error: 'a' was not declared in this scope
   39 |       cout << a[i] << endl;
      |               ^
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <ctime>
#include <climits>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <utility>
#include <cstdlib>

using namespace std;
long int pow107 = (int)pow(10, 9) + 7;
long int limit = LONG_MAX;

bool comp(pair<int, string> a, pair<int, string> b){
    if(a.first != b.first) return a.first > b.first;
    else return a.second < b.second;
}

long int jou(long int x, long int y){
    long int f = 1;
    for(int i = 0; i < y; ++i){
        f = f * x % pow107;
    }
    return f;
}

bool pn(long int x){
    if(x != 2 && x % 2 == 0)
        return false;
    for(int i = 3; i < x; ++i){
        if(x != i && x % i == 0)
            return false;
    }
    return true;
}

long int factorial(long int n){
    long int f = 1;
    for(long int i = 1; i <= n; ++i){
        f = f * i % pow107;
    }
    return f;
}

//最大limit
//10^9+7    pow107
//素数pn
//n乗jou
//コンビネーションfactorial
//

int main(){
    int n , k , t = 0;
    cin >> n >> k;
    vector<pair<int, int> > v;
    for(int i = 0; i < n; ++i){
        int a,b;
        cin >> a >> b;
        v.push_back(make_pair(a,b));
    }
    sort(v.begin(),v.end());

    while(t < k){
        t += v.second;
        if(t >= k){
            cout << v.first << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:16: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   68 |         t += v.second;
      |                ^~~~~~
a.cc:70:23: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   70 |             cout << v.first << endl;
      |                       ^~~~~
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  ll n, k, a, b, cnt = 0, ans;
  cin >> n >> k;
  vector<pair<int, int>> p(n);
  rep(i, n) cin >> p[i].first >> p[i].second;

  sort(p.begin(), p.end());

  for (int i = 0; i < n; ++i) {
    cnt += x.second;
    if (cnt >= k) {
      ans = x.first;
      break;
    }
  }
  cout << ans << endl;

  // priority_queue<int, vector<int>, greater<int>> pq;

  // for (int i = 0; i < n; ++i) {
  //   cin >> a >> b;
  //   for (int j = 0; j < b; ++j) {
  //     pq.push(a);
  //   }
  // }

  // for (int i = 0; i < k - 1; ++i) pq.pop();

  // cout << pq.top() << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: 'x' was not declared in this scope
   17 |     cnt += x.second;
      |            ^
Language: C++

#include <bits/stdc++.h>

#define mod 1000000007

#define rep(i, n) for(int i=0; i<n; ++i)

using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
 
int main(void){
	
	int N, K;
	
	cin >> N >> K;
	
	vector<pair<int, int>> ab(N);
	
	rep(i, N)
		cin >> ab[i].first >> ab[i].second;
		
	sort(ab.begin(), ab.end());
	
	int ans, count = 0;
	
	while(count <= K){
		if(count + ab[i].second >= K){
			ans = ab[i].first;
			break;
		}
		else{
			count += ab[i].second;
			ans = ab[i].first;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:31: error: 'i' was not declared in this scope
   27 |                 if(count + ab[i].second >= K){
      |                               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define pb push_back
#define lb(v,k) lower_bound(all(v),k)-v.begin()
#define chmin(x,y) if(x>y)x=y
#define chmax(x,y) if(x<y)x=y
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
ll inf=100100100100;
const int mod=1000000007;
int main(){
   ll n,k;cin>>n>>k;
   vector<P> v;
   rep(i,n){
       ll a,b;cin>>a>>b;
       v.eb(a,b);
   }
   sort(all());
   ll ans=0;
   rep(i,n){
       ans+=v[i].second;
       if(ans>=k){
           cout<<v[i].first<<endl;
           return 0;
       }
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: expected primary-expression before '.' token
    5 | #define all(a) a.begin(),a.end()
      |                 ^
a.cc:29:9: note: in expansion of macro 'all'
   29 |    sort(all());
      |         ^~~
a.cc:5:27: error: expected primary-expression before '.' token
    5 | #define all(a) a.begin(),a.end()
      |                           ^
a.cc:29:9: note: in expansion of macro 'all'
   29 |    sort(all());
      |         ^~~