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

#include <iostream>

int main()
{
	int N;
	int M;
	int* s;
	int* c;
	int ans=0;

	std::cin >> N >> M;

	s = new int[M];
	c = new int[M];

	for (int i = 0; i < M; i++)
	{
		std::cin >> s[i] >> c[i];
	}

	if (N >= 2) 
	{
		for (int i = 0; i < M; i++)
		{
			if (s[i] == 1 && c[i] == 0)
			{
				ans = -1;
				goto out;
				
			}

			bool a=true;
			for (int j = 0; j < M; j++)
			{
				if (i == j)
				{
					continue;
				}
				if (s[i] == s[j] && c[i] != c[j])
				{
					ans = -1;
					goto out;
				}
				else if (s[i] == s[j] && c[i] == c[j])
				{
					s[j] = -1;
					c[j] = -1;
				}
			}
			if (s[i]!=-1)
				ans += (int)std::pow(10, N - s[i]) * c[i];
		}
	}
	else
	{
		for (int i = 0; i < M; i++)
		{
			bool a = true;
			for (int j = 0; j < M; j++)
			{
				if (i == j)
				{
					continue;
				}
				if (s[i] == s[j] && c[i] != c[j])
				{
					ans = -1;
					goto out;
				}
				else if (s[i] == s[j] && c[i] == c[j])
				{
					s[j] = -1;
					c[j] = -1;
				}
			}
			if (s[i] != -1)
				ans += (int)std::pow(10, N - s[i]) * c[i];
		}
	}

out:
	std::cout << ans;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:50: error: 'pow' is not a member of 'std'
   51 |                                 ans += (int)std::pow(10, N - s[i]) * c[i];
      |                                                  ^~~
a.cc:77:50: error: 'pow' is not a member of 'std'
   77 |                                 ans += (int)std::pow(10, N - s[i]) * c[i];
      |                                                  ^~~
Language: C++

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

int main(){
    int N, M, T, X;
    cin >> N >> M;
    vector<vector<int>> vec_a(M, vector<int>(2));
    vector<int> vec_b(N, 0);
    T =0;

    for(int i = 0; i < M; i++){
    for (int j = 0; j < 2; j++){
        cin >> vec_a[i][j];
    }
      if(vec_a[i][0] == 1 && vec_a[i][1]==0 && N != 1){
     T =1;
     }
}

for(int i = 0; i < M-1; i++){
        for(int j = i+1; j < M; j++){
            if(vec_a[i][0] == vec_a[j][0] && vec_a[i][1] != vec_a[j][1]){
                T = 1; 
            }
    }
}


   for(int i = 0; i < M; i++){
     X = vec_a[i][0] - 1;
       vec_b[X] = vec_a[i][1];
     
   } 

   if(N != 1 && vec_b[0] == 0){
       vec_b[0] == 1;
   }

   if(T == 0){
   for (int i = 0; i < N; i++){  
    cout << vec_b[i];
    }
    cout <<endl;
   }

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

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

int main() {
  ostringstream oss;
  int n, m, flag=0, sum=0;
  cin >> n >> m;
  vector<int> vec(n); //-1で初期化
  for (int i = 0; i < n; i++) {vec.at(i) = -1;}
  
  for (int i = 0; i < m; i++) {
    int s,c;
    cin >> s >> c;
    if (vec.at(s-1) == -1 || vec.at(s-1) == c) {
      vec.at(s-1) = c;
    }else{
      flag = -1;
      cout << -1;
      break;
    }
  }
  for (int i = 0; i < n; i++){
    if (vec.at(i) > 0){
      sum += vec.at(i) * pow(10 , n-i-1);
    }
  }
  if (n > 1 && vec.at(1) <= 0){
    flag = -1;
    count << -1;
  }else if (flag == 0){
    cout << sum;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:11: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   29 |     count << -1;
      |     ~~~~~~^~~~~
Language: C++

#include <iostream>

int main()
{
	int N;
	int M;
	int* s;
	int* c;
	int ans=0;

	std::cin >> N >> M;

	s = new int[M];
	c = new int[M];

	for (int i = 0; i < M; i++)
	{
		std::cin >> s[i] >> c[i];
	}

	if (N >= 2) 
	{
		for (int i = 0; i < M; i++)
		{
			if (s[i] == 1 && c[i] == 0)
			{
				ans = -1;
				goto out;
				
			}

			bool a=true;
			for (int j = 0; j < M; j++)
			{
				if (i == j)
				{
					continue;
				}
				if (s[i] == s[j] && c[j] != c[j])
				{
					ans = -1;
					goto out;
				}
				else if (s[i] == s[j] && c[j] == c[j])
				{
					s[j] = -1;
					c[j] = -1;
				}
			}
			if (s[i]!=-1)
				ans += (int)std::pow(10, N - s[i]) * c[i];
		}
	}

out:
	std::cout << ans;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:50: error: 'pow' is not a member of 'std'
   51 |                                 ans += (int)std::pow(10, N - s[i]) * c[i];
      |                                                  ^~~
Language: C++

#include<iostream>
#include<string>
 
using namespace std;
 
int main() {
	int N,M;
	int s,c;
	int ans[3];
	bool flag = false;
	cin >> N >> M;
	for(int i=0;i<3;i++)ans[i] = -1;
	for(int i=0;i<M;i++){
		cin >> s >> c;
		if(ans[s-1]==-1 || ans[s-1]==c){
			ans[s-1]=c;
		}else{
			flag = true;
		}
	}
	if(flag || (ans[0]==0  && N > 1){
		cout << "-1" << endl;;
	}else{
		if(ans[0]==-1){
			if(N == 1){
				cout << "0" << endl;
				return 0;
			}
			ans[0]=1;
		}
		for(int i=1;i<N;i++){
			if(ans[i]==-1){
				ans[i]=0;
			}
			ans[0]=ans[0]*10+ans[i];
		}
		cout << ans[0] << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:41: error: expected ';' before '{' token
   21 |         if(flag || (ans[0]==0  && N > 1){
      |                                         ^
      |                                         ;
a.cc:23:10: error: expected primary-expression before 'else'
   23 |         }else{
      |          ^~~~
a.cc:23:10: error: expected ')' before 'else'
   23 |         }else{
      |          ^~~~
      |          )
a.cc:21:11: note: to match this '('
   21 |         if(flag || (ans[0]==0  && N > 1){
      |           ^
Language: C++

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

int main(){
    int N, M, T, X;
    cin >> N >> M;
    vector<vector<int>> vec_a(M, vector<int>(2));
    vector<int> vec_b(N, 0);
    T =0;

    for(int i = 0; i < M; i++){
    for (int j = 0; j < 2; j++){
        cin >> vec_a[i][j];
    }
}

for(int i = 0; i < M-1; i++){
        for(int j = i+1; j < M; j++){
            if(vec_a[i][0] == vec_a[j][0] && vec_a[i][1] != vec_a[j][1]){
                T = 1; 
            }
    }
}


   for(int i = 0; i < M; i++){
     X = vec_a[i][0] - 1;
       vec_b[X] = vec_a[i][1];
     if(vec_a[i][0] == 1 && vec_b[i][1] && N != 1){
     T =1;
     }
   } 

   if(N != 1 && vec_b[0] == 0){
       vec_b[0] == 1;
   }

   if(T == 0){
   for (int i = 0; i < M; i++){  
    cout << vec_b[i];
    }
   }
   if(T == 1){
    cout << "-1" << endl;
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:37: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   29 |      if(vec_a[i][0] == 1 && vec_b[i][1] && N != 1){
      |                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int a[10005]={0},n,m,s,k;
bool f[10005];
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;++i){
        scanf("%d%d",&s,&k);
        if(f[s]==1 && a[s]!=k){
            puts("-1");
            return 0;f
        }
        a[s]=k,f[s]=1;
    }
    if(a[1]==0 && n!=0){
        puts("-1");
        return 0;
    }
    for(int i=1;i<=n;++i){
        printf("%d",a[i]);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected ';' before '}' token
   12 |             return 0;f
      |                       ^
      |                       ;
   13 |         }
      |         ~
Language: C++

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

int main(){
    int N, M, T, X;
    cin >> N >> M;
    vector<vector<int>> vec_a(M, vector<int>(2));
    vector<int> vec_b(N, 0);
    T =0;

    for(int i = 0; i < M; i++){
    for (int j = 0; j < 2; j++){
        cin >> vec_a[i][j];
    }
}

for(int i = 0; i < M-1; i++){
        for(int j = i+1; j < M; j++){
            if(vec_a[i][0] == vec_a[j][0] && vec_a[i][1] != vec_a[j][1]){
                T = 1; 
            }
    }
}


   for(int i = 0; i < M; i++){
     X = vec_a[i][0] - 1;
       vec_b[X] = vec_a[i][1];
     if(vec_a[i][0] == 1 && vec_b[i][1] && N != 1){
     T =1
     }
   } 

   if(N != 1 && vec_b[0] == 0){
       vec_b[0] == 1 ;
   }

   if(T == 0){
   for (int i = 0; i < M; i++){  
    cout << vec_b[i];
    }
   }
   if(T == 1){
    cout << "-1" << endl;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:37: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   29 |      if(vec_a[i][0] == 1 && vec_b[i][1] && N != 1){
      |                                     ^
a.cc:30:10: error: expected ';' before '}' token
   30 |      T =1
      |          ^
      |          ;
   31 |      }
      |      ~
Language: C++

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


int main() {
  int N,M;
cin>>N>>M;
  vector<pair<int, int>> p(M);
  for(int i=0;i<M;i++){
    cin>>p.at(i).first>>p.at(i).second;//si,ci
  }
  string n="000";
  int h=0;
  int f=0;
  for(int i=0;i<M;i++){
    for(int j=0;j<M;j++){
  if(p.at(i).first==p.at(j).first){
   if(p.at(i).second!=p.at(j).second){
    f=max(f,p.(i).first);
     h++;
     break;
   }
  	else {
  	string str = to_string(p.at(i).second);
       n.at(p.at(i).first-1)= str.at(0);
       f=max(f,p.(i).first);
  	}
    
  }
      
      else {
string str = to_string(p.at(i).second);
       n.at(p.at(i).first-1)= str.at(0);
         f=max(f,p.(i).first);
      }
      
  }
    if(h!=0){
      cout<<"-1"<<endl; 
     break; 
    }
  }

   
 
  if(h==0&&n.at(0)!='0'&&f==3){
   cout<<n<<endl; 
  }
   else if(h==0&&n.at(0)=='0'&&f==3){
   cout<<'1'<<n.at(1)<<n.at(2)<<endl; 
  }
  else if(h==0&&n.at(1)!='0'&&f==2){
   cout<<n.at(1)<<n.at(2)<<endl; 
  }
  else if(h==0&&n.at(1)=='0'&&f==2){
   cout<<'1'<<n.at(2)<<endl; 
  }
   else if(h==0&&n.at(2)!='0'&&f==1){
   cout<<n.at(2)<<endl; 
  }
  else if(h==0&&n.at(2)=='0'&&f==1){
   cout<<n.at(2)<<endl; 
  }
    else if(h==0){
   cout<<"-1"<<endl; 
  }
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: expected unqualified-id before '(' token
   19 |     f=max(f,p.(i).first);
      |               ^
a.cc:26:18: error: expected unqualified-id before '(' token
   26 |        f=max(f,p.(i).first);
      |                  ^
a.cc:34:20: error: expected unqualified-id before '(' token
   34 |          f=max(f,p.(i).first);
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main() {
    int N, M;
    cin >> N >> M;
    int res=0;
    int tmp=0;
    vector<int> c(N,-1);
    for (int i=0;i<M;i++){
        int si,ci;
        cin >> si >> ci;
        if (c[si-1]==-1){
            c[si-1]=ci;
        }else{
            if(c[si-1]!=ci){
                res=-1;
            }
        }
    }
 
    if (N>1){
        if (c[0]==-1) c[0]=1;
    }else{
        if (c[0]==-1) c[0]=0;
    }
 
    for (int i=0; i<N-1; i++){
        if(tmp==0 && c[i]==0){
            res=-1;
            break;
        }
        tmp=c[i];
    }
 
    if(res==-1){
        cout << res;
    }else{
        bool flag=false;
        for (int i=0;i<N;i++){
            if (c[i]==-1){
                c[i]=0;
            }
            if (i==N-1){
                flag=true;
            }
            if (c[i]==0){
                if(flag==true){
                    cout << c[i];
                }
            }else{
                flag=true;
                cout << c[i];
            }
        }
    }
    cout << endl;
}
#include<bits/stdc++.h>
using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    int res=0;
    int tmp=0;
    vector<int> c(N,-1);
    for (int i=0;i<M;i++){
        int si,ci;
        cin >> si >> ci;
        if (c[si-1]==-1){
            c[si-1]=ci;
        }else{
            if(c[si-1]!=ci){
                res=-1;
            }
        }
    }

    if (N>1){
        if (c[0]==-1) c[0]=1;
    }else{
        if (c[0]==-1) c[0]=0;
    }

    for (int i=0; i<N-1; i++){
        if(tmp==0 && c[i]==0){
            res=-1;
            break;
        }
        tmp=c[i];
    }

    if(res==-1){
        cout << res;
    }else{
        bool flag=false;
        for (int i=0;i<N;i++){
            if (c[i]==-1){
                c[i]=0;
            }
            if (i==N-1){
                flag=true;
            }
            if (c[i]==0){
                if(flag==true){
                    cout << c[i];
                }
            }else{
                flag=true;
                cout << c[i];
            }
        }
    }
    cout << endl;
}
提出情報

Compiler output:
a.cc:62:5: error: redefinition of 'int main()'
   62 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
a.cc:117:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
  117 | 提出情報
      | ^~~~~~~~
Language: C++

#include<iostream>
#include<string>
 
using namespace std;
 
int main() {
	int N,M;
	int s,c;
	int ans[3];
	bool flag = false;
	cin >> N >> M;
	for(int i=0;i<3;i++)ans[i] = -1;
	for(int i=0;i<M;i++){
		cin >> s >> c;
		if(ans[s-1]==-1 || ans[s-1]==c){
			ans[s-1]=c;
		}else{
			flag = true;
		}
	}
	if(flag || ans[0]==0){
		cout << "-1" << endl;;
	}else{
		if(ans[0]==-1){
			if(N == 1){
				cout << "0" << endl;
				return;
			}
			ans[0]=1;
		}
		for(int i=1;i<N;i++){
			if(ans[i]==-1){
				ans[i]=0;
			}
			ans[0]=ans[0]*10+ans[i];
		}
		cout << ans[0] << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:33: error: return-statement with no value, in function returning 'int' [-fpermissive]
   27 |                                 return;
      |                                 ^~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;
int a[8];
int main()
{
    memset(a,-1,sizeof(a));
    int n,m;cin>>n>>m;
    int x,y;
    while(m--)
    {
        cin>>x>>y;
        if(a[x]!=-1&&a[x]!=y) return cout<<"-1",0;
        a[x]=y;
    }
    if(n!=1&&a[1]==0) return cout<<"-1",0;
    if(a[1]==-1) a[i]==1;
    for(int i=1;i<=n;i++)
    {
        if(a[i]!=-1) cout<<a[i];
        else if(n==1||i!=1) cout<<0;
    }
}


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

#include<iostream>
#include<string>
 
using namespace std;
 
int main() {
	int N,M;
	int s,c;
	int ans[3];
	bool flag = false;
	cin >> N >> M;
	for(int i=0;i<3;i++)ans[i] = -1;
	for(int i=0;i<M;i++){
		cin >> s >> c;
		if(ans[s-1]==-1 || ans[s-1]==c){
			ans[s-1]=c;
		}else{
			flag = true;
		}
	}
	if(flag || ans[0]==0){
		cout << "-1" << endl;;
	}else{
		if(ans[0]==-1){
			if(N == 1){
				cout << 0 << endl;
				return;
			}
			ans[0]=1;
		}
		for(int i=1;i<N;i++){
			if(ans[i]==-1){
				ans[i]=0;
			}
			ans[0]=ans[0]*10+ans[i];
		}
		cout << ans[0] << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:33: error: return-statement with no value, in function returning 'int' [-fpermissive]
   27 |                                 return;
      |                                 ^~~~~~
Language: C++

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

int main() {
	vector<pair<int,int>> x(100),y(100);
	int n, m,o,t,h,k=0;
	o = t = h = 10;
	cin >> n >> m;
	vector<int> s(m), c(m);
	for(int i = 0; i < m; ++i) {
		cin >> s.at(i) >> c.at(i);
		if(s.at(i) == 1) {
			o = min(o,c.at(i));
		}
		if(s.at(i) == 2) {
			t =min(t, c.at(i));
		}
		if(s.at(i) == 3) {
			h = min(h,c.at(i));
		}
		x.at(s.at(i)).first += 1;
		if(x.at(s.at(i)).first > 0 && c.at(i) == x.at(s.at(i)).second) {
			x.at(s.at(i)).first -= 1;
			x.at(s.at(i)).second = c.at(i);
		}
		if(x.at(s.at(i)).second==0)
			x.at(s.at(i)).second = c.at(i);
		else if(x.at(s.at(i)).second!=c.at(i)) {
			cout << "-1" << endl;
			return 0;
		}
		if(x.at(s.at(i)).second == c.at(i))
			x.at(s.at(i)).first = 1;
		if(x.at(s.at(i)).second != c.at(i))
			k = 1;
		if(s.at(i) == 1 && c.at(i) == 0　&& n != 0) {
			cout << "-1" << endl;
			return 0;
		}
		if(x.at(s.at(i)).first!=0)
			if(x.at(s.at(i)).second != c.at(i)) {
				cout << "-1" << endl;
				return 0;
			}
		/*if(x.at(s.at(i)).second != c.at(i)) {
			cout << "-1" << endl;
			return 0;
		}*/
		/*if(x.at(s.at(i)).second!=c.at(i)) {
			cout << "-1" << endl;
			return 0;
		}*/
	}
	if(o == 10) {
		o = 1;
		if(n == 1)
			o = 0;
	}
	if(t == 10) {
		t = 0;
	}
	if(h == 10)
		h = 0;

	cout << o;
	if(n == 2)
		cout << t;
	if(n == 3)
		cout<<t << h;
	cout << endl;

}


Compiler output:
a.cc:39:47: error: extended character 　 is not valid in an identifier
   39 |                 if(s.at(i) == 1 && c.at(i) == 0　&& n != 0) {
      |                                               ^
a.cc: In function 'int main()':
a.cc:39:47: error: unable to find numeric literal operator 'operator""\U00003000'
   39 |                 if(s.at(i) == 1 && c.at(i) == 0　&& n != 0) {
      |                                               ^~~
Language: C++

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

int main()
{
  int n,m;
  cin >> n >> m;
  int s[m];
  int c[m];
  int ans = 0;
  bool f=0;
  rep(i, m){
    cin >> s[i] >> c[i];
    rep(j, i){
      if(!(s[i] == s[j])){
        ans += c[i] * pow(10, n-s[i]);
      } else if(!(c[i] == c[j])){
        f = 1;
      }
    }
    if(c[i] == 0 && s[i] == 1) f = 1;
  }
  if(ans < pow(10, n-1)) ans += pow(10, n-1)
  if(f) ans = -1;
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:45: error: expected ';' before 'if'
   25 |   if(ans < pow(10, n-1)) ans += pow(10, n-1)
      |                                             ^
      |                                             ;
   26 |   if(f) ans = -1;
      |   ~~
Language: C

//author:luckYrat(twitter:@luckYrat_)
//#include <bits/stdc++.h>
#include <stdio.h>
int main(){
  int n,m;scanf("%n %n",&n,%m);
  int ans[n];
  for(int i = 0; n > i; i++){
    ans[i] = -1;
  }
  for(int i = 0; m > i; i++){
    int a,b;scanf("%n %n",&a,%b);
    a--;
    if(!(ans[a] == -1 || ans[a] == b)){
      printf(-1);
      return 0;
    }
    ans[a] = b;
  }
  if(n==1 && ans[0] < 1){
    printf(0);
    return 0;
  }
  if(ans[0] == 0){
    printf(-1);
    return 0;
  }
  for(int i = 0; n > i; i++){
    if(!i){
      printf("%n",(ans[i]!=-1?ans[i]:1));
    }else{
      printf("%n",(ans[i]!=-1?ans[i]:0));
    }
  }printf("\n");
}


Compiler output:
main.c: In function 'main':
main.c:5:28: error: expected expression before '%' token
    5 |   int n,m;scanf("%n %n",&n,%m);
      |                            ^
main.c:11:30: error: expected expression before '%' token
   11 |     int a,b;scanf("%n %n",&a,%b);
      |                              ^
main.c:14:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   14 |       printf(-1);
      |              ^~
      |              |
      |              int
In file included from main.c:3:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:24:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   24 |     printf(-1);
      |            ^~
      |            |
      |            int
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C

#include <stdio.h>
#include <math.h>
int main(void){
    int i,j,k=0,n,m,s[9],c[9],num[3];
    scanf("%d %d",&n,&m);
    for(i=0;i<m;i++){
        scanf("%d %d",&s[i],&c[i]);
    }
    if(m==0){
        printf("%d\n"pow(10,n-1))
    }
    for(i=0;i<pow(10,n);i++){
        num[0]=(i/100)%10;
        num[1]=(i/10)%10;
        num[2]=i%10;
        k=0;
        for(j=0;j<m;j++){
            if(s[j]==1&&c[j]==0){
                printf("-1\n");
                return 0;
            }
            if(num[s[j]-1]==c[j]){
                k++;
            }
        }
        if(k==m){
            printf("%d\n",i);
            return 0;
        }
    }
    printf("-1\n");
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:22: error: expected ')' before 'pow'
   10 |         printf("%d\n"pow(10,n-1))
      |               ~      ^~~
      |                      )
main.c:10:34: error: expected ';' before '}' token
   10 |         printf("%d\n"pow(10,n-1))
      |                                  ^
      |                                  ;
   11 |     }
      |     ~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
int main(){

  int n;
  std::cin>>n;
  int m;
  std::cin>>m;
  std::vector<int> num;
  std::vector<bool> input;
  num.resize(n);
  input.resize(n);
  for(auto&& i:input)
    i=false;
  int output=0;
  for(int i=0;i<m;++i){
  	int keta;
    std::cin>>keta;
    int a;
    std::cin>>a;
    if(input[n-keta])
      output=-1;
    else
      input[n-keta]=true;
    
    num[n-keta]=a;
  }
  if(output==-1){
    std::cout<<output<<std::endl;
  	return 0;
  }
  
  for(int i=0;i<n;i++){
  	if(input[i]=false){
    	if(i==n-1)
          num[i]=1;
      	else
          num[i]=0;
    }
    output+=num[i]*pow(10,i);
  }
  std::endl<<output<<std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:12: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   43 |   std::endl<<output<<std::endl;
      |   ~~~~~~~~~^~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
int main(){

  int n;
  std::cin>>n;
  int m;
  std::cin>>m;
  std::vector<int> num;
  std::vector<bool> input;
  num.resize(n);
  input.resize(n);
  for(auto&& i:input)
    i=false;
  int out=0;
  for(int i=0;i<m;++i){
  	int keta;
    std::cin>>keta;
    int a;
    std::cin>>a;
    if(input[n-keta])
      output=-1;
    else
      input[n-keta]=true;
    
    num[n-keta]=a;
  }
  if(output==-1){
    std::cout<<output<<std::endl;
  	return 0;
  }
  
  for(int i=0;i<n;i++){
  	if(input[i]=false){
    	if(i==n-1)
          num[i]=1;
      	else
          num[i]=0;
    }
    output+=num[i]*pow(10,i);
  }
  std::endl<<output<<std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: 'output' was not declared in this scope
   23 |       output=-1;
      |       ^~~~~~
a.cc:29:6: error: 'output' was not declared in this scope
   29 |   if(output==-1){
      |      ^~~~~~
a.cc:41:5: error: 'output' was not declared in this scope
   41 |     output+=num[i]*pow(10,i);
      |     ^~~~~~
a.cc:43:14: error: 'output' was not declared in this scope
   43 |   std::endl<<output<<std::endl;
      |              ^~~~~~
Language: C++

#include <iostream>
#include <vector>
int main(){

  int n;
  std::cin>>n;
  int m;
  std::cin>>m;
  std::vector<int> num;
  std::vector<bool> input;
  num.resize(n);
  input.resize(n);
  for(auto&& i:input)
    i=false;
  int out=0;
  for(int i=0;i<m;++i){
  	int keta;
    std::cin>>keta;
    int a;
    std::cin>>a;
    if(input[n-keta])
      output=-1;
    else
      input[n-keta]=true;
    
    num[n-keta]=a;
  }
  if(output==-1){
    std::cout<<output<<std::endl;
  	return 0;
  }
  
  for(int i=0;i<n;i++){
  	if(input[i]=false){
    	if(i==n-1)
          num[i]=1;
      	else
          num[i]=0;
    }
    output+=num[i]*std::pow(10,i);
  }
  std::endl<<output<<std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: 'output' was not declared in this scope
   22 |       output=-1;
      |       ^~~~~~
a.cc:28:6: error: 'output' was not declared in this scope
   28 |   if(output==-1){
      |      ^~~~~~
a.cc:40:5: error: 'output' was not declared in this scope
   40 |     output+=num[i]*std::pow(10,i);
      |     ^~~~~~
a.cc:40:25: error: 'pow' is not a member of 'std'
   40 |     output+=num[i]*std::pow(10,i);
      |                         ^~~
a.cc:42:14: error: 'output' was not declared in this scope
   42 |   std::endl<<output<<std::endl;
      |              ^~~~~~
Language: C++

#include <iostream>
#include <vector>
int main(){

  int n;
  std::cin>>n;
  int m;
  std::cin>>m;
  std::vector<int> num;
  std::vector<bool> input;
  num.resize(n);
  input.resize(n);
  for(auto&& i:input)
    i=false;
  int out=0;
  for(int i=0;i<m;++i){
  	int keta;
    std::cin>>keta;
    int a;
    std::cin>>a;
    if(input[n-keta])
      output=-1;
    else
      input[n-keta]=true;
    
    num[n-keta]=a;
  }
  if(output==-1){
    std::cout<<output<<std::endl;
  	return 0;
  }
  
  for(int i=0;i<n;i++){
  	if(input[i]=false){
    	if(i==n-1)
          num[i]=1;
      	else
          num[i]=0;
    }
    output+=num[i]*pow(10,i);
  }
  std::endl<<output<<std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: 'output' was not declared in this scope
   22 |       output=-1;
      |       ^~~~~~
a.cc:28:6: error: 'output' was not declared in this scope
   28 |   if(output==-1){
      |      ^~~~~~
a.cc:40:5: error: 'output' was not declared in this scope
   40 |     output+=num[i]*pow(10,i);
      |     ^~~~~~
a.cc:40:20: error: 'pow' was not declared in this scope
   40 |     output+=num[i]*pow(10,i);
      |                    ^~~
a.cc:42:14: error: 'output' was not declared in this scope
   42 |   std::endl<<output<<std::endl;
      |              ^~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define ll long long
 
int main(){
  ll int n,m,ans=0,w=0;
  scanf("%lld %lld",&n,&m);
  ll int s[m],c[m];
  for(ll int i=0;i<m;i++){
  scanf("%lld %lld",&s[i],&c[i]);
  }
 
  if(n==1 && m==0){
    printf("0");
    return 0;
  }
  
  for(int i=0;i<m;i++){
    if(c[i]!=0){
      w++;
    }
  }
  
  if(w==0 && n==1){
    printf("0");
    return 0;
  }
  
  if((s[0]==s[1] && c[0]!=c[1])||(s[0]==s[2] && c[0]!=c[2]) || (s[0]==s[3] && c[0]!=c[3])|| (s[0]==s[4] && c[0]!=c[4])|| (s[1]==s[2] && c[1]!=c[2])|| (s[1]==s[3] && c[1]!=c[3])|| (s[1]==s[4] && c[1]!=c[4])|| (s[2]==s[3] && c[2]!=c[3])|| (s[2]==s[4] && c[2]!=c[4])|| (s[4]==s[3] && c[4]!=c[3])){
    printf("-1");
    return 0;
  }
  
  for(ll int i=0;i<m;i++){
  if(s[i]==1 && c[i]==0){
    printf("-1");
    return 0;
  }
  }
  
 ll int sum[m];
  for(ll int i=0;i<m;i++){
    sum[i]=c[i]*pow(10,n-s[i]);
  }
  
  ll int compare(const void *a, const void *b){
  return (*(ll int *)a)- (*(ll int *)b);
}
 
qsort(sum,m,sizeof(ll int),compare);
for(ll int i=0;i<m;i++){
  if(sum[i]!=sum[i+1]){
    ans+=sum[i];
  }
}
 
  if(ans<pow(10,n-1)){
    ans+=pow(10,n-1);
  }
  
  printf("%lld",ans);
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:47: error: a function-definition is not allowed here before '{' token
   48 |   ll int compare(const void *a, const void *b){
      |                                               ^
a.cc:52:28: error: 'compare' was not declared in this scope
   52 | qsort(sum,m,sizeof(ll int),compare);
      |                            ^~~~~~~
Language: C++

        #include <bits/stdc++.h>
        using namespace std;
        int main()
        {
          
          int n,m;
          int a[n];
          memset(a,0,sizeof a)
          cin>>n>>m;
          for(int i=0;i<m;i++)
          {
            int s,c;
            cin>>s>>c;
             int a[n];
             a[s-1]=c;
          }
          for(int i=0;i<n;i++)
            cout<<a[i];
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: expected ';' before 'cin'
    8 |           memset(a,0,sizeof a)
      |                               ^
      |                               ;
    9 |           cin>>n>>m;
      |           ~~~
Language: C++

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

void c(std::istream& in)
{
    int N, M;
    in >> N >> M;

    struct sc
    {
        int s;
        int c;
    };

    std::vector<sc> scList(M);
    for (auto& sc : scList)
    {
        in >> sc.s >> sc.c;
    }


    std::vector<int> num(N, 10);
    for (const auto& sc : scList)
    {
        if (num[static_cast<size_t>(sc.s) - 1] > sc.c)
            num[static_cast<size_t>(sc.s) - 1] = sc.c;
    }

    for (auto& n : num)
    {
        if (n == 10)
            n = 0;
    }


    if ((num[static_cast<size_t>(N) - 1] == 10) or num[static_cast<size_t>(N) - 1] == 0)
    {
        std::cout << -1;
        return;
    }

    int result = 0;
    for (int i = 0; i < N; ++i)
    {
        result += num[i] * static_cast<int>(std::pow(10, N - i - 1));
    }

    std::cout << result;
}

int main(int, char* [])
{
    c(std::cin);
    return 0;
}



Compiler output:
a.cc: In function 'void c(std::istream&)':
a.cc:48:50: error: 'pow' is not a member of 'std'
   48 |         result += num[i] * static_cast<int>(std::pow(10, N - i - 1));
      |                                                  ^~~
Language: C++

    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
      
      int n,m;
      int a[n];
      memset(a,0.sizeof a)
      cin>>n>>m;
      for(int i=0;i<m;i++)
      {
        int s,c;
        cin>>s>>c;
         int a[n];
         a[s-1]=c;
      }
      for(int i=0;i<n;i++)
        cout<<a[i];
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: unable to find numeric literal operator 'operator""sizeof'
    8 |       memset(a,0.sizeof a)
      |                ^~~~~~~~
Language: C++

N,M = map(int, input().split())
A=[-1 for i in range(N)]

ans=True
for i in range(M):
    s, c = map(int, input().split())
    if A[s-1]==-1:
        A[s-1]=c
    elif A[s-1]!=c:
        ans=False
        
if A[0]==0:
    ans=False        

head=True
for i in range(N):       
    if A[i]==-1:
        if head and N!=1:
            A[i]=1
            head=False
        else:
            A[i]=0 
    elif A[i]==0:
        pass
    else:
        head=False
            
if ans and not head:
    A=[str(a) for a in A]
    print("".join(A))
elif head and N==1:
    print(0)
else:     
    print(-1)


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

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

int main() {
int n,m;
cin >> n >> m;
int s[m];
char c[m];
string ans;
int p=pow(10,n);
ans=to_string(p);
for(int i=0;i<m;i++){
    cin >> s[i] >> c[i];
}
for(int i=0;i<m;i++){
    if(s[i]==1&&c[i]=='0'){
        cout << "-1";
        return 0;
    }
}
for(int i=0;i<m;i++){
    if(!(ans[s[i]]=='0')&&!(ans[s[i]]==c[i])){
        cout << "-1";
        return 0;
    }
    ans[s[i]]=c[i];
}
if(ans[1]='0'&&ans[2]='0'&&n==3)ans[2]='1';
if(ans[1]='0'&&n==3)ans[1]='1';
if(ans[1]='0'&&n==2)ans[1]='1';
cout << stoi(ans) - p;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:14: error: lvalue required as left operand of assignment
   28 | if(ans[1]='0'&&ans[2]='0'&&n==3)ans[2]='1';
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> value(3, 0);
  vector<bool> change(3, false);
  rep(i, M){
    int s;
    int c;
    cin >> s >> c;
    if(change.at(N-s) == false){
      value.at(N-s) = c;
      change.at(N-s) = true;
    }
    else if(value.at(N-s) == c){
      value.at(N-s) = c;
    }
    else{
      cout << -1 << endl;
      return 0;
    }
  }
  int ans = value.at(0) + value.at(1)*10 + value.at(2)*100;
  int tmp = ans;
  int digit = 0;
  if(tmp < 10){
    digit = 1
  }
  else if (tmp < 100){
    digit = 2;
  }
  else{
    digit = 3;
  }
  if(digit!=N) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: expected ';' before '}' token
   32 |     digit = 1
      |              ^
      |              ;
   33 |   }
      |   ~
Language: C++

#include "include.cpp"
#include "include/math.cpp"

using namespace std;

signed main (){
	int n,m;
	cin >> n>> m;
	vector<pair<int,int>> A(m);
	int max = -1;
	for(int i=0;i<m;i++){
		cin >> A.at(i).first >> A.at(i).second;
		if(A[i].first > max){
			max = A[i].first;
		}
	}
	vector<int> B(max,-1);
	for(int i=0;i<m;i++){
		int p=A[i].first-1;
		if(B[p]==-1){
			B[p]=A[i].second;
		}else if(B[p] != A[i].second){
			cout<<-1<<endl;
			return 0;
		}
	}
	reverse(B.begin(),B.end());
	int ans;
	int deg = 1;
	for(int i=0;i<max;i++){
		if(B[i]==-1){
			B[i]=0;
		}
	}
	for(int i=0;i<max;i++){
		ans += B[i] * deg;
		deg *= 10;
	}
	if(ans==0){
		cout<<-1<<endl;
	}else{
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: include.cpp: No such file or directory
    1 | #include "include.cpp"
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>

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

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> result(N, -1);
    rep(i, M) {
        int s, c;
        cin >> s >> c;
        if(result[s-1]!=-1&&result[s-1]!=c){
            cout << "-1" << endl;
            return 0;
        }
        return[s-1] = c;
    }
    if (N==1) {
        cout << (result[0]==-1?0:result[0]) <<endl;
        return 0;
    }
    if (result[0]==-1) {
        result[0] = 1
    } else if (result[0] == 0) {
        cout << "-1" << endl;
        return 0;
    }
    rep(i, N) {
        cout << (result[i]==-1?0:result[i]);
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: expected ',' before '-' token
   17 |         return[s-1] = c;
      |                 ^
      |                 ,
a.cc:17:17: error: expected identifier before '-' token
a.cc: In lambda function:
a.cc:17:21: error: expected '{' before '=' token
   17 |         return[s-1] = c;
      |                     ^
a.cc: In function 'int main()':
a.cc:17:23: error: no match for 'operator=' (operand types are 'main()::<lambda()>' and 'int')
   17 |         return[s-1] = c;
      |                       ^
a.cc:17:19: note: candidate: 'main()::<lambda()>& main()::<lambda()>::operator=(const main()::<lambda()>&)' (deleted)
   17 |         return[s-1] = c;
      |                   ^
a.cc:17:19: note:   no known conversion for argument 1 from 'int' to 'const main()::<lambda()>&'
a.cc:24:22: error: expected ';' before '}' token
   24 |         result[0] = 1
      |                      ^
      |                      ;
   25 |     } else if (result[0] == 0) {
      |     ~
Language: C

#include<stdio.h>

int main(void){

    int N,M,s[4],c[4],i,j,ans[11] = {0},max = 0,tmp1,tmp2;

    scanf("%d %d",&N,&M);
    for(i = 0;i < M;i++){
        scanf("%d %d",&s[i],&c[i]);
    }

    for(i = 0;i < M;i++){
        for(j = i+1;j < M;j++){
            if(s[i] > s[j]){
                tmp1 = s[i];
                tmp2 = c[i];
                s[i] = s[j];
                c[i] = c[j];
                s[j] = tmp1;
                c[j] = tmp2;
            }
        }
    }

    for(i = 0;i < M;i++){
        if(max < s[i]) max = s[i];
        ans[s[i]] = c[i];
    }
    //printf("max:%d\n",max);
    //for(i = 1;i < max;i++) printf("%d\n",ans[i]);
    for(i = 1;i < max;i++){
        if(ans[i] == ans[i+1] && c[i] != c[i+1]){
            printf("-1\n");
            return 0;
        }
        //printf("done%d\n",i);
    }

    if(ans[1] == 0){
        if(n > 1) printf("-1\n");
        else printf("0\n");
    }else{
        for(i = 1;i <= max;i++) printf("%d",ans[i]);
        printf("\n");
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:40:12: error: 'n' undeclared (first use in this function)
   40 |         if(n > 1) printf("-1\n");
      |            ^
main.c:40:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> value(3, 0);
  vector<bool> change(3, false);
  rep(i, M){
    int s;
    int c;
    cin >> s >> c;
    if(change.at(N-s) == false){
      value.at(N-s) = c;
      change.at(N-s) = true;
    }
    else if(value.at(N-s) == c){
      value.at(N-s) = c;
    }
    else{
      cout << -1 << endl;
      return 0;
    }
  }
  ans = value.at(0) + value.at(1)*10 + value.at(2)*100;
  int tmp = ans;
  int digit = 0;
  while(0 < tmp){
    tmp /= 10;
    digit++;
  }
  if(digit!=N) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |   ans = value.at(0) + value.at(1)*10 + value.at(2)*100;
      |   ^~~
      |   abs
Language: C++

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

int main(){
    int n,m,cnt=0,ans=0;
    cin>>n>>m;

    map<int, int> mp;
    vector<int> vec;
    vec = { 0, 0, 0 }

    for(int i=0; i<m; i++){
        int s,c;
        cin>>s>>c;

        if(vec.at(s-1)!=0 && mp.at(s)!=c) cnt++;

        else{
            mp[s]=c;
            vec.at(s-1)+=1;
            ans+=(pow(10,n-s))*c;
        }
    }

    if(cnt!=0) cout<<-1<<endl;
    else{
        if(n!=1 && ans==0) cout<<-1<<endl;
        else  cout<<ans<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before 'for'
   11 |     vec = { 0, 0, 0 }
      |                      ^
      |                      ;
   12 | 
   13 |     for(int i=0; i<m; i++){
      |     ~~~               
a.cc:13:18: error: 'i' was not declared in this scope
   13 |     for(int i=0; i<m; i++){
      |                  ^
Language: C++

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
	vector<int> a[3];
	int n, m;
	for (int i = 1; i <= m; i++)
	{
		int u, v;
		cin >> u >> v;
		a[u].push_back(v);
	}
	int b[3];
	for (int i = 1; i <= 3; i++)
	{
		for (int j = 0; j < a[i].size(); j++)
		{
			b[i-1] = a[i][j];
			if (a[i][j] < b[0]) { b[i-1] = a[i][j]; }
		}
	}
	int n = b[0] + b[1] * 10 + b[2] * 100;
	cout << n << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: redeclaration of 'int n'
   24 |         int n = b[0] + b[1] * 10 + b[2] * 100;
      |             ^
a.cc:8:13: note: 'int n' previously declared here
    8 |         int n, m;
      |             ^
Language: C

int main(void){
	int n,m,s,c,i;
	int ans[3]={-1,-1,-1};
 
	scanf("%d %d\n",&n,&m);
	for(i=0;i<m;i++){
		scanf("%d %d",&s,&c);
		if(n!=1&&s==1&&c==0){
			printf("-1");
			return 0;
		}
		if(ans[s-1]==-1){
			ans[s-1]=c;
		}else if(ans[s-1]==c){
		}else{
			printf("-1");
			return 0;
		}
	}
	if(n==2||n==3){
		for(s=0;s<3;s++){
			if(ans[s]==-1){
				if(s==0){
					ans[s]=1;
				}else{
					ans[s]=0;
				}
			}
		}
	}else if(ans[0]==-1){
      ans[0]=0
    }
	for(i=0;i<n;i++){
		printf("%d",ans[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |         scanf("%d %d\n",&n,&m);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |         scanf("%d %d\n",&n,&m);
      |         ^~~~~
main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:9:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    9 |                         printf("-1");
      |                         ^~~~~~
main.c:9:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:9:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:16:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   16 |                         printf("-1");
      |                         ^~~~~~
main.c:16:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:31:15: error: expected ';' before '}' token
   31 |       ans[0]=0
      |               ^
      |               ;
   32 |     }
      |     ~          
main.c:34:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   34 |                 printf("%d",ans[i]);
      |                 ^~~~~~
main.c:34:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
	vector<int> a[3];
	int n, m;
	for (int i = 1; i <= m; i++)
	{
		int u, v;
		cin >> u >> v;
		a[u].push_back(v);
	}
	int b[3];
	for (int i = 1; i <= 3; i++)
	{
		for (int j = 0; j < a[i].size(); j++)
		{
			b[i-1] = a[i][j];
			if (a[i][j] < b[0]) { b[i-1] = a[i][j]; }
		}
	}
	int n = b[0] + b[1] * 10 + b[2] * 100;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: redeclaration of 'int n'
   24 |         int n = b[0] + b[1] * 10 + b[2] * 100;
      |             ^
a.cc:8:13: note: 'int n' previously declared here
    8 |         int n, m;
      |             ^
Language: C++

+/++*/02502−9-++#include <stdio.h>

using namespace std;

int pow(int n, int k){
    int res = 1;
    for(int i=0; i<k; i++){
        res *= n;
    }
    return res;
}

int main(){

    int N, M;
    scanf("%d %d", &N, &M);
    int s[5];
    int c[5];
    for(int i=0; i<M; i++) scanf("%d %d", &s[i], &c[i]);

    int base = pow(10, N-1);
    if(N==1) base = 0;

    int check[4];
    for(int i=0; i<4; i++) check[i] = -1;
    for(int i=0; i<M; i++){
        if(s[i] == 1 && c[i] == 0 && N!=1){
            printf("%d\n", -1);
            return 0;
        }
        if(check[s[i]] == -1){
            if(s[i] == 1){
                base += pow(10, N-s[i]) * (c[i]-1);
            }else{
                base += pow(10, N-s[i]) * c[i];
            }
            check[s[i]] = c[i];
        }else{
            if(check[s[i]] != c[i]){
                printf("%d\n", -1);
                return 0;
            }
        }
    }

    printf("%d\n", base);
    return 0;
    
}

Compiler output:
a.cc:1:7: error: extended character − is not valid in an identifier
    1 | +/++*/02502−9-++#include <stdio.h>
      |       ^
a.cc:1:17: error: stray '#' in program
    1 | +/++*/02502−9-++#include <stdio.h>
      |                 ^
a.cc:1:1: error: expected unqualified-id before '+' token
    1 | +/++*/02502−9-++#include <stdio.h>
      | ^
a.cc: In function 'int main()':
a.cc:16:5: error: 'scanf' was not declared in this scope
   16 |     scanf("%d %d", &N, &M);
      |     ^~~~~
a.cc:28:13: error: 'printf' was not declared in this scope
   28 |             printf("%d\n", -1);
      |             ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | +/++*/02502−9-++#include <stdio.h>
a.cc:40:17: error: 'printf' was not declared in this scope
   40 |                 printf("%d\n", -1);
      |                 ^~~~~~
a.cc:40:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:46:5: error: 'printf' was not declared in this scope
   46 |     printf("%d\n", base);
      |     ^~~~~~
a.cc:46:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C

#include<stdio.h>

int main(void){
  pribtf("0\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'pribtf'; did you mean 'printf'? [-Wimplicit-function-declaration]
    4 |   pribtf("0\n");
      |   ^~~~~~
      |   printf
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define INF (1LL << 60)

#define REP(i,m,n) for(ll (i)=(m),i##_len=(n);(i)<(i##_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define _PR(x) cout << (x) << endl
#define _PS(x) cout << (x) << " "
#define SZ(x) ((int)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back

int main()
{
    ll N, M;
    cin >> N >> M;
    vector<ll> s(M), c(M), _s(M);
    REP(i,0,M){
        cin >> s[i] >> c[i];
        _s[i] = s[i];
    }

    sort(ALL(_s));
    ll D = _s[M-1];

    vector<ll> num(N, 0);
    bool f = true;
    if(D > N) f = false;
    else {
        REP(i,0,M) if(N != 1 && s[i] == 1 && c[i] == 0) f = false;
        else {
            REP(i,0,M) {
                if(num[s[i]] != 0 && num[s[i]] != c[i]) f = false;
                else {
                    num[[i]] = c[i];
                }
            }
            if(N != 1 && num[0] == 0) num[0] = 1;
        }
    }

    if(f) {
        REP(i,0,N) cout << num[i];
        cout << endl;
    }
    else _PR(-1);

    return 0;
}

/*



*/

Compiler output:
a.cc: In function 'int main()':
a.cc:40:24: error: two consecutive '[' shall only introduce an attribute before '[' token
   40 |                     num[[i]] = c[i];
      |                        ^
Language: C++

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

int main(){
    // あとで消す
    //std::ifstream in("cin3.txt");
    //std::cin.rdbuf(in.rdbuf());

    // N 桁数
    // M 条件の個数
    int N,M,si,ci;
    cin >> N >> M;

    vector<int> arr(N+1,-1);

    for(int i=0;i<M;i++){
        cin >> si >> ci;
        //cout << si << ci <<endl;
        
        if(arr[si]>=0 && arr[si]!=ci){
            //cout << arr[si+1];
            cout << -1 <<endl;
            return 0;
        }
        arr[si]=ci;
    }

    if(N==1 && arr[i]==0){
        cout << 0 << endl;
        return 0;
    }
    if(arr[1]==0){
        cout << -1 << endl;
        return 0;
    }
    if(arr[1]<0){
        arr[1]=1;
    }

    for(int i=1;i<=N;i++){
        if(arr[i]<0){arr[i]=0;}
        cout << arr[i];
    }
    cout << endl;

    // N==1のときは0で構わない...

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:20: error: 'i' was not declared in this scope; did you mean 'ci'?
   32 |     if(N==1 && arr[i]==0){
      |                    ^
      |                    ci
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main() {
    int N, M;
    cin >> N >> M;

    string ans = "";
    for (int i = 0; i < N; i++) {
        ans += 'a';
    }
    bool f = true;
    for (int i = 0; i < M; i++) {
        int s, c;
        cin >> s >> c;
        if (ans[s - 1] == 'a') {
            ans[s - 1] = char('0' + c);
        } else if (int(ans[s - 1]) - '0' != c) {
            f = false;
            break;
        }
        // cout << ans << endl;
    }

    if (N != 1) {
        if (ans[0] == '0') {
            f = false;
        }
        for (int i = 0; i < 3; i++) {
            if (ans[0] == 'a') {
                ans.erase(0, 1);
            } else
        }

    }

    for (char& a : ans) {
        if (a == 'a') {
            a = '0';
        }
    }

    // cout << ans.length() << endl;

    if (f && ans.length() > 0) {
        cout << ans << endl;
    } else {
        cout << "-1" << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: expected primary-expression before '}' token
   36 |         }
      |         ^