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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  bool check = 1;
  int i = 0;
  int num[11][2];
  int N, M;
  cin >> N >> M;
  
  for(int i = 0; i < M; i++){
    cin >> N >> M;
  }
    
  for(int i = 0; i < M; i++){
    cin >> num[i][0] >> num[i][1]; 
  }
  
  
  while(check = 1){
    bool kaku = 1;
    string S = to_string(i);
    
    if(S.size() < N) continue;
    for(int j = 0; j < M; j++){
     if(S[num[j]] != num[j]) kaku = 0;
    }
    
    if(kaku = 1){
     cout << i << endl;
      break;
    }
    else i++;
    
  }
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:16: error: invalid conversion from 'int*' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-fpermissive]
   26 |      if(S[num[j]] != num[j]) kaku = 0;
      |           ~~~~~^
      |                |
      |                int*
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1265:28: note:   initializing argument 1 of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
 1265 |       operator[](size_type __pos)
      |                  ~~~~~~~~~~^~~~~
a.cc:26:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |      if(S[num[j]] != num[j]) kaku = 0;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
int main()	{
  int n,m;
  cin>>n>>m;
  vector<pair<int,int>>s[m];
  rep(i,m) {
    cin>> s[i].first >> s[i].second;
  }
  rep(x,1000){
    int nx=x/10;
    vector<int>d(1,x%10);
    while(nx){
      d.push_back(nx%10);
      nx/=10;
    }
    bool ex=false;
    reverse(d.begin(),d.end());
    rep(i,m){
      if(d[s[i].first-1]==s[i].second){
        ex=true;
      }
    }
    if(ex){
      cout<<x<<endl;
      return 0;
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   13 |     cin>> s[i].first >> s[i].second;
      |                ^~~~~
a.cc:13:30: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   13 |     cin>> s[i].first >> s[i].second;
      |                              ^~~~~~
a.cc:25:17: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   25 |       if(d[s[i].first-1]==s[i].second){
      |                 ^~~~~
a.cc:25:32: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   25 |       if(d[s[i].first-1]==s[i].second){
      |                                ^~~~~~
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:8:17: note: to match this '{'
    8 | int main()      {
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
int main()	{
  int n,m;
  cin>>n>>m;
  vector<pair<int,int>>s[m];
  rep(i,m) {
    cin>> s[i].first >> s[i].second;
  }
  rep(x,1000){
    int nx=x/10;
    vector<int>d(1,x%10);
    while(nx){
      d.push_back(nx%10);
      nx/=10;
    }
    reverse(d.begin(),d.end());
    if(d[s[i].first]==s[i].second){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   13 |     cin>> s[i].first >> s[i].second;
      |                ^~~~~
a.cc:13:30: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   13 |     cin>> s[i].first >> s[i].second;
      |                              ^~~~~~
a.cc:23:12: error: 'i' was not declared in this scope
   23 |     if(d[s[i].first]==s[i].second){
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
int main()	{
  int n,m;
  cin>>n>>m;
  vector<pair<int,int>>s[m];
  rep(i,m) {
    cin>> s[i].first >> c[i].second;
  }
  rep(i,1000){
    int nx=x/10;
    vector<int>d(1,x%10);
    while(nx){
      d.push_back(nx%10);
      nx/=10;
    }
    reverse(d.begin(),d.end());
    if(d[s[i].first]==s[i].second){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   13 |     cin>> s[i].first >> c[i].second;
      |                ^~~~~
a.cc:13:25: error: 'c' was not declared in this scope
   13 |     cin>> s[i].first >> c[i].second;
      |                         ^
a.cc:16:12: error: 'x' was not declared in this scope; did you mean 'nx'?
   16 |     int nx=x/10;
      |            ^
      |            nx
a.cc:23:15: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   23 |     if(d[s[i].first]==s[i].second){
      |               ^~~~~
a.cc:23:28: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   23 |     if(d[s[i].first]==s[i].second){
      |                            ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
vector<int>d(3);
void digit(int x){
  int i=0;
  while(x){
    d[i]=x%10;
    x/=10
    i++;
  }
}
int main()	{
  int n,m;
  cin>>n>>m;
  vector<int>s(m),c(m);
  rep(i,m) cin>>s[i]>>c[i];
  for(int x=1;x<1000;x++){
    digit(x);
    rep(i,m){
      rep(j,n){
        if(s[i]==d[j]){
          cout<<x<<endl;
          return 0;
        }
      }
    }
  }
  cout<<-1<<endl;
}

Compiler output:
a.cc: In function 'void digit(int)':
a.cc:13:10: error: expected ';' before 'i'
   13 |     x/=10
      |          ^
      |          ;
   14 |     i++;
      |     ~
Language: C++

#include<bits/stdc++.h>

using namespace std;



int main() {

    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);

   int n,m,x,y;
   int a,b,c;

   cin>>n>>m;

   a = 0;
   b = 0;
   c = 0;

   int flaga = 0, flagb = 0, flagc = 0;
    int flag = 0;

   for(int i=0;i<m;i++){
        cin>>x>>y;

        if(x==1){
            if(flaga == 1){
               if(a != y) flag = 1;
            }

            a = y;
            flaga = 1;
        }
        if(x==2){
            if(flagb == 1){
               if(b != y) flag = 1;
            }

            b = y;
            flagb = 1;
        }
        if(x==3){
            if(flagc == 1){
               if(c != y) flag = 1;
            }
            c = y;
            flagc = 1;
        }

   }

    if(flag==1) {
        cout<<-1<<endl;
        return 0;
    }

   if(n==1){
        cout<<a<<endl;
        return 0;
   }

   if(n==2){
        if(a == 0) cout<<-1<<endl;
        else{

            for(int i=10;i<100;i++){
                int tmp = i;
                int ta = tmp%10;
                tmp /= 10;
                if(tmp == a %% ta==b){
                    cout<<i<<endl;
                    return 0;
                }
            }

        }

        return 0;
   }


    if(a == 0){
        cout<<-1<<endl;
        return 0;
    }

    for(int i=100;i<1000;i++){
        int tmp = i;
        int tc = tmp%10;
        tmp /= 10;
        int tb = tmp%10;
        tmp /= 10;

        if(tc == c && tb == b && tmp==a){
            cout<<i<<endl;
            return 0;
        }

    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:71:30: error: expected primary-expression before '%' token
   71 |                 if(tmp == a %% ta==b){
      |                              ^
Language: C++

#include <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<stw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値

using namespace std;

int main(void){
    int N,M;cin>>N>>M;
    vector<int> digit(N+1,-1);
    int s = 0;
    int alt = 0;
    int ans = 0;
    int end = 0;
    for(int i=0;i<M;i++){
        cin >> s;
        alt = digit[s];
        cin >> digit[s];
        if(alt!=-1&&alt!=digit[s]){
            end = 1;
          break;
        }
        if(digit[1]==0&&N!=1){
            end = 1;
          break;
        }else if(digit[1]==0&&N==1){
            end = 2;
          break:
        }
    }
    if(end==1){
        cout << -1 << endl;
    }else if(end==2){
        cout << 0 << endl;
    }else{
        for(int i=1;i<=N;i++){
            if(digit[i]==-1){
                if(i==1){
                    digit[i] = 1;
                }else{
                    digit[i] = 0;
                }
            }
        }
        for(int i=1;i<=N;i++){
            ans += digit[i]*pow(10,N-i);
        }
        if(M!=0){
            cout << ans << endl;
        }else if(M==0){
            if(N==1){
                cout << 0 << endl;
            }else{
                cout << pow(10,N-1);
            }
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:16: error: expected ';' before ':' token
   31 |           break:
      |                ^
      |                ;
a.cc:31:16: error: expected primary-expression before ':' token
Language: C++

#include <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<stw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値

using namespace std;

int main(void){
    int N,M;cin>>N>>M;
    vector<int> digit(N+1,-1);
    int s = 0;
    int alt = 0;
    int ans = 0;
    int end = 0;
    for(int i=0;i<M;i++){
        cin >> s;
        alt = digit[s];
        cin >> digit[s];
        if(alt!=-1&&alt!=digit[s]){
            end = 1;
          	break;
        }
        if(digit[1]==0&&N!=1){
            end = 1;
          	break;
        }else if(digit[1]==0&&N==1){
            end = 2;
          	break:
        }
    }
    if(end==1){
        cout << -1 << endl;
    }else if(end==2){
        cout << 0 << endl;
    }else{
        for(int i=1;i<=N;i++){
            if(digit[i]==-1){
                if(i==1){
                    digit[i] = 1;
                }else{
                    digit[i] = 0;
                }
            }
        }
        for(int i=1;i<=N;i++){
            ans += digit[i]*pow(10,N-i);
        }
        if(M!=0){
            cout << ans << endl;
        }else if(M==0){
            if(N==1){
                cout << 0 << endl;
            }else{
                cout << pow(10,N-1);
            }
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:22: error: expected ';' before ':' token
   31 |                 break:
      |                      ^
      |                      ;
a.cc:31:22: error: expected primary-expression before ':' token
Language: C++

#include <cstdio>

using namespace std;

int a[10];

int main() {
    int n, m;
    scanf("%d%d", &n, &m);// don't forget &
    for (int i = 1; i <= n; i++) {
        a[i] = -1;
    }
    bool f = true;
    while (m--) {
        int x, y;
        scanf("%d%d", &x, &y);// don't forget &
        if (a[x] != -1 && a[i] != y) {
            f = false;
            continue;
        }
        a[x] = y;
    }
    if (n != 1 && a[1] <= 0) {
        f = false;
    }
    if (!f) {
        puts("-1");
    }else {
        for (int i = 1; i <= n; i++) {
            if (a[i] == -1) {
                a[i] = 0;
            }
            printf("%d", a[i]);
        }
    }
    
    return 0;
}


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

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

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector < set<int> > a(n);
 int d, e;
for (int i = 0; i < m; ++i){
	cin >> d >> e;
	a[d-1].insert(e);
}
if (n == 1 && m == 0){
	cout << 0 << "\n"
	return 0;
}
vector<int> b;
for (int i = 0; i < n; ++i){
	if (i==0){
		if (a[i].empty()){
			b.push_back(1);
		}else if (a[i].size() > 1){
			cout << -1 << "\n";
			return 0;
		}else{
			if(*a[i].begin() == 0){
				cout << -1 << "\n";
				return 0;
			}else{
			b.push_back(*a[i].begin());
			}
		}
	}else{
		if (a[i].size() > 1){
			cout << -1 << "\n";
			return 0;
		}else if (a[i].empty()){
			b.push_back(0);
		}else{
			b.push_back(*a[i].begin());
		}
	}
}
for (int i : b){
	cout << i;
}
cout << "\n";
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: expected ';' before 'return'
   17 |         cout << 0 << "\n"
      |                          ^
      |                          ;
   18 |         return 0;
      |         ~~~~~~
Language: C++

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[] array = new int[3];
    for(int i = 0; i < 3; i++){
      array[i] = -1;
    }
    for(int i = 0; i < m; i++){
      int s = sc.nextInt()-1;
      int c = sc.nextInt();
      if(n!=1&&s==0&&c==0){
        System.out.println(-1);
        return;
      }
      if(array[s] != -1&&array[s] != c){
        System.out.println(-1);
        return;
      }
      if(array[s] == -1){
        array[s] = c;
      }
    }
    for(int i = 0; i < 3; i++){
      if(n != 1&& i == 0 && array[i] == -1){
        array[i] = 1;
      }
      if(array[i] == -1){
        array[i] = 0;
      }
    }
      int num = 0;
      for(int i = 0; i < n; i++){
        if(i != 0){
          num = num*10;
        }
        num = num + array[i];
      }
      System.out.println(num);
    }
  }

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

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

int main() {
  int n , m ;
  cin >> n >> m;
  for (int i = 0; i< m ; i++){
    vector<vector<int>> data(m,vector<int>(2));
    for (int i =0; i<m ; i++){
      for (int j =0 ; j< 2 ; j++){
        cin >> date.at(i).at(j);
      }}
    int ans = 0;
    int add =1;
    for(int i=0; i<n; i++){
      add = add*10;}
    ans =ans + add;
    int kai=0  
    if (data.at(i).at(0)==1&&data.at(i).at(1)==0){
      cout << -1 << endl;
      return 0;}
    for (int i = 0; i<m;i++){
       if (data.at(i).at(1)==1){
    ans = 0;}
      for (int j=0; j<m ;j ++){
        if (data.at(i).at(1)==data.at (j).at(1)&&!(data.at(i).at(2)==data.at(j).at(2))){
          cout << -1 << endl;
          return 0;}}
      
      int new = data.at(i).at(2);
   for (int k =0; k<(n-data.at(i).at(1)); k++){
     new=new*10;}
      for (int j=0; j<m; j++){
         if (data.at(i).at(1)==data.at (j).at(1)&&j<i){
          new =0}
      kai=kai+new;}
      
    }
    cout << kai <<endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'date' was not declared in this scope; did you mean 'data'?
   11 |         cin >> date.at(i).at(j);
      |                ^~~~
      |                data
a.cc:19:5: error: expected ',' or ';' before 'if'
   19 |     if (data.at(i).at(0)==1&&data.at(i).at(1)==0){
      |     ^~
a.cc:30:11: error: expected unqualified-id before 'new'
   30 |       int new = data.at(i).at(2);
      |           ^~~
a.cc:32:9: error: expected type-specifier before '=' token
   32 |      new=new*10;}
      |         ^
a.cc:32:13: error: expected type-specifier before '*' token
   32 |      new=new*10;}
      |             ^
a.cc:35:15: error: expected type-specifier before '=' token
   35 |           new =0}
      |               ^
a.cc:36:18: error: expected type-specifier before ';' token
   36 |       kai=kai+new;}
      |                  ^
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main(){
    int N,M,s,c,ans = -1;
    cin >> N >> M;
    vector<int> a(3,-1);
    REP(i,M){
        cin >> s >> c;
        if(a[s-1] != -1){
            if(a[s-1] == c)// continue;
            else{
                cout << "-1" <<endl;
                return 0;
            }
        }if( N != 1 && (s == 1 && c == 0)){
            cout << "-1" <<endl;
            return 0;
        }else{
            a[s-1] = c;
        }
    }
    ans = 0;
    if(a[N-1] == -1) a[N-1] = 1;
    REP(i,N){
        if(a[i] == -1) a[i] = 0;
        ans += a[i];
        if(i != N-1)ans *= 10;
    }
   
    cout << ans <<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: expected primary-expression before 'else'
   18 |             else{
      |             ^~~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <iterator>
#include <algorithm>
#include <map>
#include <string>
#include <vector>

using namespace std;

int n,m,a[10];

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);

  cin>>n>>m;
    int x,y;
    memset(a,-1,sizeof(a));
    int flag=0;
    for (int i=1;i<=m;i++)
    {
        cin>>x>>y;
        if (a[x]==-1) a[x]=y;
        else if (a[x]!=y) {flag=1;}
    }
    if (flag|| (n>1&&a[1]==0)) puts("-1");
    else
    {
        if (n==1&&a[1]==-1) puts("0");
        else
        {
            if (a[1]==-1) a[1]=1;
            if (a[2]==-1) a[2]=0;
            if (a[3]==-1) a[3]=0;
            for (int i=1;i<=n;i++)
                cout<<a[i];
            cout<<endl;
        }

    }


}


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

#include <bits/stdc++. h> 

using namespace std;

int n,m,a[10];

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);

  cin>>n>>m;
    int x,y;
    memset(a,-1,sizeof(a));
    int flag=0;
    for (int i=1;i<=m;i++)
    {
        cin>>x>>y;
        if (a[x]==-1) a[x]=y;
        else if (a[x]!=y) {flag=1;}
    }
    if (flag|| (n>1&&a[1]==0)) puts("-1");
    else
    {
        if (n==1&&a[1]==-1) puts("0");
        else
        {
            if (a[1]==-1) a[1]=1;
            if (a[2]==-1) a[2]=0;
            if (a[3]==-1) a[3]=0;
            for (int i=1;i<=n;i++)
                cout<<a[i];
            cout<<endl;
        }

    }


}


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

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <iterator>
#include <algorithm>
#include <map>
#include <string>
#include <vector>

using namespace std;

int n,m,a[10];

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);

  cin>>n>>m;
    int x,y;
    memset(a,-1,sizeof(a));
    int flag=0;
    for (int i=1;i<=m;i++)
    {
        cin>>x>>y;
        if (a[x]==-1) a[x]=y;
        else if (a[x]!=y) {flag=1;}
    }
    if (flag|| (n>1&&a[1]==0)) puts("-1");
    else
    {
        if (n==1&&a[1]==-1) puts("0");
        else
        {
            if (a[1]==-1) a[1]=1;
            if (a[2]==-1) a[2]=0;
            if (a[3]==-1) a[3]=0;
            for (int i=1;i<=n;i++)
                cout<<a[i];
            cout<<endl;
        }

    }


}


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

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

using namespace std;

int n,m,a[10];

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);

  cin>>n>>m;
    int x,y;
    memset(a,-1,sizeof(a));
    int flag=0;
    for (int i=1;i<=m;i++)
    {
        cin>>x>>y;
        if (a[x]==-1) a[x]=y;
        else if (a[x]!=y) {flag=1;}
    }
    if (flag|| (n>1&&a[1]==0)) puts("-1");
    else
    {
        if (n==1&&a[1]==-1) puts("0");
        else
        {
            if (a[1]==-1) a[1]=1;
            if (a[2]==-1) a[2]=0;
            if (a[3]==-1) a[3]=0;
            for (int i=1;i<=n;i++)
                cout<<a[i];
            cout<<endl;
        }

    }


}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'memset' was not declared in this scope
   19 |     memset(a,-1,sizeof(a));
      |     ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <vector>
  +++ |+#include <cstring>
    8 |
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> ans(M);

	int anser = 0;

	for (int i = 0;i < M;i++) {
		cin >> s.at(i) >> c.at(i);
		if (ans.at(s.at(i) - 1) == 0) {
			ans.at(s.at(i) - 1) = c.at(i);
		}
	}

	bool can = true;
	for (int i = 0;i < M-1;i++) {
		for (int j = i+1;j < M;j++) {
			if (s.at(i) == s.at(j) && c.at(i) != c.at(j)) {
				can = false;
				break;
			}
		}
		if (!can)
			break;
	}
	if (!can || (N >= 2 && ans.at(0) == 0))
		cout << -1;

	else {
		for (int i = 0;i < M;i++) {
			anser += pow(10, N - 1 - i) * ans.at(i);
		}
		cout << anser;
	}

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

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")

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

#define pb push_back
#define F first
#define S second
#define f(i,a,b)  for(int i = a; i < b; i++)
#define endl '\n'
using ll = long long;
#define int ll
using db = long double;
using ii = pair<int, int>;

const int N = 1e5 + 5, LG = 19, MOD = 998244353;
const int SQ =320;
const long double EPS = 1e-7;
set<int>st[10];
int32_t main(){
#ifdef ONLINE_JUDGE
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif
  int n,m;
  cin>>n>>m;
  for(int i = 0, s, c;i<m;i++){
      cin>>s>>c;
    st[s].insert(c);
  }
  f(i,1,n+1)if(st[i].size()>1){
    cout<<-1<<'\n';
    return 0;
  }
  if(st[1].count(0)){
    cout<<-1<<'\n'
    return 0;
  }

  f(i,1,n+1){
    if(st[i].empty())
      cout<<0+(i==1);
    else
      cout<<*st[i].begin();
  }

  return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:37:19: error: expected ';' before 'return'
   37 |     cout<<-1<<'\n'
      |                   ^
      |                   ;
   38 |     return 0;
      |     ~~~~~~
Language: C++

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

using namespace std;


int main() {
    int N, M;
    int si, ci;
    bool ans = false;
    cin >> N >> M;
    vector<pair<int, int>> p(M);
    rep(i, M) cin >> p[i].first >> p[i].second;
    rep(x, 1000) {
        int keta = 1;
        int nx = x / 10;
        vector<int> d(1, x % 10);
        while (nx > 0) {
            keta++;
            d.push_back(nx % 10);
            nx /= 10;
        }
        if (keta != N)continue;
        bool ok = true;
        reverse(d.begin(), d.end());
        rep(i, M) {
            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:30:9: error: 'reverse' was not declared in this scope
   30 |         reverse(d.begin(), d.end());
      |         ^~~~~~~
Language: C

#include<stdio.h>
int main(void){
  int n,m,i;
  scanf("%d%d",&n,&m);
  int s,c;
  int a[3]={-1,-1,-1};
  for(i=0;i<m;i++){
    scanf("%d%d",&n,&m);
    if(a[s-1]!=&&a[s-1]!=c){
      printf("-1");
      return 0;
    }
  a[s-1]=c;
  }
  if(n!=1&&a[0]==0){
    printf("-1");
    return 0;
  }
  if(n==1&&a[0]==-1) a[0]=0;
  if(n!=1&&a[0]==-1) a[0]=1;
  for(i=0;i<n;i++){
    if(a[i]==-1) printf("0");
    else printf("%d",a[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:14: warning: comparison between pointer and integer
    9 |     if(a[s-1]!=&&a[s-1]!=c){
      |              ^~
main.c:9:19: error: expected ')' before '[' token
    9 |     if(a[s-1]!=&&a[s-1]!=c){
      |       ~           ^
      |                   )
main.c:9:5: error: label 'a' used but not defined
    9 |     if(a[s-1]!=&&a[s-1]!=c){
      |     ^~
Language: C++

#include<stdio.h>
int main(void){
  int n,m,i;
  scanf("%d%d",&n,&m);
  int s,c;
  int a[3]={-1,-1,-1};
  for(i=0;i<m;i++){
    scanf("%d%d",&n,&m);
    if(a[s-1]!=&&a[s-1]!=c){
      printf("-1");
      return 0;
    }
  a[s-1]=c;
  }
  if(n!=1&&a[0]==0){
    printf("-1");
    return 0;
  }
  if(n==1&&a[0]==-1) a[0]=0;
  if(n!=1&&a[0]==-1) a[0]=1;
  for(i=0;i<n;i++){
    if(a[i]==-1) printf("0");
    else printf("%d",a[i]);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(a[s-1]!=&&a[s-1]!=c){
      |        ~~~~~~^~~~~
a.cc:9:19: error: expected ')' before '[' token
    9 |     if(a[s-1]!=&&a[s-1]!=c){
      |       ~           ^
      |                   )
a.cc:9:18: error: label 'a' used but not defined
    9 |     if(a[s-1]!=&&a[s-1]!=c){
      |                  ^
Language: C++

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


int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n, m;
    cin>>n>>m;
    pait<int, int> p[m];
    loop(m){
        cin>>p[i].first>>p[i].second;
    }

    string s;
    bool ok = 1;
    int r, q;
    for(int j = 0; j<1000; j++){
        ok = 1;
        s = to_string(j);
        if(s.size() != n) continue;

        loop(m){
            r = p[i].first - 1;
            q = p[i].second;
            if(s[r] != '0'+q){
                ok = false;
            }
        }

        if(ok){
            cout<<j<<"\n";
            return 0;
        }
    }
    cout<<-1<<"\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'pait' was not declared in this scope
   13 |     pait<int, int> p[m];
      |     ^~~~
a.cc:13:10: error: expected primary-expression before 'int'
   13 |     pait<int, int> p[m];
      |          ^~~
a.cc:15:14: error: 'p' was not declared in this scope
   15 |         cin>>p[i].first>>p[i].second;
      |              ^
a.cc:27:17: error: 'p' was not declared in this scope
   27 |             r = p[i].first - 1;
      |                 ^
Language: C++

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


int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);

    bool ok = 1;
    int n, m, index;
    char x;
    cin>>n>>m;
    string num = "";
    loop(n) num.push_back('0');
    num[0] = '1';

    loop(m){
        cin>>index>>x;
        if(index != 1 && num[index-1] != '0') ok = 0;
        else(num[index-1] = x;)
    }

    if(n==1 && num=="0"){
        cout<<0<<"\n";
        return 0;
    }

    if(!ok || num[0]=='0') cout<<-1<<"\n";
    else cout<<num<<"\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:30: error: expected ')' before ';' token
   22 |         else(num[index-1] = x;)
      |             ~                ^
      |                              )
a.cc:22:31: error: expected primary-expression before ')' token
   22 |         else(num[index-1] = x;)
      |                               ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
#define rep(i, N) for (int i=0; i<(int)N; i++)
#define rep1(i, N) for (int i=1; i<(int)N; i++)

using namespace std;

int N, M;

int main() {
  cin >> N >> M;
  int s[M], c[M];
  rep(i, M) {
    cin >> s[i] >> c[i];
  }
 
  int ans = -1;
  int count_correct;
  for (int i = pow(10, N-1); i < pow(10, N); i++) {
    count_correct = 0;
    rep(j, M) {
      int k = floor(i / pow(10, (N-s[j])));
      if (k%10 == c[j]) {
        count_correct++;
      }
    }
    if (count_correct == M) ans = i;
    if (ans != -1) break;
  }
  if(N==1 && c[0]==0) {
    ans = 0
  }
  
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:12: error: expected ';' before '}' token
   37 |     ans = 0
      |            ^
      |            ;
   38 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
#include <unordered_map>

using namespace std;
typedef long long int ll;
typedef long double ld;
#define REP(i, n) for(ll i = 0LL; i < (ll)(n); i++)
#define REPR(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define FOR(i, n, m) for(ll i = (ll)n; i < (ll)(m); i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL << 62)

#define PI (acos(-1))
#define PRINT(x) cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll countDigit(ll n) { return floor(log10(n) + 1); } 
typedef pair <ll,ll> P;
static const ll dy[4] = {0,1,0,-1}, dx[4] = {1,0,-1,0};

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    for (int i = 0; i < (int)v.size(); ++i) os << v[i] << " ";  
    return os; 
}

template <typename T1, typename T2> 
ostream& operator<<(ostream& os, const map<T1, T2>& m) 
{ 
    for (auto p : m) os << "<" << p.first << ", " << p.second << "> "; 
    return os; 
}

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

    string tmp = to_string(0);
    bool flag = false;
    for(P p : vec) {
        if(tmp[p.first-1] - '0' != p.second) {
            flag = true;
        }
    }
    if (!flag) {
        PRINT(i);
        return 0;
    }

    FOR(i, pow(10, N-1), pow(10, N)) {
        string tmp = to_string(i);
        bool flag = false;
        for(P p : vec) {
            if(tmp[p.first-1] - '0' != p.second) {
                flag = true;
            }
        }
        if (!flag) {
            PRINT(i);
            return 0;
        }
    }
    PRINT(-1);
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:56:15: error: 'i' was not declared in this scope
   56 |         PRINT(i);
      |               ^
a.cc:15:26: note: in definition of macro 'PRINT'
   15 | #define PRINT(x) cout << x << endl
      |                          ^
Language: C++

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

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> vi(n, 0);
    vector<vector<int>　> a(m, vector<int>(2));
    vector<int> b(n, 0);
    for (int i = 0; i < m; i++)
    {
        int s, t;
        if (b[s - 1] == 0)
            b[s - 1] = 1;
        else
        {
            cout << -1 << endl;
            return 0;
        }
        cin >> s >> t;
        vi[s - 1] = t;
    }
    if (n == 1 && vi[0] == 0)
    {
        cout << 0 << endl;
        return 0;
    }
    if (vi[0] != 0)
    {
        for (int i = 0; i < n; i++)
            cout << vi[i];
        cout << "\n";
        return 0;
    }
    cout << -1 << endl;
}


Compiler output:
a.cc:9:23: error: extended character 　 is not valid in an identifier
    9 |     vector<vector<int>　> a(m, vector<int>(2));
      |                       ^
a.cc: In function 'int main()':
a.cc:9:25: error: template argument 1 is invalid
    9 |     vector<vector<int>　> a(m, vector<int>(2));
      |                         ^
a.cc:9:25: error: template argument 2 is invalid
a.cc:9:46: error: expression list treated as compound expression in initializer [-fpermissive]
    9 |     vector<vector<int>　> a(m, vector<int>(2));
      |                                              ^
a.cc:9:32: error: cannot convert 'std::vector<int>' to 'int' in initialization
    9 |     vector<vector<int>　> a(m, vector<int>(2));
      |                                ^~~~~~~~~~~~~~
      |                                |
      |                                std::vector<int>
Language: Java

import java.util.*;

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];
        int[] c = new int[m];
        int[] ans = new int[n];
        Arrays.fill(ans,-1);
        int range = Math.pow(10,n);
        for(int i = 0;i < m;i++){
            s[i] = sc.nextInt()-1;
            c[i] = sc.nextInt();
        }
            

        for(int i = 0;i <= range;i++){
            String str = String.valueOf(i);
            if(str.length()==n){
                boolean flag = true;
                for(int j=0;j<m;j++){
                    flag = flag&&(str.charAt(s[j])==c[j]+'0');
                }
                if(flag){
                    System.out.println(i);
                    return;
                }
            }
        }
        System.out.println(-1);
    }
}

Compiler output:
Main.java:12: error: incompatible types: possible lossy conversion from double to int
        int range = Math.pow(10,n);
                            ^
1 error
Language: C++

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

int main() {

	int n, m;

	cin >> n >> m;

	int s[5];
	int b[15];

	for (int i = 0; i < m; i++) {
		cin >> s[i];
		cin >> b[i];
	}
	
	for (int i = 0; i < 1000; i++) {
		for (int j = 0; j < 10; j++) {
			if (i.at(s[0]) == b[j] && i.at(s[1]) == b[j]) {
				if (i.at(s[2]) == b[j]) {
					cout << i << endl;
					return 0;
				}
			}
		}
	}

	cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:31: error: request for member 'at' in 'i', which is of non-class type 'int'
   20 |                         if (i.at(s[0]) == b[j] && i.at(s[1]) == b[j]) {
      |                               ^~
a.cc:20:53: error: request for member 'at' in 'i', which is of non-class type 'int'
   20 |                         if (i.at(s[0]) == b[j] && i.at(s[1]) == b[j]) {
      |                                                     ^~
a.cc:21:39: error: request for member 'at' in 'i', which is of non-class type 'int'
   21 |                                 if (i.at(s[2]) == b[j]) {
      |                                       ^~
Language: C++

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

int main() {

	int n, m;

	cin >> n >> m;

	int s[5];
	int b[15];

	for (int i = 0; i < m; i++) {
		cin >> s[i];
		cin >> b[i];
	}
	
	for (int i = 0; i < 1000; i++) {
		for (int j = 0; j < 10; j++) {
			if (i.at(s[0]) == b[j] && i.at(s[1]) == b[j] && i.at(s[2]) == b[j]) {
				cout << i << endl;
				return 0;
			}
		}
	}

	cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:31: error: request for member 'at' in 'i', which is of non-class type 'int'
   20 |                         if (i.at(s[0]) == b[j] && i.at(s[1]) == b[j] && i.at(s[2]) == b[j]) {
      |                               ^~
a.cc:20:53: error: request for member 'at' in 'i', which is of non-class type 'int'
   20 |                         if (i.at(s[0]) == b[j] && i.at(s[1]) == b[j] && i.at(s[2]) == b[j]) {
      |                                                     ^~
a.cc:20:75: error: request for member 'at' in 'i', which is of non-class type 'int'
   20 |                         if (i.at(s[0]) == b[j] && i.at(s[1]) == b[j] && i.at(s[2]) == b[j]) {
      |                                                                           ^~
Language: C

#include<stdio.h>

int main(){
  int n,m; scanf("%d%d",&n,&m); int a[m][2], b[n];
  for(int i=0; i<m; i++){
    scanf("%d%d",&a[i][0],&a[i][1]);
  }
  
  for (int i=0; i<n; i++) b[i]=0;
  int ans=0;
  if(a[i][0]==1 && a[i][1]==0) ans=-1;
  for(int i=0; i<m; i++){
    if (b[a[i][0]-1]==0){
      b[a[i][0]-1]=a[i][1];
    }
    else{
      if (b[a[i][0]-1]==a[i][1]) continue;
      else ans = -1;
    }
  }
  if (b[0]==0) b[0]=1;
  if (ans==-1) printf("-1\n");
  else{
    for(int i=0; i<n; i++)printf("%d",b[i]);
    printf("\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:8: error: 'i' undeclared (first use in this function)
   11 |   if(a[i][0]==1 && a[i][1]==0) ans=-1;
      |        ^
main.c:11:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(){
  int n,m; scanf("%d%d",&n,&m); int a[m][2], b[n];
  for(int i=0; i<m; i++){
    scanf("%d%d",&a[i][0],&a[i][1]);
  }
  
  for (int i=0; i<n; i++) b[i]=0;
  int ans=0;
  if(a[i][0]==1 && a[i][1]==0) ans=-1;
  for(int i=0; i<m; i++){
    if (b[a[i][0]-1]==0){
      b[a[i][0]-1]=a[i][1];
    else{
      if (b[a[i][0]-1]==a[i][1]) continue;
      else ans = -1;
    }
  }
  if (b[0]==0) b[0]=1;
  if (ans==-1) printf("-1\n");
  else{
    for(int i=0; i<n; i++)printf("%d",b[i]);
    printf("\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:8: error: 'i' undeclared (first use in this function)
   11 |   if(a[i][0]==1 && a[i][1]==0) ans=-1;
      |        ^
main.c:11:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:5: error: expected '}' before 'else'
   15 |     else{
      |     ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<map>

using namespace std;


int main() {
	int n, m;
	int s, c;

	cin >> n >> m;
	vector<int> checker(n);
	for (int i = 0; i < n; i++) checker[i] = -1;

	for (int i = 0; i < m; i++) {
		cin >> s >> c;
		if (s == 1 && c == 0) {
			cout << "-1" << endl;
			return 0;
		}

		if (checker[s - 1] == -1) {
			checker[s - 1] = c;
		}
		else if (checker[s-1] != c) {
			cout << "-1" << endl;
			return 0;
		}
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (checker[i] == -1) checker[i] = 0;
		ans += checker[i] * pow(10, n - i - 1);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:37: error: 'pow' was not declared in this scope
   34 |                 ans += checker[i] * pow(10, n - i - 1);
      |                                     ^~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
int n,m;
cin >> n >> m;
int s;
char c;
char ans[n]={-1};

bool flg = true;
REP(i,m) {
  cin >> s >> c;
  if(ans[s-1]==-1||ans[s-1]==c) {
    ans[s-1]=c;
  } else {
    flg = false;
  }
}
if(ans[0]==0) flg=false;
if(flg==true) {
  REP(i,n) {
    if(ans[i]==-1) {
      if(i==0) {
        cout << "1";
      } else {
        cout << "0";
      } else {
        cout << ans[i];
      }
    }
  }
  cout << endl;
} else {
  cout << "-1" << endl;
}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: expected '}' before 'else'
   36 |       } else {
      |         ^~~~
a.cc:31:20: note: to match this '{'
   31 |     if(ans[i]==-1) {
      |                    ^
a.cc: At global scope:
a.cc:42:3: error: expected unqualified-id before 'else'
   42 | } else {
      |   ^~~~
a.cc:45:1: error: expected unqualified-id before 'return'
   45 | return 0;
      | ^~~~~~
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
int n,m;
cin >> n >> m;
int s;
char c;
char ans[n]={-1};

bool flg = true;
REP(i,m) {
  cin >> s >> c;
  if(ans[s-1]==-1||ans[s-1]==c) {
    ans[s-1]=c;
  } else {
    flg = false;
  }
}
if(s[0]==0) flg=false;
if(flg==true) {
  REP(i,n) {
    if(s[i]==-1) {
      if(i==0) {
        cout << "1";
      } else {
        cout << "0";
      } else {
        cout << s[i];
      }
    }
  }
  cout << endl;
} else {
  cout << "-1" << endl;
}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: invalid types 'int[int]' for array subscript
   28 | if(s[0]==0) flg=false;
      |     ^
a.cc:31:9: error: invalid types 'int[int]' for array subscript
   31 |     if(s[i]==-1) {
      |         ^
a.cc:36:9: error: expected '}' before 'else'
   36 |       } else {
      |         ^~~~
a.cc:31:18: note: to match this '{'
   31 |     if(s[i]==-1) {
      |                  ^
a.cc:37:18: error: invalid types 'int[int]' for array subscript
   37 |         cout << s[i];
      |                  ^
a.cc: At global scope:
a.cc:42:3: error: expected unqualified-id before 'else'
   42 | } else {
      |   ^~~~
a.cc:45:1: error: expected unqualified-id before 'return'
   45 | return 0;
      | ^~~~~~
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <utility>
#include <map>
 
int main()
{
  	int n, m;
  	std::cin >> n >> m;
  	std::vector<int> ans(n);
  	for(auto &e:ans){
      e = -1;
    }
  	int dig;
	int val;
  	bool illegal = false;
  	int min=6;
  	for(int i=0;i<m;i++)
    {  	
      	std::cin >> dig >> val;
      	if(ans[dig-1] != -1 && ans[dig-1] != val)
        {
          	illegal = true;
          	break;
        }
      	if(val!=0) min = std::min(min, dig-1);
      	ans[dig-1] = val;
    }
  	for(int i=0;i<min && m!=0;i++)
    {
      	if(ans[i] == 0)
        {
          	illegal = true;
			break;
        }
    }
  	if(illegal || (n > 1 && m == 0))
    {
      	std::cout << -1 << "\n";
    }
  	else
    {
      	for(int i=0;i<n;i++)
    	{
      		std::cout << ((ans[i] == -1) ? 0 : ans[i]);
    	}
  		std::cout << "\n";
    }
  	return 0;
}#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <utility>
#include <map>
 
int main()
{
  	int n, m;
  	std::cin >> n >> m;
  	std::vector<int> ans(n);
  	for(auto &e:ans){
      e = -1;
    }
  	int dig;
	int val;
  	bool illegal = false;
  	int min=6;
  	for(int i=0;i<m;i++)
    {  	
      	std::cin >> dig >> val;
      	if(ans[dig-1] != -1 && ans[dig-1] != val)
        {
          	illegal = true;
          	break;
        }
      	if(val!=0) min = std::min(min, dig-1);
      	ans[dig-1] = val;
    }
  	for(int i=0;i<min && m!=0;i++)
    {
      	if(ans[i] == 0)
        {
          	illegal = true;
			break;
        }
    }
  	if(illegal || (n > 1 && m == 0))
    {
      	std::cout << -1 << "\n";
    }
  	else
    {
      	for(int i=0;i<n;i++)
    	{
      		std::cout << ((ans[i] == -1) ? 0 : ans[i]);
    	}
  		std::cout << "\n";
    }
  	return 0;
}

Compiler output:
a.cc:52:2: error: stray '#' in program
   52 | }#include <iostream>
      |  ^
a.cc:52:3: error: 'include' does not name a type
   52 | }#include <iostream>
      |   ^~~~~~~
Language: C++

#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <algorithm>
using namespace std;
#define x first
#define y second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define ll long long
#define ld long double
#define ii pair<int,int>
#define ull unsigned long long
#define all(k) k.begin(),k.end()
#define rall(k) k.rbegin(),k.rend()
#define db(x) cerr<<#x<<" = "<<x<<endl
#define len(v) ((int)v.size())
#define endl '\n'



void solve(){
  int n,m;
  cin>>n>>m;
  vector<int> a(n,-1);
  vector<ii> regras;
  while(m--){
    int s,c;
    cin>>s>>c;
    regras.pb({s,c});
    a[s-1]=c;
  }

  for(auto &p : regras){
    if(a[p.x-1]!=p.y){
      cout<<-1<<endl;
      return;
    }
  }

  if(a[0]==-1) a[0]=1;
  for(int i=1;i<n;i++) if(v[i]==-1) v=0;

  if(a[0]==0 and n!=1){
    cout<<-1<<endl;
    return;
  }

  for(auto &v : a) cout<<v;
  cout<<endl;

}
int32_t main(){
  ios::sync_with_stdio(0); cin.tie(0);
  int t; 
#ifdef TESTCASE
  cin>>t;
#else 
  t = 1;
#endif
  while(t--) solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:48:27: error: 'v' was not declared in this scope
   48 |   for(int i=1;i<n;i++) if(v[i]==-1) v=0;
      |                           ^
Language: C++

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

int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> a;
  rep(i,m) {
    cin >> a[i].first >> a[i].second;
  }
  
  rep(x,1000) {
    int keta = 1;
    vector<int> d(1,x%10);
    int xx = x/10;
    while(xx) {
      keta++;
      d.push_back(xx%10);
      xx /= 10;
    }
    reverse(d.begin(),d.end());
    
    if(keta == n) {
      bool ok = true;
      rep(i,m) if(d[a[i].first-1] != a[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:29:8: error: 'ok' was not declared in this scope
   29 |     if(ok) {
      |        ^~
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: expected unqualified-id before ')' token
   29 |     if(bool) {
      |            ^