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

#include<iostream>

using namespace std;


int main()
{
	int N;
	unsigned long long K;
	unsigned long long j = 0;
	int a[100000], b[100000];
	int Array[100000];
	
	cin >> N >> K;

	for (int i = 0; i < N; i++) {
		cin >> a[i] >> b[i];
	}
	for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
		for (int*p_Array = Array; p_Array < p_Array + (int)p_b; p_Array++) {
			*p_Array = *p_a;
		}
	}
	cout << Array[K - 1] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: expected unqualified-id before 'int'
   19 |         for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
      |                           ^~~
a.cc:19:26: error: expected ';' before 'int'
   19 |         for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
      |                          ^~~~
      |                          ;
a.cc:19:49: error: expected ')' before ';' token
   19 |         for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
      |             ~                                   ^
      |                                                 )
a.cc:19:51: error: 'p_a' was not declared in this scope
   19 |         for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
      |                                                   ^~~
a.cc:19:58: error: 'p_b' was not declared in this scope
   19 |         for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
      |                                                          ^~~
Language: C++

#include<iostream>

using namespace std;


int main()
{
	int N;
	unsigned long long K;
	unsigned long long j = 0;
	int a[100000], b[100000];
	int Array[100000];
	
	cin >> N >> K;

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

	for (int i = 0; i < N; i++) {
		for (; j < b[i]; j++) {
			Array[j] = a[i];
		}
	}

#else

	for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
		for (int*p_Array = Array; p_Array < p_Array + (int)p_b; p_Array++) {
			*p_Array = *p_a;
		}
	}

#endif

	cout << Array[K - 1] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:27: error: expected unqualified-id before 'int'
   29 |         for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
      |                           ^~~
a.cc:29:26: error: expected ';' before 'int'
   29 |         for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
      |                          ^~~~
      |                          ;
a.cc:29:49: error: expected ')' before ';' token
   29 |         for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
      |             ~                                   ^
      |                                                 )
a.cc:29:51: error: 'p_a' was not declared in this scope
   29 |         for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
      |                                                   ^~~
a.cc:29:58: error: 'p_b' was not declared in this scope
   29 |         for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
      |                                                          ^~~
Language: Java

import java.util.*;
import java.lang.*;
 
public class Main {
    public static void main(String[] args) {

        Scanner sc  = new Scanner(System.in);

        long N = Long.parseLong(sc.next());
        long W = Long.parseLong(sc.next());
        
        int c;
        long cnt = 0;


      
        for(int i=0;i<N;i++){
            c = Integer.parseLong(sc.next());
            cnt  += Integer.parseLong(sc.next());
            
            if(cnt >= W) {
               //System.out.print(cnt);
                System.out.print(c);
                break;   
            }
            
        }


        System.out.println();
    }

}

Compiler output:
Main.java:18: error: cannot find symbol
            c = Integer.parseLong(sc.next());
                       ^
  symbol:   method parseLong(String)
  location: class Integer
Main.java:19: error: cannot find symbol
            cnt  += Integer.parseLong(sc.next());
                           ^
  symbol:   method parseLong(String)
  location: class Integer
2 errors
Language: C++

#include<iostream>
#include<stdio.h>
#include<vector>
#include<utility>
#include<algorithm>
using namespace std;

int main(){
    int n,k;
    cin>>n>>k;

    vector< pair<int,int> > a(n);
    for(int i=0;i<n;i++){
        cin>>a[i].first;
        cin>>a[i].second;
    }
    pair<int,int> temp;

    /*sort
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            if(a[j].first<a[i].first){
                temp=a[j];
                a[j]=a[i];
                a[i]=temp;
            }
        }
    }*/
    sort(a,a.length());

    long long int hoge=0;
    for(int i=0;;i++){
        if((k<=hoge)){
            cout<<a[i-1].first<<endl;
            break;
        }else{
            hoge+=a[i].second;
            //cout<<hoge<<endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: 'class std::vector<std::pair<int, int> >' has no member named 'length'
   29 |     sort(a,a.length());
      |              ^~~~~~
Language: Java

package beginner061;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class ProbC {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();

		List<Integer> list = new ArrayList<>();
		Map<Integer, Integer> map = new HashMap<>();
		for(int i = 0; i < n; i++){
			int a = scan.nextInt();
			int b = scan.nextInt();
			list.add(a);
			if(map.containsKey(a)){
				map.put(a, map.get(a) + b);
			}else{
				map.put(a, b);
			}
		}

		list.sort(Comparator.naturalOrder());

		for(int i = 0; i < list.size(); i++){
			int num = list.get(i);
			k -= map.get(num);
			if(k <= 0){
				System.out.println(num);
				break;
			}
		}

	}

}



Compiler output:
Main.java:10: error: class ProbC is public, should be declared in a file named ProbC.java
public class ProbC {
       ^
1 error
Language: C++

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

struct Data {
    int no;
    int a;
    int b;

    bool operator<( const Data& right ) const {
        return a == right.a ? no < right.no : a < right.a;
    }
};

int main() {
    int N, K;
    int a, b;
    cin >> N >> K;
    vector<Data> d(N);
    for(int i = 0; i < N; i++) {
        cin >> d[i].a >> d[i].b;
        d[i].no = i+1;
    }
    sort(d.begin(), d.end());
    for(int i = 0; i < N; i++) {
        K -= d[i].b;
        if(K <= 0) {
            cout << d[i].a << endl;
            return 0;
        }
    }
    return 0;
}

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

//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
unsigned int ruio[1000001];
int main() {
	memset(ruio, 0, sizeof(ruio));
	unsigned int N, K;
	cin >> N >> K;
	unsigned int sum = 1;
	for (int i = 0; i < N; i++) {
		int a, b;
		cin >> a >> b;
		if (a >= ruio[sum - 1]) {
			for (int j = 0; j < b; j++) {
				if (j > K)break;
				ruio[sum] = a;
				sum++;
			}
		}
		else {
			for (int j = 0; j < sum; j++) {
				if (j > K)break;
				if (ruio[j] > a) {
					for (int z = sum + b; z > j; z--) {
						ruio[z] = ruio[z - 1];
					}
					ruio[j] = a;
					sum += b;
					break;
				}
			}
		}
	}
	cout << ruio[K] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'memset' was not declared in this scope
    7 |         memset(ruio, 0, sizeof(ruio));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C

#include<stdio.h>
int main(void){
	int n, k;
	int a, b;
	int array[10001] = {0};
	int i;
	int cnt, ans;

	scanf("%d%d",&n, &k)k;
	for(i = 0;i < n; ++i){
		scanf("%d%d", &a, &b);
		array[a] += b;
	}

	ans = 0;
	cnt = 0;
	for(i = 0; cnt < k; ++i){
		ans = i;
		cnt += array[i];
	}
	printf("%d\n", ans);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:29: error: expected ';' before 'k'
    9 |         scanf("%d%d",&n, &k)k;
      |                             ^
      |                             ;
Language: C++

//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
unsigned int ruio[1000001];
int main() {
	memset(ruio, 0, sizeof(ruio));
	unsigned int N, K;
	cin >> N >> K;
	unsigned int sum = 1;
	for (int i = 0; i < N; i++) {
		int a, b;
		cin >> a >> b;
		if (a >= ruio[sum - 1]) {
			for (int j = 0; j < b; j++) {
				ruio[sum] = a;
				sum++;
			}
		}
		else {
			for (int j = 0; j < sum; j++) {
				if (ruio[j] > a) {
					for (int z = sum + b; z > j; z--) {
						ruio[z] = ruio[z - 1];
					}
					ruio[j] = a;
					sum += b;
					break;
				}
			}
		}
	}
	cout << ruio[K] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'memset' was not declared in this scope
    7 |         memset(ruio, 0, sizeof(ruio));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
unsigned
int  unsigned ruio[1000001];
int main() {
	memset(ruio, 0, sizeof(ruio));
	unsigned int N, K;
	cin >> N >> K;
	unsigned int sum = 1;
	for (int i = 0; i < N; i++) {
		int a, b;
		cin >> a >> b;
		if (a >= ruio[sum - 1]) {
			for (int j = 0; j < b; j++) {
				ruio[sum] = a;
				sum++;
			}
		}
		else {
			for (int j = 0; j < sum; j++) {
				if (ruio[j] > a) {
					for (int z = sum + b; z > j; z--) {
						ruio[z] = ruio[z - 1];
					}
					ruio[j] = a;
					sum += b;
					break;
				}
			}
		}
	}
	cout << ruio[K] << endl;
}

Compiler output:
a.cc:6:6: error: duplicate 'unsigned'
    6 | int  unsigned ruio[1000001];
      |      ^~~~~~~~
      |      --------
a.cc: In function 'int main()':
a.cc:8:9: error: 'memset' was not declared in this scope
    8 |         memset(ruio, 0, sizeof(ruio));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
typedef struct {
    int a;             
    int b;          
} ab;
int cmp( const void *p, const void *q ) {
    return ((ab*)p)->a - ((ab*)q)->a;
}
int main (){
    int i;
    int n,k;
    ab lst[10050] = {0};
    int ans = 0;
    scanf("%d",&n);
    scanf("%d",&k);
    for(i=0;i<n;i++){
        scanf("%d %d",&lst[i].a,&lst[i].b);
    }
    qsort( lst, n, sizeof(ab), cmp );//aが小さい順
    i=0;
    while(1){
        ans += lst[i].b;
        if(ans >= k){
            printf("%d\n",lst[i].a);
            break;
        }
        i++;
    }
    /*for(i=0;i<n;i++){
        printf("%d %d\n",lst[i].a,lst[i].b);
    }*/
    return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<ll, ll> ii;
ii v[10000050];
ll n, k,x;
int main(){
  scanf("%lld%lld", &n, &k);
  for(int i=0;i<n;i++){
    scanf("%lld%lld", &(v[i].first), &(v[i].second));
  }
  sort(v, v + n);
  for(int i=0;i<n;i++){
    x += v[i].second;
    if(x >= k) {printf("%lld\n", v[i].first); break;}
  }
}

Compiler output:
a.cc:3:14: error: 'll' was not declared in this scope
    3 | typedef pair<ll, ll> ii;
      |              ^~
a.cc:3:18: error: 'll' was not declared in this scope
    3 | typedef pair<ll, ll> ii;
      |                  ^~
a.cc:3:20: error: template argument 1 is invalid
    3 | typedef pair<ll, ll> ii;
      |                    ^
a.cc:3:20: error: template argument 2 is invalid
a.cc:5:1: error: 'll' does not name a type
    5 | ll n, k,x;
      | ^~
a.cc: In function 'int main()':
a.cc:7:22: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |   scanf("%lld%lld", &n, &k);
      |                      ^
      |                      yn
a.cc:7:26: error: 'k' was not declared in this scope
    7 |   scanf("%lld%lld", &n, &k);
      |                          ^
a.cc:9:30: error: request for member 'first' in 'v[i]', which is of non-class type 'ii' {aka 'int'}
    9 |     scanf("%lld%lld", &(v[i].first), &(v[i].second));
      |                              ^~~~~
a.cc:9:45: error: request for member 'second' in 'v[i]', which is of non-class type 'ii' {aka 'int'}
    9 |     scanf("%lld%lld", &(v[i].first), &(v[i].second));
      |                                             ^~~~~~
a.cc:13:5: error: 'x' was not declared in this scope
   13 |     x += v[i].second;
      |     ^
a.cc:13:15: error: request for member 'second' in 'v[i]', which is of non-class type 'ii' {aka 'int'}
   13 |     x += v[i].second;
      |               ^~~~~~
a.cc:14:39: error: request for member 'first' in 'v[i]', which is of non-class type 'ii' {aka 'int'}
   14 |     if(x >= k) {printf("%lld\n", v[i].first); break;}
      |                                       ^~~~~
Language: C++

#include<algorithm>
#include<vector>
#include<list>
#include<iostream>
#include<utility>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<iterator>
#include<map>
#include<limits>
#include<iomanip>
#include<ctime>
#include<cmath>
 
const int INF=2147483647;
const long long MOD=1e9+7;
 
using namespace std;




int main(){
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    long long k
    cin>>n>>k;
    vector<long long> vi(100001,0);
    for(int i=1; i<=n; i++){
        int x,y;
        cin>>x>>y;
        //cout<<x<<vi[x]<<endl;
        vi[x]+=y;
    }
    
    long long ct=0;
    for(int i=0; ct<k; i++){
        ct+=vi[i];
        if(ct>=k){
            cout<<i;
            return 0;
        }
    }
    
    
   
    
    
    
    return 0;
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:5: error: expected initializer before 'cin'
   32 |     cin>>n>>k;
      |     ^~~
a.cc:42:21: error: 'k' was not declared in this scope
   42 |     for(int i=0; ct<k; i++){
      |                     ^
Language: C++

#include<iostream>
#include<cstdint>
#include<map>
#include<vector>
using namespace std;
#define MAX 100000
int main() {
	int N, a, b;
	int64_t K;
	cin >> N >> K;
	vector<pair<int, int> > add(N);
	for (int i = 0;i < N;i ++) {
		cin >> a >> b;
		add[i] = make_pair(a, b);
	}
  	sort(add.begin(), add.end());
	
	for (int i = 0;i < N;i ++) {
		K -= add[i].second;
		if (K <= 0) {
			cout << add[i].first;
			break;
		}
	}
}

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

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

int main(int argc, const char * argv[]) {
    long long n, k;
    long long a, b;
    pair<long long, long long> p;
    vector<pair<long long, long long>> v;
    long long cnt, ans;
    
    cin >> n >> k;
    
    for (int i = 0; i < n; i++) {
        //入力
        cin >> a >> b;
        
        p.first = a;
        p.second = b;
        
        v.push_back(p);
    }
    sort(v.begin(), v.end());
    
    
    cnt = 0;
    for (int i = 0; ; i++) {
        cnt += v[i].second;
        if (cnt>=k) {
            ans = v[i].first;
            break;
        }
    }
    cout << ans << endl;
    
    return 0;
}

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

#include <string.h>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <iterator>
#include <functional>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <cstdio>
using namespace std;
#define sz(a)  int((a).size())
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
#define CLR(a) memset((a), 0, sizeof(a))
#define INF (1 << 31) - 1
const int dh[8] = {-1, 1, 0, 0,1,1,-1,-1};
const int dw[8] = {0, 0, 1, -1,1,-1,1,-1};
typedef long long ll;
typedef pair<double, double> p;
typedef vector <int> VI;
typedef vector <string> VS;

int main(){
  
  int n, k;
	cin >> n;
  cin >> k;

  VI ans(10001, 0);

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

  for(int i = 1; i < 10001; i++){
    k -= ans[i];
    if(k <= 0){
      cout << i << endl; 
      break 0;
    }
  }

	return 0;	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:12: error: expected ';' before numeric constant
   53 |       break 0;
      |            ^~
      |            ;
Language: C++

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cstring>
#include <set>
#include <utility>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <map>
#define ll long long
#define read(x) scanf("%d",&x);
#define readll(x) cin>>x;
#define FOR(x,a,b) for(int x=a;x<b;x++)
#define MP make_pair
#define PB push_back
#define pii pair<int,int>
#define piii pair<int,pair<int,int> >

#define readN(N,X) for(int i=0;i<N;i++) scanf("%d",&X[i]);
using namespace std;
ll K;
int N;
pii kagi[100005];
int main(){
	read(N);
	cin>>k>>endl;
	FOR(i,0,N){
		int a, b;
		read(a);
		read(b);
		kagi[i] = make_pair(a,b);
	}	
	sort(kagi, kagi + N);
	for (int i=0;i<N;i++){
		K -= kagi[i].second;
		if (K < 1){
			printf("%d\n", kagi[i].first);
			return 0;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:14: error: 'k' was not declared in this scope
   30 |         cin>>k>>endl;
      |              ^
Language: Java

import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;

public class Main {

	void solve() {
		int N = sc.nextInt();
		long K = sc.nextLong();
		int[] a = new int[N];
		int[] b = new int[N];
		for (int i = 0; i < N; i++) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		long lo = 0;
		long hi = 1L << 58;
		while (hi - lo > 1) {
			int mi = (hi + lo) / 2;
			if (f(a, b, mi) < K)
				lo = mi;
			else
				hi = mi;
		}
		out.println(hi);
	}
	long f(int[] a, int[]b, int x) {
		long res = 0;
		for (int i = 0; i < a.length; i++) {
			if (a[i] <= x) 
				res += b[i];
		}
		return res;
	}
	
	static void tr(Object... os) { System.err.println(deepToString(os)); }
	static void tr(int[][] as) { for (int[] a : as) tr(a); }

	void print(int[] a) {
		out.print(a[0]);
		for (int i = 1; i < a.length; i++) out.print(" " + a[i]);
		out.println();
	}

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

	MyScanner sc = null;
	PrintWriter out = null;
	public void run() throws Exception {
		sc = new MyScanner(System.in);
		out = new PrintWriter(System.out);
		for (;sc.hasNext();) {
			solve();
			out.flush();
		}
		out.close();
	}

	class MyScanner {
		String line;
		BufferedReader reader;
		StringTokenizer tokenizer;

		public MyScanner(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}
		public void eat() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					line = reader.readLine();
					if (line == null) {
						tokenizer = null;
						return;
					}
					tokenizer = new StringTokenizer(line);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
		}
		public String next() {
			eat();
			return tokenizer.nextToken();
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		public boolean hasNext() {
			eat();
			return (tokenizer != null && tokenizer.hasMoreElements());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}
	}
}

Compiler output:
Main.java:20: error: incompatible types: possible lossy conversion from long to int
			int mi = (hi + lo) / 2;
			                   ^
1 error
Language: C++

#include <cstdio>
#ifdef _MSC_VER
#include <conio.h>
#else
#define getch()
#endif

#define LIMIT 100000

#define int long long int

int main(){
	int Data[LIMIT]={};
	int N=0;
	int K=0;
	scanf(" %d %d",&N,&K);
	for(int i=0;i<N;i++){
		int TempA=0;
		int TempB=0;
		scanf(" %d %d",&TempA,&TempB);
		Data[TempA-1]+=TempB;
	}
	for(int i=0;i<LIMIT;i++){
		K-=Data[i];
		if(K<=0){
			printf("%d\n",i+1);
			break;
		}
	}
	getch();
}

Compiler output:
a.cc:10:23: error: '::main' must return 'int'
   10 | #define int long long int
      |                       ^~~
a.cc:12:1: note: in expansion of macro 'int'
   12 | int main(){
      | ^~~
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

using int64 = int64_t;

constexpr int64 MOD = 1000000007;

int main() {
    int N,
    int64 K;
    int64 count[100002];
    fill(count, count+100002, 0);
    cin >> N >> K;
    for (int j = 0; j < N; ++j) {
        int a, b; cin >> a >> b;
        count[a] += b;
    }

    int64 acc = 0;
    for (int j = 0; j <= 100000; ++j) {
        acc += count[j];
        if (acc >= K) {
            cout << j << endl;
            return 0;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:11: error: expected initializer before 'K'
   30 |     int64 K;
      |           ^
a.cc:33:17: error: 'K' was not declared in this scope
   33 |     cin >> N >> K;
      |                 ^
Language: C++

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

int main()
{
	int N, K;
	int num[100001];
	memset(num, 0, sizeof(int) * 100001);
	cin >> N >> K;
	for (int i = 0; i < N; i++) {
		int a, b;
		cin >> a >> b;
		num[a] += b;
	}
	long long sum = 0;
	for (int i = 0; i < 100001; i++) {
		if (sum < K && K <= sum + num[i]) {
			printf("%d\n", i);
			break;
		}
		sum += num[i];
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'memset' was not declared in this scope
   10 |         memset(num, 0, sizeof(int) * 100001);
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C

#include<stdio.h>
long count[100001];
int main(int argc, char const *argv[]){
	long i,n,k,c=0;
	scanf("%ld %ld",&n,&k);
	for(i=0;i<n;i++){
		scanf("%ld %ld",&a,&b);
		count[a]+=b;
	}
	for(i=1;i<=100000;i++){
		c+=count[i];
		if(c>=k){
			printf("%ld\n",i);
			break;
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:34: error: 'a' undeclared (first use in this function)
    7 |                 scanf("%ld %ld",&a,&b);
      |                                  ^
main.c:7:34: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:37: error: 'b' undeclared (first use in this function)
    7 |                 scanf("%ld %ld",&a,&b);
      |                                     ^
Language: C

#include<stdio.h>
long count[100001];
int main(int argc, char const *argv[]){
	long i,n,k,c=0;
	scanf("%ld %ld",&n,&k);
	for(i=0;i<n;i++){
		scanf("%ld %ld",a,b);
		count[a]+=b;
	}
	for(i=1;i<=100000;i++){
		c+=count[i];
		if(c>=k){
			printf("%ld\n",i);
			break;
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:33: error: 'a' undeclared (first use in this function)
    7 |                 scanf("%ld %ld",a,b);
      |                                 ^
main.c:7:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:35: error: 'b' undeclared (first use in this function)
    7 |                 scanf("%ld %ld",a,b);
      |                                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
signed main(){
  int n;
  cin>>n;
  P p[n];
  for(int i=0;i<n;i++) cin>>p[i].first>>p[i].second;
  int k;
  cin>>k;
  sort(p.begin(),p.end());
  for(int i=0;i<n;i++){
    if(k>p[i].second) k-=p[i].second;
    else{
      cout<<p[i].first<<endl;
      return 0;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: request for member 'begin' in 'p', which is of non-class type 'P [n]' {aka 'std::pair<long long int, long long int> [n]'}
   12 |   sort(p.begin(),p.end());
      |          ^~~~~
a.cc:12:20: error: request for member 'end' in 'p', which is of non-class type 'P [n]' {aka 'std::pair<long long int, long long int> [n]'}
   12 |   sort(p.begin(),p.end());
      |                    ^~~
Language: C++

#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

ll n,k;

int main(){
	cin>>n>>k;
	ll res
	for(int i=0;i<n;i++){
		ll A,B;
		cin>>A>>B;
		k-=B;
		if(k<=0){
			res=A;
			break;
		}
	}
	cout<<res<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:9: error: expected initializer before 'for'
   52 |         for(int i=0;i<n;i++){
      |         ^~~
a.cc:52:21: error: 'i' was not declared in this scope; did you mean 'vi'?
   52 |         for(int i=0;i<n;i++){
      |                     ^
      |                     vi
a.cc:61:15: error: 'res' was not declared in this scope
   61 |         cout<<res<<endl;
      |               ^~~
Language: Java

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

public class Main{

	private static final int mod =(int)1e9+7;
	public static void main(String[] args) throws Exception  {
	      Scanner  sc=new Scanner(System.in);
	      PrintWriter out=new PrintWriter(System.out);
int n=sc.nextInt();
long m=sc.nextLong();
pair []aa=new pair[m];

for(int i=0;i<m;i++) {
  int x=sc.nextInt()-1;
  int y=sc.nextInt()-1;
  long c=sc.nextLong();
  c=-1l*c;
  pair p=new pair(x,y,c);
 aa[i]=p;
}
long dis[]=new long[n];

Arrays.fill(dis,Long.MAX_VALUE);
dis[0]=0;
for(int i=0;i<n-1;i++) {
  for(int j=0;j<m;j++) {
    int src=aa[j].src;
    int des=aa[j].des;
    long wt=aa[j].val;
    if(dis[des]>dis[src]+wt) {
      dis[des]=dis[src]+wt;
    }
  }
}
boolean negative=false;
    for(int j=0;j<m;j++) {
      int src=aa[j].src;
      int des=aa[j].des;
      long wt=aa[j].val;
      if(dis[des]!=Long.MAX_VALUE&&dis[des]>dis[src]+wt) {
        dis[des]=dis[src]+wt;
        negative=true;
        break;
      }
        
    }

	System.out.println(negative==true?"inf":-dis[n-1]);

}

	      static long gcd(long a, long b) 
	      { 
	          if (a == 0) 
	              return b; 
	          return gcd(b % a, a); 
	      } 

static long nCr(int n,int r) {
  int dp[][]=new int[2001][2001];
  for(int i=0;i<2001;i++) {
    dp[0][i]=0;
  }
  for(int i=0;i<2001;i++) {
    dp[i][0]=1;
  }
  for(int i=1;i<2001;i++) {
    for(int j=1;j<2001;j++) {
      if(i==j) {
        dp[i][j]=1;
      }else {
        dp[i][j]=dp[i-1][j-1]+dp[i][j-1];
      }
    }
  }
  return dp[n][r];
}


      
}
class pair {
  int src;
 int  des;
 long val;
  pair(int src,int des,long val){
    this.src=src;
    this.des=des;
    this.val=val;
    
  }

//  @Override
//  public int compareTo(pair o) {
//   
//    return this.wt-o.wt;
//  }
}


Compiler output:
Main.java:12: error: incompatible types: possible lossy conversion from long to int
pair []aa=new pair[m];
                   ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef pair<int,int> P;
typedef long long ll;
const int INF = 1001001001;
const ll INFL = 1e17;
const int MOD = 1e9+7;

struct edge{ll from,to,cost;};
vector<bool> negative(1010,false);

bool Bellman_Ford(int s, int V, vector<ll>& dist, vector<edge>& G){
    fill(dist.begin(),dist.end(),INFL);
    dist[s] = 0;
    for(int loop = 0; loop < V*2; loop++){
        bool update = false;
        for(int i=0; i<int(G.size()); i++){
            edge e = G[i];
            if(dist[e.from] != INFL && dist[e.to] > dist[e.from] + e.cost){
                dist[e.to] = dist[e.from] + e.cost;
                update = true;
                if(loop >= V){
                    negative[e.to] = true;
                }
                if(loop == 2*v-1){
                    return true;
                }
            } 
        }
        if(!update) break;
    }
    return false;
}

int main(){
    int V,E;
    cin >> V >> E;
    vector<ll> dist(V);
    vector<edge> G;
    rep(i,E){
        int a,b,c;
        cin >> a >> b >> c;
        --a; --b; c = -c;
        G.push_back(edge{a,b,c});
    }
    if(Bellman_Ford(0,V,dist,G)){
        cout << "inf" << endl;
    }else{
        cout << -dist[V-1] << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'bool Bellman_Ford(int, int, std::vector<long long int>&, std::vector<edge>&)':
a.cc:26:30: error: 'v' was not declared in this scope
   26 |                 if(loop == 2*v-1){
      |                              ^
Language: C++

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

struct bellford
{
    const ll INF=LONG_LONG_MAX;
    struct edge {int u, v; ll w;};
    int nv, ne;
    vector<ll> d;
    vector<int> p;
    vector<edge> E;

    bellford(int nv, int ne) : nv(nv), ne(ne)
    {
        d.resize(nv, INF);
        p.resize(nv,-1);
    }

    void relax(int u, int v, ll w)
    {
        if(d[u]!=INF && d[v]>d[u]+w)
        {
            d[v]=d[u]+w;
            p[v]=u;
        }
    }

    bool get(int s)
    {
        d[s]=0; 
        for(int i=0; i<nv-1; i++)
            for(auto &e : E)
                relax(e.u, e.v, e.w);

        vector<bool> path(nv, false);
        path[nv-1]=true;
        int v=p[nv-1];
        while(v!=-1 && !path[v])
        {
            path[v]=true;
            v=p[v];
        }
        if(v!=-1 && path[v]) return false;
        return true;
    }
};


int main()
{
    int N, M;
    scanf("%d%d", &N, &M);
    bellford g(N, M);
    for(int i=0; i<M; i++)
    {
        int a, b;
        ll c;
        scanf("%d%d%lld", &a, &b, &c);
        g.E.push_back({a-1, b-1, -c});
    }

    if(g.get(0)) printf("%lld\n", -g.d[N-1]);
    else printf("inf\n");
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:65:14: error: expected '}' at end of input
   65 |     return 0;
      |              ^
a.cc:51:1: note: to match this '{'
   51 | {
      | ^
Language: C++

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

#define _GLIBCXX_DEBUG
#define rep(i, V) for (int i = 0; i < V; i++)
#define repr(i, V) for (int i = V-1; i >= 0; i--)
#define repval(i, a, V) for (int i = a; i < V ; i++)
#define all(x) x.begin(), x.end()
#define ld long double
#define eps 0.0000000001
#define mod 1000000007
#define inf 1e9
#define vec vector
#define each(i, mp) for(auto& i:mp)

struct Edge {
    int to, cost;
    Edge(int b, int c){
        to = b; cost = c;
    }
};

int main(){
    int n, m; //points, edge
    cin >> n >> m;
    vec<vec<Edge>> graph(n);
    vec<int> dist(n, inf);
    int a, b, c;
    rep(i, m){
        cin >> a >> b >> c;
        a--; b--;
        graph[a].push_back(Edge(b, -c));
    }

    bool negative = false;
    dist[0] = 0;
    rep(i, n){
        rep(v, n){
            rep(k, (int)(graph[v].size())){
                Edge e = graph[v][k];
                if (dist[v]!= inf && dist[e.to] > dist[v] + e.cost){
                    dist[e.to] = dist[v] + e.cost;
                    if (i == n-1 && e.first == n-1){
                        negative = true;
                    }
                }
            }
        }
    }
    if (!negative){
        cout << -dist[n-1] << endl;
    } else {
        cout << "inf" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:39: error: 'struct Edge' has no member named 'first'
   44 |                     if (i == n-1 && e.first == n-1){
      |                                       ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
vector<pair<int,int > >graph[MAX];
bool visit[MAX],visit2[MAX];
ll clr[MAX],cost[MAX];
int cycle;
void c_dfs(int src)
{
    visit[src]=1;
    clr[src]=1;
    for(int i=0; i<graph[src].size(); i++)
    {
        int child=graph[src][i].first;
        if(visit[child]==0)
            c_dfs(child);
        else if(clr[child]==1)
        {
            cycle=1;
            return;
        }
    }
    clr[src]=2;
}
void dfs(int src)
{
    for(int i=0; i<graph[src].size(); i++)
    {
        int child=graph[src][i].first;
        int cur=graph[src][i].second;
        if(cost[src]+cur>cost[child])
        {
            cost[child]=cost[src]+cur;
            dfs(child);
        }
    }
}
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    int n,m;
    cin>>n>>m;
    for(int i=2;i<=n;i++)
        cost[i]=-1e18;
    while(m--)
    {
        int a,b,c;
        cin>>a>>b>>c;
        graph[a].push_back({b,c});
    }
    c_dfs(1);
    if(cycle)
        cout<<"inf"<<endl;
    else
    {
        dfs(1);
        cout<<cost[n]<<endl;

    }


    return 0;
}


Compiler output:
a.cc: In function 'void c_dfs(int)':
a.cc:21:5: error: reference to 'visit' is ambiguous
   21 |     visit[src]=1;
      |     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:16:6: note:                 'bool visit [1000000]'
   16 | bool visit[MAX],visit2[MAX];
      |      ^~~~~
a.cc:26:12: error: reference to 'visit' is ambiguous
   26 |         if(visit[child]==0)
      |            ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:16:6: note:                 'bool visit [1000000]'
   16 | bool visit[MAX],visit2[MAX];
      |      ^~~~~
Language: C++

/**
 *    author:  FromDihPout
 *    created: 2020-07-26
**/

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


const long long INF = 1e18;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, m;
    cin >> n >> m;
    vector<pair<pair<int,int>, int>> edges(m);
    for (int i = 0; i < m; i++) {
        int u, v, w;
        cin >> u >> v >> w;
        u--; v--;
        edges[i] = {{u, v}, w};
    }
    
    vector<long long> score(n, -INF);
    score[0] = 0;
    for (int i = 0; i < n; i++) {
        for (auto e : edges) {
            int u = e.f.f, v = e.f.s, w = e.s;
            if (score[u] >= -INF) {
                score[v] = max(score[v], score[u] + w);
            }
        }
    }
    long long prev = score[n-1];
    for (int i = 0; i < n; i++) {
        for (auto e : edges) {
            int u = e.f.f, v = e.f.s, w = e.s;
            if (score[u] >= -INF) {
                score[v] = max(score[v], score[u] + w);
            }
        }
    }
    if (score[n-1] > prev) {
        cout << "inf" << '\n';
    }
    else {
        cout << prev << '\n';
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: 'struct std::pair<std::pair<int, int>, int>' has no member named 'f'
   30 |             int u = e.f.f, v = e.f.s, w = e.s;
      |                       ^
a.cc:32:23: error: 'v' was not declared in this scope
   32 |                 score[v] = max(score[v], score[u] + w);
      |                       ^
a.cc:32:53: error: 'w' was not declared in this scope
   32 |                 score[v] = max(score[v], score[u] + w);
      |                                                     ^
a.cc:39:23: error: 'struct std::pair<std::pair<int, int>, int>' has no member named 'f'
   39 |             int u = e.f.f, v = e.f.s, w = e.s;
      |                       ^
a.cc:41:23: error: 'v' was not declared in this scope
   41 |                 score[v] = max(score[v], score[u] + w);
      |                       ^
a.cc:41:53: error: 'w' was not declared in this scope
   41 |                 score[v] = max(score[v], score[u] + w);
      |                                                     ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#define rep(i,n) for(int i = 0; i < (n); i++)
using ll = long long;
using namespace std;

int main()
{
    const ll INF = -1e15;
    struct edge{
        ll from;
        ll to;
        ll cost;
    };
    ll n, m;
    cin >> n >> m;
    vector<edge>edges(m);
    rep(i,m){
        int a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        edges[i] = {a, b, c};
    }
    vector<ll>ans(n, INF);
    ans[0] = 0;
    rep(i,n - 1){
        rep(j, m){
            if(ans[edges[j].from] != INF){ 
                ans[edges[j].to] = max(ans[edges[j].to], ans[edges[j].from] + edges[j].cost);
            }
        }
    }
    bool ok = true;
    rep(j,m){
        ll a = ans[edges[j].to];
        if(ans[edges[j].from] != INF){
            ans[edges[j].to] = max(ans[edges[j].to], ans[edges[j].from] + edges[j].cost);
        }
        if(a < ans[edges[j].to]) //ok = false;
    }
    if(!ok) cout << "inf" << endl;
    else cout << ans[n - 1] << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:42:5: error: expected primary-expression before '}' token
   42 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>
#define ss second
#define ff first
#define all(x) x.begin(), x.end()
 
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
 
const ll oo = 1e11 + 7;
const int mod = 1e9 + 7, maxn = (2 * 1e3) + 10;
const long double PI = acos(-1);

int main (){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll n, m;

    cin >> n >> m;

    vector<ll> a(m), b(m), c(m), dist(n, oo);
    bitset<maxn> neg(0);

    for (int i=0; i<m; i++){
        cin >> a[i] >> b[i] >> c[i];
        a[i]--, b[i]--;
        c[i]*=-1;
    }

    dist[0] = 0;

    for (int loop=0; loop<n-1; loop++){
        if (dist[a[i]] == oo) continue;
        for (int i=0; i<m; i++){
            if (dist[b[i]] > dist[a[i]] + c[i]){
                dist[b[i]] = dist[a[i]] + c[i];
            }
        }
    }

    ll ans = dist[n-1];

    for (int loop = 0; loop < n-1; loop++){
        for (int i=0; i<m; i++){
            if (dist[b[i]] > dist[a[i]] + c[i]){
                neg[a[i]] = 1;
                dist[b[i]] = dist[a[i]] + c[i];
            }
            if (neg[a[i]]) neg[b[i]] = 1;
        }
    }

    if (neg[n-1]) cout << "inf" << endl;
    else cout << -ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:20: error: 'i' was not declared in this scope
   33 |         if (dist[a[i]] == oo) continue;
      |                    ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <tuple>
#include <bitset>
#include <random>
#define REP(i,n) for(int i=0;i<n;i++)
#define INF 100000000000000000
using namespace std;
using pii=pair<int,int>;





vector<int> dist;
vector<int> pre;
vector<bool> exist_negative_cycle;

void Bellman_Ford(vector<vector<pii>> adj_list,int start){
    /*trueなら負の閉路が存在*/
    
    int n=adj_list.size();
    /*初期化*/
    dist=vector<int>(n,INF);
    pre=vector<int>(n);/*最短経路におけるひとつ前の頂点*/
    exist_negative_cycle=vector<bool>(n,false);/*nまでの経路に負の閉路があるかどうか*/
    dist.at(start)=0;
    REP(i,n){
        REP(u,n){
            for(auto vpair : adj_list.at(u)){
                int weight_u_to_v,v;
                tie(v,weight_u_to_v)=vpair;
                if(dist.at(v)>dist.at(u)+weight_u_to_v){
                  dist.at(v)=dist.at(u)+weight_u_to_v;
                  pre.at(v)=u;
                  if (i == n - 1){
                    exist_negative_cycle.at(v)=true;
                  }; // n回目にも更新があるなら負の閉路が存在
                }

            }
        }
    }


  
}
int main() {
  int V,E;
  cin>>V>>E;
  vector<vector<pair<int,int>>> adj_list(V);
  
  REP(i,E){
    int s,t,d;
    cin>>s>>t>>d;
    s--;
    t--;/*添字の調整*/
    adj_list.at(s).push_back(make_pair(t,-d));

  }
  

  Bellman_Ford(adj_list,0);
  
  if(exist_negative_cycle.at(n-1)){
    cout<<"inf"<<endl;
    return 0;
  }
  cout<<-dist.at(V-1)<<endl;


  return 0;
}

Compiler output:
a.cc: In function 'void Bellman_Ford(std::vector<std::vector<std::pair<int, int> > >, int)':
a.cc:15:13: warning: overflow in conversion from 'long int' to 'std::vector<int>::value_type' {aka 'int'} changes value from '100000000000000000' to '1569325056' [-Woverflow]
   15 | #define INF 100000000000000000
      |             ^~~~~~~~~~~~~~~~~~
a.cc:32:24: note: in expansion of macro 'INF'
   32 |     dist=vector<int>(n,INF);
      |                        ^~~
a.cc: In function 'int main()':
a.cc:73:30: error: 'n' was not declared in this scope
   73 |   if(exist_negative_cycle.at(n-1)){
      |                              ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>    
#include<cmath>
#include<map>
#include<vector>
#include<math.h>
#include<stdio.h>
#include<stack>
#include<queue>
#include<tuple>
#include<cassert>
#include<set>
#include<functional>
//#include<bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
const ll INF = 1000000000000000000;
const ll mod = 1000000007;
const ld pi = 3.141592653589793238;
//printf("%.10f\n", n);

ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (a % b == 0)return b;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
ll modpow(ll x, ll y) {
	ll res = 1;
	while (y) {
		if (y % 2) { res *= x; res %= mod; }
		x = x * x % mod; y /= 2;
	}
	return res;
}

//頂点fromから頂点toへのコストcostの辺
struct edge { ll from, to, cost; };
edge es[345678]; //辺
ll d[345678]; //最短距離
//Vは頂点数、Eは辺数
//s番目の頂点から各頂点への最短距離を求める
void Bellman_Ford(ll V, ll E, ll s) {
	for (int i = 0; i <= V; i++) d[i] = INF;
	d[s] = 0;
	while (true) {
		bool update = false;
		for (int i = 0; i < E; i++) {
			edge e = es[i];
			if (d[e.from] != INF && d[e.to] > d[e.from] + e.cost) {
				d[e.to] = d[e.from] + e.cost;
				update = true;
			}
		}
		if (!update)break;
	}
}
//trueなら負の経路が存在する
bool find_negative_loop(ll V, ll E) { //Vは頂点数、Eは辺数
	memset(d, 0, sizeof(d));
	for (int i = 0; i <= V; i++) {
		for (int j = 0; j < E; j++) {
			edge e = es[j];
			if (d[e.to] > d[e.from] + e.cost) {
				d[e.to] = d[e.from] + e.cost;
				//n回目にも更新があるなら負の経路が存在
				if (i == V - 1)return true;
			}
		}
	}
	return false;
}
ll test[12345678];
signed main() {
	ll n, m, a, b, c; cin >> n >> m;
	for (int h = 0; h < m; h++) {
		cin >> a >> b >> c;
		es[h] = { a, b, 0 - c };
	}
	if (find_negative_loop(n, m)) { cout << "inf" << endl; return 0; }
	Bellman_Ford(n, m, 1);
	cout << 0 - d[n] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'bool find_negative_loop(ll, ll)':
a.cc:64:9: error: 'memset' was not declared in this scope
   64 |         memset(d, 0, sizeof(d));
      |         ^~~~~~
a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   14 | #include<functional>
  +++ |+#include <cstring>
   15 | //#include<bits/stdc++.h>