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

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

int main(){
    int ans1=-1;
    int n,m,si,ci;
    cin>>n>>m;
    vector<int>ans(n,0);
    for(int i=0;i<m;i++){
        cin>>si>>ci;
        if(si-1>n){
            cout<<-1;
            exit(0)
        }
        if(si==1){
            if(ans[0]==0)
                ans[0]=ci;
            else if(ans[0]>ci)
                ans[0]=ci;
        }
        if(ans[si-1]==0)
            ans[si-1]=ci;
        else if(ans[si-1]>ci)
            ans[si-1]=ci;
    }
    if(ans[0]==0){
        if(n==1)
            cout<<0;
        else
            cout<<-1;
    }
    else
        for(int i=0;i<n;i++){
            cout<<ans[i];
        }
    return 0;    
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before '}' token
   14 |             exit(0)
      |                    ^
      |                    ;
   15 |         }
      |         ~
Language: C++

#include <iostream>
#include<vector>
#include<math.h>
using namespace std;

int main()
{
    int m,n,i,s[10],c[10],z;
    
    cin>>n>>m;
    for(i=1;i<=m;i++)
    {
        cin>>s[i];
        cin>>c[i];
    }
    vector<int> num;
    int a;
    for(i=1;i<=m;i++)
    {
        a=c[i]*pow(10,n-s[i]+1);
        num.push_back(a);
    }
    for(i=1;i<=m;i++)
    {
        for(j=1;i<i;j++)
        if(num[j]==num[j+1])
        num.erase(num[j]);
    }
     for (auto i = num.begin(); i != num.end(); ++i)
     {
         z+=num[i];
     }
     cout<<z;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'j' was not declared in this scope
   25 |         for(j=1;i<i;j++)
      |             ^
a.cc:31:16: error: no match for 'operator[]' (operand types are 'std::vector<int>' and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >')
   31 |          z+=num[i];
      |                ^
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1128:28: note:   no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1147:28: note:   no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  map<int,int> mp;
  for(int i = 0; i < m; i++){
  	int si,ci;
    cin>>si>>ci;
    bool f = 0;
    if(mp.count(si)){
    	if(mp[si]!=ci){
        	f = 1;
        }
    }
    mp[si] = ci;  
  }
  if(mp.count(1)){
  	if(mp[1] == 0){
    	f = 1;
    }
  }
  else {
    if( n == 1) mp[1] = 0;
    else
    mp[1] = 1;
  }
  if(f==1){
  	cout<<"-1"<<"\n";
  }
  else{
   for(int i = 1; i <= n; i++){
  	cout<<mp[i];
   }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'f' was not declared in this scope
   20 |         f = 1;
      |         ^
a.cc:28:6: error: 'f' was not declared in this scope
   28 |   if(f==1){
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << '\n';}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);}

const ll inf = 1e18 + 1;
const ll mod = 1e9 + 7;

void print(ll a[], ll n){for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<"\n";}
ll power(ll x, ll y, ll M = inf){
    ll ans = 1;
    x %= M;
    while(y){
        if(y&1)
            ans = (x * ans) % M;

        x = (x * x) % M;
        y >>= 1;
    }
    return ans;
}
ll modInverse(ll n) {return power(n, mod-2, mod);}
inline ll mul(ll a, ll b){ return (a * b) % mod; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > mod) c -= mod; return c; }
inline ll divi(ll a, ll b){ return mul(a, modInverse(b)); }

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

	
		int n, m;
		cin>>n>>m;
		ll s[m], c[m];
		vector<ll> v(n, 10);
		ll flag=0;
		for(int i=0;i<m;i++){
			cin>>s[i]>>c[i];
			if(v[s[i]-1]==10){
        	    v[s[i]-1]=c[i];
	        }
	        else if(v[s[i]-1]!=c[i]){
		        cout<<-1<<"\n";
		        return 0;
		     }
		}	
		if(v[0]==10){
	        if(n==1) v[0]=0;
	        if(n!=1) v[0]=1;
	    }
	    if(v[0]==0 && n!=1) 
	    {
	        cout<<-1<<"\n";
	        return 0;
	    }
		for(int j=0;j<n;j++){
			if(v[i]==10) cout<<0;
			else cout<<v[i];
		}
		cout<<"\n";
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:30: error: 'i' was not declared in this scope
   63 |                         if(v[i]==10) cout<<0;
      |                              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << '\n';}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);}

const ll inf = 1e18 + 1;
const ll mod = 1e9 + 7;

void print(ll a[], ll n){for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<"\n";}
ll power(ll x, ll y, ll M = inf){
    ll ans = 1;
    x %= M;
    while(y){
        if(y&1)
            ans = (x * ans) % M;

        x = (x * x) % M;
        y >>= 1;
    }
    return ans;
}
ll modInverse(ll n) {return power(n, mod-2, mod);}
inline ll mul(ll a, ll b){ return (a * b) % mod; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > mod) c -= mod; return c; }
inline ll divi(ll a, ll b){ return mul(a, modInverse(b)); }

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

	
		int n, m;
		cin>>n>>m;
		ll s[m], c[m];
		vector<ll> v(n, 10);
		ll flag=0;
		for(int i=0;i<m;i++){
			cin>>s[i]>>c[i];
			if(v[s[i]-1]==10){
        	    v[s[i]-1]=c[i];
	        }
	        else if(v[s[i]-1]!=c[i]){
		        cout<<-1<<"\n";
		        return 0;
		     }
		}	
		if(v[0]==10){
	        if(n==1) v[0]=0;
	        if(n!=1) v[0]=1;
	    }
	    if(v[0]==0 && n!=1) 
	    {
	        cout<<-1<<"\n";
	        return 0;
	    }
		for(int j=0;j<n;j++){
			if(v[i]==10) cout<<0;
			else cout<a[i];
		}
		cout<<"\n";
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:30: error: 'i' was not declared in this scope
   63 |                         if(v[i]==10) cout<<0;
      |                              ^
a.cc:64:35: error: 'a' was not declared in this scope
   64 |                         else cout<a[i];
      |                                   ^
Language: C

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

struct p{
  int s;
  int c;
};

int main(){
  int n,m;
  int limit;
  int i;
  struct p a[5];

  scanf("%d %d", &n, &m);

  limit = pow(10,n) - 1;

  if(m == 0){
    printf("-1\n");
    return 0;
  }

  for(i = 0;i < m;i++) scanf("%d %d", &a[i].s, &a[i].c);

  for(i = 0;i < m;i++){
    if()
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:8: error: expected expression before ')' token
   27 |     if()
      |        ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
	int n,m;
	int a[3];
	cin>>n>>m;
	a[0]=-1;
	a[1]=-1;
	a[2]=-1;
	for(int i=0;i<m;i++){
		int s,c;
		cin>>s>>c;
		if(a[s-1]==-1){
			a[s-1]=c;
		}else{
			if(a[s-1]==c){
				continue;
			}else{
				cout<<-1<<endl;
				return 0;
			}
		}
	}
	if(a[0]==0){
		if(n==1){
			cout<<0<<<endl;
		}else{
			cout<<-1<<endl;
		}
		return 0;
	}
	if(n==1){
		if(a[0]==-1){
			cout<<0<<endl;
		}else{
			cout<<a[0]<<endl;
		}
		return 0;
	}
	for(int i=0;i<n;i++){
		if(a[i]==-1){
			if(i==0){
				cout<<1;
			}else{
				cout<<0;
			}
		}else{
			cout<<a[i];
		}
	}
	cout<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:34: error: expected primary-expression before '<' token
   27 |                         cout<<0<<<endl;
      |                                  ^
Language: C++

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

int main() {
  int n, m;
  cin >> n >> m;
  string s;
  for (int i = 0; i < n; i++) {
    s += "*";
  }
  for (int i = 0; i < m; i++) {
    int p;
    char c;
    cin >> p >> c;
    if (s.at(p-1) == '*') {
      s.at(p-1) = c;
      continue;
    } else if (s.at(p-1) == c) {
      continue;
    } else {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0 ; i < n; i++) {
    if (i == 0 && s.at(i) == '*') {
      s.at(i) = '1';
    } else if (s.at(i) == '*') {
      s.at(i) = '0';
    }
  }
  if (s.at(0) == '0' && s.size != 1) {
    cout << -1 << endl;
    return 0;
  }
  cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:27: 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 '()' ?)
   32 |   if (s.at(0) == '0' && s.size != 1) {
      |                         ~~^~~~
      |                               ()
Language: C++

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

int main() {
  int n, m;
  cin >> n >> m;
  string s;
  for (int i = 0; i < n; i++) {
    s += "*";
  }
  for (int i = 0; i < m; i++) {
    int p;
    char c;
    cin >> p >> c;
    if (s.at(p-1) == '*') {
      s.at(p-1) = c;
      continue;
    } else if (s.at(p-1) == c) {
      continue;
    } else {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0 ; i < n; i++) {
    if (i == 0 && s.at(i) == '*') {
      s.at(i) = '1';
    } else if (s.at(i) == '*') {
      s.at(i) = '0';
    }
  }
  if (s.at(0) == '0') {
    cout << -1 << endl;
    return 0;
  }

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

#include <bits/stdc++.h>

using namespace std;

int main(){
    int n, m;
    cin >> n >> m;
    vector<int> ass(n, 0);
    int x, y;
    for(int i = 0; i<m; i++){
        cin >> x >> y;
        ass[x-1] = y; 
    }
    if(ass[0] == 0)
        ass[0] = 1;
        
    a = ass.size(); 
    for(int i = 0; i<a; i++){
        cout<<ass[i];
    }
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:7: error: not a statement
    cin >> n >> m;
             ^
Main.java:8: error: not a statement
    vector<int> ass(n, 0);
                    ^
Main.java:11: error: not a statement
        cin >> x >> y;
                 ^
Main.java:19: error: not a statement
        cout<<ass[i];
            ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: ';' expected
    vector<int> ass(n, 0);
                   ^
Main.java:8: error: ';' expected
    vector<int> ass(n, 0);
                     ^
9 errors
Language: C++

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

int main() {
  int n,m;
  cin>>n>>m;
  vector<int>s(m);
  vector<char>c(m);
  for(int i=0;i<m;i++) cin>>s[i]>>c[i];
  long long ans=-1;
  int b=pow(10,n);
  if(n==1){
  for(int i=pow(10,n-1)-1;i<b;i++){
    string answer=to_string(i);
    for(int j=0;j<m;j++){
      if(answer[s[j]-1]!=c[j]) break;
    }
    if(m==0 || j==m-1) {
      ans=i;
      break;
    }
  }
  cout<<ans<<endl;
  }
  if(n!=1){
  for(int i=pow(10,n-1);i<b;i++){
    string answer=to_string(i);
    for(int j=0;j<m;j++){
      if(answer[s[j]-1]!=c[j]) break;
    }
    if(m==0 || j==m-1){
      ans=i;
      break;
    }
  }
  cout<<ans<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: 'j' was not declared in this scope
   18 |     if(m==0 || j==m-1) {
      |                ^
a.cc:31:16: error: 'j' was not declared in this scope
   31 |     if(m==0 || j==m-1){
      |                ^
Language: C++

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

int main() {
  int n,m;
  cin>>n>>m;
  vector<int>s(m);
  vector<char>c(m);
  for(int i=0;i<m;i++) cin>>s[i]>>c[i];
  long long ans=-1;
  if(n==1){
  for(int i=pow(10,n-1)-1;i<pow(10,n);i++){
    if(m==0){
      int ans=pow(10,n-1)-1;
      cout<<ans<<endl;
    }
    else if{
    string answer=to_string(i);
    for(int j=0;j<m;j++){
      if(answer[s[j]-1]!=c[j]) break;
      else if(j==m-1){
        ans=i;
        cout<<ans<<endl;
        return 0;
      }
    }
  }
  cout<<ans<<endl;
  }
  }
  if(n!=1){
  for(int i=pow(10,n-1);i<pow(10,n);i++){
    string answer=to_string(i);
    if(m==0){
      int ans=pow(10,n-1);
      cout<<ans<<endl;
    }
    else if{
    for(int j=0;j<m;j++){
      if(answer[s[j]-1]!=c[j]) break;
      else if(j==m-1){
        ans=i;
        cout<<ans<<endl;
        return 0;
      }
    }
  }
  cout<<ans<<endl;
  }
  }
}


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

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

int main() {
  int N, M;
  cin >> N >> M;
  int A[N][M]={0};
  for(int i=0; i<N; i++) {
    for(int j=0; j<2; j++) {
      cin >> A[i][j];
    }
  }
  if(A[0][0]==A[1][0]&&A[0][1]!=A[1][1]) {
    cout << "-1" << endl;
    return 0;
  }
  if(A[0][0]==A[2][0]&&A[0][1]!=A[2][1]) {
    cout << "-1" << endl;
    return 0;
  }
  if(A[2][0]==A[1][0]&&A[2][1]!=A[1][1]) {
    cout << "-1" << endl;
    return 0;
  }
  for(int i=0; i<N; i++) [
    if(A[i][0]==1&&A[i][1]) {
      cout << "-1" << endl;
    }
    }
  
  int chohuku=0;
  if(A[0][0]==A[1][0]&&A[0][1]==A[1][1]&&A[0][0]==A[2][0]&&A[0][1]==A[2][1]) {
    chohuku+=1000*A[0][1]*(pow(0.1,A[0][0]));
  }
  if(A[0][0]==A[1][0]&&A[0][1]==A[1][1]) {
    chohuku-=1000*A[0][1]*(pow(0.1,A[0][0]));
  }
  if(A[0][0]==A[2][0]&&A[0][1]==A[2][1]) {
    chohuku-=1000*A[2][1]*(pow(0.1,A[2][0]));
  }
  if(A[2][0]==A[1][0]&&A[2][1]==A[1][1]) {
    chohuku-=1000*A[2][1]*(pow(0.1,A[2][0]));
  }
  cout << 1000*A[0][1]*(pow(0.1,A[0][0]))+1000*A[1][1]*(pow(0.1,A[1][0]))+1000*A[2][1]*(pow(0.1,A[2][0]))+chohuku << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: expected identifier before 'if'
   26 |     if(A[i][0]==1&&A[i][1]) {
      |     ^~
a.cc:28:6: error: expected ']' before '}' token
   28 |     }
      |      ^
      |      ]
   29 |     }
      |     ~ 
a.cc: In lambda function:
a.cc:29:5: error: expected '{' before '}' token
   29 |     }
      |     ^
a.cc: In function 'int main()':
a.cc:28:6: error: expected ';' before '}' token
   28 |     }
      |      ^
      |      ;
   29 |     }
      |     ~ 
a.cc: At global scope:
a.cc:32:3: error: expected unqualified-id before 'if'
   32 |   if(A[0][0]==A[1][0]&&A[0][1]==A[1][1]&&A[0][0]==A[2][0]&&A[0][1]==A[2][1]) {
      |   ^~
a.cc:35:3: error: expected unqualified-id before 'if'
   35 |   if(A[0][0]==A[1][0]&&A[0][1]==A[1][1]) {
      |   ^~
a.cc:38:3: error: expected unqualified-id before 'if'
   38 |   if(A[0][0]==A[2][0]&&A[0][1]==A[2][1]) {
      |   ^~
a.cc:41:3: error: expected unqualified-id before 'if'
   41 |   if(A[2][0]==A[1][0]&&A[2][1]==A[1][1]) {
      |   ^~
a.cc:44:3: error: 'cout' does not name a type
   44 |   cout << 1000*A[0][1]*(pow(0.1,A[0][0]))+1000*A[1][1]*(pow(0.1,A[1][0]))+1000*A[2][1]*(pow(0.1,A[2][0]))+chohuku << endl;
      |   ^~~~
a.cc:45:1: error: expected declaration before '}' token
   45 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include<vector>
using namespace std;
 
int main() {
  int a,b,e,f;
  cin>>a>>b;
  vector<int>c(a,0);
  bool d[a];
  rep(i,a)d[i]=false;
  rep(i,b){
    cin>>e>>f;
    if(d[e]==true&&d[e]!=c[e]){
	  cout<<-1;
      return 0;
    }
    c[e]=f;
    d[e]=true;
  }
  rep(i,a){
    if(i==0&&c[i]==0){
      cout<<1;
    }
    else cout<<c[i];
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   rep(i,a)d[i]=false;
      |       ^
a.cc:10:3: error: 'rep' was not declared in this scope
   10 |   rep(i,a)d[i]=false;
      |   ^~~
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<int>s(m),c(m);
  rep(i,m) cin>>s[i]>>c[i];
  rep(x,1000){
    int nx=x/10;
    vector<int>d(3);
    d[0]=x%10;
    while(nx){
      int i=1;
      d[i]=nx%10;
      nx/=10;
      i++;
    }
    reverse(all(d));
    int c=0;
    rep(j,m){
      if(d[s[j]-1]==c[j])
        c++;
    }
    if(c==n){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: invalid types 'int[int]' for array subscript
   26 |       if(d[s[j]-1]==c[j])
      |                      ^
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<int>s(m),c(m);
  rep(i,m) cin>>s[i]>>c[i];
  rep(x,1000){
    int nx=x/10;
    vector<int>d(3);
    d[0]=x%10;
    while(nx){
      int i=1;
      d[i]=nx%10;
      nx/=10;
      i++;
    }
    reverse(all(d));
    int c=0;
    rep(j,m){
      if(d[s[j]]==c[j])
        c++;
    }
    if(c==n){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: invalid types 'int[int]' for array subscript
   26 |       if(d[s[j]]==c[j])
      |                    ^
Language: C++

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

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

	int n, m;
	cin >> n >> m;
	vector<int> s(m), c(m);
	for(int i=0; i<m; i++) cin >> s[i] >> c[i];

	for(int i=0; i<1000; i++) {
		string x = to_string(i);
		if(x.size() == n) {
			bool valid=1;
			for(int j=0; j<m; j++) {
				if(x[s[j]-1] != ('0' + c[j]) valid=0;	
			}
			if(valid) {
				cout << i;
				return 0;
			}
		}
	}
	cout << -1;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:61: error: expected ';' before 'valid'
   18 |                                 if(x[s[j]-1] != ('0' + c[j]) valid=0;
      |                                                             ^~~~~~
      |                                                             ;
a.cc:19:25: error: expected primary-expression before '}' token
   19 |                         }
      |                         ^
a.cc:18:72: error: expected ')' before '}' token
   18 |                                 if(x[s[j]-1] != ('0' + c[j]) valid=0;
      |                                   ~                                  ^  
      |                                                                        )
   19 |                         }
      |                         ~                                             
a.cc:19:25: error: expected primary-expression before '}' token
   19 |                         }
      |                         ^
Language: C++

//by Top1
#include <bits/stdc++.h>
          
#define f first
#define s second
#define int long long
#define ld long double
#define ull unsigned long long
#define pii pair <int, int>
#define pll pair <long, long>
#define mp make_pair
#define pb push_back
#define pf push_front
#define pp pop_back
#define cerr cout
#define rev reverse
#define all(s) s.begin(), s.end()
#define sz(s) (int)s.size()
#define forn(i, a, b) for (int i = a; i <= b; i++)
#define boost ios_base::sync_with_stdio(false); cin.tie(0),cout.tie(0);
#define nxtp next_permutation
#define pvtp prev_permutation
#define KZ return 
#define x1 x21212121
#define y1 y21212121
#define sqr(x) x * x 
      
const int inf = (1e9) + 1;
const int mod = 479001599;
const int maxn = 1e6 + 111;
        
using namespace std;          

int n, m, a[maxn];

void solve(){ 
	cin >> n >> m;

	for (int i = 1; i <= n; i++)
		a[i] = inf;

	for (int i = 1; i <= m; i++){
		int x, y;
		cin >> x >> y;
		if (a[x] == inf)
			a[x] = y;	
		else if (a[x] != y){
			cout << -1;
			return;
		}
	}
	
	for (int i = 1; i <= n; i++)
		if (a[i] == inf)
			a[i] = 0;
   	
   	if (n == 3 && m == 1 && x == 1 && y == 0){
   		cout << -1;
   		return;
   	}

	if (n >= 2 && a[1] == 0){
		cout << -1;
		return;
	}

	for (int i = 1; i <= n; i++){
		cout << a[i];
	}
}                              
      
main(){
    boost;
    
    int q = 1;
 
    //cin >> q;
    
    while (q--){
        solve();
    }
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:57:33: error: 'x' was not declared in this scope
   57 |         if (n == 3 && m == 1 && x == 1 && y == 0){
      |                                 ^
a.cc:57:43: error: 'y' was not declared in this scope; did you mean 'yn'?
   57 |         if (n == 3 && m == 1 && x == 1 && y == 0){
      |                                           ^
      |                                           yn
a.cc: At global scope:
a.cc:72:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   72 | main(){
      | ^~~~
Language: C++

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

#define V vector<int>

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

	V s(M), c(M);
	for (int i = 0; i < M; i++) cin >> s[i] >> c[i];//s->左からの桁

	for (int i = ((N == 1) ? 0; pow(10, N - 1)); i < pow(10, N); i++) {//3桁->10^2　すべての数を調べる
		V digits(N);
		fill(ALL(digits), 0);//指定された範囲を埋める
		int tmp = i;
		for (int j = 0; j < N; j++) {
			digits[j] = tmp % 10;//右の桁から配列に格納
			tmp /= 10;
		}

		bool flag = true;
		for (int j = 0; j < M; j++)
			if (digits[N - s[j]] != c[j]) flag = false;//一つの桁に二回代入されても片方でfalseになるのでok

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:35: error: expected ':' before ';' token
   15 |         for (int i = ((N == 1) ? 0; pow(10, N - 1)); i < pow(10, N); i++) {//3桁->10^2　すべての数を調べる
      |                                   ^
      |                                   :
a.cc:15:35: error: expected primary-expression before ';' token
a.cc:15:35: error: expected ')' before ';' token
   15 |         for (int i = ((N == 1) ? 0; pow(10, N - 1)); i < pow(10, N); i++) {//3桁->10^2　すべての数を調べる
      |                      ~            ^
      |                                   )
a.cc:15:51: error: expected ';' before ')' token
   15 |         for (int i = ((N == 1) ? 0; pow(10, N - 1)); i < pow(10, N); i++) {//3桁->10^2　すべての数を調べる
      |                                                   ^
      |                                                   ;
a.cc:15:54: error: 'i' was not declared in this scope
   15 |         for (int i = ((N == 1) ? 0; pow(10, N - 1)); i < pow(10, N); i++) {//3桁->10^2　すべての数を調べる
      |                                                      ^
Language: C++

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

#define V vector<int>
#define P pair<int,int>

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

	V s(M), c(M);
	for (int i = 0; i < M; i++) cin >> s[i] >> c[i];

	for (int i = ((N == 1) ? 0; pow(10, N - 1)); i < pow(10, N); i++) {
		V digits(N);
		fill(ALL(digits), 0);
		int tmp = i;
		for (int j = 0; j < N; j++) {
			digits[j] = tmp % 10;
			tmp /= 10;
		}

		bool flag = true;
		for (int j = 0; j < M; j++)
			if (digits[N - s[j]] != c[j]) flag = false;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:35: error: expected ':' before ';' token
   16 |         for (int i = ((N == 1) ? 0; pow(10, N - 1)); i < pow(10, N); i++) {
      |                                   ^
      |                                   :
a.cc:16:35: error: expected primary-expression before ';' token
a.cc:16:35: error: expected ')' before ';' token
   16 |         for (int i = ((N == 1) ? 0; pow(10, N - 1)); i < pow(10, N); i++) {
      |                      ~            ^
      |                                   )
a.cc:16:51: error: expected ';' before ')' token
   16 |         for (int i = ((N == 1) ? 0; pow(10, N - 1)); i < pow(10, N); i++) {
      |                                                   ^
      |                                                   ;
a.cc:16:54: error: 'i' was not declared in this scope
   16 |         for (int i = ((N == 1) ? 0; pow(10, N - 1)); i < pow(10, N); i++) {
      |                                                      ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
	int N,M,s[4],c[10];
	cin>>N>>M;
	if(N==1&&M==0)
	{
		cout<<0;
		return 0;
	}
	int fla=1;
	memset(s,-1,sizeof(s));
	for(int i=1;i<=M;i++)
	{
		int ss,cc;
		cin>>ss>>cc;
		if(N>1&&ss==1&&cc==0)fla=0;
		else if(s[ss]==-1)s[ss]=cc;
		else  
		{
			if(s[ss]!=-1&&s[ss]!=cc)fla=0;
		}
	}
	if(fla==0)
	{
		cout<<"-1";
		return 0;
	}
	for(int i=1;i<=N;i++)
	{
		if(s[i]==-1&&i==1)s[i]=1;
		else if(s[i]==-1)s[i]=0;
		printf("%d",s[i]);
	}
	return 0;
	
} 

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

#include<iostream>
using namespace std;
int main()
{
	int N,M,s[4],c[10];
	cin>>N>>M;
	if(N==1&&M==0)
	{
		cout<<0;
		return 0;
	}
	int flag=1;
	memset(s,-1,sizeof(s));
	for(int i=1;i<=M;i++)
	{
		int ss,cc;
		cin>>ss>>cc;
		if(N>1&&ss==1&&cc==0)flag=0;
		else if(s[ss]==-1)s[ss]=cc;
		else  
		{
			if(s[ss]!=-1&&s[ss]!=cc)flag=0;
		}
	}
	if(flag==0)
	{
		cout<<"-1";
		return 0;
	}
	for(int i=1;i<=N;i++)
	{
		if(s[i]==-1&&i==1)s[i]=1;
		else if(s[i]==-1)s[i]=0;
		printf("%d",s[i]);
	}
	return 0;
	
} 

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

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

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

#include <iostream>
#include<cstdio>
#include<deque>
#include<string>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const int maxn=2e5+100;
int n,m,a[10],s,c;
map<int,int>mp;
int main()
{
    
    cin>>n>>m;
    int flag=1;
    memset(a,-1,sizeof(a));
    while(m--)
    {
        cin>>s>>c;
        if(mp.count(s)==0){
            q[s]=c;
            a[s]=c;
        }
        else{
            if(mp[s]!=c) flag=0;
        }
    }
    if(a[1]==0 && n>1) flag=0;
    if(flag==0) printf("-1");
    else{
        if(n>1){
            for(int i=1;i<=n;i++){
                if(a[i]==-1 && i==1) cout<<1;
                else if(a[i]==-1 && i>1) cout<<0;
                else cout<<a[i];
            }
        }
        else{
            if(a[1]==-1) cout<<0;
            else cout<<a[1];
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: error: 'q' was not declared in this scope
   26 |             q[s]=c;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
bool flag = true;
int n,m,b,c;
struct num{
    int a,b;
}x[50];
int main()
{
    cin>>n>>m;
    while(m--)
    {
        cin>>b>>c;
        if(x[b].b!=0&&x[b].a!=c)
            flag=false;
        else
        {
            x[b].a=c;
            x[b].b=1;
        }
    }
    if(flag==false||(x[1].b==1&&x[1].a==0&&n>1))
    {
        cout<<-1;
    }
    else if(n>1)
    {
        if(x[1].a==0)
            cout<<1;
        else
            cout<<x[1].a;
        for(int i=2;i<=n;i++)
            cout<<x[i].a;
    }
    else
        cout<<x[i].a;

}



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

#include<bits/stdc++.h>
using namespace std;
bool flag = true;
int n,m,b,c;
struct num{
    int a,b;
}x[50];
int main()
{
    cin>>n>>m;
    while(m--)
    {
        cin>>b>>c;
        if(x[b].b!=0&&x[b].a!=c)
            flag=false;
        else
        {
            x[b].a=c;
            x[b].b=1;
        }
    }
    if(flag==false||(x[1].b==1&&x[1].a==0&&n>1))
    {
        cout<<-1;
    }
    else if(n>1)
    {
        if(x[1].a==0)
            cout<<1;
        else
            cout<<x[1].a;
        for(int i=1;i<=n;i++)
            cout<<x[i].a;
    }
    else
        cout<<x[i].a;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:17: error: 'i' was not declared in this scope
   36 |         cout<<x[i].a;
      |                 ^
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<int>s(m),c(m);
  rep(i,m) cin>>s[i]>>c[i];
  rep(x,1000){
    int nx=x/10;
    vector<int>d(3);
    d[0]=x%10;
    while(nx){
      int i=1;
      d[i]=nx%10;
      nx/=10;
      i++;
    }
    reverse(all(d));
    int c=0;
    rep(j,m){
      if(d[s[j]]==c[j])
        c++;
    }
    if(c=3){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: invalid types 'int[int]' for array subscript
   26 |       if(d[s[j]]==c[j])
      |                    ^
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<int>s(m),c(m);
  rep(i,m) cin>>s[i]>>c[i];
  rep(x,1000){
    int nx=x/10;
    vector<int>d(3);
    d[0]=x%10;
    while(nx){
      int i=1;
      d[i]=nx%10;
      nx/=10;
      i++;
    }
    reverse(all(d));
    int c=0;
    rep(j,m){
      if(d[s[j]]==c[j])
        c++
    }
    if(c=3){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: invalid types 'int[int]' for array subscript
   26 |       if(d[s[j]]==c[j])
      |                    ^
a.cc:27:12: error: expected ';' before '}' token
   27 |         c++
      |            ^
      |            ;
   28 |     }
      |     ~
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<int>s(m),c(m);
  rep(i,m) cin>>s[i]>>c[i];
  rep(x,1000){
    int nx=x/10;
    vector<int>d(3);
    d[0]=x%10;
    while(nx){
      int i=1;
      d[i]=nx%10;
      nx/=10;
      i++;
    }
    reverse(all(d));
    int c=0;
    rep(j,3){
      int f=s[j];
      if(d[f]==c[j])
        c++
    }
    if(c=3){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: invalid types 'int[int]' for array subscript
   27 |       if(d[f]==c[j])
      |                 ^
a.cc:28:12: error: expected ';' before '}' token
   28 |         c++
      |            ^
      |            ;
   29 |     }
      |     ~
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<int>s(m),c(m);
  rep(i,m) cin>>s[i]>>c[i];
  rep(x,1000){
    int nx=x/10;
    vector<int>d(3);
    d[0]=x%10;
    while(nx){
      int i=1;
      d[i]=nx%10;
      nx/=10;
      i++;
    }
    reverse(all(d));
    int c=0;
    rep(j,3){
      if(d[s[j]]==c[j])
        c++;
    }
    if(c=3){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: invalid types 'int[int]' for array subscript
   26 |       if(d[s[j]]==c[j])
      |                    ^
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<int>s(m),c(m);
  rep(i,m) cin>>s[i]>>c[i];
  rep(x,1000){
    int nx=x/10;
    vector<int>d(3);
    d[0]=x%10;
    while(nx){
      int i=1;
      d[i]=nx%10;
      nx/=10;
      i++;
    }
    reverse(all(d));
    int c=0;
    rep(j,3){
      if(d[s[i]]==c[i])
        c++;
    }
    if(c=3){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: 'i' was not declared in this scope
   26 |       if(d[s[i]]==c[i])
      |              ^
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<int>s(m),c(m);
  rep(i,m) cin>>s[i]>>c[i];
  rep(x,1000){
    int nx=x/10;
    int d=x%10;
    while(nx){
      d.push_back(nx%10);
      nx/=10;
    }
    reverse(all(d));
    int c=0;
    rep(j,3){
      if(d[s[i]]==c[i])
        c++;
    }
    if(c=3){
      cout<<x<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: request for member 'push_back' in 'd', which is of non-class type 'int'
   17 |       d.push_back(nx%10);
      |         ^~~~~~~~~
a.cc:4:18: error: request for member 'begin' in 'd', which is of non-class type 'int'
    4 | #define all(v) v.begin(),v.end()
      |                  ^~~~~
a.cc:20:13: note: in expansion of macro 'all'
   20 |     reverse(all(d));
      |             ^~~
a.cc:4:28: error: request for member 'end' in 'd', which is of non-class type 'int'
    4 | #define all(v) v.begin(),v.end()
      |                            ^~~
a.cc:20:13: note: in expansion of macro 'all'
   20 |     reverse(all(d));
      |             ^~~
a.cc:23:14: error: 'i' was not declared in this scope
   23 |       if(d[s[i]]==c[i])
      |              ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_back
#define pp() pop_back()
#define V vector
#define P pair
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define Q queue
#define pri priority_queue
#define Pri priority_queue<int,vector<int>,greater<int>>
#define PriP priority_queue<P<int,int>,vector<P<int,int>>,greater<P<int,int>>>
#define all(a)  (a).begin(),(a).end()

int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
signed main(){
  int n,m;
  cin>>n>>m;
  V<P<int,int>> a(m);
  fo(i,m){
    cin>>a[i].fi>>a[i].se;
  }
  Sort(a);
  int b=0;
  fo(i,m-1){
    if(a[i].fi==a[i+1].fi&&a[i].se!=a[i].se)
      b=1;
  }
  if(b){
    cout<<-1<<endl;
    return 0;
  }
  uni(a);
  if(n==1&&m==0){
    cout<<0<<endl;
    return 0;
  }
  if(n==2&&m==0){
    cout<10<<endl;
    return 0;
  }
  if(n==3&&m==0){
    cout<<100<<endl;
    return 0;
  }
  if(n==1&&a[0].se==0){
    cout<<0<<endl;
    return 0;
  }
  if(n==2||n==3){
    fo(i,m){
      if(a[i].fi==1&&a[i].se==0){
        cout<<-1<<endl;
        return 0;
      }
    }
  }
  for(int i=1; i<=999; i++){
    if(keta(i)!=n)
      continue;
    int d=1;
    string c=to_string(i);
    fo(j,m){
      if(c[a[j].fi-1]-'0'!=a[j].se){
        d=0;
      }
    }
    if(d){
      cout<<i<<endl;
      return 0;
    }
    
  }
  cout<<-1<<endl;
}

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

#include<bits/stdc++.h>
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_back
#define pp() pop_back()
#define V vector
#define P pair
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define Q queue
#define pri priority_queue
#define Pri priority_queue<int,vector<int>,greater<int>>
#define PriP priority_queue<P<int,int>,vector<P<int,int>>,greater<P<int,int>>>
#define all(a)  (a).begin(),(a).end()

int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
signed main(){
  int n,m;
  cin>>n>>m;
  V<P<int,int>> a(m);
  fo(i,m){
    cin>>a[i].fi>>a[i].se;
  }
  Sort(a);
  fo(i,m-1){
    if(a[i].fi==a[i+1].fi){
      if(a[i].se!=a[i+1].se){
        cout<<-1<<endl;
        return 0;

      }
    }
  }
  if(n==1){
    fo(i,m){
      int x=1;
      if(a[i].se==0)
        x=x;
      else
        x++;
    }
    if(x){
      cout<<0<<endl;
      return 0;
    }
  }
  for(int i=1; i<=999; i++){
    if(keta(i)!=n)
      continue;
    string f=to_string(i);
    int c=1;
    fo(k,m){
      if(f[a[k].fi-1]-'0'!=a[k].se){
        c=0;
      }
 
    }
    if(c){
      cout<<i<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:8: error: 'x' was not declared in this scope
   59 |     if(x){
      |        ^
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 >> num[i][0] >> num[i][1]; 
  }
  
  int i = 0;
  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.at(num[j][0]-1) != num[j][1]) kaku = 0;
    }
    
    if(kaku == 1){
     cout << i << endl;
      break;
    }
    else if(S.size() > N){
      cout << -1 << endl;
      break;
    }
    else i++;
    
  }
  
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: redeclaration of 'int i'
   17 |   int i = 0;
      |       ^
a.cc:6:7: note: 'int i' previously declared here
    6 |   int i = 0;
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int num[6][2];
  int N, M;
  cin >> N >> M;
  

    
  for(int i = 0; i < M; i++){
    cin >> num[i][0] >> num[i][1]; 
  }
  
  int p = 0;
  while(true){
    bool kaku = 1;
    string S = to_string(p);
    
    if(S.size() < N){
        p++;
        continue;
    }
    for(int j = 0; j < M; j++){
     if(S.at(num[j][0]-1) != num[j][1]){
         p++;
         continue;
    }
     if(S.size() > N){
      cout << -1 << endl;
      break;
    }
    else if(kaku == 1){
     cout << p << endl;
      break;
    }
   
    else p++;
    
  }
  
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:2: error: expected '}' at end of input
   44 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | 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<int>s(m),c(m);
  rep(i,m) {
    cin>> s[i] >> c[i];
  }
  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]-1]==c[i]){
        ex=true;
      }
    }
    if(ex){
      cout<<x<<endl;
      return 0;
  }
  cout<<-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
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;
 
int main() {
  int num[6][2];
  int N, M;
  cin >> N >> M;
  

    
  for(int i = 0; i < M; i++){
    cin >> num[i][0] >> num[i][1]; 
  }
  
  int p = 0;
  while(true){
    bool kaku = 1;
    string S = to_string(p);
    
    if(S.size() < N){
        p++;
        continue;
    }
    for(int j = 0; j < M; j++){
     if(S.at(num[j][0]-1) != num[j][1]){
         p++;
         continue;
    }
    
    if(kaku == 1){
     cout << p << endl;
      break;
    }
    else if(S.size() > N){
      cout << -1 << endl;
      break;
    }
    else p++;
    
  }
  
  
  
}

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

{
  int num[6][2];
  int N, M;
  cin >> N >> M;
  

    
  for(int i = 0; i < M; i++){
    cin >> num[i][0] >> num[i][1]; 
  }
  
  int p = 0;
  while(true){
    bool kaku = 1;
    string S = to_string(p);
    
    if(S.size() < N){
        p++;
        continue;
    }
    for(int j = 0; j < M; j++){
     if(S.at(num[j][0]-1) != num[j][1]){
         p++;
         continue;
    }
    
    if(kaku == 1){
     cout << p << endl;
      break;
    }
    else if(S.size() > N){
      cout << -1 << endl;
      break;
    }
    else p++;
    
  }
  
  
  
}
}
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {
      | ^
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

{
  int num[6][2];
  int N, M;
  cin >> N >> M;
  

    
  for(int i = 0; i < M; i++){
    cin >> num[i][0] >> num[i][1]; 
  }
  
  int p = 0;
  while(true){
    bool kaku = 1;
    string S = to_string(p);
    
    if(S.size() < N){
        p++;
        continue;
    }
    for(int j = 0; j < M; j++){
     if(S.at(num[j][0]-1) != num[j][1]){
         p++;
         continue;
    }
    
    if(kaku == 1){
     cout << p << endl;
      break;
    }
    else if(S.size() > N){
      cout << -1 << endl;
      break;
    }
    else p++;
    
  }
  
  
  
}
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {
      | ^
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 >> 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.at(num[j][0]) != num[j][1]) kaku = 0;
    }
    
    if(kaku = 1){
     cout << i << endl;
      break;
    }
    else if(S.size > N){
      cout << -1 << endl;
      break;
    }
    else i++;
    
  }
  
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: 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 '()' ?)
   31 |     else if(S.size > N){
      |             ~~^~~~
      |                   ()
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 >> 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.at(num[j][0]) != num[j][1]) kaku = 0;
    }
    
    if(kaku = 1){
     cout << i << endl;
      break;
    }
    else if(S.size > N) cout << -1 << endl;
    else i++;
    
  }
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: 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 '()' ?)
   31 |     else if(S.size > N) cout << -1 << endl;
      |             ~~^~~~
      |                   ()
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.at(num[j][0]) != num[j][1]) kaku = 0;
    }
    
    if(kaku = 1){
     cout << i << endl;
      break;
    }
    else if(S.size > N) cout << -1 << endl;
    else i++;
    
  }
  
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:15: 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 '()' ?)
   33 |     else if(S.size > N) cout << -1 << endl;
      |             ~~^~~~
      |                   ()