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

#include <iostream>
#include <cstdint>
#include <algorithm>
#include <utility>
#include <cstdlib>

int main() {
  std::int_fast64_t n, k;
  std::cin >> n >> k;
  std::vector<std::pair<std::int_fast64_t, std::int_fast64_t>> queries(n);
  for (std::pair<std::int_fast64_t, std::int_fast64_t>& query : queries) {
    std::cin >> query.first >> query.second;
  }
  std::sort(queries.begin(), queries.end(), [](const std::pair<std::int_fast64_t, std::int_fast64_t>& lhs, const std::pair<std::int_fast64_t, std::int_fast64_t>& rhs) {
    return lhs.first < rhs.first;
  });
  for (const std::pair<std::int_fast64_t, std::int_fast64_t>& query : queries) {
    k -= query.second;
    if (k <= 0) {
      std::cout << query.first << std::endl;
      return 0;
    }
  }
  return EXIT_FAILURE;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'vector' is not a member of 'std'
   10 |   std::vector<std::pair<std::int_fast64_t, std::int_fast64_t>> queries(n);
      |        ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    5 | #include <cstdlib>
  +++ |+#include <vector>
    6 | 
a.cc:10:61: error: expected primary-expression before '>' token
   10 |   std::vector<std::pair<std::int_fast64_t, std::int_fast64_t>> queries(n);
      |                                                             ^~
a.cc:10:64: error: 'queries' was not declared in this scope
   10 |   std::vector<std::pair<std::int_fast64_t, std::int_fast64_t>> queries(n);
      |                                                                ^~~~~~~
Language: C++

line = gets
data = line.split(" ")
n = data[0].to_i
k = data[1].to_i
ai = Array.new
bi = Hash.new
n.times do |i|
  line = gets
  data = line.split(" ")
  a = data[0].to_i
  ai << a if !ai.include?(a)
  if bi[a] == nil
    bi[a] = data[1].to_i
  else
    bi[a] += data[1].to_i
  end
end
ai.sort!
ai.each do |a|
  k -= bi[a]
  if k <= 0
    break
  end
end

Compiler output:
a.cc:1:1: error: 'line' does not name a type
    1 | line = gets
      | ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;

#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define REP(...) _overload3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__)

#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)

#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))

template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl

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:38:8: error: 'AMAX' was not declared in this scope
   38 | ll cnt[AMAX + 1];
      |        ^~~~
a.cc: In function 'int main()':
a.cc:48:1: error: 'cnt' was not declared in this scope; did you mean 'int'?
   48 | cnt[A] += B;
      | ^~~
      | int
a.cc:51:26: error: 'AMAX' was not declared in this scope
   51 | for (int ans = 1; ans <= AMAX; ++ans){
      |                          ^~~~
a.cc:52:10: error: 'cnt' was not declared in this scope; did you mean 'int'?
   52 | if (K <= cnt[ans]) {
      |          ^~~
      |          int
a.cc:56:6: error: 'cnt' was not declared in this scope; did you mean 'int'?
   56 | K -= cnt[ans];
      |      ^~~
      |      int
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;

#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define REP(...) _overload3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__)

#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)

#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))

template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl


int main(){
    map<int,ll> p;
    int n;
    ll k;
    cin>>n>>k;
    REP(i,n){
        int a,b;
        cin>>a>>b;
        p[a]+=b;
    }
    for(P s:p){
        k-=s.second;
        if(k<=0){
            cout<<s.first<<endll
            break;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:28: error: 'endll' was not declared in this scope
   52 |             cout<<s.first<<endll
      |                            ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
const long long INF = 1e9;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
//char c;
 
#define Endl endl
 
/*--------------------template--------------------*/

int main() {
    ll N,K;
    cin>>N>>K;
    vp ab(N);
    REP(i,N){
        ll a,b;
        cin>>a>>b;
        ab[i]=make_pair(a,b);
    }
    sort(ab.begin(),ab.end(),[&](P& l,P& r){return l.frist<r.first;});
    REP(i,N){
        ans+=ab[i].second;
        if(ans>=K){
            cout<<ab[i].first<<endl;
            break;
        }
    }
    return 0;
}


Compiler output:
a.cc: In lambda function:
a.cc:39:54: error: 'P' {aka 'struct std::pair<long long int, long long int>'} has no member named 'frist'; did you mean 'first'?
   39 |     sort(ab.begin(),ab.end(),[&](P& l,P& r){return l.frist<r.first;});
      |                                                      ^~~~~
      |                                                      first
Language: C++

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

int main(){
    int N
    long long K;
    cin >> N >> K;
    int a[N], b[N];
    long long c[100010]={};
    for(int i = 0; i < N; i++){
        cin >> a[i] >> b[i];
        c[a[i]] += b[i];
    }
    int ans = 0;
    for(int i = 1; i <100010; i++){
        K -= c[i];
        if(K <= 0 ){
            ans = i;
            break;
        }
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'long'
    6 |     long long K;
      |     ^~~~
a.cc:7:12: error: 'N' was not declared in this scope
    7 |     cin >> N >> K;
      |            ^
a.cc:7:17: error: 'K' was not declared in this scope
    7 |     cin >> N >> K;
      |                 ^
a.cc:11:16: error: 'a' was not declared in this scope
   11 |         cin >> a[i] >> b[i];
      |                ^
a.cc:11:24: error: 'b' was not declared in this scope
   11 |         cin >> a[i] >> b[i];
      |                        ^
Language: C++

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

long long n,m,a,b;

main(){
cin>>n>>m;
  for(int i=0;i<n;i++){
    long long p,p,q;
    cin>>p>>q;
    b+=q;
    if(m<=b)break;
    a=p;
    }
  cout<<a<<endl;
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:17: error: redeclaration of 'long long int p'
    9 |     long long p,p,q;
      |                 ^
a.cc:9:15: note: 'long long int p' previously declared here
    9 |     long long p,p,q;
      |               ^
Language: C++

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

long long n,m,a,b;

main{
cin>>n>>m;
  for(int i=0;i<n;i++){
    long long q;
    cin>>a>>q;
    b+=q;
    if(m<=b)break;
    }
  cout<<a<<endl;
}

Compiler output:
a.cc:6:1: error: 'main' does not name a type
    6 | main{
      | ^~~~
Language: Java

import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.Map.Entry;

import atcoder.Main;

public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);

		Map<Integer,Integer> map=new TreeMap<Integer,Integer>();

		int N = sc.nextInt();
		int K = sc.nextInt();

		for (int i = 0; i < N; i++) {

			int A = sc.nextInt();
			int B = sc.nextInt();

			if(map.containsKey(A)) {
				map.put(A, map.get(A)+B);
			}else {
				map.put(A, B);
			}

		}

		int cnt=0;
		for(Entry<Integer, Integer> E:map.entrySet()) {

			cnt+=E.getValue();

			if(cnt>=K) {
				System.out.println(E.getKey());
				return;
			}

		}

	}

	//以下テンプレート

	public static int[] extgcd(int a, int b) {

		int x0 = 1;
		int x1 = 0;

		int y0 = 0;
		int y1 = 1;

		while (b != 0) {
			int q = a / b;
			int r = a % b;

			int x2 = x0 - q * x1;
			int y2 = y0 - q * y1;

			a = b;
			b = r;

			x0 = x1;
			x1 = x2;

			y0 = y1;
			y1 = y2;
		}

		return new int[] { a, x0, y0 };

	}

	static int gcd(int a, int b) {

		if (b == 0)
			return a;

		if (a < b) {
			int t = a;
			a = b;
			b = t;
		}

		return gcd(b, a % b);

	}

	static int lcm(int a, int b) {
		return a * b / gcd(a, b);
	}

	static void swap(int[] a) {
		int t;

		t = a[0];
		a[0] = a[1];
		a[1] = t;

		return;
	}

	static <T> void output(List<T> list) {

		for (int i = 0; i < list.size(); i++) {
			System.out.print(list.get(i));

			if (i != list.size() - 1) {
				System.out.print(" ");
			} else {
				nl();
			}
		}

	}

	static void output(String[][] str) {

		for (int i = 0; i < str.length; i++) {
			for (int j = 0; j < str[i].length; j++) {
				print(str[i][j]);
			}

			nl();
		}

	}

	static void output(boolean flg, String Yes, String No) {

		if (flg) {
			pln(Yes);
		} else {
			pln(No);
		}

	}

	static void output(String[][] str, int digit) {

		String dig = "%" + String.valueOf(digit) + "s";

		for (int i = 0; i < str.length; i++) {
			for (int j = 0; j < str[i].length; j++) {
				System.out.printf(dig, str[i][j]);
			}
			nl();
		}

	}

	static void pln(String str) {
		System.out.println(str);
	}

	static void pln(int x) {
		System.out.println(x);
	}

	static void print(String str) {
		System.out.print(str);
	}

	static void print(int x) {
		System.out.print(x);
	}

	static void print(String str, int times) {
		for (int i = 0; i < times; i++) {
			print(str);
		}
	}

	static void print(int x, int times) {
		for (int i = 0; i < times; i++) {
			print(x);
		}
	}

	static void nl() {
		System.out.println();
	}

}


Compiler output:
Main.java:7: error: package atcoder does not exist
import atcoder.Main;
              ^
1 error
Language: C++

#include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
#include "dbgtoki.hpp"
#define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i) 
#else
#define DUMP(i)
#endif

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());
#define dis distance
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define pub push_back
#define sec second
#define fir first

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector <int> > vvi;
const int EPS = 1e-9;
const int MOD = 1e9+7;
const int INF = (1 << 30);
 
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,k;
	cin >> n >> k;
	map<int,ll> M;
	REP(i,n){
		int a,b;
		cin >> a >> b;
		M[a] += b;
	}
	ll kk = k;
	for(auto m : M ){
		kk -= m.sec;
		if(sum >= k){
			cout << m.fir << endl;
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:20: error: 'sum' was not declared in this scope
   48 |                 if(sum >= k){
      |                    ^~~
Language: C++

#include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
#include "dbgtoki.hpp"
#define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i) 
#else
#define DUMP(i)
#endif

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());
#define dis distance
#define so sort
#define rev reverse
#define pub push_back
#define sec second
#define fir first

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector <int> > vvi;
const int EPS = 1e-9;
const int MOD = 1e9+7;
const int INF = (1 << 30);

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,k;
	cin >> n >> k;
	vll V[i];
	REP(i,n){
		int a,b;
		cin >> a >> b;
		V[a] += b;
	}
	ll cnt = 0;
	REP(i,n){
		cnt += V[i];
		if(cnt >= k){
			cout << i << endl;
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:15: error: 'i' was not declared in this scope
   39 |         vll V[i];
      |               ^
a.cc:43:17: error: 'V' was not declared in this scope
   43 |                 V[a] += b;
      |                 ^
a.cc:47:24: error: 'V' was not declared in this scope
   47 |                 cnt += V[i];
      |                        ^
Language: C++

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

int main() {
 	

  ll n,k; cin >> n >> k;
  map<int,ll> m;
  
  for(int i=0; i<n; i++) {
    ll a,b; cin >> a >> b;
    m[a]+=b;
  }
  
  ll sum = 0;
  for(auto x:m){
   	 sum += m.second;
    if( sum >= k ) {
      cout << x.first << endl;
      break;
    }
  }
     
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: 'class std::map<int, long long int>' has no member named 'second'
   18 |          sum += m.second;
      |                   ^~~~~~
Language: C++

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

int main() {
 	

  ll n,k; cin >> n >> k;
  map<int,ll> m;
  
  for(int i=0; i<n; i++) {
    ll a,b; cin >> a >> b;
    m[a]+=b;
  }
  
  ll sum = 0;
  for(auto x:m){
   	 sum += m.second;
    if( sum >= k ) {
      cout << x.first << endl;
      break;
    }
  }
     
}

Compiler output:
a.cc:3:9: error: 'lon' does not name a type; did you mean 'long'?
    3 | typedef lon glong ll;
      |         ^~~
      |         long
a.cc: In function 'int main()':
a.cc:8:3: error: 'll' was not declared in this scope
    8 |   ll n,k; cin >> n >> k;
      |   ^~
a.cc:8:18: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |   ll n,k; cin >> n >> k;
      |                  ^
      |                  yn
a.cc:8:23: error: 'k' was not declared in this scope
    8 |   ll n,k; cin >> n >> k;
      |                       ^
a.cc:9:13: error: template argument 4 is invalid
    9 |   map<int,ll> m;
      |             ^
a.cc:12:7: error: expected ';' before 'a'
   12 |     ll a,b; cin >> a >> b;
      |       ^~
      |       ;
a.cc:12:20: error: 'a' was not declared in this scope
   12 |     ll a,b; cin >> a >> b;
      |                    ^
a.cc:12:25: error: 'b' was not declared in this scope
   12 |     ll a,b; cin >> a >> b;
      |                         ^
a.cc:16:5: error: expected ';' before 'sum'
   16 |   ll sum = 0;
      |     ^~~~
      |     ;
a.cc:17:14: error: 'begin' was not declared in this scope
   17 |   for(auto x:m){
      |              ^
a.cc:17:14: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:17:14: error: 'end' was not declared in this scope
   17 |   for(auto x:m){
      |              ^
a.cc:17:14: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:18:10: error: 'sum' was not declared in this scope
   18 |          sum += m.second;
      |          ^~~
a.cc:18:19: error: request for member 'second' in 'm', which is of non-class type 'int'
   18 |          sum += m.second;
      |                   ^~~~~~
Language: C

#include<stdio.h>
int main(void){
  long n,k,i,ho=0;
  scanf("%ld %ld",&n,&k);
  long a,b;
  long x[100000]={0};
  for(i=0;i<n;i++){
    scanf("%ld %ld",&a,&b);
    x[a-1]+=b;
  }
  for(i=0;i<100000;i++){
    ho+=x[i];
    if(ho>=k){
      ch=1;
      break;
    }
  }
  printf("%ld",i+1);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:7: error: 'ch' undeclared (first use in this function)
   14 |       ch=1;
      |       ^~
main.c:14:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;
int main(){
    int n,k,i;
	long long x;
    cin >> n >> k;
    vector <pair<int, int> > a(n);
    for(i=0;i<n;i++){
        cin >> x >> y;
        a[i] = make_pair(x,y);
    }
    sort(a.begin(),a.end());
    x = 0;
	for(i=0;i<n;i++){
        if(x<k){
        	x += a[i].second;
        }else{
        	cout << a[i].first << endl;
    }
}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: 'y' was not declared in this scope
   13 |         cin >> x >> y;
      |                     ^
Language: C++

tmp = list(map(int,input().split()))
n, k = tmp[0],tmp[1]
an = []
for i in range(n):
  tmp = list(map(int,input().split()))
    an += [tmp[0]] * tmp[1]
an.sort()
print(an[k-1])

Compiler output:
a.cc:1:1: error: 'tmp' does not name a type
    1 | tmp = list(map(int,input().split()))
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define repr(i,k,n) for(int i = (k); i < (n); i++)
#define rep(i,n) repr(i,0,n)
#define ALL(a) begin(a),end(a)
const int INF = 114514810;
const int MOD = 1000000007;
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N,K,a,b;
	vi ans;
	vi b;
	vi a;
	cin >> N >> K;
	rep(i,N){
		cin >> a >> b;
	}
	rep(i,N){
		rep(j,b[i]){
		ans.push_back(a[i]);
		}
		if(ans.size()>K){
			sort(ans.begin(),ans.end());
			cout << ans[K-1] << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: conflicting declaration 'vi b'
   16 |         vi b;
      |            ^
a.cc:14:19: note: previous declaration as 'int b'
   14 |         int N,K,a,b;
      |                   ^
a.cc:17:12: error: conflicting declaration 'vi a'
   17 |         vi a;
      |            ^
a.cc:14:17: note: previous declaration as 'int a'
   14 |         int N,K,a,b;
      |                 ^
a.cc:23:24: error: invalid types 'int[int]' for array subscript
   23 |                 rep(j,b[i]){
      |                        ^
a.cc:3:43: note: in definition of macro 'repr'
    3 | #define repr(i,k,n) for(int i = (k); i < (n); i++)
      |                                           ^
a.cc:23:17: note: in expansion of macro 'rep'
   23 |                 rep(j,b[i]){
      |                 ^~~
a.cc:24:32: error: invalid types 'int[int]' for array subscript
   24 |                 ans.push_back(a[i]);
      |                                ^
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <math.h>
#include <algorithm>

using namespace std;

int main() {
        int N, K,total;
        cin >> N >> K;

        map<int, int> mp;
        total = 0;
        for (int i = 0; i < N; i++) {
                int a, b;
                cin >> a >> b;
                mp[a] = b;
        }

        for (auto&& var : mp) {
                toral += var.second;
                if (total >= K) {
                        cout << var.first;
                }
        }


        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'toral' was not declared in this scope; did you mean 'total'?
   22 |                 toral += var.second;
      |                 ^~~~~
      |                 total
Language: C++

#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<stack>
#include<map>
#include<string>
#include<algorithm>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll __int64
//#define __int64 long long
const ll M=1000000007;
int n,k;
int a[111111];
int b[111111];
int cnt[111111];
int main(){
	cin>>n>>k;
	rep(i,n)cin>>a[i]>>b[i];
	rep(i,n)cnt[a[i]]+=b[i];
	int sum=0;

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

Compiler output:
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:18:7: note: in expansion of macro 'll'
   18 | const ll M=1000000007;
      |       ^~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Map;
import java.util.TreeMap;

public class Main {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    public static void main(String... args) throws IOException {
        String[] params = br.readLine().split(" ");
        int n = Integer.parseInt(params[0]);
        int k = Integer.parseInt(params[1]);

        Map<Integer, Integer> inData = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            String[] data = br.readLine().split(" ");
            int key = Integer.parseInt(data[0]);
            int val = Integer.parseInt(data[1]);
            if (inData.get(key) == null) {
                inData.put(key, val);
            } else {
                inData.put(key, inData.get(key) + val);
            }
        }
        int curCount = 0;
        for (Map.Entry<Integer, Integer> entry : inData.entrySet()) {
            curCount += entry.getValue();
            if (k <= curCount) {
                System.out.println(entry.getKey());
                break;
            }
        }
    }
}

Compiler output:
Main.java:12: error: non-static variable br cannot be referenced from a static context
        String[] params = br.readLine().split(" ");
                          ^
Main.java:18: error: non-static variable br cannot be referenced from a static context
            String[] data = br.readLine().split(" ");
                            ^
2 errors
Language: C++

#include<bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n)  int(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<int,int>
#define I vector<int>
#define S set<int>
#define pb(v) push_back(v)
#define V vector
 Sun[2000000];
int main(){
    CIN(N);CIN(K);
    map<int,LL> m;
    REP(a,N){
        CIN(A);CIN(B);
        Sun[A]+=B;
    }
    int s = 0;
    REP(a,K){
        if(a==K-1)COUT(s);
        while(Sun[s]==0){
            s++;
        }
        Sun[s]--;
    }
    return 0;
}


Compiler output:
a.cc:27:2: error: 'Sun' does not name a type
   27 |  Sun[2000000];
      |  ^~~
a.cc: In function 'int main()':
a.cc:33:9: error: 'Sun' was not declared in this scope
   33 |         Sun[A]+=B;
      |         ^~~
a.cc:38:15: error: 'Sun' was not declared in this scope
   38 |         while(Sun[s]==0){
      |               ^~~
a.cc:41:9: error: 'Sun' was not declared in this scope
   41 |         Sun[s]--;
      |         ^~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
int main()
{
	int n
	long long m;
	scanf("%d %lld", &n, &m);
	map<int, long long> a;
	for(int i = 0, j, k; i < n; ++i)
	{
		scanf("%d %lld", &j, &k);
		if(a.find(j) == a.end())
		{
			a.insert(make_pair(j, k));
		}
		else
		{
			a[j] += k;
		}
	}
	for(auto i : a)
	{
		m -= i.second;
		if(m <= 0)
		{
			printf("%d\n", i.first);
			break;
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before 'long'
    6 |         long long m;
      |         ^~~~
a.cc:7:27: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         scanf("%d %lld", &n, &m);
      |                           ^
      |                           yn
a.cc:7:31: error: 'm' was not declared in this scope; did you mean 'tm'?
    7 |         scanf("%d %lld", &n, &m);
      |                               ^
      |                               tm
Language: C++

#include <iostream>
#include <map>

int N, K;
using ll = long long;
int main() {
  cin >> N >> K;
  map<ll, ll> M;
  for(int i = 0; i < N; ++i){
    ll a,b;
    cin >> a >> b;
    M[a] += b;
  }
  
  ll sum = 0;
  ll ans = 0;
  auto it = M.begin();
  while(sum < K) {
    sum += it->second;
    ans = it->first;
    ++it;
  }
  cout << it->first << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> N >> K;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:3: error: 'map' was not declared in this scope
    8 |   map<ll, ll> M;
      |   ^~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:102:11: note:   'std::map'
  102 |     class map
      |           ^~~
/usr/include/c++/14/map:89:13: note:   'std::pmr::map'
   89 |       using map
      |             ^~~
a.cc:8:9: error: expected primary-expression before ',' token
    8 |   map<ll, ll> M;
      |         ^
a.cc:8:13: error: expected primary-expression before '>' token
    8 |   map<ll, ll> M;
      |             ^
a.cc:8:15: error: 'M' was not declared in this scope
    8 |   map<ll, ll> M;
      |               ^
a.cc:23:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |   cout << it->first << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |   cout << it->first << endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <map>

int N, K;
int main() {
  cin >> N >> K;
  map<int, int> M;
  for(int i = 0; i < N; ++i){
    int a,b;
    cin >> a >> b;
    M[a] += b;
  }
  
  int sum = 0;
  int ans = 0;
  auto it = M.begin();
  while(sum < K) {
    sum += it->second;
    ans = it->first;
    ++it;
  }
  cout << it->first << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> N >> K;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'map' was not declared in this scope
    7 |   map<int, int> M;
      |   ^~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:102:11: note:   'std::map'
  102 |     class map
      |           ^~~
/usr/include/c++/14/map:89:13: note:   'std::pmr::map'
   89 |       using map
      |             ^~~
a.cc:7:7: error: expected primary-expression before 'int'
    7 |   map<int, int> M;
      |       ^~~
a.cc:11:5: error: 'M' was not declared in this scope
   11 |     M[a] += b;
      |     ^
a.cc:16:13: error: 'M' was not declared in this scope
   16 |   auto it = M.begin();
      |             ^
a.cc:22:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |   cout << it->first << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |   cout << it->first << endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

struct box
{
	int a;
	int b;
};

int main()
{
	int n
	long long k;
	cin >> n >> k;
	
	vector<box> x(n);
	for(int i = 0; i < n; i++)
	{
		cin >> x[i].a >> x[i].b;
	}
	
	//sort(x.begin(), x.end(), [](const box& n, const box& m) {return n.a < m.a;});
	
	int i = 0;
	while(k > 0)
	{
		k -= x[i].b;
		i++;
	}
	
	cout << x[i - 1].a << endl;
	return 0;
}

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

#include<cstdio>
#include<vector>

#define rep(n) for(int i=0;i<n;i++)
#define Pii std::pair<int, int>
#define all(v) v.begin(), v.end()

int main(){
    int length = 0, n, k;
    scanf("%d %d", &n, &k);
    std::vector<Pii> v(n);
    rep(n) scanf("%d %d", &v[i].first, &v[i].second);
    sort(all(v));
    for(Pii p: v){
        if(length < k && k <= length+p.second){
            printf("%d\n", p.first);
            return 0;
        }
        length += p.second;
    }
}


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

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
using namespace std;
//
int main(){
  int N;
  long long K;
  cin>>N>>K;
  PA S[100000];
  FOR(i,0,N){
    cin>>S[i].first>>S[i].second;
  }
  sort(S,S+N);
  int i=0;
  while(K>0&&i<N){
    K-=(long long)S[i];
    i++;
  }
  i--;
  cout<<S[i].first<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:8: error: invalid cast from type 'std::pair<int, int>' to type 'long long int'
   36 |     K-=(long long)S[i];
      |        ^~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
using namespace std;
//
int main(){
  long long N,K;
  cin>>N>>K;
  pair<long long,long long> S[100000];
  FOR(i,0,N){
    cin>>S[i].first>>S[i].second;
  }
  sort(S,S+N);
  long long i=0;
  while(K>0&&i<N){
    K-=S[i];
    i++;
  }
  i--;
  cout<<S[i].first<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:6: error: no match for 'operator-=' (operand types are 'long long int' and 'std::pair<long long int, long long int>')
   35 |     K-=S[i];
      |     ~^~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
using namespace std;
//
int main(){
  long long N,K;
  cin>>N>>K;
  PA S[100000];
  FOR(i,0,N){
    cin>>S[i].first>>S[i].second;
  }
  sort(S,S+N);
  long long i=0;
  while(K>0&&i<N){
    K-=S[i];
    i++;
  }
  i--;
  cout<<S[i].first<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:6: error: no match for 'operator-=' (operand types are 'long long int' and 'std::pair<int, int>')
   35 |     K-=S[i];
      |     ~^~~~~~
Language: Java

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        Map<Integer,Integer> vals = new TreeMap<>();
        Set<Integer> valSet = new HashSet<>();
        for(int i = 0; i < n; i++) {
            int a = in.nextInt();
            int b = in.nextInt();
            if(valSet.contains(a)) {
                vals.put(a,vals.get(a)+b);
            } else {
                vals.put(a,b);
            }
            vals.add(a);
        }
        int sum = 0;
        for(Map.Entry<Integer,Integer> val : vals.entrySet()) {
            sum += val.getValue();
            if(sum >= k) {
                System.out.println(val.getKey());
                return;
            }
        }
    }
}


Compiler output:
Main.java:19: error: cannot find symbol
            vals.add(a);
                ^
  symbol:   method add(int)
  location: variable vals of type Map<Integer,Integer>
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int tests = sc.nextInt();
		long indexVal = sc.nextLong();
		
		int[] aVals = new int[tests];
		int[] bVals = new int[tests];
		
		int bSum = 0;
		
		for (int i = 0; i < tests; i++) {
			aVals[i] = sc.nextInt();
			bVals[i] = sc.nextInt();
			bSum += bVals[i];
		}
		
		int[] finalResult = new int[bSum];
		
		int currIndex = 0;
		for (int i = 0; i < tests; i++) {
			for (int j = 0; j < bVals[i]; j++) {
				finalResult[currIndex++] = aVals[i];
			}
		}
		Arrays.sort(finalResult);
		
		System.out.println(finalResult[indexVal - 1]);
	}
}


Compiler output:
Main.java:32: error: incompatible types: possible lossy conversion from long to int
		System.out.println(finalResult[indexVal - 1]);
		                                        ^
1 error
Language: C++

#include<iostream>
using namespace std;
int main(){
	int N;
	__int64 E[100000];
	__int64 K;
	int i=0;
	int a,b;
	int c=0;
	int ans;
	
	for(i=0;i<100000;i++){
		E[i]=0;
	}
	
	cin>>N>>K;
	for(i=0;i<N;i++){
		cin>>a>>b;
		E[a-1]=E[a-1]+b;
	}
	for(i=0;i<N;i++){
		c=c+E[i];
		if(c>=K){
			ans=i+1;
			break;
		}
	}
	cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    5 |         __int64 E[100000];
      |         ^~~~~~~
      |         __int64_t
a.cc:6:16: error: expected ';' before 'K'
    6 |         __int64 K;
      |                ^~
      |                ;
a.cc:13:17: error: 'E' was not declared in this scope
   13 |                 E[i]=0;
      |                 ^
a.cc:16:17: error: 'K' was not declared in this scope
   16 |         cin>>N>>K;
      |                 ^
a.cc:19:17: error: 'E' was not declared in this scope
   19 |                 E[a-1]=E[a-1]+b;
      |                 ^
a.cc:22:21: error: 'E' was not declared in this scope
   22 |                 c=c+E[i];
      |                     ^
Language: C++

#include <iostream>
#define b_MAX 100000;
using namespace std;

int ary[b_MAX+1];

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

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

    long long ans = 0;
    for(int i=1; ans<K && i<=b_MAX; i++){
        ans += ary[i];
        if(ans>=K){
            cout << i << '\n';
            break;
        }
    }

    return 0;
}


Compiler output:
a.cc:2:21: error: expected ']' before ';' token
    2 | #define b_MAX 100000;
      |                     ^
a.cc:5:9: note: in expansion of macro 'b_MAX'
    5 | int ary[b_MAX+1];
      |         ^~~~~
a.cc:5:14: error: expected unqualified-id before '+' token
    5 | int ary[b_MAX+1];
      |              ^
a.cc: In function 'int main()':
a.cc:14:9: error: 'ary' was not declared in this scope
   14 |         ary[a] += b;
      |         ^~~
a.cc:18:35: error: expected primary-expression before ';' token
   18 |     for(int i=1; ans<K && i<=b_MAX; i++){
      |                                   ^
a.cc:18:35: error: expected ')' before ';' token
   18 |     for(int i=1; ans<K && i<=b_MAX; i++){
      |        ~                          ^
a.cc:18:37: error: 'i' was not declared in this scope
   18 |     for(int i=1; ans<K && i<=b_MAX; i++){
      |                                     ^
Language: C++

#include <iostream>
using namespace std;

int ary[1e5+1];

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

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

    long long ans = 0;
    for(int i=1; ans<K && i<=1e5; i++){
        ans += ary[i];
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc:4:12: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    4 | int ary[1e5+1];
      |         ~~~^~
a.cc:4:12: error: could not convert '(1.0e+5 + (double)1)' from 'double' to 'long unsigned int'
    4 | int ary[1e5+1];
      |         ~~~^~
      |            |
      |            double
a.cc:4:12: error: size of array 'ary' has non-integral type 'double'
Language: C++

#include <iostream>

using namespace std;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N,
    long long K;
    cin >> N >> K;
    long long nums[100001] = {0};

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

    long long res = 0;
    long long ans;
    for (int i = 1; i < 100001; ++i)
    {
        if (K <= res + nums[i])
        {
            ans = i;
            break;
        }
        res += nums[i];
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected unqualified-id before 'long'
   11 |     long long K;
      |     ^~~~
a.cc:12:17: error: 'K' was not declared in this scope
   12 |     cin >> N >> K;
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define loop(i, a, b) for(int i = a; i < b; i++) 
#define rep(i, a) loop(i, 0, a)
using namespace std;
const int MOD = 1000000007;
const int inf = 1e8;
using vi = vector <int>;
using vvi = vector <vi>;
using vc = vector <char>;
using vvc = vector <vc>;
using vs = vector <string>;
using vvs = vector <vs>;
//g++ -std==c++14
//setprecision(10)
long long n, k;
vector <long long> a, b;

int main(){
    cin >> n >> k;
    a = b = vi(n);
    rep(i, n){
        cin >> a[i] >> b[i];
        if(i != 0)
            b[i] += b[i - 1];
    }
    rep(i, n){
        //cout << b[i - 1] << " " << b[i] << endl;
        if(i == 0){
            if(k <= b[i]){
                cout << a[i] << endl;
                return 0;
            }
        }
        else{
            if(b[i - 1] < k && k <= b[i]){
                cout << a[i] << endl;
                return 0;
            }
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'vi' {aka 'std::vector<int>'})
   20 |     a = b = vi(n);
      |                 ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'vi' {aka 'std::vector<int>'} to 'const std::vector<long long int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'vi' {aka 'std::vector<int>'} to 'std::vector<long long int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'vi' {aka 'std::vector<int>'} to 'std::initializer_list<long long int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#define imfor(i, n) for(int i = 0; i < n; i++)
using namespace std;
ll MOD = 1000000007;

int main() {
    lln, k;
    ll cnt[100100];
    fill(cnt, cnt + 100010, 0);
    cin >> n >> k;
    imfor(i, n) {
        ll a, b;
        cin >> a >> b;
        cnt[a] += b;
    }
    ll pos = 1;
    ll tmp = 0;
    while (1) {
        tmp += cnt[pos];
        if (tmp >= k) {
            break;
        }
        pos++;
    }
    cout << pos << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'lln' was not declared in this scope; did you mean 'll'?
   22 |     lln, k;
      |     ^~~
      |     ll
a.cc:22:10: error: 'k' was not declared in this scope
   22 |     lln, k;
      |          ^
a.cc:25:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   25 |     cin >> n >> k;
      |            ^
      |            yn
Language: C++

#include<iostream>
using namespace std;
__int64 x[100005]={0};
int main(){
	int n,k;
	cin>>n>>k;
	int i=0;
	int a,b;
	for(i=0;i<n;i++){
		cin>>a>>b;
		x[a]+=b;
	}
	i=1;
	while(1){
		k-=x[i];
		if(k<=0){
			cout<<i<<endl;
			break;
		}
		i++;
	}
	return 0;
}


Compiler output:
a.cc:3:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    3 | __int64 x[100005]={0};
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:11:17: error: 'x' was not declared in this scope
   11 |                 x[a]+=b;
      |                 ^
a.cc:15:20: error: 'x' was not declared in this scope
   15 |                 k-=x[i];
      |                    ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    unsigned long long int flag[1000000] = {};
    int N,K;
    int a,b;
    unsigned long long int sum = 0;
    cin >> N >> K;

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

    for (int i = 1; i <= 100001; i++) {
        sum += flag[i];
        if (sum >= K) {
            cout << i << '\n';
            break;
        }
    }
    if (i == 100002) {
        cout << '0' << '\n';
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'i' was not declared in this scope
   30 |     if (i == 100002) {
      |         ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    unsigned long long int flag[1000000] = {};
    int N,K;
    int a,b;
    unsigned long long int sum = 0;
    cin >> N >> K;

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

    for (int i = 1; i <= 100001; i++) {
        sum += flag[i];
        if (sum >= K) {
            cout << i << '\n';
            break;
        }
    }
    if (i == 100002) {
        cout << 0 << '\n';
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'i' was not declared in this scope
   30 |     if (i == 100002) {
      |         ^