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

#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


ll *min_data,*max_data,*add_data;
char buf[300001];
int N = 1;

void init(ll first_N){
	while(N < first_N)N *= 2;
}

void add(int left,int right,ll value,int node_id,int node_left,int node_right){

	if(right < node_left || left > node_right){
		return;
	}
	else if(left <= node_left && right >= node_right){

		add_data[node_id] += value;

		while(node_id != 0){

			node_id = (node_id-1)/2;a[2*node_id+2]+add_data[2*node_id+2]);
			max_data[node_id] = max(max_data[2*node_id+1]+add_data[2*node_id+1],max_data[2*node_id+2]+add_data[2*node_id+2]);
		}
	}else{

		add(left,right,value,2*node_id+1,node_left,(node_left+node_right)/2);
		add(left,right,value,2*node_id+2,(node_left+node_right)/2+1,node_right);
	}
}

ll getMin(int left,int right,int node_id,int node_left,int node_right){
	if(right < node_left || left > node_right)return BIG_NUM;
	else if(left <= node_left && right >= node_right){
		return min_data[node_id]+add_data[node_id];

	}else{

		ll  left_min  = getMin(left,right,2*node_id+1,node_left,(node_left+node_right)/2);
		ll  right_min = getMin(left,right,2*node_id+2,(node_left+node_right)/2+1,node_right);
		return min(left_min,right_min)+add_data[node_id];
	}
}


int main(){

	int first_N,Q;
	scanf("%d %d",&first_N,&Q);

	init(first_N);

	min_data = new ll[2*N-1];
	max_data = new ll[2*N-1];
	add_data = new ll[2*N-1];

	for(ll i = 0; i <= 2*N-2; i++){
		min_data[i] = 0;
		max_data[i] = 0;
		add_data[i] = 0;
	}

	scanf("%s",buf);

	set<int> CLOSE;

	for(int i = 0; i < first_N; i++){
		if(buf[i] == '('){
			add(i,N-1,1,0,0,N-1);
		}else{
			CLOSE.insert(i);
			add(i,N-1,-1,0,0,N-1);
		}
	}

	int loc,calc_loc;
	int left,right,m;

	for(int i = 0; i < Q; i++){
		scanf("%d",&loc);
		loc--;

		if(buf[loc] == '('){

			buf[loc] = ')';
			add(loc,N-1,-2,0,0,N-1);
			CLOSE.insert(loc);

			calc_loc = *begin(CLOSE);
			CLOSE.erase(begin(CLOSE));

			add(calc_loc,N-1,2,0,0,N-1);
			buf[calc_loc] = '(';
			printf("%d\n",calc_loc+1);

		}else{ //buf[loc] == ')'

			CLOSE.erase(loc);
			buf[loc] = '(';
			add(loc,N-1,2,0,0,N-1);

			left = 0,right = first_N-1, m = (left+right)/2;

			while(left <= right){
				if(getMin(m,N-1,0,0,N-1) >= 2){
					calc_loc = m;
					right = m-1;
				}else{
					left = m+1;
				}
				m = (left+right)/2;
			}

			while(buf[calc_loc] != '(')calc_loc++;

			buf[calc_loc] = ')';
			add(calc_loc,N-1,-2,0,0,N-1);

			printf("%d\n",calc_loc+1);
			CLOSE.insert(calc_loc);
		}
	}

	return 0;
}



Compiler output:
a.cc: In function 'void add(int, int, ll, int, int, int)':
a.cc:29:49: error: 'a' was not declared in this scope
   29 |                         node_id = (node_id-1)/2;a[2*node_id+2]+add_data[2*node_id+2]);
      |                                                 ^
Language: Java

import java.util.Scanner;


public class ICPCRegional2015A {
    
    public static void main(String[] args) throws Exception {
        new ICPCRegional2015A().solve();
    }

    private void solve() throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] ds = new int[n];
        for (int i = 0; i < n; i++) {
            ds[i] = sc.nextInt();
        }
        
        int MAX = 100000;
        int MAX_D = 5;
        boolean[] occured = new boolean[MAX];
        for (int i = 0; i < n; i++) {
            int s = 0;
            for (int j = i; j < i + MAX_D && j < n; j++) {
                s *= 10;
                s += ds[j];
                if (s < MAX) {
//                    if (!occured[s])System.out.println("v: " + s);
                    occured[s] = true;
                }
            }
        }
        
        for (int i = 0; i < MAX; i++) {
            if (!occured[i]) {
                System.out.println(i);
                return;
            }
        }
    }

}

Compiler output:
Main.java:4: error: class ICPCRegional2015A is public, should be declared in a file named ICPCRegional2015A.java
public class ICPCRegional2015A {
       ^
1 error
Language: Java

import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class ProblemA {

	private static Scanner scanner;
	private static PrintWriter writer;

	private static int nod;
	// private static int[] numbers;
	private static String numbers = new String();
	private static Set<BigDecimal> allNumbers = new TreeSet<>();

	public static void main(String[] args) {
		scanner = new Scanner(System.in);
		writer = new PrintWriter(System.out, true);
		writer.flush();

		// ????????°???????????????
		nod = scanner.nextInt();

		// ??°??????????????????
		for (int i = 0; i < nod; i++) {
			int number = scanner.nextInt();
			numbers += Integer.toString(number);
		}

		// ??°???????????¢?????§??????????????????????????????????????????????????????
		for (int start = 0; start <= nod - 1; start++) {
			for (int end = start + 1; end <= nod; end++) {
				// System.out.println(numbers.substring(start, end));
				allNumbers.add(new BigDecimal(numbers.substring(start, end)));
			}
		}

		// ??°???????°????????????????????????????
		// TreeSet??§?????????????????????

		// [????°????+1]=????°????+1?????????????????§??????
		// YES????????????????????¨?????????????????????????????°break??????return ????°????+1
		// Iterator<Integer> iterator = allNumbers.iterator();
		Object[] array = allNumbers.toArray();
		BigDecimal result = null;
		for (int i = 0; i < allNumbers.size(); i++) {
			if (!allNumbers.contains(BigDecimal.ZERO)) {
				result = BigDecimal.ZERO;
				break;
			}
			if (i == allNumbers.size()) {
				result = new BigDecimal(String.valueOf(array[i])).add(BigDecimal.ONE);
				break;
			}
			BigDecimal value = new BigDecimal(String.valueOf(array[i]));
			BigDecimal nextValue = new BigDecimal(String.valueOf(array[i + 1]));
			if (!value.add(BigDecimal.ONE).equals(nextValue)) {
				result = value.add(BigDecimal.ONE);
				break;
			}
		}
		writer.println(result);

		scanner.close();
		writer.close();
	}

}

Compiler output:
Main.java:7: error: class ProblemA is public, should be declared in a file named ProblemA.java
public class ProblemA {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main2{
	public static void main(String args[]) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		String D = br.readLine().replace(" ", "");
		for(int i = 0 ; i <= 100000 ; i++){
			boolean isok = false;
			int length = String.valueOf(i).length();
			for(int j = 0 ; j < D.length() - length + 1 ; j++){
				if(Integer.parseInt(D.substring(j, j + length)) == i){
					isok = true;
					break;
				}
			}
			if(!isok){
				System.out.println(i);
				break;
			}
		}
	}
}

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

#include<stdio.h>

int main(void){
int n,a,i,ii,y,s[2048];
scanf("%d",&n);
for(i=1;i<=n;i++){
    scanf("%d",&a);
    s[i] = a;
}
for(i=0;i<=9;i++){
    y=0;
    for(ii=1;ii<=n;ii++){ 
        if(s[ii]==i){
            y=1;
            break;
        }
    }
    if(y==0){
        printf("%d\n",i);
        return 0;
    }
}
for(i=10;i<=99;i++){
    y=0;
    for(ii=1;ii<=n-1;ii++){ 
        if(s[ii]==i/10 &&s[ii+1]==i%10){
            y=1;
            break;
        }
    }
    if(y==0){
        printf("%d\n",i);
        return 0;
    }
}
for(i=100;i<=999;i++){
    y=0;
    for(ii=1;ii<=n-2;ii++){ 
        if(s[ii]==i/100 &&s[ii+1]==(i/10)%10 &&s[ii+2]==i%10
            y=1;
            break;
        }
    }
    if(y==0){
        printf("%d\n",i);
        return 0;
    }
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:39:61: error: expected ')' before 'y'
   39 |         if(s[ii]==i/100 &&s[ii+1]==(i/10)%10 &&s[ii+2]==i%10
      |           ~                                                 ^
      |                                                             )
   40 |             y=1;
      |             ~                                                
main.c:42:9: error: expected expression before '}' token
   42 |         }
      |         ^
main.c: At top level:
main.c:49:1: error: expected identifier or '(' before 'return'
   49 | return 0;
      | ^~~~~~
main.c:50:1: error: expected identifier or '(' before '}' token
   50 | }
      | ^
Language: C

#include<stdio.h>

int main(void){
int n,a,i,ii,y,s[2048];
scanf("%d",&n);
for(i=1;i<=n;i++){
    scanf("%d",&a);
    s[i] = a;
}
for(i=0;i<=9;i++){
    y=0;
    for(ii=1;ii<=n;ii++){ 
        if(s[ii]==i){
            y=1;
            break;
        }
    }
    if(y==0){
        printf("%d\n",i);
        return 0;
    }
}
for(i=10;i<=99;i++){
    y=0;
    for(ii=1;ii<=n-1;ii++){ 
        if(s[ii]==i/10 &&s[ii+1]==i%10){
            y=1;
            break;
        }
    }
    if(y==0){
        printf("%d\n",i);
        return 0;
    }
}
for(i=100;i<=999;i++){
    y=0;
    for(ii=1;ii<=n-2;ii++){ 
        if(s[ii]==i/100 &&s[ii+1]==(i/10)%10 &&s[ii+2]==i%10)
            y=1;
            break;
        }
    }
    if(y==0){
        printf("%d\n",i);
        return 0;
    }
}
return 0;
}

Compiler output:
main.c:49:1: error: expected identifier or '(' before 'return'
   49 | return 0;
      | ^~~~~~
main.c:50:1: error: expected identifier or '(' before '}' token
   50 | }
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int N,i,t;
char x[1005],d[10];
int main()
{
	scanf("%d",&N);
	for(i=0;i<N;x[i++]=t+'0')scanf("%d",&t);
	for(i=0;i<100000;i++)
	{
		itoa(i,d,10);
		if(strstr(x,d)==NULL)
		{
			puts(d);
			return 0;
		}
	}

}

Compiler output:
main.c: In function 'main':
main.c:12:17: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
   12 |                 itoa(i,d,10);
      |                 ^~~~
Language: C

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int a[1010];
int t[10],b[10],top;
bool ok(int t)
{
	for(int i=1;i<=top;i++)
		if(a[t+i-1]!=b[i])
			return false;
	return true;
}
int main()
{
	int N;
	cin>>N;
	for(int i=1;i<=N;i++)
		cin>>a[i];
	for(int i=0;;i++)
	{
		top=0;
		int x=i;
		do
		{
			t[++top]=x%10;
			x/=10;
		}while(x);
		for(int j=1;j<=top;j++)
			b[j]=t[top-j+1];
		bool f=false;
		for(int j=1;j<=N-top+1&&!f;j++) f=ok(j);
		if(!f)
		{
			cout<<i<<endl;
			break;
		}
	}
}

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

#include<iostream>
#include<cmath>
using namespace std;
typedef long long ll;
const ll inf=abs((-1ll<<63)+1);
int le(int a)
{
	if(a==0)
		return 1;
	int s=0;
	while(a)
	{
		s++;
		a/=10;
	}
	return s;
}
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int n,i,a[1010],l,j;
	cin>>n;
	bool b;
	for(i=0;i<n;i++)
		cin>>a[i];
	for(i=0;1;i++)
	{
		b=false;
		for(j=0;j<n-le(i)+1;j++)
		{
			switch(le(i))
			{
				case 1:{
					if(i==a[j])
						b=true;
					break;
				} 
				case 2:{
					if(i==a[j]*10+a[j+1])
						b=true;
					break;
				} 
				case 3:{
					if(i==a[j]*100+a[j+1]*10+a[j+2])
						b=true;
					break;
				} 
			}
			if(b)
			break;
		}
		if(!b)
		{
			cout<<i<<endl;
			break;
		}
	}
	//fclose(stdin);
	//fclose(stdout);
	return 0;
}

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

#include <cstdio>
using namespace std;
int n;
int d[1005];
bool vis[1005];
void dfs(int now,int bs,int ans)
{
	if (bs>3||now>n) return;
	ans=ans*10+d[now];
	vis[ans]=1;
	dfs(now+1,bs+1,ans);
}
int main()
{
	register int i,j;
	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		scanf("%d",&d[i]);
		vis[d[i]]=1;
	}
	for (i=1;i<=n;i++) 
	if (d[i]!='0') dfs(i,0,0);
	for (i=0;i<=1000;i++)
	if (!vis[i])
	{
		printf("%d\n",i);
		return 0;
	}
}

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

#include <map>
#include <ctime>
#include <cmath>
#include <queue>
#include <string>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
int a[1001];
int b[1000000];
int main()
{
    int n,i,j,k,t,s;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    	scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++)
    {
    	for(j=i;j<i+6&&j<n;j++)
    	{
    		s=0;
    		t=1;
    		for(k=j;k>=i;k--)
    		{
    			s=s+a[k]*t;
    			t=t*10;
    		}
    		//printf("%d\n",s);
    		if(s>=0)
    		{
    			b[s]=1;
    		}
    	}
    }
    for(i=0;i<10000000;i++)
    {
    	//printf("%d %d\n",i,b[i]);
    	if(b[i]==0)
    	{
    		printf("%d\n",i);
    		return 0;
    	}
    }
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    cin >> n;
    char c;
    string s="";
    while(n--){
        cin >> c;
        s+=c;
    }
    for(int i=0; i<=1997; i++){//4桁は997個だけ1997より小さい
        if(s.find(to_string(i))==npos){//nposとは部分列が入っていないのをさす
            cout << i << "\n";
            break;
        }
    }
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:34: error: 'npos' was not declared in this scope
   13 |         if(s.find(to_string(i))==npos){//nposとは部分列が入っていないのをさす
      |                                  ^~~~
Language: C++

100
7 2 7 5 4 7 4 4 5 8 1 5 7 7 0 5 6 2 0
4 3 4 1 1 0 6 1 6 6 2 1 7 9 2 4 6 9 3
6 2 8 0 5 9 7 6 3 1 4 9 1 9 1 2 6 4 2
9 7 8 3 9 5 5 2 3 3 8 4 0 6 8 2 5 5 0
6 7 1 8 5 1 4 8 1 3 7 3 3 5 3 0 6 0 6
5 3 2 2 2

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 100
      | ^~~
Language: C++

#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
 
int main()
{
        int n;
        cin >> n;
        string s(n, ' ');
        for (int  i=0; i<n; i++)
                cin >> s[i];
 
        vector<int> nums;
        for (int k=1; k<=3; k++)
                for (int i=0; i<n-k+1; i++)
                {
                        stringstream ss(string(s.begin()+i, s.begin()+i+k));
                        int tmp;
                        ss >> tmp;
                        nums.push_back(tmp);
                }
        sort(nums.begin(), nums.end());
        nums.erase(unique(nums.begin(), nums.end()), nums.end());
        for (int i=0; i<=1000; i++)
                if (nums[i] != i)
                {
                        cout << i << endl;
                        break;
                }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope
   10 |         cin >> n;
      |         ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <vector>
  +++ |+#include <iostream>
    5 | using namespace std;
a.cc:29:25: error: 'cout' was not declared in this scope
   29 |                         cout << i << endl;
      |                         ^~~~
a.cc:29:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
main(){
string s,t;
int N,x;
for(cin>>N;N--;){cin>>t,s+=t;}
char buf[9],*p=s.c_str();
for(x=0;;x++){
sprintf(buf,"%d",x);
if(!strstr(p,buf)){puts(buf);return 0;}
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'string' was not declared in this scope
    5 | string s,t;
      | ^~~~~~
a.cc:5:1: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | for(cin>>N;N--;){cin>>t,s+=t;}
      |     ^~~
      |     std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:23: error: 't' was not declared in this scope
    7 | for(cin>>N;N--;){cin>>t,s+=t;}
      |                       ^
a.cc:7:25: error: 's' was not declared in this scope
    7 | for(cin>>N;N--;){cin>>t,s+=t;}
      |                         ^
a.cc:8:16: error: 's' was not declared in this scope
    8 | char buf[9],*p=s.c_str();
      |                ^
a.cc:11:5: error: 'strstr' was not declared in this scope
   11 | if(!strstr(p,buf)){puts(buf);return 0;}
      |     ^~~~~~
a.cc:4:1: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<cstdio>
  +++ |+#include <cstring>
    4 | main(){
a.cc:12:2: error: expected '}' at end of input
   12 | }
      |  ^
a.cc:4:7: note: to match this '{'
    4 | main(){
      |       ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
main(){
string s,t;
int N,x;
for(cin>>N;N--;){cin>>t,s+=t;}
char buf[9],*p=s.c_str();
for(x=0;;x++){
sprintf(buf,"%d",x);
if(!strstr(p,buf)){puts(buf);return 0;}
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:1: error: 'string' was not declared in this scope
    6 | string s,t;
      | ^~~~~~
a.cc:6:1: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 | for(cin>>N;N--;){cin>>t,s+=t;}
      |     ^~~
      |     std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:23: error: 't' was not declared in this scope
    8 | for(cin>>N;N--;){cin>>t,s+=t;}
      |                       ^
a.cc:8:25: error: 's' was not declared in this scope
    8 | for(cin>>N;N--;){cin>>t,s+=t;}
      |                         ^
a.cc:9:16: error: 's' was not declared in this scope
    9 | char buf[9],*p=s.c_str();
      |                ^
a.cc:13:2: error: expected '}' at end of input
   13 | }
      |  ^
a.cc:5:7: note: to match this '{'
    5 | main(){
      |       ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
using namespace std;
main(){
string s,t;
int N,x;
for(cin>>N;N--;){cin>>t,s+=t;}
char buf[9],*p=s.c_str();
for(x=0;;x++){
sprintf(buf,"%d",x);
if(!strstr(p,buf)){puts(buf);return 0;}
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:10:23: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
   10 | char buf[9],*p=s.c_str();
      |                ~~~~~~~^~
      |                       |
      |                       const char*
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:6:7: note: to match this '{'
    6 | main(){
      |       ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
using namespace std;
main(){
string s,t;
int N,x;
for(cin>>N;N--;){cin>>t,s+=t;}
char buf[9];
const char *p=s.c_str();
for(x=0;;x++){
sprintf(buf,"%d",x);
if(!strstr(p,buf)){puts(buf);return 0;}
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:6:7: note: to match this '{'
    6 | main(){
      |       ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
using namespace std;

int main(){
  int n;
  string c;
  string s="";
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> c;
    s+=c;
  }
  
  const char *ss = s.c_str();
  
  for(int i=0;i<=1000;i++){
    char tmp[5];
    sprintf(tmp,"%d",i);
    if(strstr(ss,tmp)==NULL){
      printf("%d\n",i);
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:8: error: 'strstr' was not declared in this scope
   21 |     if(strstr(ss,tmp)==NULL){
      |        ^~~~~~
a.cc:3:1: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include <string>
#include <iostream>
using namespace std;
int n, a, c; string s;
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) scanf("%d", &a), s += (char)(a + 48);
	while(true)
		if(s.find(to_string(c++)) == string::npos) {
			printf("%d\n", c--); break;
		}
	}
	return 0;
}

Compiler output:
a.cc:13:9: error: expected unqualified-id before 'return'
   13 |         return 0;
      |         ^~~~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int N,i,t;
char x[1005],d[10];
int main()
{
	scanf("%d",&N);
	for(i=0;i<N;x[i++]=t+'0')scanf("%d",&t);
	for(i=0;i<100000;i++)
	{
		itoa(i,d,10);
		if(strstr(x,d)==NULL)
		{
			puts(d);
			return 0;
		}
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'itoa' was not declared in this scope
   12 |                 itoa(i,d,10);
      |                 ^~~~
Language: Java

import java.util.Scanner;

public class Main {

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

	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int r[] = new int[n];
		for (int i = 0; i < r.length; i++) {
			r[i] = sc.nextInt();
		}
		double c[] = new double[n];
		for (int i = 0; i < c.length; i++) {
			c[i] = r[i];
			for (int j = 0; j < i; j++) {
				double t = Math.sqrt(4 * r[i] * r[j]);
				c[i] = Math.max(c[j] + t, c[i]);
			}
		}
		double max = 0;
		for (int i = 0; i < n; i++) {
			max = Math.max(max, c[i] + r[i]);
		}
		System.out.println(max);
		sc.close();
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
		new Main2().run();
		    ^
  symbol:   class Main2
  location: class Main
1 error
Language: C

#include <stdio.h>
#include <math.h>

int r[502];
double WID[502];

double width(int r1, int r2)
{
	if (r1 == 10001 && r2 == 10001) {
		return 0.0;
	} else if (r1 == 10001) {
		return (double)r2;
	} else if (r2 == 10001){
		return (double)r1;
	} else
		return 2 * sqrt((double)(r1 * r2));
}

int main(void)
{
	int N;
	double add;
	scanf("%d",&N);
	for (int i = 1; i <= N; i++) {
		scanf("%d", &r[i]);
	}
	r[0] = r[N + 1] = 10001;

	WID[0] = 0;
	for (int i = 1; i <= N + 1; i++) {
		WID[i] = WID[i - 1] + width(r[i - 1],r[i]);
	}

	for (int i = 2; i <= N; i++) {
		for (int j = 0; j + i <= N + 1; j++) {
			if ((add = width(r[j], r[j + i]) - (WID[j + i] - WID[j])) > 0.0) {
				for (int k = j + i; k <= N + 1; k++) {
					WID[k] += add;
				}
			}
		}
	}
	printf("%.5lf\n",WID[N + 1]);
	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/cc2jxkFn.o: in function `width':
main.c:(.text+0x68): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#include <math.h>

int r[502];
double WID[502];

double width(int r1, int r2)
{
	if (r1 == 10001 && r2 == 10001) {
		return 0.0;
	} else if (r1 == 10001) {
		return (double)r2;
	} else if (r2 == 10001){
		return (double)r1;
	} else
		return 2 * sqrt((double)(r1 * r2));
}

int main(void)
{
	int N,i,j,k;
	double add;
	scanf("%d",&N);
	for (int i = 1; i <= N; i++) {
		scanf("%d", &r[i]);
	}
	r[0] = r[N + 1] = 10001;

	WID[0] = 0;
	for (i = 1; i <= N + 1; i++) {
		WID[i] = WID[i - 1] + width(r[i - 1],r[i]);
	}

	for (i = 2; i <= N; i++) {
		for (j = 0; j + i <= N + 1; j++) {
			if ((add = width(r[j], r[j + i]) - (WID[j + i] - WID[j])) > 0.0) {
				for (k = j + i; k <= N + 1; k++) {
					WID[k] += add;
				}
			}
		}
	}
	printf("%.5lf\n",WID[N + 1]);
	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/cc3K1Yun.o: in function `width':
main.c:(.text+0x68): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
Language: C++

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

double r[1010],x[1010];

const double eps=1e-6;
const double inf=1e9;

bool cross(int m,double cx,double cy){
	rep(i,m){
		double d=0.0;
		d+=1.0*(x[i]-cx)*(x[i]-cx);
		d+=1.0*(r[i]-cy)*(r[i]-cy);
		double rr=(r[i]+r[m])*(r[i]+r[m]);
		if(rr>d+eps) return true;
	}
	return false;
}

int main(void){
	int n;
	cin >> n;
	rep(i,n) cin >> r[i];
	rep(i,n) x[i]=inf;
	
	rep(i,n){
		for(int j=-1;j<i;++j){
			double cx=r[i];
			if(j>=0){
				double d=1.0*(r[i]+r[j])*(r[i]+r[j]);
				d-=1.0*(r[i]-r[j])*(r[i]-r[j]);
				cx=x[j]+sqrt(d);
			}
			if(cx<r[i]) continue;
			if(cross(i,cx,r[i])) continue;
			if(cx<x[i]) x[i]=cx;
		}
		//cerr << i << " " << x[i] << " " << r[i] << endl;
	}

	double ans=0.0;
	rep(i,n) ans=max(ans,x[i]+r[i]);
	cout.precision(20);
	assert(ans<inf);
	cout << fixed << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: 'assert' was not declared in this scope
   46 |         assert(ans<inf);
      |         ^~~~~~
a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    2 | #include <cmath>
  +++ |+#include <cassert>
    3 | #define rep(i,n) for(int i=0;i<n;++i)
Language: C++

#include<iostream>
#include<math.h>
#include<iomanip>

using namespace std;

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

int n;
double r[500];
double dp[500];

double dis(double r1, double r2){
    return sqrt(pow(r1+r2, 2)-pow(r1-r2, 2));
}

int main(){
    cin >> n;

    REP(i, n){
        cin >> r[i];
    }

    int s = 0;
    double sd = 0;
    double tsd = 0;
    REP(i, n){
        if(i==0){
            sd = r[0];
            tsd = r[0];
        } else {
            if(dis(r[i-1], r[i])+tsd < r[i]){
                s = i;
                tsd = r[i];
                sd = r[i];
            } else {
                tsd = dis(r[i-1], r[i]) + tsd;
            }
        }
    }

    int g = n-1;
    double gd = 0;
    double tgd = 0;
    for(int i=n-1; i>=0; i--){
        if(i == n-1){
            gd = r[n-1];
            tgd = r[n-1];
        } else {
            if(dis(r[i+1], r[i])+tgd < r[i]){
                g = i;
                tgd = r[i];
                gd = r[i];
            } else {
                tgd = dis(r[i+1], r[i]) + tgd;
            }
        }
    }

    REP(i, g+1) dp[i] = 0;
    for(int i = s; i < g; i++){
        for(int j = s; j<=i; j++){
            if(dp[i+1] < dp[j] + dis(r[j], r[i+1])){
                dp[i+1] = dp[j] + dis(r[j], r[i+1]);
            }
        }
    }
    
    double output = sd + gd + dp[g];
    cout << fixed << setprecision(5) << output << endl;
}javascript:void(0)

Compiler output:
a.cc:71:2: error: 'javascript' does not name a type
   71 | }javascript:void(0)
      |  ^~~~~~~~~~
Language: Java

import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.SortedMap;
import java.util.StringTokenizer;
import java.util.TreeMap;
 
public class Main {
	
	public static boolean[][] mul(final int n, final boolean[][] mat1, final boolean[][] mat2){
		boolean[][] ret = new boolean[n][n];
		
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				for(int k = 0; k < n; k++){
					ret[i][j] |= mat1[i][k] && mat2[k][j];
				}
			}
		}
		
		return ret;
	}
	
	public static boolean[][] pow(final int n, final boolean[][] adj, final int a){
		if(a == 1){
			boolean[][] ret = new boolean[n][n];
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					ret[i][j] = adj[i][j];
				}
			}
			return ret;
		}else if(a % 2 == 0){
			boolean[][] ret = pow(n, adj, a / 2);
			return mul(n, ret, ret);
		}else{
			return mul(n, adj, pow(n, adj, a - 1));
		}
	}
	
	public static int[][] warshallFroyd(final int n, int[][] adj){
		int[][] ret = new int[n][n];
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				ret[i][j] = adj[i][j];
			}
		}
		
		for(int k = 0; k < n; k++){
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					ret[i][j] = Math.min(ret[i][j], ret[i][k] + ret[k][j]);
				}
			}
		}
		
		return ret;
	}
	
	public static final int INF = Integer.MAX_VALUE / 2 - 1;
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		final int m = sc.nextInt();
		
		int[] hops = new int[3];
		for(int i = 0; i < 3; i++){
			hops[i] = sc.nextInt();
		}
		
		boolean[][] adj = new boolean[n][n];
		for(int i = 0; i < m; i++){
			final int u = sc.nextInt() - 1;
			final int v = sc.nextInt() - 1;
			
			adj[u][v] = true;
		}
		
		boolean[][] all_adj = new boolean[n][n];
		for(int i = 0; i < n; i++){ Arrays.fill(all_adj[i], true); }
		
		for(final int hop : hops){
			boolean[][] hop_adj = pow(n, adj, hop);
			
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					all_adj[i][j] &= hop_adj[i][j];
				}
			}
		}
		
		int[][] distances = new int[n][n];
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				distances[i][j] = (i == j ? 0 : all_adj[i][j] ? 1 : INF);
			}
		}
		
		distances = warshallFroyd(n, distances);
		
		System.out.println(distances[0][n - 1] >= INF ? "IMPOSSIBLE" : distances[0][n - 1]);
		
	}
}

Compiler output:
Main.java:66: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:66: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C

#include <bits/stdc++.h>
#define fo(i,a,b) for (int i = a;i <= b;i ++)
using namespace std;

const int maxn = 105;
int n,m,step[3],t;
bitset<60> d[maxn][maxn];
int f[maxn];

bool solve() {
    bool flag = false;
    for (int i = 1; i <= n; i++) {
		int wp = 0;
		//if (f[i] < 1 << 29) continue;
		for (int k = 0; k < 3; k++) {
			int js = 1 << 29;
			for (int j = 1; j <= n; j++) {
				if (d[i][step[k]][j]) {
					js = min(js, f[j]);
				}
			}
			wp = max(wp, js + 1);
		}
		if (f[i] > wp) flag = true;
		f[i] = min(f[i], wp);
    }
    return flag;
}

int main() {

	scanf("%d%d%d%d%d",&n,&m,&step[0],&step[1],&step[2]);

	for (int i = 1; i <= m; i++) {
	    int a,b;
	    scanf("%d %d",&a,&b);
	    d[a][1][b]  = 1;
	}

	for (int j = 2; j <= 100; j++)
	    for (int i = 1; i <= n; i++) {
		for (int k = 1; k <= n; k++)
		    if (d[i][1][k]) d[i][j] = d[i][j] | d[k][j - 1];
	    }

	for (int i = 1; i <= n; i++) f[i] = 1 << 29;
	f[n] = 0;

	while (solve() && (++t < n * 3));

	if (t >= n * 3 || f[1] >= 1 << 29) printf("IMPOSSIBLE\n") ;
	else printf("%d\n",f[1]);
	return 0;
}

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

#include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
#include <complex>
using namespace std;

const int INF = 1<<29;
const double EPS = 1e-8;
typedef vector<int> vec;
typedef pair<int,int> P;
typedef long long ll;

vector<vec> G;
vector<bool> goal;

bool memo[50][1001];
bool move(int v, int t){
    if(memo[v][t]) return true;
    if(t == 0){
        return goal[v];
    }else{
        if(G[v].size() == 0) return false;
        for(int i=0;i<G[v].size();i++){
            int to = G[v][i];
            if(move(to, t-1)){
                memo[v][t] = true;
                return true;
            }
        }
        return false;
    }
}

int main() {
    int n, m;
    cin >> n >> m;
    vec abc(3);
    cin >> abc[0] >> abc[1] >> abc[2];

    G.assign(n, vec(0));
    for(int i=0;i<m;i++){
        int u, v;
        cin >> u >> v;
        G[u-1].push_back(v-1);
    }

    bitset<50> cango[50][1001];
    for(int j=0;j<n;j++){
        cango[j][0].set(j);
        for(int k=0;k<G[j].size();k++){
            int to = G[j][k];
            cango[j][1].set(to);
        }
    }
    for(int i=2;i<=1000;i++){
        for(int j=0;j<n;j++){
            for(int k=0;k<G[j].size();k++){
                int to = G[j][k];
                cango[j][i] |= cango[to][i-1];
            }
        }
    }

    goal.assign(n, false);
    goal[n-1] = true;
    for(int t=1;t<=n;t++){
        vector<bool> goal_new = goal;
        for(int i=0;i<n;i++){
            if(goal[i]) continue;
            bool able = true;
            for(int j=0;j<3;j++){
                bool ableany = false;
                for(int k=0;k<n;k++){
                    if(!goal[k]) continue;
                    if(goal[k] && cango[i][abc[j]][k]){
                        ableany = true;
                        break;
                    }
                }
                if(!ableany){
                    able = false;
                    break;
                }
            }
            if(able){
                if(i == 0){
                    cout << t << endl;
                    return 0;
                }
                goal_new[i] = true;
            }
        }
        goal = goal_new;
    }

    cout << "IMPOSSIBLE" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:5: error: 'bitset' was not declared in this scope
   57 |     bitset<50> cango[50][1001];
      |     ^~~~~~
a.cc:15:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
   14 | #include <complex>
  +++ |+#include <bitset>
   15 | using namespace std;
a.cc:57:16: error: 'cango' was not declared in this scope
   57 |     bitset<50> cango[50][1001];
      |                ^~~~~
Language: C++

#include <iostream>
#include <queue>
#include <vector>

using namespace std;

constexpr int MAX_N = 50;
constexpr int MAX_C = 100;
constexpr int INF = (1 << 29);

vector<int> G[MAX_N], G2[MAX_N][3];
bool visited[MAX_N][MAX_C];

bool dfs(int curr, int goal, int rem)
{
    if (visited[curr][rem]) return 0;
    visited[curr][rem] = 1;
    
    if (rem == 0) {
        return (curr == goal);
    }    
    for (auto& next : G[curr]) {
        if (dfs(next, goal, rem - 1)) {
            return 1;
        }
    }
    return 0;
}

void solve(int N)
{    
    vector<int> d(N, INF);
    d[N - 1] = 0;

    bool update = 1;
    while (update) {
        update = 0;

        for (int i = 0; i < N; i++) {
            int cost = 0;
            for (int j = 0; j < 3; j++) {
                int mc = INF;
                for (auto& u : G2[i][j]) {
                    mc = min(mc, d[u]);
                }
                cost = max(cost, mc + 1);                
            }

            if (cost < d[i]) {
                d[i] = cost;
                update = 1;
            } 
        }            
    }
    
    if (d[0] == INF) {
        cout << "IMPOSSIBLE" << endl;
    } else {
        cout << d[0] << endl;
    }
}

int main()
{
    int N, M, a[3];
    cin >> N >> M >> a[0] >> a[1] >> a[2];
    for (int i = 0; i < M; i++) {
        int u, v;
        cin >> u >> v; u--; v--;
        G[u].emplace_back(v);
    }
    
    memset(visited, 0, sizeof(visited));
    for (int i = 0; i < 3; i++) {
        for (int from = 0; from < N; from++) {
            for (int to = 0; to < N; to++) {
                if (from == to) continue;
                if (dfs(from, to, a[i])) {
                    G2[from][i].emplace_back(to);
                }
            }
        }
    }       
    solve(N);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:5: error: 'memset' was not declared in this scope
   73 |     memset(visited, 0, sizeof(visited));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <queue>
  +++ |+#include <cstring>
    3 | #include <vector>
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define INF 1e9

using vb=vector<bool>;
using vvb=vector<vb>;

int main(){
	int n,m,a[3];
	while(cin>>n>>m>>a[0]>>a[1]>>a[2]){
		vvb z(n,vb(n,false));
		auto e=z;
		rep(_,m){
			int p,q; cin>>p>>q;
			e[p-1][q-1]=true;
		}

		vector<vvb> dd(3);
		auto f=e;
		rep(l,*max_element(a,a+3)){
			rep(p,3) if(l==a[p]-1) dd[p]=f;
			auto next=z;
			rep(k,n)rep(i,n)rep(j,n){
				next[i][j] = next[i][j] or (f[i][k] and e[k][j]);
			}
			f=next;
		}
		vvd d(n,vb(n,true));
		rep(p,3)rep(i,n)rep(j,n){
			d&=dd[p][i][j];
		}
		unordered_set<int> g;
		g.insert(n-1);
		rep(t,1000){
			unordered_set<int> ng;
			rep(i,n) if(!g.count(i)){
				if([=]{bool r=0; rep(j,n) r|=(g.count(j) && d[i][j]); return r;}()) ng.insert(i);
			}
			if(ng.size()==0){
				cout<<"IMPOSSIBLE"<<endl;
				break;
			} else if(ng.count(0)){
				cout<<t+1<<endl;
				break;
			}
			g.insert(all(ng));
		}
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:17: error: 'vvd' was not declared in this scope; did you mean 'vvb'?
   32 |                 vvd d(n,vb(n,true));
      |                 ^~~
      |                 vvb
a.cc:34:25: error: 'd' was not declared in this scope
   34 |                         d&=dd[p][i][j];
      |                         ^
a.cc: In lambda function:
a.cc:41:77: error: 'd' was not declared in this scope
   41 |                                 if([=]{bool r=0; rep(j,n) r|=(g.count(j) && d[i][j]); return r;}()) ng.insert(i);
      |                                                                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define INF 1e9

using vi=vector<int>;
using vvi=vector<vi>;

int main(){
	int n,m,a[3];
	while(cin>>n>>m>>a[0]>>a[1]>>a[2]){
		vvi z(n,vi(n,0));
		auto e=z;
		rep(_,m){
			int p,q; cin>>p>>q;
			e[p-1][q-1]=1;
		}

		vvi f=e,d(n,vi(n,1));
		rep(l,*max_element(a,a+3)){
			rep(p,3) if(l==a[p]-1) rep(i,n)rep(j,n) d[i][j]&=f[i][j];
			auto next=z;
			rep(k,n)rep(i,n)rep(j,n){
				next[i][j]|=(f[i][k] and e[k][j]);
			}
			f=next;
		}
		
		
		unordered_set<int> g;
		g.insert(n-1);
		rep(t,1000){
			unordered_set<int> ng;
			rep(i,n) if(!g.count(i)){
				bool ok=1;
				rep(p,3) ok&=[=]{bool r=0; rep(j,n) r|=(g.count(j) and d[p][i][j]); return r;}();
				if(ok) ng.insert(i);
			}
			if(ng.size()==0){
				cout<<"IMPOSSIBLE"<<endl;
				break;
			} else if(ng.count(0)){
				cout<<t+1<<endl;
				break;
			}
			g.insert(all(ng));
		}
	}
	return 0;
}



Compiler output:
a.cc: In lambda function:
a.cc:39:95: error: invalid types 'const __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka const int}[int]' for array subscript
   39 |                                 rep(p,3) ok&=[=]{bool r=0; rep(j,n) r|=(g.count(j) and d[p][i][j]); return r;}();
      |                                                                                               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define INF 1e9

using vi=vector<int>;
using vvi=vector<vi>;

int main(){
	int n,m,a[3];
	while(cin>>n>>m>>a[0]>>a[1]>>a[2]){
		vvi z(n,vi(n,0));
		auto e=z;
		rep(_,m){
			int p,q; cin>>p>>q;
			e[p-1][q-1]=1;
		}

		vector<vvi> d(3);
		auto f=e;
		rep(l,*max_element(a,a+3)){
			rep(p,3) if(l==a[p]-1) d[p]=f;
			auto next=z;
			rep(k,n)rep(i,n)rep(j,n){
				next[i][j]|=(f[i][k] and e[k][j]);
			}
			f=next;
		}
		
		unordered_set<int> g;
		g.insert(n-1);
		rep(t,1000){
			unordered_set<int> ng;
			rep(i,n) if(!g.count(i)){
				bool ok=1;
				rep(p,3) [=](bool&){bool r=0; rep(j,n) r|=(g.count(j) and d[p][i][j]); ok&=r;}(ok);
				if(ok) ng.insert(i);
			}
			if(ng.size()==0){
				cout<<"IMPOSSIBLE"<<endl;
				break;
			} else if(ng.count(0)){
				cout<<t+1<<endl;
				break;
			}
			g.insert(all(ng));
		}
	}
	return 0;
}



Compiler output:
a.cc: In lambda function:
a.cc:39:106: error: assignment of read-only variable 'ok'
   39 |                                 rep(p,3) [=](bool&){bool r=0; rep(j,n) r|=(g.count(j) and d[p][i][j]); ok&=r;}(ok);
      |                                                                                                        ~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define INF 1e9

using vi=vector<int>;
using vvi=vector<vi>;

int main(){
	int n,m,a[3];
	while(cin>>n>>m>>a[0]>>a[1]>>a[2]){
		vvi z(n,vi(n,0));
		auto e=z;
		rep(_,m){
			int p,q; cin>>p>>q;
			e[p-1][q-1]=1;
		}

		vector<vvi> d(3);
		auto f=e;
		rep(l,*max_element(a,a+3)){
			rep(p,3) if(l==a[p]-1) d[p]=f;
			auto next=z;
			rep(k,n)rep(i,n)rep(j,n){
				next[i][j]|=(f[i][k] and e[k][j]);
			}
			f=next;
		}
		
		unordered_set<int> g;
		g.insert(n-1);
		rep(t,1000){
			unordered_set<int> ng;
			rep(i,n) if(!g.count(i)){
				bool ok=1;
				rep(p,3) [&]{bool r=0; rep(j,n) r|=(g.count(j) and d[p][i][j]); ok&=r;}(ok);
				if(ok) ng.insert(i);
			}
			if(ng.size()==0){
				cout<<"IMPOSSIBLE"<<endl;
				break;
			} else if(ng.count(0)){
				cout<<t+1<<endl;
				break;
			}
			g.insert(all(ng));
		}
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:104: error: no match for call to '(main()::<lambda()>) (bool&)'
   39 |                                 rep(p,3) [&]{bool r=0; rep(j,n) r|=(g.count(j) and d[p][i][j]); ok&=r;}(ok);
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
a.cc:39:42: note: candidate: 'main()::<lambda()>'
   39 |                                 rep(p,3) [&]{bool r=0; rep(j,n) r|=(g.count(j) and d[p][i][j]); ok&=r;}(ok);
      |                                          ^
a.cc:39:42: note:   candidate expects 0 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define INF 1e9

using vi=vector<int>;
using vvi=vector<vi>;

vvi matmul(vvi a, vvi b){
	int n=a.size();
	auto d=vvi(n,vi(n,0));
	rep(i,n)rep(j,n)rep(k,n){
		d[i][j]|=r[i][k]*a[k][j];
	}
	return d;
}

vvi matpow(vvi a,int p){
	static map<int,vvi> memo;
	memo[1]=a;
	if(memo.find(p)==memo.end()){
		if(p%2){
			memo[p]=matmul(matpow(a,p-1),a);
		}else{
			auto r=matpow(a,p/2);
			memo[p]=matmul(r,a);		
		}
	}
	return memo[p];
}


int main(){
	int n,m,a[3];
	while(cin>>n>>m>>a[0]>>a[1]>>a[2]){
		vvi z(n,vi(n,0));
		auto e=z;
		rep(_,m){
			int p,q; cin>>p>>q;
			e[p-1][q-1]=1;
		}

		vector<vvi> d(3);
		auto f=e;
		rep(p,3){
			d[p]=matpow(e,a[p]);
		}
		
		vi g(n,0);
		g[n-1]=1;
		rep(t,1000){
			bool next=0;
			vi ng(n,0);
			rep(i,n) if(!g[i]){
				bool ok=1,r;
				rep(p,3) [&]{r=0; rep(j,n) r|=(g[j] and d[p][i][j]); ok&=r;}();
				if(ok) ng[i]=next=1;
			}
			if(!next){
				cout<<"IMPOSSIBLE"<<endl;
				break;
			} else if(ng[0]){
				cout<<t+1<<endl;
				break;
			}
			rep(i,n)g[i]|=ng[i];
		}
	}
	return 0;
}



Compiler output:
a.cc: In function 'vvi matmul(vvi, vvi)':
a.cc:16:26: error: 'r' was not declared in this scope
   16 |                 d[i][j]|=r[i][k]*a[k][j];
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vi=vector<int>;
using vvi=vector<vi>;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()

vvi matmul(vvi a, vvi b){
	int n=a.size();
	vvi d(n,vi(n,0));
	rep(i,n)rep(j,n)rep(k,n) d[i][j]|=a[i][k]&b[k][j];
	return d;
}

unnordered_map<int,vvi> memo;
inline vvi matpow(vvi a,int p){
	return memo[p]=memo.find(p)==memo.end()?p%2?matmul(matpow(a,p-1),a):matmul(matpow(a,p/2),matpow(a,p/2)):memo[p];
}

int main(){
	int n,m,a[3];
	while(cin>>n>>m>>a[0]>>a[1]>>a[2]){
		vvi z(n,vi(n,0)), e=z;
		rep(_,m){
			int p,q; cin>>p>>q;
			e[p-1][q-1]=1;
		}
		memo.clear();
		memo[1]=e;

		vector<vvi> d(3);
		rep(p,3) d[p]=matpow(e,a[p]);
		
		vi g(n,0), ng(n,0);
		g[n-1]=1;
		rep(t,1000){
			bool next=0;
			fill(all(ng),0);
			rep(i,n) if(!g[i]){
				bool ok=1,r;
				rep(p,3) [&]{r=0; rep(j,n) r|=(g[j] and d[p][i][j]); ok&=r;}();
				if(ok) ng[i]=next=1;
			}
			if(!next){
				cout<<"IMPOSSIBLE"<<endl;
				break;
			} else if(ng[0]){
				cout<<t+1<<endl;
				break;
			}
			rep(i,n)g[i]|=ng[i];
		}
	}
	return 0;
}



Compiler output:
a.cc:15:1: error: 'unnordered_map' does not name a type
   15 | unnordered_map<int,vvi> memo;
      | ^~~~~~~~~~~~~~
a.cc: In function 'vvi matpow(vvi, int)':
a.cc:17:16: error: 'memo' was not declared in this scope
   17 |         return memo[p]=memo.find(p)==memo.end()?p%2?matmul(matpow(a,p-1),a):matmul(matpow(a,p/2),matpow(a,p/2)):memo[p];
      |                ^~~~
a.cc: In function 'int main()':
a.cc:28:17: error: 'memo' was not declared in this scope
   28 |                 memo.clear();
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
using vll=vector<ll>;

vll matmul(vll a, vll b){
	int n=a.size();
	vll d(n,0);
	vll r(n,0);
	rep(i,n)rep(j,n){
		d[j]|=b[j]&(1<<(n-i-1));
	}
	rep(i,n)rep(j,n){
		r[i][j]=!!(c[i]&d[j]);
	}
	return r;
}

vector<vll> memo(101);
vll matpow(vll a,int p){
	if(memo[p].size()==0)
		memo[p]=(p&1)?matmul(matpow(a,p-1),a):matmul(matpow(a,p/2),matpow(a,p/2));
	return memo[p];
}

int main(){
	int n,m,a[3];
	while(cin>>n>>m>>a[0]>>a[1]>>a[2]){
		vll z(n,0), e=z;
		rep(_,m){
			int p,q; cin>>p>>q;
			e[p-1]|=1<<(n-q);
		}
		fill(all(memo),vll());
		memo[1]=e;

		vector<vll> d(3);
		rep(p,3) d[p]=matpow(e,a[p]);
		
		vi g(n,0), ng(n,0);
		g[n-1]=1;
		rep(t,1000){
			bool next=0;
			fill(all(ng),0);
			rep(i,n) if(!g[i]){
				bool ok=1,r;
				rep(p,3) [&]{r=0; rep(j,n) r|=(g[j]&!!(d[p][i]&(1<<(n-j-1)))); ok&=r;}();
				if(ok) ng[i]=next=1;
			}
			if(!next){
				cout<<"IMPOSSIBLE"<<endl;
				break;
			} else if(ng[0]){
				cout<<t+1<<endl;
				break;
			}
			rep(i,n)g[i]|=ng[i];
		}
	}
	return 0;
}



Compiler output:
a.cc: In function 'vll matmul(vll, vll)':
a.cc:18:21: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[int]' for array subscript
   18 |                 r[i][j]=!!(c[i]&d[j]);
      |                     ^
a.cc:18:28: error: 'c' was not declared in this scope
   18 |                 r[i][j]=!!(c[i]&d[j]);
      |                            ^