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

#include<bits/stdc++.h>
using namespace std;
template <typename T> using vec = vector<T>;

int main()
{
    int n,m;
    cin >> n >> m;
    bool flag = true;
    vec<int> num(n,-1);
    int s,c;
    while(cin >> s >> c)
    {
        s--;
        if (num[s]!= -1 and num[s] != c)
        {
            flag = false;
            break;
        }
        else
        {
            num[s] = c;
        }
    }
    if (flag)
    {
        s[0] = max(s[0],1);
        for (auto &&e : num)
        {
            e = max(0,e);
        }
        auto sum = accumulate(num.begin(),num.end(),0,[](auto a,autob)
        {
            return a*10+b;
        })
        cout << sum << endl;
    }
    else
    {
        cout << -1 << endl;
    }
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: invalid types 'int[int]' for array subscript
   27 |         s[0] = max(s[0],1);
      |          ^
a.cc:27:21: error: invalid types 'int[int]' for array subscript
   27 |         s[0] = max(s[0],1);
      |                     ^
a.cc:32:65: error: 'autob' has not been declared
   32 |         auto sum = accumulate(num.begin(),num.end(),0,[](auto a,autob)
      |                                                                 ^~~~~
a.cc: In lambda function:
a.cc:34:25: error: 'b' was not declared in this scope
   34 |             return a*10+b;
      |                         ^
a.cc: In function 'int main()':
a.cc:36:9: error: expected ',' or ';' before 'cout'
   36 |         cout << sum << endl;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N,M;
    cin>>N>>M;
    
    vector<pair<int,int>> r(M);
    for(int i=0;i<N;++i){
        int s,c;
        cin>>s>>c;
        --s;
        r[i]=make_pair(s,c);
    }
    sort(r.begin(),r.end(),);
    r.erase(unique(r.begin(),r.end()),r.end());
    
    bool ok=adjacent_find(r.begin(),r.end(),[](auto a,auto b){return a.first==b.first;})==r.end();

    if(!ok){
        cout<<"-1"<<endl;
    }else{
        string ans=string(N,'0');
        if(N!=1)ans[0]='1';
        for(const auto &x:r){
            cout<<x.first<<" "<<x.second<<endl;
            ans[x.first]=x.second+'0';
        }
        if(ans[0]=='0')cout<<"-1"<<endl;
        else cout<<ans<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:28: error: expected primary-expression before ')' token
   14 |     sort(r.begin(),r.end(),);
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
  int n, m;
  cin>>n>>m;
  string s;
  rep(i, n) s.at(i)="a";
  bool ans=true;
  rep(i, m) {
    cin << t << u;
    if(s.at(t-1)=="a"||s.at(t-1)==u) s.at(t-1)=u;
    else ans=false;
  }
  if(s.at(0)=="0") ans==false;
  if(ans==true) {
    if(s.at(0)=="a") cout << "1";
    else cout << s.at(0);
    
    for(int i=1; i<=n; i++) {
      if(s.at(i)=="a") cout << "0";
      else cout << s.at(i);
    }
  }
  else cout << -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    9 |   rep(i, n) s.at(i)="a";
      |                     ^~~
      |                     |
      |                     const char*
a.cc:12:12: error: 't' was not declared in this scope
   12 |     cin << t << u;
      |            ^
a.cc:12:17: error: 'u' was not declared in this scope
   12 |     cin << t << u;
      |                 ^
a.cc:16:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |   if(s.at(0)=="0") ans==false;
      |      ~~~~~~~^~~~~
a.cc:18:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |     if(s.at(0)=="a") cout << "1";
      |        ~~~~~~~^~~~~
a.cc:22:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |       if(s.at(i)=="a") cout << "0";
      |          ~~~~~~~^~~~~
Language: C++

int N, M;
vector<int> s, c;

bool ok(string str) {
    if (str.size() != N) return false;
    for (int i = 0; i < M; ++i) if (str[s[i]] != (char)(c[i] + '0')) return false;
    return true;
}

string solve() {
    for (int i = 0; i <= 999; ++i) {
        stringstream iss; iss << i;
        string str = iss.str();
        if (ok(str)) return str;
    }
    return "-1";
}

int main() {
    cin >> N >> M;
    s.resize(M); c.resize(M);
    for (int i = 0; i < M; ++i) cin >> s[i] >> c[i], --s[i];
    cout << solve() << endl;
}

Compiler output:
a.cc:2:1: error: 'vector' does not name a type
    2 | vector<int> s, c;
      | ^~~~~~
a.cc:4:9: error: 'string' was not declared in this scope
    4 | bool ok(string str) {
      |         ^~~~~~
a.cc:10:1: error: 'string' does not name a type
   10 | string solve() {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:20:5: error: 'cin' was not declared in this scope
   20 |     cin >> N >> M;
      |     ^~~
a.cc:21:5: error: 's' was not declared in this scope
   21 |     s.resize(M); c.resize(M);
      |     ^
a.cc:21:18: error: 'c' was not declared in this scope
   21 |     s.resize(M); c.resize(M);
      |                  ^
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout << solve() << endl;
      |     ^~~~
a.cc:23:13: error: 'solve' was not declared in this scope
   23 |     cout << solve() << endl;
      |             ^~~~~
a.cc:23:24: error: 'endl' was not declared in this scope
   23 |     cout << solve() << endl;
      |                        ^~~~
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,k;
    k=0;
    cin >> n >> m ;
    vector <int> s(m),c(m);
    string newans="";
    
    rep(i,m){
        cin >> s[i] >> c[i];
    }

    vector <int> ans(n+1,-1);

    rep(i,m){
        
        if (ans[s[i]]!=-1 and ans[s[i]]!=c[i]){
            k=1;
            break;
        }
        else{
            ans[s[i]]=c[i];
        }
    }

    
    if (ans[1]==0){
        k=2;
    }
    if (ans[1]==-1){
        ans[1]=1;
    }
    if (k==0){
        rep(i+1,n){
            if (ans[i+1]==-1){
                ans[i+1]=0;
            }
            
            newans=newans+to_string(ans[i+1]);
        }
        cout << newans << endl;
    }
    else{
        cout << -1 << endl;
    }
    

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:14: error: expected ';' before '+' token
   39 |         rep(i+1,n){
      |              ^
a.cc:2:27: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i=0; i<(n); ++i)
      |                           ^
a.cc:39:14: error: lvalue required as left operand of assignment
   39 |         rep(i+1,n){
      |              ^~
a.cc:2:27: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i=0; i<(n); ++i)
      |                           ^
a.cc:2:37: error: expected ')' before ';' token
    2 | #define rep(i,n) for (int i=0; i<(n); ++i)
      |                      ~              ^
a.cc:39:9: note: in expansion of macro 'rep'
   39 |         rep(i+1,n){
      |         ^~~
a.cc:39:13: error: 'i' was not declared in this scope
   39 |         rep(i+1,n){
      |             ^
a.cc:2:41: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i=0; i<(n); ++i)
      |                                         ^
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,k;
    k=0;
    cin >> n >> m ;
    vector <int> s(m),c(m);
    string newans="";
    
    rep(i,m){
        cin >> s[i] >> c[i];
    }

    vector <int> ans(n+1,-1);

    rep(i,m){
        
        if (ans[s[i]]!=-1 and ans[s[i]]!=c[i]){
            k=1;
            break;
        }
        else{
            ans[s[i]]=c[i];
        }
    }

    
    if (ans[1]==0 ){
        k=2;
    }
    elif (ans[1]==-1){
        ans[1]=1;
    }
    if (k==0){
        rep(i,n){
            if (ans[i+1]==-1){
                ans[i+1]=0;
            }
            
            newans=newans+to_string(ans[i+1]);
        }
        cout << newans << endl;
    }
    else{
        cout << -1 << endl;
    }
    

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: 'elif' was not declared in this scope
   35 |     elif (ans[1]==-1){
      |     ^~~~
Language: C++

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

int main(){
  int N,M;
  int ju = 1;            //条件を満たす値が存在するかどうか
  cin >> N >> M;
  vector<int> ans(N,0);  //N桁で各桁が0で初期化された整数
  if(N != 1){
    ans.at(0) = 1;
  }
  
  for(int i = 0;i < M;i++){
    int s,c;
    cin >> s >> c;
    s--;
    //一番左の桁が0で答えが0でないとき
    if(s == 0 && c == 0 && N != 1){
      ju = 0;
      break;
    }
    if(  (ans.at(s) == 0)   || (s == 0 && N != 1 && ans.at(s) ==1){
      ans.at(s) = c;
    }else if(ans.at(s) != c){
      ju = 0;
      break;
    }
  }
  
  if(!ju){
    cout << -1;
  }else{
    for(int i = 0;i < N;i++){
      cout << ans.at(i);
    }
  }
  cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:67: error: expected ')' before '{' token
   22 |     if(  (ans.at(s) == 0)   || (s == 0 && N != 1 && ans.at(s) ==1){
      |       ~                                                           ^
      |                                                                   )
a.cc:28:3: error: expected primary-expression before '}' token
   28 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
int main() {
  int N,M;
  cin >> N >> M;
  vector<int>A(M);
  vector<int>B(M);
  rep(i,M){
    cin >> A[i] >> B[i];
  }
  if(N == 1){
    cout << A[0];
  }
  rep(i,M){
    if(N == 1){
      cout << A[0];
      return 0;
    for(int j = 1; j + i < M; j++){
      if(A[i] == A[i + j] && B[i] != B[j]){
        cout << "-1";
        return 0;
      }
    }
  }
  vector<int>C(N);
  rep(i,N){
    C[A[i] - 1] = B[i];
  }
  if(C[N - 1] == 0){
    cout << "-1";
    return 0;
  }
  if(C[0] == 0){
    cout << "0";
    return 0;
  }
  rep(i,N){
    cout << C[i];
  }
}

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

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

int main(){
  int n,m; cin >> n >> m;
  bool ad=1;
  vector<int> ans(n,0),s(m),c(m);
  for(int i=0;i<m;i++){
    cin >> s[i] >> c[i];
  }
  for(int i=0;i<m;i++){
    for(int j=i+1;j<m;j++){
      if((s[i]==s[j]) && (c[i]!=c[j]))ad=0;
    }
  }

  for(int i=0;i<m;i++){
    ans[s[i]-1]=c[i];
    if(s[i]==1 && c[i]==0)ad=0;
  }

  if(ad){
    if(ans[0]==0){
      cout << 1;
      for(int i=1;i<n;i++){
        cout << ans[i];
      }
    }
    else{
      for(int i=0;i<n;i++){
        cout << ans[i];
      }
    }

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

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

int main() { 
  int N, M;
  int s, c;
  cin >> N >> M;
  
  vector<int> n(N, 10);
  
  for(int i = 0; i < M; i++) {
    cin >> s >> c;
    if(n[s-1] == 10 || n[s-1] == c) {
      n[s-1] = c;
    }
    else {
      cout << -1 << endl;
      return 0;
    }
  }
  
  if(n[0] != 10 && n[0] != 0) {
    for(int i  = 0; i < N; i++) {
      if(n[i] == 10)
        cout << 0;
      else
      	cout << n[i];
    }
    cout << endl;
  }
  else if(N == 1)
    cout << n[i];
  else {
    cout << -1 << endl;
  }
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:15: error: 'i' was not declared in this scope
   33 |     cout << n[i];
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int i,j,k,count1=0,count2=0;
int gcd(int,int);
void ABC157();
void ABC158();
void ABC161();
void ABC162();
void ABC163();
void ABC164();

int main(){
    ABC157();
}

void ABC157(){
    int s,c,ans=1;
    int n,m;
    cin>>n>>m;
    vector<int> vec(n,-1);
    //同じ数の場合，何も入ってなかった場合
    for(i=0;i<m;i++){
        cin>>s>>c;
        if(vec[s-1]==-1){
            vec[s-1]=c;
        }
        else if(vec[s-1]!=c){
            ans=0;
        }
    }
    if(n==1&&ans=1){cout<<vec[0]<<endl;}
    else if(ans==1&&vec[0]!=0){
        for(i=0;i<n;i++){
            if(vec[i]==-1&&i==0)cout<<1;
            else if(vec[i]==-1)cout<<0;
            else cout<<vec[i];
        }
        cout<<endl;
    }else{
        cout<<-1<<endl;
    }
}

Compiler output:
a.cc: In function 'void ABC157()':
a.cc:31:12: error: lvalue required as left operand of assignment
   31 |     if(n==1&&ans=1){cout<<vec[0]<<endl;}
      |        ~~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[100050],s[10005],c[10005];
int main()
{
	int n,m;
	cin>>n>>m;
	if(n==1&&m==0)
	{
		cout<<"-1\n";
		break;
	}
	for(int i=1;i<=m;i++)
	{
		cin>>s[i]>>c[i];
	}
	int flag=1;
	for(int i=1;i<=m;i++)
	{
		if(s[i]==1&&c[i]==0&&n>1) 
		{
			flag=0;
			break;
		} 
		for(int j=i+1;j<=m;j++)
		{
			if(s[i]==s[j]&&c[i]!=c[j])
			{
				flag=0;break;
			}
		}
		if(!flag) break;
	}
	if(!flag) cout<<"-1\n";
	else
	{
		for(int i=1;i<=m;i++)
		{
			a[s[i]]=c[i];
		}
		if(a[1]==0) a[1]=1;
		for(int i=1;i<=n;i++)
			cout<<a[i];
		cout<<'\n';
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: break statement not within loop or switch
   11 |                 break;
      |                 ^~~~~
Language: C++

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

int main() {
  int n,m;
  cin >> n >> m;
  vector<vector<int>> data(m, vector<int>(2));
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> data.at(i).at(j);
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < m-i; j++) {
      if(data.at(i).at(0)==data.at(i+j).at(0) && data.at(i).at(1)!=data.at(i+j).at(1)){
      cout << -1 << endl;
      return 0;
      }
      if(n>1 && data.at(i).at(0)==n && data.at(i).at(1)==0){
      	cout << -1 << endl;
        return 0;
      }
    }
  }
  int one=0;
  if(n>1)
  int two=10;
  else
  int two =0;
  if(n>2)
  int thr=100;
  else
  int thr=0;
  for (int i = 0; i < m; i++) {
      if(data.at(i).at(0)==1)
      one = (data.at(i).at(1))*pow(10,n-1);
      if(data.at(i).at(0)==2)
      two = (data.at(i).at(1))*pow(10,n-2);
      if(data.at(i).at(0)==3)
      thr = (data.at(i).at(1));
  }
  cout << one+two+thr << endl;   			
}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:7: error: 'two' was not declared in this scope
   39 |       two = (data.at(i).at(1))*pow(10,n-2);
      |       ^~~
a.cc:41:7: error: 'thr' was not declared in this scope
   41 |       thr = (data.at(i).at(1));
      |       ^~~
a.cc:43:15: error: 'two' was not declared in this scope
   43 |   cout << one+two+thr << endl;
      |               ^~~
a.cc:43:19: error: 'thr' was not declared in this scope
   43 |   cout << one+two+thr << endl;
      |                   ^~~
Language: C++

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

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

	vector<int> s(M);
	vector<int> c(M);

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

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

	map<int, int> ans;
	for (int i = 0; i < M; i++) {
		if (ans.count(s.at(i))) {
			if (c.at(i) <= ans.at(s.at(i))) {
				ans[s.at(i)] = c.at(i);
			}
			else continue;
		}
		else {
			ans[s.at(i)] = c.at(i);
		}
	}

	if (N == 1) {
		if (ans.count(1)) {
			cout << ans.at(1) << endl;
			return 0;
		}
		else {
			cout << 0 << endl;
			return 0;
		}
	}

	if (N == 2) {
			if (ans.count(1) == false) {
				ans[i] = 1;
			}
          if (ans.count(2) == false) {
				ans[i] = 0;
		}
	}
  
  if (N == 3) {
			if (ans.count(1) == false) {
				ans[i] = 1;
			}
          if (ans.count(2) == false) {
				ans[i] = 0;
		}
    if (ans.count(3) == false) {
				ans[i] = 0;
		}
	}

	if (ans.at(1) == 0) {
		cout << -1 << endl;
		return 0;
	}
	else {
		for (int i = 1; i <= N; i++) {
			cout << ans.at(i);
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:37: error: 'i' was not declared in this scope
   56 |                                 ans[i] = 1;
      |                                     ^
a.cc:59:37: error: 'i' was not declared in this scope
   59 |                                 ans[i] = 0;
      |                                     ^
a.cc:65:37: error: 'i' was not declared in this scope
   65 |                                 ans[i] = 1;
      |                                     ^
a.cc:68:37: error: 'i' was not declared in this scope
   68 |                                 ans[i] = 0;
      |                                     ^
a.cc:71:37: error: 'i' was not declared in this scope
   71 |                                 ans[i] = 0;
      |                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,m,y,z;
  cin >> n >> m;
  vector<int> x(n,0);
  for (int i = 0; i < m; i++) {
    cin >> y >> z;
    if(x[y]==10&&x[y]!=z) {
      cout << -1 << endl;
      exit(0);
    }
    if(z==0) {
      if(y==1){
        cout << -1 << endl;
        exit(0);
      }else{
        z=10;
      }
    }
    x[y]=z;
  }
  if(x[1]%==0) x[1]=1;
  for (int i = 1; i < n+1; i++) {
    cout << x[i]%10;
  }
  cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: expected primary-expression before '=' token
   23 |   if(x[1]%==0) x[1]=1;
      |            ^
Language: C

#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

//ABC157C
int main(void) {
  int n, m, k, i, cou=0, tmp;
  scanf(" %d %d", &n, &m);
  int s[m], c[m], num[n];
  for(i=0; i<m; i++){
    scanf(" %d %d", &s[i], &c[i]);
  }

  for(i=0; i<n; i++)
    num[i]=-1;

  for(i=0; i<m; i++){
    if(num[s[i]-1]==-1){
      num[s[i]-1]=c[i];
    }else if(num[s[i]-1]!=c[i]){
      printf("-1");
      return 0;
    }

    if(num[0]==0&&n>1){
      printf("-1");
      return 0;
    }

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

Compiler output:
main.c: In function 'main':
main.c:38:3: error: expected declaration or statement at end of input
   38 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<double> VL;
typedef vector<string> VS;
typedef vector<PLL> VP;
typedef vector<ll> VLL;
#define rep(i,n) for (ll i=0; i<(ll)(n); i++)
#define repd(i,n) for (ll i=n-1; i>=0; i--)
#define rept(i,m,n) for(ll i=m; i<n; i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define PF push_front
#define PB push_back
#define SORT(V) sort((V).begin(), (V).end())
#define RVERSE(V) reverse((V).begin(), (V).end())
#define paired make_pair
#define PRINT(V) for(auto v : (V)) cout << v << " "
int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; } //charを整数に

int main()
{
    int N, M;
    cin >> N >> M;
    VI s(M), c(M);
    rep(i,M){
        cin >> s.at(i) >> c.at(i);
    }
    rep(i,1000){
        int nx;
        int keta=0;
        string d=to_string(i);
        if(d.size()!=N) continue;
        boll ok=true;
        rep(j,M){
            if(d.at(s.at(i)-1)!=c.at(i)) ok=false;
        }
        if(ok){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: 'boll' was not declared in this scope; did you mean 'bool'?
   37 |         boll ok=true;
      |         ^~~~
      |         bool
a.cc:39:42: error: 'ok' was not declared in this scope
   39 |             if(d.at(s.at(i)-1)!=c.at(i)) ok=false;
      |                                          ^~
a.cc:41:12: error: 'ok' was not declared in this scope
   41 |         if(ok){
      |            ^~
Language: C++

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

using namespace std;

int main(int argc, char const *argv[])
{
    int N, M;
    cin >> N >> M;
    string num;
    for (int i = 0; i < N; i++)
    {
        num.push_back('a');
    }

    int s;
    char c;
    for (int i = 0; i < M; i++)
    {
        cin >> s >> c;
        if (num[s - 1] == 'a')
        {
            num[s - 1] = c;
        }else
        {
            if (c != num[s - 1])
            {
                cout << -1 << endl;
                return 0;
            }
            
        }
        
    }

    if (num.size > 1)
    {
        if (num[0] == 'a') num[0] = '1';
        if (num[0] == '0')
        {
            cout << -1 << endl;
            return 0;
        }
        
    }

    for (int i = 1; i < num.size(); i++)
    {
        if (num[i] == 'a') num[i] = '0';
    }
    
    int ans = stoi(num);
    cout << ans << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:38:13: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   38 |     if (num.size > 1)
      |         ~~~~^~~~
      |                 ()
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll; 
int N, M;
int s[10], c[10];
string S;
int ans = 10000000;
void dfs(int num) {
  if(num == N) {
    int count = 1;
    for(int i = 0; i < M; i++) {
    
      if(S[s[i]] != (char)(c[i] + '0')) { count = 0; break; } 
    
    }
    if(S[0] == '0' && N > 1) { count = 0; }
    int t = 0;

    for(int i = 0; i < N; i++) {
      t += (S[i] - '0') * pow(10, N - i - 1);
    }
    if(ans > t && count == 1) { ans = t; }
   
    return;
  }

  for(int i = 0; i < 10; i++) {
    S[num] = to_string(i);
    dfs(num + 1);
  }

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

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

  dfs(0);
  if(ans == 10000000) cout << -1;
  else cout << ans;
 return 0;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:28:23: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   28 |     S[num] = to_string(i);
      |              ~~~~~~~~~^~~
      |                       |
      |                       std::string {aka std::__cxx11::basic_string<char>}
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll; 
int N, M;
int s[10], c[10];
string S;
int ans = 10000000;
void dfs(int num) {
  if(num == N) {
    int count = 1;
    for(int i = 0; i < M; i++) {
    
      if(S[s[i]] != (char)(c[i] + '0')) { count = 0; break; } 
    
    }
    if(S[0] == '0' && N > 1) { count = 0; }
    int t = 0;

    for(int i = 0; i < N; i++) {
      t += (S[i] - '0') * pow(10, N - i - 1);
    }
    if(ans > t && count == 1) { ans = t; }
   
    return;
  }

  for(int i = 0; i < 10; i++) {
    S[num] = to_string(i + '0');
    dfs(num + 1);
  }

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

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

  dfs(0);
  if(ans == 10000000) cout << -1;
  else cout << ans;
 return 0;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:28:23: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   28 |     S[num] = to_string(i + '0');
      |              ~~~~~~~~~^~~~~~~~~
      |                       |
      |                       std::string {aka std::__cxx11::basic_string<char>}
Language: C

#include<iostream>
using namespace std;
int a[5];
int main()
{
    int n,m,i,s,c;
    cin >> n >> m;
    for(i=1;i<=n;i++) a[i] = -1;
    for(i=1;i<=m;i++) {
        cin >> s >> c;
        if(a[s]!=-1&&a[s]!=c) { //check if a value has already been input and if new input is equal to original
            cout << -1 << endl;
            return 0;
        } else {
            a[s] = c;
        }
    }
    if(n>1&&a[1]==0) { //check for leading zero
        cout << -1 << endl;
    }
    else if(n==1) {
        if(a[1]==-1) cout << 0 << endl; //check no input, if 1 digit 0 is allowed
        else cout << a[1] << endl;
    }
    else {
        for(int i=1;i<=n;i++) { //fill no inputs with 1 or 0 to make lowest number possible
            if(i==1&&a[i]==-1) cout << "1";
            else if(a[i]==-1) cout << "0";
            else cout << a[i];
        }
        cout << endl;
    }
    return 0;
}


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

#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<ll, ll>;



int main(){
    int n, m;
    cin >> n >> m;

    vector<P> p;
    rep(i, m){
        int a, b;
        cin >> a >> b;
        p.emplace_back(a, b);
    }

    if(n == 1){
        bool f = true;
        rep(i, m){
            int fst = p[j].first, snd = p[j].second;
            if(now[fst - 1] - '0' != snd)f = false;
        }
        if(f){
            cout << 0;
            return 0;
        }
    }
    for(int i = pow(10, n - 1); i < pow(10, n); i++){
        string now = to_string(i);
        bool f = true;
        rep(j, m){
            int fst = p[j].first, snd = p[j].second;
            if(now[fst - 1] - '0' != snd)f = false;
        }
        if(f){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:49:25: error: 'j' was not declared in this scope
   49 |             int fst = p[j].first, snd = p[j].second;
      |                         ^
a.cc:50:16: error: 'now' was not declared in this scope; did you mean 'pow'?
   50 |             if(now[fst - 1] - '0' != snd)f = false;
      |                ^~~
      |                pow
a.cc:50:38: error: 'snd' was not declared in this scope; did you mean 'std'?
   50 |             if(now[fst - 1] - '0' != snd)f = false;
      |                                      ^~~
      |                                      std
Language: C++

#include <iostream>
#include <vector>
#include <map>
int main()
{
	int N, M;
	std::cin >> N >> M;
	std::map<int, int> answer;
	for (int i = 0; i < N+1; i++)
	{
		answer[i] = -1;
	}
	for (int i = 0; i < M; i++)
	{
		int index, value = 0;
		std::cin >> index >> value;
		if (answer.find(index) != answer.end() && answer[index] != -1 && answer[index] != value)
		{
			std::cout << -1;
			return 0;
		}
		answer[index] = value;
	}
	if (answer[1] == 0)
	{
		std::cout << -1;
		return 0;
	}
	int sum = 0;
	for (int i = 1; i < N + 1; i++)
	{
		if (answer[i] != -1)
			sum += answer[i] * std::pow(10, N - i);
	}
	std::cout << sum;
	return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:31: error: expected ';' before 'for'
    7 |         memset(a,-1,sizeof(a))
      |                               ^
      |                               ;
    8 |         for(int i=1;i<=m;i++)
      |         ~~~                    
a.cc:8:21: error: 'i' was not declared in this scope
    8 |         for(int i=1;i<=m;i++)
      |                     ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int s[10];
int c[10];
int main(){
  int N, M;
  cin >> N >> M;
  for (int i = 0; i < M; i++){
    cin >> s[i];
    cin >> c[i];
  }
  //先頭チェック
  if (N > 1){
    for (int i = 0; i < M; i++){
      if (s[i] == 1 && c[i] == 0){
        cout << -1 << endl;
        return 0;
      }
    }
  }
  //重複チェック
  for (int i = 0; i < M; i++){
    for (int j = 0; j < M; j++){
      if (s[i] == s[j] && s[i] != -1 && i != j){
        if (c[i] != c[j]){
          cout << -1 << endl;
          return 0;
        } else {
          s[i] = -1;
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < M; i++){
    if (s[i] == -1) continue;
    ans += c[i] * pow(10, N - s[i]);
  }
  if (ans == 0){
    assert(N == 1);
    cout << 0 << endl;
    return 0;
  }
  if (ans < pow(10, N - 1)){
    assert(N >= 2);
    ans += pow(10, N - 1);
  }
  assert(ans < pow(10, N));
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:5: error: 'assert' was not declared in this scope
   41 |     assert(N == 1);
      |     ^~~~~~
a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    2 | #include <cmath>
  +++ |+#include <cassert>
    3 | using namespace std;
a.cc:46:5: error: 'assert' was not declared in this scope
   46 |     assert(N >= 2);
      |     ^~~~~~
a.cc:46:5: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
a.cc:49:3: error: 'assert' was not declared in this scope
   49 |   assert(ans < pow(10, N));
      |   ^~~~~~
a.cc:49:3: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
Language: C++

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

int main()
{
 int n,m;
  cin >> n >> m;
	int s[10], c[10];
  for (int i = 0;i < m;i++)
    cin >> s[i] >> c[i];
  
  bool f = true;
  for (int i = pow(1,n-1) - (n == 1), i < pow(1,n); i++)
  {
   for (int j = 0;j < m;j++)
   {
     f &= ((i/pow(1,s[i]-1))%10)==c[i];
   }
    if (f) {
      cout << i << endl;
      break;
    }
  }
  if (!f)
    cout << -1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:40: error: expected ';' before '<' token
   13 |   for (int i = pow(1,n-1) - (n == 1), i < pow(1,n); i++)
      |                                        ^~
      |                                        ;
a.cc:13:41: error: expected primary-expression before '<' token
   13 |   for (int i = pow(1,n-1) - (n == 1), i < pow(1,n); i++)
      |                                         ^
a.cc:17:29: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   17 |      f &= ((i/pow(1,s[i]-1))%10)==c[i];
      |            ~~~~~~~~~~~~~~~~~^~~
      |              |               |
      |              |               int
      |              __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

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

int main()
{
 int n,m;
  cin >> n >> m;
	int s[10], c[10];
  for (int i = 0;i < m;i++)
    cin >> s[i] >> c[i];
  
  bool f = true;
  for (int i = pow(1,n-1), i < pow(1,n); i++)
  {
   for (int j = 0;j < m;j++)
   {
     f &= (i/pow(1,s[i]-1))%10==c[i];
   }
    if (f) {
      cout << i << endl;
      break;
    }
  }
  if (!f)
    cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: expected ';' before '<' token
   13 |   for (int i = pow(1,n-1), i < pow(1,n); i++)
      |                             ^~
      |                             ;
a.cc:13:30: error: expected primary-expression before '<' token
   13 |   for (int i = pow(1,n-1), i < pow(1,n); i++)
      |                              ^
a.cc:17:28: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   17 |      f &= (i/pow(1,s[i]-1))%10==c[i];
      |           ~~~~~~~~~~~~~~~~~^~~
      |             |               |
      |             |               int
      |             __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N,M;
    cin>>N>>M;
    int a[N]={};
    int b[N]={};
    int A,t,q,counter=0;
   for(int i=0;i<M;i++){
   cin>>A>>t;
   if(A==1&&t==0){
   counter++;
   break;}
   else if(b[A-1]==0){
   a[A-1]=t;
   b[A-1]++;}
   else {
   if(a[A-1]==t){
   continue;}
   else{
   counter++;
   break;}}}}
   if(N==1&&M==0){
   cout<<0;}
   else if(counter==0){
   if(a[0]==0)
   a[0]=1;
   for(int i=0;i<N;i++){
   cout<<a[i];}}
   else
   cout<<-1<<endl;}
   


Compiler output:
a.cc:23:4: error: expected unqualified-id before 'if'
   23 |    if(N==1&&M==0){
      |    ^~
a.cc:25:4: error: expected unqualified-id before 'else'
   25 |    else if(counter==0){
      |    ^~~~
a.cc:30:4: error: expected unqualified-id before 'else'
   30 |    else
      |    ^~~~
a.cc:31:19: error: expected declaration before '}' token
   31 |    cout<<-1<<endl;}
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N,M;
    cin>>N>>M;
    int a[N]={};
    int b[N]={};
    int A,t,q,counter=0;
   for(int i=0;i<M;i++){
   cin>>A>>t;
   if(A==1&&t==0){
   counter++;
   break;}
   else if(b[A-1]==0){
   a[A-1]=t;
   b[A-1]++;}
   else {
   if{a[A-1]==t){
   continue;}
   else{
   counter++;
   break;}}}
   if(counter==0){
   for(int i=0;i<N;i++){
   cout<<a[i];}}
   else
   cout<<-1<<endl;;}
   

Compiler output:
a.cc: In function 'int main()':
a.cc:18:6: error: expected '(' before '{' token
   18 |    if{a[A-1]==t){
      |      ^
      |      (
a.cc:27:21: error: expected '}' at end of input
   27 |    cout<<-1<<endl;;}
      |                     ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int INF=1001001001;

int main(void){
    // Your code here!
    int n,m;
    cin>>n>>m;
    vector<int> s(m);
    vector<int> c(m);
    rep(i,m) {cin>>s[i]>>c[i]; s[i]--;}
    int ans=-1;
    for(int j=0;j<1000;j++){
        int x=0;
        string t=to_string(j);
        rep(i,m){
            string y=to_string(c[i]);
        if(t.size()==n&&t[s[i]]==y[0]){
            x++;
        }
        }
        if(x==m){ ans=j; break;}
    }
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>n>>m;
      |     ^~~
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> s(m);
      |     ^~~~~~
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> s(m);
      |            ^~~
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> c(m);
      |            ^~~
a.cc:10:20: error: 's' was not declared in this scope
   10 |     rep(i,m) {cin>>s[i]>>c[i]; s[i]--;}
      |                    ^
a.cc:10:26: error: 'c' was not declared in this scope
   10 |     rep(i,m) {cin>>s[i]>>c[i]; s[i]--;}
      |                          ^
a.cc:14:9: error: 'string' was not declared in this scope
   14 |         string t=to_string(j);
      |         ^~~~~~
a.cc:16:19: error: expected ';' before 'y'
   16 |             string y=to_string(c[i]);
      |                   ^~
      |                   ;
a.cc:17:12: error: 't' was not declared in this scope
   17 |         if(t.size()==n&&t[s[i]]==y[0]){
      |            ^
a.cc:17:27: error: 's' was not declared in this scope
   17 |         if(t.size()==n&&t[s[i]]==y[0]){
      |                           ^
a.cc:17:34: error: 'y' was not declared in this scope
   17 |         if(t.size()==n&&t[s[i]]==y[0]){
      |                                  ^
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<<ans<<endl;
      |     ^~~~
a.cc:23:16: error: 'endl' was not declared in this scope
   23 |     cout<<ans<<endl;
      |                ^~~~
Language: C++

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>>data(2,vector<int>(m));
  for(int i=0;i<m;i++){
    cin>>data.at(i).at(0)>>data.at(i).at(1);
  }
  for(int i=0;i<m;i++){
    if(n=3&&data.at(i).at(0)==1&&data.at(i).at(0)==0){
      cout<<-1<<endl;
      return 0;
    }
    if(n=2&&data.at(i).at(0)==2&&data.at(i).at(0)==0){
      cout<<-1<<endl;
      return 0;
    }
    for(int j=0;j<m;j++){
      if(data.at(i).at(0)==data.at(j).at(0)&&data.at(i).at(1)!=data.at(j).at(1)){
        cout<<-1<<endl;
        return 0;
      }
    }
  }
  int ans=0;
  int time3=0;
  int time2=0;
  int time1=0;
  for(int i=0;i<m;i++){
    if(time3=0&&data.at(i).at(0)==3){
      ans=data.at(i).at(1)*100;
      time_3=1;
    }
    if(time2=0&&data.at(i).at(0)==2){
      ans=data.at(i).at(1)*10;
      time_2=1;
    }
    if(time1=0&&data.at(i).at(0)==1){
      ans=data.at(i).at(1);
      time_1=1;
    }
  }
  cout<<ans<<endl;
  return 0;
}
  
  
  
    
    
    
    
    
 


Compiler output:
a.cc: In function 'int main()':
a.cc:35:7: error: 'time_3' was not declared in this scope; did you mean 'time3'?
   35 |       time_3=1;
      |       ^~~~~~
      |       time3
a.cc:39:7: error: 'time_2' was not declared in this scope; did you mean 'time2'?
   39 |       time_2=1;
      |       ^~~~~~
      |       time2
a.cc:43:7: error: 'time_1' was not declared in this scope; did you mean 'time1'?
   43 |       time_1=1;
      |       ^~~~~~
      |       time1
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>>data(2,vector<int>(m));
  for(int i=0;i<m;i++){
    cin>>data.at(i).at(0)>>data.at(i).at(1);
  }
  for(int i=0;i<m;i++){
    if(n=3&&data.at(i).at(0)==1&&data.at(i).at(0)==0){
      cout<<-1<<endl;
      return 0;
    }
    if(n=2&&data.at(i).at(0)==2&&data.at(i).at(0)==0){
      cout<<-1<<endl;
      return 0;
    }
    for(int j=0;j<m;j++){
      if(data.at(i).at(0)==data.at(j).at(0)&&data.at(i).at(1)!=data.at(j).at(1)){
        cout<<-1<<endl;
        return 0;
      }
    }
  }
}
  
  
  
    
    
    
    
    
 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<vector<int>>data(2,vector<int>(m));
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:17: error: expected primary-expression before 'int'
    7 |   vector<vector<int>>data(2,vector<int>(m));
      |                 ^~~
a.cc:9:15: error: overloaded function with no contextual type information
    9 |     cin>>data.at(i).at(0)>>data.at(i).at(1);
      |               ^~
a.cc:9:33: error: overloaded function with no contextual type information
    9 |     cin>>data.at(i).at(0)>>data.at(i).at(1);
      |                                 ^~
a.cc:12:18: error: overloaded function with no contextual type information
   12 |     if(n=3&&data.at(i).at(0)==1&&data.at(i).at(0)==0){
      |                  ^~
a.cc:12:39: error: overloaded function with no contextual type information
   12 |     if(n=3&&data.at(i).at(0)==1&&data.at(i).at(0)==0){
      |                                       ^~
a.cc:16:18: error: overloaded function with no contextual type information
   16 |     if(n=2&&data.at(i).at(0)==2&&data.at(i).at(0)==0){
      |                  ^~
a.cc:16:39: error: overloaded function with no contextual type information
   16 |     if(n=2&&data.at(i).at(0)==2&&data.at(i).at(0)==0){
      |                                       ^~
a.cc:21:15: error: overloaded function with no contextual type information
   21 |       if(data.at(i).at(0)==data.at(j).at(0)&&data.at(i).at(1)!=data.at(j).at(1)){
      |               ^~
a.cc:21:33: error: overloaded function with no contextual type information
   21 |       if(data.at(i).at(0)==data.at(j).at(0)&&data.at(i).at(1)!=data.at(j).at(1)){
      |                                 ^~
a.cc:21:51: error: overloaded function with no contextual type information
   21 |       if(data.at(i).at(0)==data.at(j).at(0)&&data.at(i).at(1)!=data.at(j).at(1)){
      |                                                   ^~
a.cc:21:69: error: overloaded function with no contextual type information
   21 |       if(data.at(i).at(0)==data.at(j).at(0)&&data.at(i).at(1)!=data.at(j).at(1)){
      |                                                                     ^~
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  queue<int> hundred;
  queue<int> ten;
  queue<int> one;
  bool frag = true;
  for (int i = 0; i < M; i++) {
    int s, c;
    cin >> s >> c;
    if (N == 3 && s == 1) {
      if (hundred.empty()) {
        hundred.push(c);
        continue;
      }
      if (hundred.front() != c) {
        frag = false;
      }
    }
    else if ((N==3 && s==2) || (N==2 && s==1)) {
      if (ten.empty()) {
        ten.push(c);
        continue;
      }
      if (ten.front() != c) {
        frag = false;
      }
    }
    else if ((N==3 && s==3) || (N==2&&s==2) || (N==1&&s==1)) {
      if (one.empty()) {
        one.push(c);
        continue;
      }
      if (one.front() != c) {
        frag = false;
      }
    }
  }
  if (!frag) {
    cout << -1 << endl;
    return 0;
  }
  
  if (hundred.empty()) {
    if (N == 3) {
      hundred.push(1);
    }
    else {
      hundred.ppush(0);
    }
  }
  if (ten.empty()) {
    if (N == 2) {
      ten.push(1);
    }
    else {
      ten.push(0);
    }
  }
  if (one.empty()) {
    one.push(0);
  }
  int h = hundred.front();
  int t = ten.front();
  int o = one.front();
  if (N == 1) {
    cout << o << endl;
  }
  else if (N == 2) {
    if (t != 0) {
      cout << t*10 + o << endl;
    }
    else {
      cout << -1 << endl;
    }
  }
  else if (N == 3) {
    if (h != 0) {
      cout << h*100 + t*10 + o << endl;
    }
    else {
      cout << -1 << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:15: error: 'class std::queue<int>' has no member named 'ppush'; did you mean 'push'?
   54 |       hundred.ppush(0);
      |               ^~~~~
      |               push
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  queue<int> hundred;
  queue<int> ten;
  queue<int> one;
  bool frag = true;
  for (int i = 0; i < M; i++) {
    int s, c;
    cin >> s >> c;
    if (N == 3 && s == 1) {
      if (hundred.empty()) {
        hundred.push(c);
        continue;
      }
      if (hundred.front() != c) {
        frag = false;
      }
    }
    else if ((N==3 && s==2) || (N==2 && s==1) {
      if (ten.empty()) {
        ten.push(c);
        continue;
      }
      if (ten.front() != c) {
        frag = false;
      }
    }
    else if ((N==3 && s==3) || (N==2&&s==2) || (N==1&&s==1)) {
      if (one.empty()) {
        one.push(c);
        continue;
      }
      if (one.front() != c) {
        frag = false;
      }
    }
  }
  if (hundred.empty()) {
    hundred.push(0);
  }
  if (ten.empty()) {
    ten.push(0);
  }
  if (one.empty()) {
    one.push(0);
  }
  int h = hundred.front();
  int t = ten.front();
  int o = one.front();
  if (N == 1) {
    cout << o << endl;
  }
  else if (N == 2) {
    if (t != 0) {
      cout << t*10 + o << endl;
    }
    else {
      cout << -1 << endl;
    }
  }
  else if (N == 3) {
    if (h != 0) {
      cout << h*100 + t*10 + o << endl;
    }
    else {
      cout << -1 << endl;
    }
  }
}

    
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:25:46: error: expected ')' before '{' token
   25 |     else if ((N==3 && s==2) || (N==2 && s==1) {
      |             ~                                ^~
      |                                              )
a.cc:43:3: error: expected primary-expression before '}' token
   43 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std; 
int main() 
{long long n,q,index,insert;cin>>n>>q;
 string s(n,'0');
 while(q--)
 {
   cin>>index>>insert;index--;
   //if(s[index]!='0' and s[index]!=(insert+'0'))return cout<<-1,0;
   if(s[index]!='0')
   s[index]=(min(s[index]-'0',insert))+'0';
   else s[index]=(insert+'0');
 }
 if(s[0]==0 and n!=1)return cout<<-1,0;
 return cout<<s,0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: no matching function for call to 'min(int, long long int&)'
   11 |    s[index]=(min(s[index]-'0',insert))+'0';
      |              ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:11:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   11 |    s[index]=(min(s[index]-'0',insert))+'0';
      |              ~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:11:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |    s[index]=(min(s[index]-'0',insert))+'0';
      |              ~~~^~~~~~~~~~~~~~~~~~~~~