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

#include <bits/stdc++.h>

typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define DECIM8  fixed<<setprecision(8) 
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

using namespace std;
int main(void)
{
  for(;;){
    int n,a,b,c,x;
    cin >> n >> a >> b >> c >> x;
    if(!n&&!a&&!b&&!c&&!x) return 0;
    queue<int> y;
    REP(i,n){
      int tmp;
      cin >> tmp;
      y.push(tmp);
    }
    int answer=0;
    for(){
      if(answer>10000){
	answer=-1;
	break;
      }
      if(y.front()==x) y.pop();
      if(y.empty()) break;
      answer++;
      x=(a*x+b)%c;
    }
    cout << answer << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: expected primary-expression before ')' token
   42 |     for(){
      |         ^
a.cc:53:3: error: expected primary-expression before '}' token
   53 |   }
      |   ^
a.cc:52:28: error: expected ')' before '}' token
   52 |     cout << answer << endl;
      |                            ^
      |                            )
   53 |   }
      |   ~                         
a.cc:42:8: note: to match this '('
   42 |     for(){
      |        ^
a.cc:53:3: error: expected primary-expression before '}' token
   53 |   }
      |   ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;


int main(){
  int n, a, b, c, x, y, count;
  while(true){
    cin >> n >> a >> b >> c >> x;
    if(n == 0){
      break;
    }
    cin >> y;
    count = 0;
    for (int i = 0; i < n; ++i)
    {
      cin >> y;
      for (int j = 0; j < 10000; ++j)
      {
        if (y == x)
        {
          break;
        }
        x = (a * x + b) % c;
        count ++
        if(j == 9999){
          count = -1;
        }
      }
      cout << count;
      if (y == x)
      {
        break;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: expected ';' before 'if'
   26 |         count ++
      |                 ^
      |                 ;
   27 |         if(j == 9999){
      |         ~~
Language: C++

#include <stdio.h>
int main()
{
  int n,a,b,c,x,cou,s,i,j;
  while(1){
    scanf("%d %d %d %d %d",&n,&a,&b,&c,&x);
    if(n==0&&a==0&&b==0&&c==0&&x==0)break;
    cou=0;
    for(i=0;i<n;i++){
      scanf("%d",&s);
      if(cou==0&&x==s)continue;
      x=(a*x+b)%c;
      cou++;
      while(x!=s){
	x=(a*x+b)%c;
	if(cou>=10001)break;
	cou++;
      }
      if(cou>=10001){
	for(j=i+;j<n;j++)scanf("%d",&s);
	break;
      }
    }
    if(cou>=10001)printf("-1\n");
    else printf("%d\n",cou);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: expected primary-expression before ';' token
   20 |         for(j=i+;j<n;j++)scanf("%d",&s);
      |                 ^
Language: C++

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

int main(){
  int n,a,b,c,x;
  int k;
  int count;
  vector<int> y;
  int s;

  while(cin >> n >> a >> b >> c >> x){
    if(n == 0 && a == 0 && b == 0 && c == 0 && x == 0){
      break;
    }
    y.clear();
    count = -1;
    for(int i = 0;i < n; i++){
      cin >> k;
      y.push_back(k);
    }
    reverse(y.begin-1,y.begin-1);
    while(!y.empty()){
      if(x == *(y.end()-1)){
        y.pop_back();
      }
      x = (a*x + b) % c; 
      count++;
      if(count > 10000){
        break;
      }
    }

    if(count > 10000){
      cout << -1 << endl;
    }else{
      cout << count << endl;
    }
  }
      


      

}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   23 |     reverse(y.begin-1,y.begin-1);
      |             ~~~~~~~^~
      |               |     |
      |               |     int
      |               <unresolved overloaded function type>
a.cc:23:30: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   23 |     reverse(y.begin-1,y.begin-1);
      |                       ~~~~~~~^~
      |                         |     |
      |                         |     int
      |                         <unresolved overloaded function type>
Language: C++

while True:
  N,A,B,C,X = map(int,raw_input().split())
  if N == A == B == C == X == 0:break
  sum = 0
  Z = 0
  Y = [int(x) for x in raw_input().split()]
  if (X in Y) == True:
      Y.remove(X)
  while Z == 0:
      if sum == 10000:
          sum = -2
          Z = 1
      sum += 1
      X = (A*X+B)%C
      if X == Y[0]:
          Y.pop(0)
          if len(Y) == 0:
              Z = 1
  print sum

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while True:
      | ^~~~~
Language: C++

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

int LCGs(int N, int X, int A, int B, int C, const int *Y, int size) {
  int counter = 0;

  for(int i = 0; i < N; i ++) {
    for(; counter =< 10000; counter++) {
      if(X == Y[i]) {
        break;
      }
      X = ((A * X + B) % C);
    }
  }

  if(counter < 10000)
    return counter;
  else
    return -1;
}

int main() {
  int N; //リールの数                                                                                
  int X; //乱数の初期値                                                                              
  int A, B, C; //定数                                                                                
  vector<int> Y; //特殊な絵柄で停止する条件                                                          

  while(1) {
    cin >> N >> A >> B >> C >> X;
    if(N == 0)
      break;

    int y;
    for(int i = 0; i < N; i++) {
      cin >> y;
      Y.push_back(y);
    }

    cout << LCGs(N, X, A, B, C, &Y.front(), Y.size()) << endl;
  }
}



Compiler output:
a.cc: In function 'int LCGs(int, int, int, int, int, const int*, int)':
a.cc:10:20: error: expected primary-expression before '<' token
   10 |     for(; counter =< 10000; counter++) {
      |                    ^
Language: C++

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int seq[110];

int main() {
  int n, a, b, c, x;
  while (scanf("%d %d %d %d %d", &n, &a, &b, &c, &x), n|a|b|c|x) {
    REP(i, n) { scanf("%d", &seq[i]); }
    int cnt = 0;
    REP(i, n) {
      while (true) {
        if (x == seq[i]) { break; }
        x = (a * x + b) % c;
        cnt++;
        if (cnt > 10000) { break; }
      }
      if (i == n - 1) { break; }
      x = (a * x + b) % c;
      cnt++;
    }
    if (cnt > 10000) { puts("-1"); }
    else { printf("%d\n", cnt); }
  }
}
[cos

Compiler output:
a.cc:44:1: error: expected unqualified-id before '[' token
   44 | [cos
      | ^
Language: C++

main(){int n,a,b,c,x,i,t,y[101];for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){int n,a,b,c,x,i,t,y[101];for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:38: error: 'scanf' was not declared in this scope
    1 | main(){int n,a,b,c,x,i,t,y[101];for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}}
      |                                      ^~~~~
a.cc:1:75: error: 'printf' was not declared in this scope
    1 | main(){int n,a,b,c,x,i,t,y[101];for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}}
      |                                                                           ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){int n,a,b,c,x,i,t,y[101];for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}}
Language: C++

include <iostream>
using namespace std;

int main() {
    while (true) {
        int n, a, b, c, x;
        cin >> n >> a >> b >> c >> x;
        if ((n | a | b | c | x) == 0) {
            break;
        }
        int* randomNums = new int [n];
        for (int i = 0; i < n; i++) {
            cin >> randomNums[i];
        }
        int reel = 0, time = 0;
        while (reel < n && time <= 10001) {
            if (randomNums[reel] == x) {
                reel++;
            }
            x = (a * x + b) % c;
            time++;
        }
        if (time <= 10001) {
            cout << time - 1 << endl;
        } else {
            cout << -1 << endl;
        }
        delete[] randomNums;
    }
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> n >> a >> b >> c >> x;
      |         ^~~
a.cc:24:13: error: 'cout' was not declared in this scope
   24 |             cout << time - 1 << endl;
      |             ^~~~
a.cc:24:33: error: 'endl' was not declared in this scope
   24 |             cout << time - 1 << endl;
      |                                 ^~~~
a.cc:26:13: error: 'cout' was not declared in this scope
   26 |             cout << -1 << endl;
      |             ^~~~
a.cc:26:27: error: 'endl' was not declared in this scope
   26 |             cout << -1 << endl;
      |                           ^~~~
Language: Java

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class TLE {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        int size = 0;
        int[] al = new int[200000];
        for(int i = 2; i < 200000; i++){
        	boolean flg = true;
        	for(int j = 0; j < size; j++){
        		if(i % al[j] == 0){
        			flg = false;
        			break;
        		}
        	}
        	if(flg){
        		al[size] = i;
        		size++;
        	}
        }
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int p = sc.nextInt();
        while(n != -1 || p != -1){
            ArrayList<Integer> addlist = new ArrayList<Integer>();
            int idx = 0;
            for(int i = 0; i < al.length; i++){
                if(al[i] > n){
                    idx = i;
                    break;
                }
            }
           for(int i = idx; i < idx + p; i++){
                for(int j = i; j < idx + p; j++){
                    addlist.add(al[i] + al[j]);
                }
            }
            Collections.sort(addlist);
            System.out.println(addlist.get(p - 1));
            n = sc.nextInt();
            p = sc.nextInt();
        }
        sc.close();
    }
 
}

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

#include <stdio.h>
#define INF 200001

int main (void){
    int N, P;
    int count;
    int i, j;
    int eratos[INF]={};//0???true
    int memo;
    eratos[1]=1;
    for(i=2;i*i<INF;i++){
        for(j=2;i*j<INF;j++){
            eratos[i*j] = 1;
        }
    }
    while(1){
        scanf("%d %d",&N,&P);
        if(N == -1 && P == -1)
            break;
        
        count = 0;

        for(i = N+1;i<INF;i++){
            if(!eratos[i]){
                count++;
                if(count == P)
                    memo = i+i;
                ip = i;
                for(ip;ip<INF;ip++){
                    if(!eratos[i]){
                        count++;
                        if(count == P)
                            memo = i+ip;
                        break;
                    }
                }
            }
        }
        printf("%d",memo);
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:17: error: 'ip' undeclared (first use in this function); did you mean 'i'?
   28 |                 ip = i;
      |                 ^~
      |                 i
main.c:28:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>

int comp(const void *a, const void *b) { return *(int *) a - *(int *) b; }

int main() {
  while (1) {
    int N, P;
    scanf("%d %d", &N, &P);
    if (N == -1 && P == -1) break;
    int prime[1], primeSize = 0;
    for (int n = N + 1; primeSize < P; n++) {
      bool isPrime = n != 1;
      for (int i = 2; i < n; i++) isPrime &= n % i > 0;
      if (isPrime) prime[primeSize++] = n;
    }
    int primeSum[10000], primeSumSize = 0;
    for (int i = 0; i < primeSize; i++) {
      for (int j = i; j < primeSize; j++) primeSum[primeSumSize++] = prime[i] + prime[j];
    }
    qsort(primeSum, primeSumSize, sizeof(int), comp);
    printf("%d\n", primeSum[P - 1]);
  }
}



Compiler output:
main.c: In function 'main':
main.c:13:7: error: unknown type name 'bool'
   13 |       bool isPrime = n != 1;
      |       ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <stdlib.h>
  +++ |+#include <stdbool.h>
    3 |
Language: C

#include <stdio.h>
#include <stdlib.h>

#define MAX_N 101000

int isPrime[ MAX_N + 1 ] = { 0, 0, 1 };

void insertionSort( int *, int );
void quickSort( int *, int );
void quickSort_body( int *, int, int );
int median( int, int, int );

int main( void ) {
	int i, j, N, P, cnt, p[ 22 ], sum[ 253 ];

	for ( i = 3; i <= MAX_N; i += 2 )
		isPrime[ i ] = 1;

	for ( i = 3; i * i <= MAX_N; i += 2 )
		if ( isPrime[ i ] )
			for ( j = i * 2; j <= MAX_N; j += i )
				isPrime[ j ] = 0;

	for ( ; scanf( "%d %d", &N, &P ), N != -1; printf( "%d\n", sum[ P - 1 ] ) ) {
		cnt = 0;
		for ( i = N + 1; cnt < 22; i++ )
			if ( isPrime[ i ] )
				p[ cnt++ ] = i;

		cnt = 0;
		for ( i = 0; i < 22; i++ )
			for ( j = i; j < 22; j++ )
				sum[ cnt++ ] = p[ i ] + p[ j ];

		quickSort( sum, 253 );
	}

	return 0;
}

void insertionSort( int *data, int n ) {
	int i, j, tmp;

	for ( i = 1; i < n; i++ ) {
		tmp = data[ i ];

		if ( data[ i - 1 ] > tmp ) {
			j = i;
			do {
				data[ j ] = data[ j - 1 ];

				j--;
			} while ( j && data[ j - 1 ] > tmp );

			data[ j ] = tmp;
		}
	}
}

void quickSort( int *data, int n ) {
	quickSort_body( data, 0, n - 1 );
}

void quickSort_body( int *data, int l, int r ) {
	if ( l < r ) {
		int i = l, j = r, pivot = median( data[ i ], data[ ( i + j ) / 2 ], data[ j ] );

		while ( 1 ) {
			while ( data[ i ] < pivot )
				i++;
			while ( pivot < data [ j ] )
				j--;
			if ( i >= j )
				break;

			SWAP( data[ i ], data[ j ] );

			i++;
			j--;
		}

		if ( i - l < 20 )
			insertionSort( data + l, i - l );
		else
			quickSort_body( data, l, i - 1 );

		if ( r - j < 20 )
			insertionSort( data + j + 1, r - j );
		else
			quickSort_body( data, j + 1, r );
	}
}

int median( int x, int y, int z ) {
	if ( x < y )
		if ( y < z )
			return y;
		else if ( z < x )
			return x;
		else
			return z;
	else if ( z < y )
		return y;
	else if ( x < z )
		return x;
	else
		return z;
}

Compiler output:
main.c: In function 'quickSort_body':
main.c:76:25: error: implicit declaration of function 'SWAP' [-Wimplicit-function-declaration]
   76 |                         SWAP( data[ i ], data[ j ] );
      |                         ^~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>

using namespace std;

int min_prime(int n);
int isprime(int n);

int main()
{
	int n, p;
	while(1){
		cin >> n >> p;
		if(n == -1 && p == -1) break;
		int prime_array[1000] = {0}, sum_array[10000] = {0};
		if(isprime(n)) prime_array[0] = n;
		else prime_array[0] = min_prime(n);
		for(int i = 0; i < (2 * p); i++){
			prime_array[i + 1] = min_prime(prime_array[i]);
		}
		int k = 0;
		for(int i = 0; i < (2 * p) + 1; i++){
			for(int j = i; j < (2 * p) + 1; j++){
				sum_array[k] = prime_array[i] + prime_array[j];
				k++;
			}
		}
		sort(sum_array, sum_array+k);
		cout << sum_array[p - 1] << endl;
	}
	return 0;
}

int min_prime(int n)
{
	while(++n){
		if(isprime(n)) break;
		else i++;
	}
	return n;
}

int isprime(int n)
{
	int ans;
	if(n == 0 || n == 1) ans = 0;
	else if(n == 2) ans = 1;
	else {
		for(int i = 2; i < n; i++){
			if(i * i > n) ans = 1;
			else if(n % i == 0){
				ans = 0;
				break;
			}
		}
	}
	return ans;
}

Compiler output:
a.cc: In function 'int min_prime(int)':
a.cc:49:22: error: 'i' was not declared in this scope
   49 |                 else i++;
      |                      ^
Language: C++

#include<stdio.h>
int prime[1300001];

void isprime(void){
    int i,j,n,c;

    for(i = 4;i<1300001;i += 2)prime[i] = 1;

    for (i = 3;i * i <= 1300001;i += 2){
        if (prime[i] == 0){
            for (j = i + i; j <= 1300001; j += i){
                prime[j] = 1;
            }
        }
    }
}

int main(void){
    int n,i,a=0;
    int flag,p,j,k;
    isprime();
    
    while (scanf("%d%d",&n,&p),n==-1&&p==-1){
a=0;
flag=0
        for(i = (n+1)*2;;i++){
for(j = n+1;j < i;j++){
 for(k = j;j+k <= i;k++){
  if(j+k == i){
   if(prime[j]*prime[k]){
    a++;
    if(a==p){
     printf("%d\n",i);
flag=1;
break;
    }
   }
  }
if(flag)break;
 }
if(flag)break;
}
if(flag)break;
        }
a:
    }
     
    return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:7: error: expected ';' before 'for'
   25 | flag=0
      |       ^
      |       ;
   26 |         for(i = (n+1)*2;;i++){
      |         ~~~
a.cc:26:29: error: expected ';' before ')' token
   26 |         for(i = (n+1)*2;;i++){
      |                             ^
      |                             ;
a.cc:46:5: warning: label at end of compound statement only available with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   46 |     }
      |     ^
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<unordered_set>
#define INF 200000
using namespace std;

bool sosuu[INF];
int main() {
	memset(sosuu, true, sizeof(sosuu));
	sosuu[0] = sosuu[1] = false;
	for (int a = 2; a < INF; a++) {
		if (sosuu[a]) {
			for (int b = a * 2; b < INF; b+=a)sosuu[b] = false;
		}
	}
	int x, y;
	while (cin >> x >> y, x | y) {
		int s[20000];
		fill(s, s + (y+1)*(y+1), 1 << 29);
		int sum = 0, l = 0;
		for (int z = x+1; l <= y; z++) {
			if (sosuu[z]) {
				l++;
				int r = l;
				for (int i = z; r <= y; i++) {
					if (sosuu[i]) {
						r++;
						s[sum] = z + i;
						sum++;
					}
				}
			}
		}
		sort(s, s + (y + 1)*(y + 1));
		cout << s[y] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'memset' was not declared in this scope
   12 |         memset(sosuu, true, sizeof(sosuu));
      |         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<unordered_set>
  +++ |+#include <cstring>
    7 | #define INF 200000
Language: C++

#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

void eratosthenes(vector<int> &n){	
	n[1] = 1;
	for (int i = 2;i <= (120000/2); i++){
		n[i * 2] = 1;
	}
	int p = 3;
	while(p * p <= 120000){
		for (int i = p; i <= (120000/p); i++){
			n[i * p] = 1;
		}
		p++;
		while(n[p] == 1)p++;
	}
	return;
}

bool isPrime(int n){
	if (n < 2) return false;
	if (n == 2) return true;
	for (int i = 2; i <= sqrt(n) + 1; i++){
		if (n % i == 0) return false;
	}
	return true;
}
		
int main(){
	vector<int> era(120000);
	eratosthenes(era);
	vector<int> Primelist(120001);
	int index = 1;
	for (int i = 1; i <= era.size(); i++){
		if (era[i] == 0){
			Primelist[index] = i;
			index++;
		}
	}
	while(1){
		int n,p; cin >> n >> p;
		if (n + p == -2) break;
		index = 1;
		while(n >= Primelist[index]){
			index++;
		}
		
		vector<int> list(120000);
		for (int i = 1; i <= p; i++){
			for (int j = i; j <= p; j++){
				list[(i-1) * p + j] = Primelist[index + i - 1] + Primelist[index + j - 1];
			}
		}
		sort(list.begin(),list.end());
		index = 0;
		while(list[index] == 0){
			index++;
		}
		cout << list[index + p - 1] << endl;
		
	}

return 0;
}

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

#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
using namespace std;
bool a[200000];
int main() {
	fill(a, a + 200000, true);
	a[0] = false; a[1] = false;
	for (int i = 0; i < 200000; i++) {
		if (a[i]) {
			int j = 2;
			while (i*j < 200000) {
				a[i*j] = false;
				j++;
			}
		}
	}
	int n, p;
	while (cin >> n >> p&&n != -1 && p != -1) {
		int sum = 0;
		int b[1000];
		for (int i = n; i < 200000 && sum <= p; i++) {
			if (a[i]) {
				b[sum] = i;
				sum++;
			}
		}
		int c[10000];
		int sum2 = 0;
		for (int i = 0; i < sum; i++) {
			for (int j = i; j < sum; j++) {
				c[sum2] = b[i] + b[j];
				sum2++;
			}
		}
		sort(c, c + sum2);
		cout << c[p - 1] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   39 |                 sort(c, c + sum2);
      |                 ^~~~
      |                 sqrt
Language: C++

#include <bitset>
#include <functional>
#include <iostream>
#include <queue>
#include <vector>

using namespace std;

int main()
{
    const auto primes = [] {
        vector<int> r;
        bitset<1'000'000> b;
        auto t = b;
        t.set();
        t[0] = false;
        t[1] = false;
        int i = 0;
        while (true) {
            bool done = false;
            while (!t[i]) {
                ++i;
                if (i == t.size()) {
                    done = true;
                    break;
                }
            }
            if (done) {
                break;
            }

            b[i] = true;
            r.push_back(i);
            for (int j = i; j < t.size(); j += i) {
                t[j] = false;
            }
        }
        return r;
    }();

    while (true) {
        int n, p;
        cin >> n >> p;
        if (n == -1 && p == -1) {
            return 0;
        }

        const auto s = upper_bound(begin(primes), end(primes), n);
        vector<int> q;
        for (int i = 0; i < p; ++i) {
            for (int j = i; j < p; ++j) {
                q.push_back(*(s + i) + *(s + j));
            }
        }
        sort(begin(q), end(q));
        cout << q[p - 1] << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:24: error: 'upper_bound' was not declared in this scope
   48 |         const auto s = upper_bound(begin(primes), end(primes), n);
      |                        ^~~~~~~~~~~
a.cc:55:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   55 |         sort(begin(q), end(q));
      |         ^~~~
      |         short
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int psize = 1000000;
    vector<int>num(psize+1);//prime is 0
    num[0] = num[1] = 1;
    for(int i = 2;i * i <= psize;i++){
        if(num[i])continue;
        for(int j = i * 2;j <= psize;j += i){
            num[j] = 1;
        }
    }
    vector<int>prime;
    rep(i,0,psize+1){
        if(!num[i])prime.push_back(i);
    }    int psize = 1000000;
    vector<int>num(psize+1);//prime is 0
    num[0] = num[1] = 1;
    for(int i = 2;i * i <= psize;i++){
        if(num[i])continue;
        for(int j = i * 2;j <= psize;j += i){
            num[j] = 1;
        }
    }
    vector<int>prime;
    rep(i,0,psize+1){
        if(!num[i])prime.push_back(i);
    }
    
    int N,P;
    cin >> N >> P;
    while(N != -1){
        auto itr = upper_bound(prime.begin(), prime.end(), N);
        auto itr2 = itr;
        int d = distance(prime.begin(), itr);
        multiset<int>st;
        /*          
        rep(i,0,100){
            rep(j,0,100){
                st.insert(*itr + *itr2);
                itr2++;
            }
            itr++;
        }
                  */
        rep(i,0,100){
            rep(j,i,100){
                st.insert(prime[i + d] + prime[j + d]);
            }
        }
        //sort(num.begin(), num.end()); 
        //cout << num[P-1] << endl;
        auto itr3 = st.begin();
        rep(i,0,P-1){
            itr3++;
        }
        cout << *itr3 << endl;
        cin >> N >> P;
    }
    
}


Compiler output:
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:20:14: error: redeclaration of 'int psize'
   20 |     }    int psize = 1000000;
      |              ^~~~~
a.cc:8:9: note: 'int psize' previously declared here
    8 |     int psize = 1000000;
      |         ^~~~~
a.cc:21:16: error: redeclaration of 'std::vector<int> num'
   21 |     vector<int>num(psize+1);//prime is 0
      |                ^~~
a.cc:9:16: note: 'std::vector<int> num' previously declared here
    9 |     vector<int>num(psize+1);//prime is 0
      |                ^~~
a.cc:29:16: error: redeclaration of 'std::vector<int> prime'
   29 |     vector<int>prime;
      |                ^~~~~
a.cc:17:16: note: 'std::vector<int> prime' previously declared here
   17 |     vector<int>prime;
      |                ^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#define MAX 1000000
using namespace std;

void eratos ( int n, vector<int> &v){
    bool prime[MAX+1];
    for ( int i = 0; i <= n; i++ ) prime[i] = false;
    for ( int i = 3; i <= n; i += 2 ) prime[i] = true;
    prime[2] = true;
    int limit = (int)sqrt((double)n) + 1;
    for ( int i = 3; i <= limit; i += 2 ){
	if ( !prime[i] ) continue;
	for ( int j = i + i; j <= n; j += i ) prime[j] = false;
    }
    for ( int i = 0; i <=n; i++ ) if (prime[i]) v.push_back(i);
}

main(){
    int N, P;
    vector<int> primes;
    eratos(MAX, primes);

    int k;
    while(1){
	cin >> N >> P;
	if ( N == -1 && P == -1 ) break;
	int s = distance(primes.begin(), upper_bound(primes.begin(), primes.end(), N));

	vector<int> v;
	for ( int i = s; i < s+P; i++ ){
	    for ( int j = i; j < s+P; j++ ){
		v.push_back(primes[i] + primes[j]);
	    }
	}
	sort(v.begin(), v.end());
	cout << v[P-1] << endl;
    }
}

Compiler output:
a.cc:20:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   20 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:29:42: error: 'upper_bound' was not declared in this scope
   29 |         int s = distance(primes.begin(), upper_bound(primes.begin(), primes.end(), N));
      |                                          ^~~~~~~~~~~
a.cc:37:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   37 |         sort(v.begin(), v.end());
      |         ^~~~
      |         sqrt
Language: C++

#include <iostream>
#include <vector>

#define MAX_N 5000000

using namespace std;

vector<int>  primes;
vector<bool> is_prime;

void Init()
{
  is_prime.resize(MAX_N + 1, true);
  for (int i = 2; i <= MAX_N; i++)  {
    if (is_prime[i]) {
      primes.push_back(i);
      for (int j = i * 2; j <= MAX_N; j += i) {
        is_prime[j] = false;
      }
    }
  }
}

int Func(int N, int P)
{
  vector<int> vi;
  int offset;
  for (offset = 0; offset < primes.size(); offset++) 
    if (primes[offset] > N)
      break;

  for (int i = 0; i < P; i++)
    for (int j = i; j < P; j++) {
      vi.push_back(primes[i + offset] + primes[j + offset]);
    }

  sort(vi.begin(), vi.end());
  return vi[P - 1];
}

int main()
{
  Init();
  int N, P;
  while (cin >> N >> P && N != -1 && P != -1) {
    cout << Func(N, P) << endl;
  }
}

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

#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstring>

#define MAX_N 5000000

using namespace std;

vector<int>  primes;
vector<bool> is_prime;

void Init()
{
  is_prime.resize(MAX_N + 1, true);
  for (int i = 2; i <= MAX_N; i++)  {
    if (is_prime[i]) {
      primes.push_back(i);
      for (int j = i * 2; j <= MAX_N; j += i) {
        is_prime[j] = false;
      }
    }
  }
}

int Func(int N, int P)
{
  vector<int> vi;
  int offset;
  for (offset = 0; offset < primes.size(); offset++) 
    if (primes[offset] > N)
      break;

  for (int i = 0; i < P; i++)
    for (int j = i; j < P; j++) {
      vi.push_back(primes[i + offset] + primes[j + offset]);
    }

  sort(vi.begin(), vi.end());
  return vi[P - 1];
}

int main()
{
  Init();
  int N, P;
  while (cin >> N >> P && N != -1 && P != -1) {
    cout << Func(N, P) << endl;
  }
}

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

#include<iostream>
#include<cstring>
#include<vector>

using namespace std;

const int MAX = 1000000;
bool prime[MAX];
vector<int> V;
int N,P;

void make(){
  memset(prime,true,sizeof(prime));

  prime[0] = prime[1] = false;

  for(int i = 2; i*i < MAX; i++)
    if(prime[i])
      for(int j = 2; i*j < MAX; j++)
	prime[i*j] = false;

  for(int i = 0; i < MAX; i++)
    if(prime[i]) V.push_back(i);
 
}

void solve(){

  vector<int> M;
  vector<int>::iterator ite = upper_bound(V.begin(),V.end(),N);

  for(vector<int>::iterator i = ite; i < ite+200; i++)
    for(vector<int>::iterator j = i; j < ite+200; j++)
      M.push_back(*i+*j);

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

  cout << M[P-1] << endl;
}

int main(){
  make();
  while(cin >> N >> P){
    if(N == -1 && P == -1) break;
    solve();
  }
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:30:31: error: 'upper_bound' was not declared in this scope
   30 |   vector<int>::iterator ite = upper_bound(V.begin(),V.end(),N);
      |                               ^~~~~~~~~~~
a.cc:36:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   36 |   sort(M.begin(),M.end());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void)
{
	int n,p;
	int check;

	int i1,i2;

	while(1){
		cin >> n >> p;
		if(n==-1 && p==-1) break;

		vector<int> sosu;

		i1=n+1;
		if(i1==1 || i1==2) {
			sosu.push_back(2);
			i1=3;
		}

		while(sosu.size()<=p){
			
			check=0;

			
			for(i2=2;i2*i2<=i1;i2++){
				if(i1%i2==0){
					check=1;
					break;
				}
			}

			if(check==0) sosu.push_back(i1);
			i1++;

		}

		vector<int> matsuzaki;

		for(i1=0;i1<sosu.size();i1++){
			for(i2=i1;i2<sosu.size();i2++){
				matsuzaki.push_back(sosu[i1]+sosu[i2]);
			}
		}

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

		cout << matsuzaki[p-1] << endl;

	}
	return 0;


}

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

#include <iostream>
#include <vector>
using namespace std;
const int MAX = 1e6;

bool prime[MAX];

void is_prime(){
  fill(prime,prime+MAX,true);
  
  prime[0] = prime[1] = false;
  for(int i = 2 ; i*i < MAX ; i++)
    if(prime[i])
      for(int j = i*i ; j < MAX ; j += i)
	prime[j] = false;
}

int main(){
  int n,p;

  is_prime();

  while(true){
    cin >> n >> p;
    if(n == -1 && p == -1) break;

    vector<int> v;
    for(int i = n+1 ; i < n+500 ; i++){
      if(prime[i]) v.push_back(i);
    }

    vector<int> ans;
    for(int i = 0 ; i < (int)v.size() ; i++){
      for(int j = i ; j < (int)v.size() ; j++){
	ans.push_back(v[i]+v[j]);
      }
    }
    sort(ans.begin(),ans.end());

    cout << ans[p-1] << endl;
  }  

  return 0;
}

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

import java.util.*;
public class Main {
	
	void doIt() {
		Scanner stdIn = new Scanner(System.in);
		while(true) {
			int N = stdIn.nextInt();
			int P = stdIn.nextInt();
			if(N == -1 && P == -1) break;
			ArrayList<Integer> list = new ArrayList<Integer>(100);
			
			int num = N;
			while(list.size() < 100) {
				boolean flag = true; //素数であると仮定
				if(N == 1) flag = false; //Nが１であればもう見る必要は無い
				for(int c = 2; c <= Math.sqrt(N); c++) {//素数であるか見てみる
					if(N % c == 0) { 
						flag = false;
						break;
					}
				}
				if(flag) list.add(N);
				N++;
			}
		
			for(int r = 0; r < list.size(); r++) {
				if(list.get(r) > num) { 
					num = r; //添字にする 
					break;
				}
			}
			
			ArrayList<Integer> output = new ArrayList<Integer>();
			for(int r = num; r < list.size(); r++) {
				for(int c = r; c < list.size(); c++) {
					output.add(list.get(r) + list.get(c));
				}
			}
			Collections.sort(output);
			System.out.println(output.get(P - 1));
		}
	}
	
	public static void main(String[] args) {
		new Main().doIt();
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

#include <cstdlib>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
#define N 100000

int main(){
        int n, p, sosuu[100],count=0,sum[10000];
        string keymoji;

        cin >> n >> p;
        while(n != -1 && p != -1){
                int i=n;
                count = 0;
                int tmp=sqrt(n);
                if(i<2)i=2;
                for(; count<p; i++){
                        int tmp;
                        if(i==2){
                                sosuu[count]=i;
                                count++;
                                continue;
                        }
                        for(int j=2;j<sqrt(i)+1;j++){
                                if((tmp=i%j) == 0)break;
                        }
                        if(tmp != 0){
                                sosuu[count]=i;
                                count++; 
                        }
                        
                }
                count =0;
                for(i=0; i<p; i++){
                        for(int j=i; j<p; j++){
                                sum[count]=sosuu[i]+sosuu[j];
                                count++;
                        }
                }

                sort(sum, sum+count);
                cout << sum[p-1] << endl;
                cin >> n >> p;

        }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
   12 |         cin >> n >> p;
      |         ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <algorithm>
  +++ |+#include <iostream>
    5 | using namespace std;
a.cc:43:17: error: 'cout' was not declared in this scope
   43 |                 cout << sum[p-1] << endl;
      |                 ^~~~
a.cc:43:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:43:37: error: 'endl' was not declared in this scope
   43 |                 cout << sum[p-1] << endl;
      |                                     ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include <algorithm>
  +++ |+#include <ostream>
    5 | using namespace std;
Language: C++


#include <cstdlib>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
#define N 100000

int main(){
        int n, p, sosuu[100],count=0,sum[10000];
        string keymoji;

        cin >> n >> p;
        while(n != -1 && p != -1){
                int i=n;
                count = 0;
                int tmp=sqrt(n);
                if(i<2)i=2;
                for(; count<p; i++){
                        int tmp;
                        if(i==2){
                                sosuu[count]=i;
                                count++;
                                continue;
                        }
                        for(int j=2;j<sqrt(i)+1;j++){
                                if((tmp=i%j) == 0)break;
                        }
                        if(tmp != 0){
                                sosuu[count]=i;
                                count++; 
                        }
                        
                }
                count =0;
                for(i=0; i<p; i++){
                        for(int j=i; j<p; j++){
                                sum[count]=sosuu[i]+sosuu[j];
                                count++;
                        }
                }

                sort(sum, sum+count);
                cout << sum[p-1] << endl;
                cin >> n >> p;

        }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'cin' was not declared in this scope
   13 |         cin >> n >> p;
      |         ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include <algorithm>
  +++ |+#include <iostream>
    6 | using namespace std;
a.cc:44:17: error: 'cout' was not declared in this scope
   44 |                 cout << sum[p-1] << endl;
      |                 ^~~~
a.cc:44:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:44:37: error: 'endl' was not declared in this scope
   44 |                 cout << sum[p-1] << endl;
      |                                     ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include <algorithm>
  +++ |+#include <ostream>
    6 | using namespace std;
Language: C++

#include <cstdlib>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
#define N 100000

int main(){
        int n, p, sosuu[100],count=0,sum[10000];
        string keymoji;

        cin >> n >> p;
        while(n != -1 && p != -1){
                int i=n;
                count = 0;
                if(i<2)i=2;
                for(; count<p; i++){
                        int tmp;
                        if(i==2){
                                sosuu[count]=i;
                                count++;
                                continue;
                        }
                        for(int j=2;j<1010;j++){
                                if((tmp=i%j) == 0)break;
                        }
                        if(tmp != 0){
                                sosuu[count]=i;
                                count++; 
                        }
                        
                }
                count =0;
                for(i=0; i<p; i++){
                        for(int j=i; j<p; j++){
                                sum[count]=sosuu[i]+sosuu[j];
                                count++;
                        }
                }

                sort(sum, sum+count);
                cout << sum[p-1] << endl;
                cin >> n >> p;

        }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
   12 |         cin >> n >> p;
      |         ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <algorithm>
  +++ |+#include <iostream>
    5 | using namespace std;
a.cc:42:17: error: 'cout' was not declared in this scope
   42 |                 cout << sum[p-1] << endl;
      |                 ^~~~
a.cc:42:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:42:37: error: 'endl' was not declared in this scope
   42 |                 cout << sum[p-1] << endl;
      |                                     ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include <algorithm>
  +++ |+#include <ostream>
    5 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int prime[200000];
bool is_prime[200000];
int sieve(int n);
vector<int> prime_prime;
int main(){
  sieve(200000);
  int n,p;
  int count=0;
  while(cin>>n>>p){
    count=0;
    prime_prime.clear();
    if(n==-1 && p==-1)break;
    while(prime[count]<=n)count++;
    for(int i=count;i<p+count;i++)
      for(int j=i;j<p+count;j++)
	prime_prime.push_back(prime[i]+prime[j]);
    sort(prime_prime.begin(),prime_prime.end());
    //for(int i=0;i<num;i++)cout<<prime_prime[i]<<endl;    
    cout<<prime_prime[p-1]<<endl;
  }
  return 0;
}

int sieve(int n){
  int p = 0;
  for(int i = 0;i<=n;i++)is_prime[i] = true;
  is_prime[0] = is_prime[1] = false;
  for(int i = 2;i<=n;i++){
    if(is_prime[i]){
      prime[p++]=i;
      for(int j=2*i;j<=n;j+=i)is_prime[j]=false;
    }
  }
  return p;
}

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

#include<iostream>
#include<vector>
using namespace std;
int prime[200000];
bool is_prime[200000];
int sieve(int n);
vector<int> prime_prime;
int main(){
  sieve(200000);
  int i,j;
  int n,p;
  int count=0;
  while(cin>>n>>p){
    count=0;
    prime_prime.clear();
    if(n==-1 && p==-1)break;
    while(prime[count]<=n)count++;
    for(i=count;i<p+count;i++)
      for(j=i;j<p+count;j++)
	prime_prime.push_back(prime[i]+prime[j]);
    sort(prime_prime.begin(),prime_prime.end());
    //for(int i=0;i<num;i++)cout<<prime_prime[i]<<endl;    
    cout<<prime_prime[p-1]<<endl;
  }
  return 0;
}

int sieve(int n){
  int p = 0;
  int i,j;
  for(i = 0;i<=n;i++)is_prime[i] = true;
  is_prime[0] = is_prime[1] = false;
  for(i = 2;i<=n;i++){
    if(is_prime[i]){
      prime[p++]=i;
      for(j=2*i;j<=n;j+=i)is_prime[j]=false;
    }
  }
  return p;
}

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

#include <iostream>
#include <queue>
#include <vector>
  
using namespace std;
  
int N, M, L;
  
struct edge {
    int to, distance, enemy;
};
  
struct P {
    int from, money, enemy;
  
    bool operator >(const P& p) const {
        return enemy > p.enemy;
    }
};

struct edge {
    int to, distance, enemy;
};
  
int main() {
    while (cin >> N >> M >> L, N|M|L) {
        vector<vector<edge> > E(N);
        int a, b, d, e;
        for (int i = 0; i < M; i++) {
            cin >> a >> b >> d >> e;
            E[a-1].push_back({b, d, e});
            E[b-1].push_back({a, d, e});
        }
  
        priority_queue<P, vector<P>, greater<P>> q;
        city arr[N];
        for(int i = 0; i < N; i++) {
            arr[i].money = 0;
        }   
        q.push((P){0, L, 0});
            while(!q.empty()) {
            P p = q.top(); q.pop();
            // goal
            if (p.from == N-1) {
                cout << p.enemy << endl;
                break;
            }
            if (p.money >= arr[p.from].money) {
                arr[p.from].money = p.money;
                arr[p.from].enemy = p.enemy;
            } else if (p.enemy <= arr[p.from].enemy) {
                continue;
            }

            for (int i = 0; i < E[p.from].size() ; i++) {
                edge e = E[p.from][i];
                q.push((P){e.to-1, p.money, p.enemy+e.enemy});
                if (p.money-e.distance >= 0) {
                    q.push((P){e.to-1, p.money-e.distance, p.enemy});
                }
            }
        }
    }
    return 0;
}

Compiler output:
a.cc:21:8: error: redefinition of 'struct edge'
   21 | struct edge {
      |        ^~~~
a.cc:9:8: note: previous definition of 'struct edge'
    9 | struct edge {
      |        ^~~~
a.cc: In function 'int main()':
a.cc:36:9: error: 'city' was not declared in this scope
   36 |         city arr[N];
      |         ^~~~
a.cc:38:13: error: 'arr' was not declared in this scope
   38 |             arr[i].money = 0;
      |             ^~~
a.cc:48:28: error: 'arr' was not declared in this scope
   48 |             if (p.money >= arr[p.from].money) {
      |                            ^~~
Language: C++

#include <iostream>
#include <queue>
#include <vector>
   
using namespace std;
   
int N, M, L;
   
struct edge {
    int to, distance, enemy;
};
   
struct P {
    int from, money, enemy;
   
    bool operator >(const P& p) const {
        return enemy > p.enemy;
    }
};
 
struct edge {
    int to, distance, enemy;
};

struct pair {
    int money, enemy;
}
   
int main() {
    while (cin >> N >> M >> L, N|M|L) {
        vector<vector<edge> > E(N);
        int a, b, d, e;
        for (int i = 0; i < M; i++) {
            cin >> a >> b >> d >> e;
            E[a-1].push_back({b, d, e});
            E[b-1].push_back({a, d, e});
        }
   
        priority_queue<P, vector<P>, greater<P>> q;
        city arr[N];
        for(int i = 0; i < N; i++) {
            arr[i].money = 0;
        }   
        q.push((P){0, L, 0});
        while(!q.empty()) {
            P p = q.top(); q.pop();
            // goal
            if (p.from == N-1) {
                cout << p.enemy << endl;
                break;
            }
            if (p.money >= arr[p.from].money) {
                arr[p.from].money = p.money;
                arr[p.from].enemy = p.enemy;
            } else if (p.enemy <= arr[p.from].enemy) {
                continue;
            }
 
            for (int i = 0; i < E[p.from].size() ; i++) {
                edge e = E[p.from][i];
                q.push((P){e.to-1, p.money, p.enemy+e.enemy});
                if (p.money-e.distance >= 0) {
                    q.push((P){e.to-1, p.money-e.distance, p.enemy});
                }
            }
        }
    }
    return 0;
}

Compiler output:
a.cc:21:8: error: redefinition of 'struct edge'
   21 | struct edge {
      |        ^~~~
a.cc:9:8: note: previous definition of 'struct edge'
    9 | struct edge {
      |        ^~~~
a.cc:27:2: error: expected ';' after struct definition
   27 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:40:9: error: 'city' was not declared in this scope
   40 |         city arr[N];
      |         ^~~~
a.cc:42:13: error: 'arr' was not declared in this scope
   42 |             arr[i].money = 0;
      |             ^~~
a.cc:52:28: error: 'arr' was not declared in this scope
   52 |             if (p.money >= arr[p.from].money) {
      |                            ^~~