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

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

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

    if (N==1 and M==0) {
        cout << 0 << endl; exit(0);
    }
    else if (N==2 and M==0) {
        cout << 10 << endl; exit(0);
    } 
    else if (N==3 and M==0) {
        cout << 100 << endl; exit(0);
    }

    else {
        for (int i=0; i<M; i++) {
            for (int j=0; j<M; j++) {
                if (s[i]==s[j] and c[i]!=c[j]) {
                    cout << -1 << endl;
                    exit(0);
                }
            }
        }

        int x=0;

        if (N==1) {
            x = c[0];
        }

        else if (N==2) {
            for (int i=0; i<M; i++) {
                if (s[i]==1 and c[i]==0) {
                    x=-1;
                    break;
                }
                else if (s[i]==1 and x/10!=c[i]) {
                    x += 10*c[i];
                }
                else if (s[i]==2 and x%10!=c[i]) {
                    x += c[i];
                }
            }
        }

        else if (N==3) {
            for (int i=0; i<M; i++) {
                if (s[i]==1 and c[i]==0) {
                    x=-1;
                    break;
                }
                else if (s[i]==1 and x/100!=c[i]) {
                    x += 100*c[i];
                }
                else if (s[i]==2 and (x%100)/10!=c[i]) {
                    x += 10*c[i];
                }
                else if (s[i]==3 and (x%100)%10!=c[i]) {
                    x += c[i];
                }
            }
        }
    }
    
    //
    cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:13: error: 'x' was not declared in this scope
   73 |     cout << x << endl;
      |             ^
Language: C++

/// RIFAT SHARIAR SAKIL
/// SOFTWARE ENGINEERING, SUST
/// 2019831024

#include<bits/stdc++.h>
#define ll long long
#define t INT_MAX
using namespace std;
int main()
{
   // while(1)
  //  {
        int n,m,i;
    cin >> n >> m;
   // int a[n]={0},mx[3]={t,t,t};
    set <int> s1,s2,s3;
    set <int>::iterator it,ti,iu;
    for(i=0;i<m;i++)
    {
        int s,c;
        cin >> s >> c;
        /*if(s==1)
        {
            if(c && c<mx[s-1])
            {
                mx[s-1]= c;
                a[s-1] = c;
            }
        }
        else if( c<mx[s-1] )
        {
            mx[s-1] = c;
            a[s-1] = c;
        }*/
        if(s==1) s1.insert(c);
        else if(s==2)s2.insert(c);
        else s3.insert(c);
    }
    if(s1.size()>1 || s2.size()>1 || s3.size()>1 ) {cout << "-1";return 0;}
        else if(s1.size()==0 && n>1){cout << "-1";return 0;}
         it = s1.begin();
        if(*it==0 && n>1) {cout << "-1";return 0;}
    if(s.size()==0) cout << "0";
       else  cout << *it;

     //   cout << s1.size() << " " << s2.size() << " " << s3.size() << endl;
          ti = s2.begin();
         if(n>=2)
         {
            // if(*it==0 && )
             if(s2.size()==0) cout << "0";
              //  {cout << "-1";return 0;}
             else cout << *ti;
         }
        iu = s3.begin();
        if(n==3)
        {
            if(s3.size()==0)cout << "0";
            else cout << *iu;
        }


      //  cout << endl;
  //  }



}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:8: error: 's' was not declared in this scope; did you mean 's3'?
   43 |     if(s.size()==0) cout << "0";
      |        ^
      |        s3
Language: C++

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

int main() {
 int a,b,c,d;
 cin >> a;
 int e[a];
 for(int i=0;i<a;i++) e[i] = 0;
 cin >> b;
 for(int j=0;j<b;j++){
   cin >> c >> d;
   if(e[c]!=0){
     cout << "-1" <, endl;
     return 0;
   }
   e[c] = d;
 }
  if(e[2]!=0) cout << e[2] << e[1] << e[0] << endl;
  else if(e[1]!=0) cout << e[1] << e[0] << endl;
  else cout << e[0] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expected primary-expression before ',' token
   13 |      cout << "-1" <, endl;
      |                    ^
Language: C++

//auto 関数名 = [(&:ラムダ外の引数をとる時))](引数の型1 引数名1, 引数の型2, 引数名2, ...) { 関数の処理 }; //inside main() define function. take care of };
// for (int tmp = 0; tmp < (1 << ビット数); tmp++) {
//   bitset<ビット数> s(tmp);
//   // (ビット列sに対する処理)
// }
// sort(配列変数.begin(), 配列変数.end());
// do {
//   // 順列に対する処理
// } while (next_permutation(配列変数.begin(), 配列変数.end()));
//const double PI = acos(-1); M_PI
// cout << fixed << setprecision(10);
#include <bits/stdc++.h>
#include <regex>
using namespace std;
#define _GLIBCXX_DEBUG 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end() //sort(all(vec)); ,reverse(all(vec));etc
int main(){
    int n,m;
    cin>>n>>m;
    vector<string>vec(n);
    int s;
   string c;
  rep(i,m)){
       cin>>s>>c;
       if(s==1&&c=="0"){
           cout<<-1<<endl;
           return 0;
       }
       if(vec.at(s-1)==""){
         vec.at(s-1)=c;
       }
       else if(vec.at(s-1)!=c){
           cout<<-1<<endl;
           return 0;
       }
      
   }
   string ans="";

   if(n!=1&&vec.at(0)==""){
       vec.at(0)="1";
   }
   rep(i,n){
       if(vec.at(i)==""){
           ans+="0";
       }else{
           ans+=vec.at(i);
       }
   }
   //cout<<vec.at(0)<<vec.at(1)<<vec.at(2)<<endl;
   cout<<ans<<endl;

    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:11: error: expected primary-expression before ')' token
   24 |   rep(i,m)){
      |           ^
Language: C++

//auto 関数名 = [(&:ラムダ外の引数をとる時))](引数の型1 引数名1, 引数の型2, 引数名2, ...) { 関数の処理 }; //inside main() define function. take care of };
// for (int tmp = 0; tmp < (1 << ビット数); tmp++) {
//   bitset<ビット数> s(tmp);
//   // (ビット列sに対する処理)
// }
// sort(配列変数.begin(), 配列変数.end());
// do {
//   // 順列に対する処理
// } while (next_permutation(配列変数.begin(), 配列変数.end()));
//const double PI = acos(-1); M_PI
// cout << fixed << setprecision(10);
#include <bits/stdc++.h>
#include <regex>
using namespace std;
#define _GLIBCXX_DEBUG 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end() //sort(all(vec)); ,reverse(all(vec));etc
int main(){
    int n,m;
    cin>>n>>m;
    vector<string>vec(n);
    int s;
   string c;
  rep(i,m)){
       cin>>s>>c;
       if(s==1&&c=="0"){
           cout<<-1<<endl;
           return 0;
       }
       if(vec.at(s-1)==""){
         vec.at(s-1)=c;
       }
       else if(vec.at(s-1)!=c){
           cout<<-1<<endl;
           return 0;
       }
      
   }
   string ans="";

   if(n!=0&&vec.at(0)==""){
       vec.at(0)="1";
   }
   rep(i,n){
       if(vec.at(i)==""){
           ans+="0";
       }else{
           ans+=vec.at(i);
       }
   }
   //cout<<vec.at(0)<<vec.at(1)<<vec.at(2)<<endl;
   cout<<ans<<endl;

    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:11: error: expected primary-expression before ')' token
   24 |   rep(i,m)){
      |           ^
Language: C++

#include<bits/stdc++.h>						
typedef long long ll;
#define pb push_back
#define mod 1000000007ll
const ll maxn = 9e18;
using namespace std;
const ll maxsize = 100000009;



void solve() {
	int n, m;
	cin >> n >> m;
	string s(n, '0');
	for(int i = 0	;i < m; ++i) {
		int idx, v;
		cin >> idx >> v;
		--idx;	
		if((s[idx] != '0' && s[idx] != v + '0') || (n != 1 && idx == 0 && v == 0)) {
			cout << -1 << endl;l
			return; 
			}
			s[idx] = v + '0';
		}
		if(s[0] == '0' && n >= 2) cout << "No" << endl;
		else
		cout << s << endl;
}			


int main() {
	ios_base :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cout.precision(35);
	int t;
	solve();
	return 0;
}
 
 
 


Compiler output:
a.cc: In function 'void solve()':
a.cc:20:44: error: 'l' was not declared in this scope
   20 |                         cout << -1 << endl;l
      |                                            ^
Language: C++

#include<bits/stdc++.h>						
typedef long long ll;
#define pb push_back
#define mod 1000000007ll
const ll maxn = 9e18;
using namespace std;
const ll maxsize = 100000009;



void solve() {
	int n, m;
	cin >> n >> m;
	string s(n, '0');
	for(int i = 0	;i < m; ++i) {
		int idx, v;
		cin >> idx >> v;
		--idx;	
		if((s[idx] != '0' && s[idx] != v + '0') || (n != 1 && idx == 0 && v == 0)) {
			cout << -1 << endl;l
			return; 
			}
			s[idx] = v + '0';
		}
		if(s[0] == 0] && n >= 2) cout << "No" << endl;
		else
		cout << s << endl;
}			


int main() {
	ios_base :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cout.precision(35);
	int t;
	solve();
	return 0;
}
 
 
 


Compiler output:
a.cc: In function 'void solve()':
a.cc:20:44: error: 'l' was not declared in this scope
   20 |                         cout << -1 << endl;l
      |                                            ^
a.cc:25:29: error: expected ')' before ']' token
   25 |                 if(s[0] == 0] && n >= 2) cout << "No" << endl;
      |                   ~         ^
      |                             )
a.cc:25:29: error: expected primary-expression before ']' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int N,M;
cin>>N>>M;
vector<int>s(M);
vector<int>c(M);
vector<int>answer(N);
vector<bool>h(N);
bool a=false;
if(M==0){
    cout<<1;
    for(int i=0; i<N-1; i++){
        cout<<0;
    }
    cout<<""<<endl;
}
else{
for(int i=0; i<M; i++)
{
    cin>>s.at(i);
    cin>>c.at(i);
    if(   h.at(s.at(i)-1)==true){
        a=true;
    }
    answer.at(s.at(i)-1)=c.at(i);
    h.at(s.at(i)-1)=true;
}

if(a==false){
for(int i=0; i<N; i++){
cout<<answer.at(i);
}
cout<<""<<endl;
}
else
{
    cout<<-1<<endl;
}
}
}

}
else
{
    cout<<-1<<endl;
}
}
}


Compiler output:
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
a.cc:44:1: error: expected unqualified-id before 'else'
   44 | else
      | ^~~~
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
a.cc:49:1: error: expected declaration before '}' token
   49 | }
      | ^
Language: C++

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

int main() {
  ll N,M;
  cin >> N >> M;
  vector<ll> S(M);
  vector<ll> C(M);
  for(ll i=0;i<M;i++){
    cin >> S.at(i) >> C.at(i);
  }
  vector<ll> Number(N,0);
  for(ll i=0;i<M;i++){
    for(ll j=0;j<i;j++){
      if(S.at(j)==S.at(i) && C.at(j)!=C.at(i)){
        cout << -1 << endl;
        return 0;
      }
    }
    Number.at(S.at(i)-1)=C.at(i);
  }
  if(Number.at(0)==0 && N!=1){
    Number.at(0)=1;
  }
  else ifNumber.at(0)==0 && N==1){
    cout << -1 << endl;
    return 0;
  }
  for(ll i=0;i<N;i++){
    cout << Number.at(i);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:8: error: 'ifNumber' was not declared in this scope; did you mean 'Number'?
   26 |   else ifNumber.at(0)==0 && N==1){
      |        ^~~~~~~~
      |        Number
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define INF 1e8
typedef long long int ll;
const double PI = acos(-1);

using Graph = vector<vector<int>>;
int main() {
  int n, m;
  cin >> n >> m;
  int s[m];
  char c[m];
  rep(i, m) { cin >> s[i] >> c[i]; }
  for (int i = 0; i < pow(10, n); i++) {
    string str = to_string(i);
    boo

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'boo' was not declared in this scope; did you mean 'bool'?
   18 |     boo
      |     ^~~
      |     bool
a.cc:18:8: error: expected '}' at end of input
   18 |     boo
      |        ^
a.cc:16:40: note: to match this '{'
   16 |   for (int i = 0; i < pow(10, n); i++) {
      |                                        ^
a.cc:18:8: error: expected '}' at end of input
   18 |     boo
      |        ^
a.cc:10:12: note: to match this '{'
   10 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    int n,m;
    cin>>n>>m;
    vector<int> s(m),c(m),ans(n);
    rep(i,m){
        cin>>s[i]>>c[i];
        if(s[i]!=n&&c[i]==0){
            cout<<-1;
            return 0;
        }
        rep(k,i){
            if(s[i]==s[k]&&c[i]!=c[k]){
                cout<<-1;
                return 0;
            }
        }
        ans[s[i]-1]=c[i];
    }
    if(ans[0]==0&&n!=1) ans[0]=1;//一番左が分からない場合
    rep(i,n) cout<<ans[i];
    else cout<<-1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'else' without a previous 'if'
   30 |     else cout<<-1;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    int n,m;
    cin>>n>>m;
    vector<int> s(m),c(m),ans(n);
    rep(i,m){
        cin>>s[i]>>c[i];
        if(s[i]!=n&&c[i]==0){
            cout<<-1;
            return 0;
        }
        rep(k,i){
            if(s[i]==s[k]&&c[i]!=c[k]){
                cout<<-1;
                return 0;
            }
        }
        ans[s[i]-1]=c[i];
    }
    if(ans[0]==0&&n!=1) ans[0]=1;//一番左が分からない場合
    if(j) rep(i,n) cout<<ans[i];
    else cout<<-1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: 'j' was not declared in this scope
   29 |     if(j) rep(i,n) cout<<ans[i];
      |        ^
Language: C++

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



int main() {
  int n, m; ///n桁の数
  cin >> n >> m;
  int f = 0;
  vector<int> num(n, 0);
  vector<int> check(n, 0);
  rep(i, m){
    int s, c; ///s桁目の数がc
    cin >> s >> c;


    if(c == 0 && s == 1 && n!= 1) {
      f = 1;
      break;
    }
    else if(check[s-1] != 0 &&  num[s-1] != c){
      f = 1;
      break;
    }
    else if(c != 0){
      num[s-1] = c;
      check[s-1] = -1;
    }
    /*
    else{
      num[s-1] = c;
      check[s-1] = -1;
    }
    */
  }
  if (f == 1) cout << -1 << endl;
  else {
    if(chekck[0]==0){
      num[0] = 1;
    }
  
    
    rep(i, n) cout << num[i];
  }
    } 
   
  





Compiler output:
a.cc: In function 'int main()':
a.cc:40:8: error: 'chekck' was not declared in this scope; did you mean 'check'?
   40 |     if(chekck[0]==0){
      |        ^~~~~~
      |        check
Language: C++

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



int main() {
  int n, m; ///n桁の数
  cin >> n >> m;
  int f = 0;
  vector<int> num(n, 0);
  vector<int> check(n, 0);
  rep(i, m){
    int s, c; ///s桁目の数がc
    cin >> s >> c;


    if(c == 0 && s == 1 && n!= 1) {
      f = 1;
      break;
    }
    else if(check[s-1] != 0 &&  num[s-1] != c){
      f = 1;
      break;
    }
    else if(c != 0){
      num[s-1] = c;
      check[s-1] = -1;
    }
    /*
    else{
      num[s-1] = c;
      check[s-1] = -1;
    }
    */
  }
  if (f == 1) cout << -1 << endl;
  else if(
    if(chekck[0]==0){
      num[0] = 1;
    )
    
    rep(i, n) cout << num[i];
    } 
  } 
  





Compiler output:
a.cc: In function 'int main()':
a.cc:40:5: error: expected primary-expression before 'if'
   40 |     if(chekck[0]==0){
      |     ^~
a.cc:39:11: error: expected ')' before 'if'
   39 |   else if(
      |          ~^
      |           )
   40 |     if(chekck[0]==0){
      |     ~~     
a.cc:46:3: error: expected primary-expression before '}' token
   46 |   }
      |   ^
Language: C++

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



int main() {
  int n, m; ///n桁の数
  cin >> n >> m;
  int f = 0;
  vector<int> num(n, 0);
  vector<int> check(n, 0);
  rep(i, m){
    int s, c; ///s桁目の数がc
    cin >> s >> c;


    if(c == 0 && s == 1 && n!= 1) {
      f = 1;
      break;
    }
    else if(check[s-1] != 0 &&  num[s-1] != c){
      f = 1;
      break;
    }
    else if(c != 0){
      num[s-1] = c;
      check[s-1] = -1;
    }
    /*
    else{
      num[s-1] = c;
      check[s-1] = -1;
    }
    */
  }
  if (f == 1) cout << -1 << endl;
  else if {
    if(chekck[0]==0) {
      num[0] = 1;
    }
    
    rep(i, n) cout << num[i];
    } 
  } 
  





Compiler output:
a.cc: In function 'int main()':
a.cc:39:11: error: expected '(' before '{' token
   39 |   else if {
      |           ^
      |           (
Language: C++

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



int main() {
  int n, m; ///n桁の数
  cin >> n >> m;
  int f = 0;
  vector<int> num(n, 0);
  rep(i, m){
    int s, c; ///s桁目の数がc
    cin >> s >> c;


    if(c == 0 && s == 1 && n!= 1) {
      f = 1;
      break;
    }
    else if(num[s-1] != 0 && num[s-1] != c){
      f = 1;
      break;
    }
    else num[s-1] = c;
  }
  if (f == 1) cout << "-1" << endl;
  else{
    rep(i, n){
      if (num[i] != 0) f = 2;
    }
    if (f == 2){
      rep(i, n) cout << num[i];
    }
    else cout << 0;
  
  }

  }


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | z#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'z' does not name a type
    1 | z#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin >> n >> m;
      |   ^~~
a.cc:12:3: error: 'vector' was not declared in this scope
   12 |   vector<int> num(n, 0);
      |   ^~~~~~
a.cc:12:10: error: expected primary-expression before 'int'
   12 |   vector<int> num(n, 0);
      |          ^~~
a.cc:22:13: error: 'num' was not declared in this scope; did you mean 'enum'?
   22 |     else if(num[s-1] != 0 && num[s-1] != c){
      |             ^~~
      |             enum
a.cc:28:15: error: 'cout' was not declared in this scope
   28 |   if (f == 1) cout << "-1" << endl;
      |               ^~~~
a.cc:28:31: error: 'endl' was not declared in this scope
   28 |   if (f == 1) cout << "-1" << endl;
      |                               ^~~~
a.cc:31:11: error: 'num' was not declared in this scope; did you mean 'enum'?
   31 |       if (num[i] != 0) f = 2;
      |           ^~~
      |           enum
a.cc:34:17: error: 'cout' was not declared in this scope
   34 |       rep(i, n) cout << num[i];
      |                 ^~~~
a.cc:34:25: error: 'num' was not declared in this scope; did you mean 'enum'?
   34 |       rep(i, n) cout << num[i];
      |                         ^~~
      |                         enum
a.cc:36:10: error: 'cout' was not declared in this scope
   36 |     else cout << 0;
      |          ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> num(N, -1);
    for (int i=0; i<M; i++) {
        int si, ci;
        cin >> si >> ci;
        si--;
        if ((num[si] != -1) && (num[si] != ci)){
            cout << -1;
            return 0;
        }
        num[si] = ci;
    }
    bool first = true;
    for (int j=0; j<N; j++) {
        if ((j == 0) && (num[j] == 0)){
            cout << -1;
            return 0;
        } else if ((num[j] == 0) && first_val) {
            num[j-1] = 1;
        }

        if (num[j] != -1) first_val = false;
        // if ((j==0) && (num[j] == -1)) num[j] = 1;
        if (num[j] == -1){
            num[j] = 0;
        }
    }
    cout << (num[0] * 100) + (num[1] * 10) + num[2] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:37: error: 'first_val' was not declared in this scope
   27 |         } else if ((num[j] == 0) && first_val) {
      |                                     ^~~~~~~~~
a.cc:31:27: error: 'first_val' was not declared in this scope
   31 |         if (num[j] != -1) first_val = false;
      |                           ^~~~~~~~~
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<int>> data(2, vector<int>(M));
  vector<int> ans(N);
  bool X = true;
  int countA = 0;
  int countB = 0;
  int countC = 0;
  for (int i = 0; i < M; i++) 
    cin >> data.at(0).at(i) >> data.at(1).at(i);
  for (int i = 0; i < M; i++) {
    if (data.at(0).at(i) == 1 && N >= 1) {
      if (countA != 0 && ans.at(0) != data.at(1).at(i)) {
        X = false;
        break;
      }
      else {
        ans.at(0) = data.at(1).at(i);
        countA++;
      }
    }
    if (data.at(0).at(i) == 2 && N >= 2) {
      if (countB != 0 && ans.at(1) != data.at(1).at(i)) {
        X = false;
        break;
      }
      else {
        ans.at(1) = data.at(1).at(i);
        countB++;
      }
    }
    if (data.at(0).at(i) == 2 && N < 2) {
      X = false;
      break;
    }
    if (data.at(0).at(i) == 3 && N >= 3) {
      if (countC != 0 && ans.at(2) != data.at(1).at(i)) {
        X = false;
        break;
      }
      else {
        ans.at(2) = data.at(1).at(i);
        countC++;
      }
    }
    if (data.at(0).at(i) == 3 && N < 3) {
      X = false;
      break;
    }
    if (X == 0)
      cout << -1 << endl;
    else if (X == 1)
      cout << ans.at(0) + ans.at(1)*10 + ans.at(2)*100 << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
void print() {
    cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail) != 0)
        cout << " ";
    print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
    for (auto &a : vec) {
        cout << a;
        if (&a != &vec.back())
            cout << " ";
    }
    cout << endl;
}
template <class T>
void print(vector<vector<T>> &df) {
    for (auto &vec : df) {
        print(vec);
    }
}
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define xrep(i, a, b) for (int i = int(a); i < int(b); ++i)
using ll = long long;
const int INF = 1001001001;



int main() {
    int N, M;
    cin >> N >> M;
    vector<int> S(M);
    vector<int> C(M);
    rep(i, M) {
        int s, c;
        cin >> s >> c;
        --s;
        S[i] = s;
        C[i] min(C[i], c);

    }
    vector<int> num(N, 0);

    rep(i, M) {
        num[S[i]] = C[i];
    }
    int ans = 0;
    reverse(num.begin(), num.end());
    rep(k, N) {
        ans += num[k] * pow(10, k);
    }

    int k = (int)log10(ans);
    if(k+1<N) {
        print(-1);
        return 0;
    }


    print(ans);


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:13: error: expected ';' before 'min'
   45 |         C[i] min(C[i], c);
      |             ^~~~
      |             ;
a.cc:45:12: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   45 |         C[i] min(C[i], c);
      |            ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
void print() {
    cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail) != 0)
        cout << " ";
    print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
    for (auto &a : vec) {
        cout << a;
        if (&a != &vec.back())
            cout << " ";
    }
    cout << endl;
}
template <class T>
void print(vector<vector<T>> &df) {
    for (auto &vec : df) {
        print(vec);
    }
}
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define xrep(i, a, b) for (int i = int(a); i < int(b); ++i)
using ll = long long;
const int INF = 1001001001;



int main() {
    int N, M;
    cin >> N >> M;
    vector<int> S(M);
    vector<int> C(M);
    rep(i, M) {
        int s, c;
        cin >> s >> c;
        --s;
        S[i] = s;
        C[i] min(C[i], c);

    }
    vector<int> num(N, 0);

    rep(i, M) {
        num[S[i]] = C[i];
    }
    int ans = 0;
    reverse(num.begin(), num.end());
    rep(k, N) {
        ans += num[k] * pow(10, k);
    }

    int k = (int)log10(ans);
    if(k+1<N) {
        print(-1);
        return 0;
    }


    print(ans);


    return 1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:13: error: expected ';' before 'min'
   45 |         C[i] min(C[i], c);
      |             ^~~~
      |             ;
a.cc:45:12: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   45 |         C[i] min(C[i], c);
      |            ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

# include <bits/stdc++.h>
# define rep(i, n) for(ll i = 0; i < (n); ++i)
# define reps(i, n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(ll i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(ll i=((int)(n)); i>0; --i)
# define ll long long
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
# define P pair<int, int>
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll lmax(ll a, ll b){if(a>= b) return a;return b;}
ll lmin(ll a, ll b){if(a>= b) return b;return a;}

int digit(int n){
  n /= 10;
  int res = 1;
  while(n){
    res++;
    n/=10;
  }

  return res;
}

int ketame(int x, int n){
  rep(i, digit(x) - n){
    x /= 10;
  }

  return (x % 10);
}

int main() {
  int n, m; cin >> n >> m;
  vector<int> s(m), c(m);
  rep(i, m){
    cin >> s[i] >> c[i];
  }

  rep(i, 1000){
    if(n != digit(i)) continue;
    bool flag = true;
    vector<int>
    rep(j, m){
      if(ketame(i, s[j]) != c[j]) flag = false;
    }
    if(flag){
      cout << i << endl;
      return 0;
    }
  }

  cout << -1 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:20: error: expected unqualified-id before 'for'
    2 | # define rep(i, n) for(ll i = 0; i < (n); ++i)
      |                    ^~~
a.cc:48:5: note: in expansion of macro 'rep'
   48 |     rep(j, m){
      |     ^~~
a.cc:48:9: error: 'j' was not declared in this scope
   48 |     rep(j, m){
      |         ^
a.cc:2:34: note: in definition of macro 'rep'
    2 | # define rep(i, n) for(ll i = 0; i < (n); ++i)
      |                                  ^
Language: C++

#include"bits/stdc++.h"

using namespace std;

#define FastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define nl "\n"
#define sp " "
#define int long long
#define PI 3.141592653589793
#define scanstr(s) cin>>ws; getline(cin,s);

void solve()
{
	int n,m;
	cin>>n>>m;
	int low,high;
	if(n==1) low=0, high=9;
	if(n==2) low=10, high=99;
	if(n==3) low=100, high=1000;
	int a[2*m];
	for(int i=0;i<2*m;i++) cin>>a[i];
	for(low=0;low<high;low++)
	{
		int x=low;
		string s;
		while(x)
		{
			int k=x%10;
			x/=10;
			char c='0'+k;
			s+=c;
		}
		reverse(s.begin(),s.end());
		bool ok=true;
		for(int i=0;i<2*m;i+=2)
		{
			int x=a[i];
			x--;
			int k=a[i+1];
			char c='0'+k;
			if(c!=s[x])
			{
				ok=false;
				break;
			}
		}
		if(s.size()!=n && s[0]=='0') ok=false;
		if(ok)
		{
			cout<<low<<nl;
			return ;
		}
	}
	cout<<-1<<nl;
	return ;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
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> a(n);
	rep(i,m){
		int s,c;
		cin >> s >> c;
		a[s-1] = c;
	}
	if(s == 1 && c == 0) cout << -1 << endl;
	if(n >1 && a[0] == 0) cout << -1 << endl;
	else{
	rep(i,m){
		cout << a[i];
	}
	cout << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: 's' was not declared in this scope
   16 |         if(s == 1 && c == 0) cout << -1 << endl;
      |            ^
a.cc:16:22: error: 'c' was not declared in this scope
   16 |         if(s == 1 && c == 0) cout << -1 << endl;
      |                      ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[] s = new int[m];
    char[] c = new char[m];
    for(int i = 0; i < m; i++) {
      s[i] = sc.nextInt() - 1;
      c[i] = (sc.next()).charAt(0);
    }
    int ans = -1;
    for(int i = (int)Math.pow(10, n - 1); i < (int)Math.pow(10, n); i++) {
      String d = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < m; j++) {
        if(d.charAt(s[j]) != c[j]) p++;
      }
      if(p == 0) {
        ans = i;
        break;
      }
    }
    if(n == 1) {
      String d = String.valueOf(0);
      for(int j = 0; j < m; j++) {
        if(d.charAt(s[j]) != c[j]) p++;
      }
      if(p == 0) ans = 0;
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:29: error: cannot find symbol
        if(d.charAt(s[j]) != c[j]) p++;
                                   ^
  symbol:   variable p
  location: class Main
Main.java:31: error: cannot find symbol
      if(p == 0) ans = 0;
         ^
  symbol:   variable p
  location: class Main
2 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[] s = new int[m];
    char[] c = new char[m];
    for(int i = 0; i < m; i++) {
      s[i] = sc.nextInt() - 1;
      c[i] = (sc.next()).charAt(0);
    }
    int ans = -1;
    for(int i = (int)Math.pow(10, n - 1); i < (int)Math.pow(10, n); i++) {
      int d = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < m; j++) {
        if(d.charAt(s[j]) != c[j]) p++;
      }
      if(p == 0) {
        ans = i;
        break;
      }
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:16: error: incompatible types: String cannot be converted to int
      int d = String.valueOf(i);
                            ^
Main.java:19: error: int cannot be dereferenced
        if(d.charAt(s[j]) != c[j]) p++;
            ^
2 errors
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define rep(i,n) for(i=0;i<n;i++)
#define PI 3.14159265358979323846264338327950L
int main(){
    int n,m;
    scanf("%d%d",n,m);
    char s[3]={'0'};
    int c[m],i;
    rep(i,m){
        scanf("%d",&c[i]);
        if(s[c[i]-1]!='0') break;
        scanf("%c",&s[c[i]-1]);
    }
    if(s[0]=='0'){
        if(s[1]=='0') printf("%c",s[2]);
        else printf("%c%c",s[1],s[2]);
    }else if(s[0]!=0&&(s[1]!=0&&s[2]!=0){
        printf("%s",s[3]);
    }else printf("-1");
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:41: error: expected ')' before '{' token
   19 |     }else if(s[0]!=0&&(s[1]!=0&&s[2]!=0){
      |             ~                           ^
      |                                         )
main.c:23:1: error: expected expression before '}' token
   23 | }
      | ^
Language: C++

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

using namespace std;
using p=pair<int,int>;
typedef long long ll;

int main() {
  int n,m;
  cin >> n >> m;
  vector<vector<int>> sc(m,vector<int>(2));
  rep(i,m){
    cin >> sc[i][0] >> sc[i][1];
  }
  rep(i,m){
    rep(j,m){
      if(i!=j && sc[i][0]==sc[j][0]&&sc[i][1]!=sc[j][1]){
        cout << -1 << endl;
        return 0;
      }
    }
    if(sc[i][0]==n&&n!=0&&sc[i][1]==0){
      cout << -1 << endl;
      return 0;
    }
  }
  int ans=0;
  int ant=0;
  rep(i,m){
    ans+=sc[i][1]*pow(10,n-sc[i][0]);
  }
  ant=ans;
  rep(i,m){
    rep(j,m){
      if(i!=j && sc[i][0]==sc[j][0]&&sc[i][1]==sc[j][1]){
        ant-=sc[j][1]*pow(10,n-sc[j][0]);
        
  cout << ans << endl;

  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:35:13: note: to match this '{'
   35 |     rep(j,m){
      |             ^
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:34:11: note: to match this '{'
   34 |   rep(i,m){
      |           ^
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^
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 v1 = vector<int>;
using vl = vector<long long>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;

int main(){
	int n, m;
	cin >> n >> m;
	vector<int> a(n, -1);
	rep(i, m){
		int s, c;
		cin >> s >> c;
		if(s > n){
			cout << -1 << endl;
			return 0;
		}
		if(a[s-1] != -1 && a[s-1] != c){
			cout << -1 << endl;
			return 0;
		}
		a[s-1] = c;
	}
	v1 answer(n);
	if(a[0] == 0 && n == 1 && a.size() == 1){
		cout << 0 << endl;
		return 0;
	}

	if(zero) cout << 0 << endl;
	if(a[0] == 0){
		cout << -1 << endl;
		return 0;
	}else if(a[0] == -1){
		answer[0] = 1;
	}else{
		answer[0] = a[0];
	}
	for(int i = 1; i< n; i++){
		if(a[i] == -1){
			answer[i] =0;
		}else{
			answer[i] = a[i];
		}
	}
	rep(i, n){
		cout << answer[i];
	}
	cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: 'zero' was not declared in this scope; did you mean 'bzero'?
   34 |         if(zero) cout << 0 << endl;
      |            ^~~~
      |            bzero
Language: C++

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

int main()
{
  int n, m;
  cin >> n >> m;
  vector<int> v(n);
  rep(i, n) v[i] = -1;
  int a, b, ok = 0;
  int ans = 0;
  rep(i, m){
    cin >> a >> b;
    if(n == 1){
      v[0] = b;
    }
    else{
      if(a == 1 && b == 0) ans = -1;
      if(v[a - 1] == -1) v[a - 1] = b;
      if(v[a - 1 != b) ans = -1;
    }        
  }
  rep(i, n){
    if(v[i] == -1) v[i] = 0;
  }
  if(ans > -1){
    if(n == 1) {
      cout << v[0] << endl;
      return 0;
    }
    if(n > 1 && v[0] == 0){
      cout << -1 << endl;
      return 0;
    }
    rep(i, n){
      ans *= 10;
      ans += v[i];
    }
  }
  cout << ans << endl;
        

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:22: error: expected ']' before ')' token
   25 |       if(v[a - 1 != b) ans = -1;
      |                      ^
      |                      ]
Language: C++

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

int main()
{
  int n, m;
  cin >> n >> m;
  vector<int> v(n);
  rep(i, n) v[i] = -1;
  int a, b, ok = 0;
  int ans = 0;
  rep(i, m){
    cin >> a >> b;
    if(n == 1){
      v[0] = b;
    }
    else{
      if(v[a - 1] == -1) v[a - 1] = b;
      if(v[a - 1 != b) ans = -1;
    }        
  }
  rep(i, n){
    if(v[i] == -1) v[i] = 0;
  }
  if(ans > -1){
    if(n == 1) {
      cout << v[0] << endl;
      return 0;
    }
    if(n > 1 && v[0] == 0){
      cout << -1 << endl;
      return 0;
    }
    rep(i, n){
      ans *= 10;
      ans += v[i];
    }
  }
  cout << ans << endl;
        

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:22: error: expected ']' before ')' token
   24 |       if(v[a - 1 != b) ans = -1;
      |                      ^
      |                      ]
Language: C++

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

int main()
{
  int n, m;
  cin >> n >> m;
  vector<int> v(n);
  rep(i, n) v[i] = 0;
  int a, b;
  int ans = 0;
  rep(i, m){
    cin >> a >> b;
    if(n > 1 && a == 1 && b == 0) continue;
    if(v[a - 1] == 0) v[a - 1] = b;
    if(v[a - 1] != b) ans = -1;
  }
  if(ans > -1){
    if(n == 1) {
      cout << v[0] << endl;
      return 0;
    }
    rep(i, n){
      if(i == 0 && v[i] == 0){
        ans = -1;
        break;
      }
      ans *= 10;
      ans += v[i];
    }
  }
  cout << ans << endl;
        

  return 0;
} 0;
}

Compiler output:
a.cc:41:3: error: expected unqualified-id before numeric constant
   41 | } 0;
      |   ^
a.cc:42:1: error: expected declaration before '}' token
   42 | }
      | ^
Language: C

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

bool sortWay(pair<int, int> first, pair<int, int> second){
    return first.first < second.first;
}

int main(){
    int n,m;
    cin >> n >> m;
    vector<pair<int, int>> conditions(m);
    for (int i=0;i<m;i++){
        int si, ci;
        cin >> si >> ci;
        conditions[i] = make_pair(si, ci);
    }
    vector<int> memo(m+1);
    for (int i=1;i<=m;i++){
        memo[i] = -1;
    }
    for (auto cond : conditions){
        if (cond.first > m  || (memo[cond.first] != -1 && memo[cond.first] != cond.second)){
            cout << "-1" << endl;
            return 1;
        } else {
            memo[cond.first] = cond.second;
        }
    }
    for (int i=1;i<m+1;i++){
        if (i==1 && memo[i] == 0){
            cout << "-1" << endl;
            return 1;
        }
        if (memo[i] == -1){
            if (i == 1){
                cout << 1;
            } else {
            cout << 0;
            }
        } else {
            cout << memo[i];
        }
    }
    cout << endl;
    return 1;
}

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

#include <iostream>
#include <cmath>
#include <stdint.h>
#include <iomanip>
#include <vector>
#include<algorithm>
#include <queue>
using namespace std;
 
#define int long long
#define INF 1001001001

int arr[200001];
 
int nChoosek( int n, int k )
{
    if (k > n) return 0;
    if (k * 2 > n) k = n-k;
    if (k == 0) return 1;

    int result = n;
    for( int i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

int choose2(int n){
	
	return n*(n-1)/2;
}


int num[3]{-1};
num[0] = num[1] = num[2] = -1;
int32_t main() {
	
   int N,M;
   
   cin >> N>>M; 
   
   for(int i=0; i<M; i++){
   	
   		int s,c;
   		
   		cin >> s >> c;  		
   		
   	 	if(num[s-1] != -1 && num[s-1] != c){
   	 		cout << "-1" << endl;
   	 		return 0;
		}			
   	
   		num[s-1] = c;
   }
   
   if(num[0] == 0 && N>1){
   		cout << "-1" << endl;
   }
   else{
   		if(N==0 && num[0]==-1){
   			cout << 0 << endl;
		   }
   		else{
		   
   		
	   		for(int i =0; i<N;i++){
	   			
	   			if(num[i] ==-1 && i==0){
	   				cout << 1;
				}
	   			else{
	   				if(num[i] == -1)
	   					cout << 0 ;
	   				else
	   					cout << num[i];
				}	
	   			
			}
  		 }
   }
}

Compiler output:
a.cc:36:1: error: 'num' does not name a type; did you mean 'enum'?
   36 | num[0] = num[1] = num[2] = -1;
      | ^~~
      | enum
Language: C++

#include <iostream>
#include <cmath>
#include <stdint.h>
#include <iomanip>
#include <vector>
#include<algorithm>
#include <queue>
using namespace std;
 
#define int long long
#define INF 1001001001

int arr[200001];
 
int nChoosek( int n, int k )
{
    if (k > n) return 0;
    if (k * 2 > n) k = n-k;
    if (k == 0) return 1;

    int result = n;
    for( int i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

int choose2(int n){
	
	return n*(n-1)/2;
}


int num[3]{-1};
num [0] = num[1] = num[2] = -1;
int32_t main() {
	
   int N,M;
   
   cin >> N>>M; 
   
   for(int i=0; i<M; i++){
   	
   		int s,c;
   		
   		cin >> s >> c;  		
   		
   	 	if(num[s-1] != -1 && num[s-1] != c){
   	 		cout << "-1" << endl;
   	 		return 0;
		}			
   	
   		num[s-1] = c;
   }
   
   if(num[0] == 0 && N>1){
   		cout << "-1" << endl;
   }
   else{
   		if(N==0 && num[0]==-1){
   			cout << 0 << endl;
		   }
   		else{
		   
   		
	   		for(int i =0; i<N;i++){
	   			
	   			if(num[i] ==-1 && i==0){
	   				cout << 1;
				}
	   			else{
	   				if(num[i] == -1)
	   					cout << 0 ;
	   				else
	   					cout << num[i];
				}	
	   			
			}
  		 }
   }
}

Compiler output:
a.cc:36:1: error: 'num' does not name a type; did you mean 'enum'?
   36 | num [0] = num[1] = num[2] = -1;
      | ^~~
      | enum
Language: C++

#include <iostream>
#include <cmath>
#include <stdint.h>
#include <iomanip>
#include <vector>
#include<algorithm>
#include <queue>
using namespace std;
 
#define int long long
#define INF 1001001001

int arr[200001];
 
int nChoosek( int n, int k )
{
    if (k > n) return 0;
    if (k * 2 > n) k = n-k;
    if (k == 0) return 1;

    int result = n;
    for( int i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

int choose2(int n){
	
	return n*(n-1)/2;
}


int num[3]{-1};

int32_t main() {
	
   int N,M;
   
   cin >> N>>M; 
   
   for(int i=0; i<M; i++){
   	
   		int s,c;
   		
   		cin >> s >> c;  		
   		
   	 	if(num[s-1] != -1){
   	 		cout << "-1" << endl;
   	 		return 0;
		}			
   	
   		nm[s-1] = c;
   }
   
   if(num[0] == 0 && N>1){
   		cout << "-1" << endl;
   }
   else{
   	
   		for(int i =0; i<N;i++){
   			
   			cout << num[i] ;
   			
		}
   	
   }
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:54:17: error: 'nm' was not declared in this scope; did you mean 'tm'?
   54 |                 nm[s-1] = c;
      |                 ^~
      |                 tm
Language: C++

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

int main(){
    int n,m;
    cin >> n >> m;
    vector<P> p(m);
    for(int i = 0; i < m; i++){
        cin >> p[i].first >> p[i].second;
    }
    for(int x = 0; x < 1000; i++){
        int keta = 1;
        int nx = n/10;
        vector<int> d(1,x%10);
        while(nx){
            keta++;
            d.push_back(nx%10);
            nx /= 10;
        }
        if(keta != n) continue;
        bool ok = true;
        reverse(d.begin(), d.end());
        for(int i = 0; i < m; i++){
            if(d[p[i].first - 1] != p[i].second) ok = false;
        }
        if(ok){
            cout << x << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: 'i' was not declared in this scope
   14 |     for(int x = 0; x < 1000; i++){
      |                              ^
Language: C++

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

int main(){
    int n,m;
    cin >> n >> m;
    vector<P> p(m);
    for(int i = 0 i < m; i++){
        cin >> p[i].first >> p[i].second;
    }
    for(int x = 0; x < 1000; i++){
        int keta = 1;
        int nx = n/10;
        vector<int> d(1,x%10);
        while(nx){
            keta++;
            d.push_back(nx%10);
            nx /= 10;
        }
        if(keta != n) continue;
        bool ok = true;
        reverse(d.begin(), d.end());
        for(int i = 0; i < m; i++){
            if(d[p[i].first - 1] != p[i].second) ok = false;
        }
        if(ok){
            cout << x << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before 'i'
   11 |     for(int i = 0 i < m; i++){
      |                  ^~
      |                  ;
a.cc:14:30: error: 'i' was not declared in this scope
   14 |     for(int x = 0; x < 1000; i++){
      |                              ^
Language: C++

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    vector<int> v(N, -1);
    bool ok = true;
    REP(i,M){
        int s, c;
        cin >> s >> c;
        --s;
        if(v[s] == -1){
            v[s] = c;
        }
        else if(v[s] != c){
            ok = false;
        }
    }

    if(!ok) cout << -1 << endl;
    else{
        if(N == 1){
            if(M == 0) cout << 0 << endl;
            else cout << v[0] << endl;
        }
        else{
            if(v[0] == 0) cout << -1 << endl;
            else{
                REP(i,N){
                    if(v[i] != -1) cout << v[i];
                    else{
                        if(i == 0) cout << 1;
                        else cout << 0;
                    }
                }
                cout << endl;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'i' was not declared in this scope
   11 |     REP(i,M){
      |         ^
a.cc:11:5: error: 'REP' was not declared in this scope
   11 |     REP(i,M){
      |     ^~~
Language: C++

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

int main(){
    int N, M;
    int s,c;
    int flg_ne = 0, ans = 0;
    vector<int> the_num{10,10,10};

    std::cin >> N >> M;

    for(int i = 0; i < M; i++){
        std::cin >> s >> c;
        if(the_num[3-N+s-1] == 10){
            the_num[3-N+s-1] = c;
        }else{
            if(the_num[3-N+s-1] != c){
                flg_ne = 1;
                break;
            } 
        }
    }
    if(the_num[3-N]==0){
        if(N != 1){}
            flg_ne = 1;
        }
    }
    if(the_num[0] == 10){
        the_num[0] = 1;
    }
    if(the_num[1] == 10){
        if(N == 2){
            the_num[1] = 1;
        }else{
            the_num[1] = 0;
        }
    }
    if(the_num[2] == 10){
        the_num[2] = 0;
    }

    if(flg_ne == 1){
        std::cout << -1;
    }else{
        if(N == 1){
            std::cout << the_num[2];
        }else if(N == 2){
            std::cout << the_num[1] << the_num[2];
        }else if(N == 3){
            std::cout << the_num[0] << the_num[1] << the_num[2];
        }
    }

}

Compiler output:
a.cc:30:5: error: expected unqualified-id before 'if'
   30 |     if(the_num[0] == 10){
      |     ^~
a.cc:33:5: error: expected unqualified-id before 'if'
   33 |     if(the_num[1] == 10){
      |     ^~
a.cc:40:5: error: expected unqualified-id before 'if'
   40 |     if(the_num[2] == 10){
      |     ^~
a.cc:44:5: error: expected unqualified-id before 'if'
   44 |     if(flg_ne == 1){
      |     ^~
a.cc:46:6: error: expected unqualified-id before 'else'
   46 |     }else{
      |      ^~~~
a.cc:56:1: error: expected declaration before '}' token
   56 | }
      | ^