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

#include <iostream>
#include <algorithm>
using namespace std;
int digit[4];
int main(){
	int n,m;
	cin>>n>>m;
	int fac=0;
	while(m--){
		int a,b;  cin>>a>>b;
		cout<<a<<b<<endl;
		if(a==1&&b==0) fac=1;
		else if(digit[a]&&digit[a]!=b) fac=1;
		else digit[a]=b;
	}
	if(fac) cout<<-1<<endl;
	else{
		int ans=0;
		if(digit[1]==0) ans+=pow(10,n-1);
		else ans+=digit[1]*pow(10,n-1);
		if(digit[2]!=0) ans+=digit[2]*pow(10,n-2);
		if(digit[3]!=0) ans+=digit[3]*pow(10,n-3);
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:38: error: 'pow' was not declared in this scope
   19 |                 if(digit[1]==0) ans+=pow(10,n-1);
      |                                      ^~~
a.cc:20:36: error: 'pow' was not declared in this scope
   20 |                 else ans+=digit[1]*pow(10,n-1);
      |                                    ^~~
a.cc:21:47: error: 'pow' was not declared in this scope
   21 |                 if(digit[2]!=0) ans+=digit[2]*pow(10,n-2);
      |                                               ^~~
a.cc:22:47: error: 'pow' was not declared in this scope
   22 |                 if(digit[3]!=0) ans+=digit[3]*pow(10,n-3);
      |                                               ^~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int digit[4];
int main(){
	int n,m;
	cin>>n>>m;
	int fac=0;
	while(m--){
		int a,b;  cin>>a>>b;
		if(a==1&&b==0) fac==1;
		else if(digit[a]&&digit[a]!=b) fac=1;
		else digit[a]=b;
	}
	if(fac) cout<<-1<<endl;
	else{
		int ans=0;
		if(digit[1]==0) ans+=pow(10,n-1);
		else ans+=digit[1]*pow(10,n-1);
		if(digit[2]!=0) ans+=digit[2]*pow(10,n-2);
		if(digit[3]!=0) ans+=digit[3]*pow(10,n-3);
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:38: error: 'pow' was not declared in this scope
   18 |                 if(digit[1]==0) ans+=pow(10,n-1);
      |                                      ^~~
a.cc:19:36: error: 'pow' was not declared in this scope
   19 |                 else ans+=digit[1]*pow(10,n-1);
      |                                    ^~~
a.cc:20:47: error: 'pow' was not declared in this scope
   20 |                 if(digit[2]!=0) ans+=digit[2]*pow(10,n-2);
      |                                               ^~~
a.cc:21:47: error: 'pow' was not declared in this scope
   21 |                 if(digit[3]!=0) ans+=digit[3]*pow(10,n-3);
      |                                               ^~~
Language: C++

#include <bits/stdc++.h>

#include <iostream>


#define MOD 1000000007

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> P;
auto f=[]()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
};

int main()
{
	f();
	int n,m;
	cin>>n>>m;
	vector<P> d;

	while(m--)
	{
		int idx,nm;cin>>idx>>nm;
		d.push_back({idx,nm});
	}

	for(auto i=0;i<1000;++i
	{
		string s=to_string(i);
		if(s.size()==n)
		{
			bool ok=false;
			for(auto j=0;j<d.size();++j)
			{
				if((s[d[j].first-1]-'0')==d[j].second)
					ok=true;
			}
			if(ok){
				cout<<s<<"\n";
				return 0;
			}
		}
	}
	cout<<-1<<"\n";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:32: error: expected ')' before '{' token
   31 |         for(auto i=0;i<1000;++i
      |            ~                   ^
      |                                )
   32 |         {
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define dlog(x) cerr<<#x<<'='<<x<<endl
#define f first
#define s second
#define endl '\n'
#define sq(x) (x)*(x)*1ll
typedef long long ll;
typedef pair<int,int> pii;

/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do something instead of nothing and stay organized
*/

int mas[3]{-1,-1,-1};
int main () {
      int n ,m;
      cin>>n>>m;
      while (m--) {
            int a,b;
            cin>>a>>b; a--;
            if (mas[a] != -1 && mas[a] != b) {
                  goto NO;
            }
            mas[a]=b;
      }

      int start = pow(10,n-1);
      if (start == 1) start--;
      for (int i=start; i<pow(10,n); i++) {
            string cur = to_string(i);
            bool ok=true;
            for (int j = 0; j<cur.size(); j++) {
                  if (mas[j] == -1) continue;
                  if (mas[j] != cur[j] - '0') ok=false;
            }

            if (ok) {
                  cout << i << endl;
                  return 0;
            }
      }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:47:7: error: jump to label 'NO'
   47 |       NO: cout << -1 << endl;
      |       ^~
a.cc:26:24: note:   from here
   26 |                   goto NO;
      |                        ^~
a.cc:31:11: note:   crosses initialization of 'int start'
   31 |       int start = pow(10,n-1);
      |           ^~~~~
Language: C++

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

int main() {
	int n,m;
	cin>>n>>m;
	string str;
	set<int> s;
	map<int,int> ma;
	if(n==1)
	{
	  str="0";
	  for(int i=0;i<m;++i)
	    {
	        int temp1,temp2;
	        cin>>temp1>>temp2;
	       
	        
	        else if(s.find(temp1)!=s.end())
	        {
	            if(ma[temp1]!=temp2)
	            {
	            cout<<-1<<endl;
	            return 0;
	            }
	        }
	        else
	        {
	            s.insert(temp1);
	            ma[temp1] = temp2;
	            str[temp1-1]=(temp2+'0');
	        }
	        //cout<<"fdvfdv"<<endl;
	        
	        //cout<<str<<endl;
	    }
	    cout<<str<<endl;
	  
	}
	else
	{
	    str="1";
	    for(int i=0;i<n-1;++i)
	    {
	        str+="0";
	    }
	    
	    for(int i=0;i<m;++i)
	    {
	        int temp1,temp2;
	        cin>>temp1>>temp2;
	        if(temp1==1&&temp2==0)
	        {
	            cout<<-1<<endl;
	            return 0;
	        }
	        
	        else if(s.find(temp1)!=s.end())
	        {
	            if(ma[temp1]!=temp2)
	            {
	            cout<<-1<<endl;
	            return 0;
	            }
	        }
	        else
	        {
	            s.insert(temp1);
	            ma[temp1] = temp2;
	            str[temp1-1]=(temp2+'0');
	        }
	        //cout<<"fdvfdv"<<endl;
	        
	        //cout<<str<<endl;
	    }
	    cout<<str<<endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'else' without a previous 'if'
   19 |                 else if(s.find(temp1)!=s.end())
      |                 ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <queue>
#include <map>
#include <map>
#include <stack>
#include <set>

using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const double eps = 1e-10;
const int INF = 0x3f3f3f3f;
const ll mod  = 1e9 + 7;
const ll maxn = 1e6 + 5;

int main(){
	int n,m,a[10],s,c;
	map<int,int>mp;
	cin>>n>>m;
	bool flag=false;
	memset(a,-1,sizeof(a));
	while(m--){
		cin>>s>>c;
		if(a[s]==-1){
			q[s]=c;
			a[s]=c;
		}else{
			flag=true;
		}
	}
	if(a[1]==0 && n>1) flag=true;
	if(flag) cout<<-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:30:25: error: 'q' was not declared in this scope
   30 |                         q[s]=c;
      |                         ^
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 ull = unsigned long long;
using P = pair<int,int>;

int main(){
  int n,m;
  cin >> n >> m;
  vector<P> p(m);
  rep(i,m) cin >> p.at(i).first >> p.at(i).second;
  rep(x,1000){
    if(x.size() != n) continue;
    int nx = x;       
    vector<int> d(1);
    while(nx){
      d.push_back(nx%10);
      nx /= 10;
    }
    reverse(d.begin(),d.end()); //数字を、桁ごとにアクセス可能な形にした。
    
    bool ok = true;
    rep(i,m){
      if(d.at(p.at(i).first-1) != p.at(i).second) ok = false;
    }
    if( ok ){
      cout << x << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: 'i' was not declared in this scope
   12 |   rep(i,m) cin >> p.at(i).first >> p.at(i).second;
      |                        ^
a.cc:14:8: error: 'x' was not declared in this scope
   14 |     if(x.size() != n) continue;
      |        ^
a.cc:14:23: error: continue statement not within a loop
   14 |     if(x.size() != n) continue;
      |                       ^~~~~~~~
a.cc:15:14: error: 'x' was not declared in this scope; did you mean 'nx'?
   15 |     int nx = x;
      |              ^
      |              nx
Language: C++

#include <bits/stdc++.h>
using namespace std;
int a[100];
int main(){
	int n,m;
	cin>>n>>m;
	for(int i=1,x1,x2;i<=m;i++) {
	  cin>>x1>>x2;
	  if(!a[x1]&&!vis[x1]){
		 a[x1]=x2;
		 vis[x1]=1;
	  }
	  else a[x1]=min(a[x1],x2);
	}
	if(n==1){
	 cout<<a[1]<<'\n';
	 return 0;
  }
	if(!a[1]) cout<<-1<<'\n';
	else{
	for(int i=1;i<=n;i++){
		cout<<a[i];
	}
}
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: 'vis' was not declared in this scope
    9 |           if(!a[x1]&&!vis[x1]){
      |                       ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)

signed main(){

	lli n,m;cin>>n>>m;
	lli s[m]; char c[m];
	REP(i,0,m)cin>>s[i]>>c[i]; s[i]--;

	REP(i,0,1000){
		string A = to_string(i);
		if(A.size()!=n)continue;
		bool ok = true;
		REP(i,0,m)if(A[s[i]] != c[i])ok = false;
		if(ok){cout<<i<<endl;return 0;}
	}
	cout<<-1<<endl;


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:38: error: 'i' was not declared in this scope
   19 |         REP(i,0,m)cin>>s[i]>>c[i]; s[i]--;
      |                                      ^
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(n,-1);
  bool frag=true;
  rep(i, m) {
    int s,c; cin>>s>>c;
    if (a[s-1]!=-1&&a[s-1]!=c) frag=false;
    a[s-1]=c;
  }
  if (n!=1&&a[0]==0) frag=false;
  if (!frag) cout<<-1<<endl;
  if (n==1) cout<<max(0, a[0])<<endl;
  else {
    rep(i, n) {
    if (i==0) cout<<max(1, a[i]);
    else {
      if (a[i]==-1) cout<<0;
      else cout<<a[i];
    }
    cout<<endl;
  }
}


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

//#include "pch.h"
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <list>
#include <map>
#define OO INT_MAX
#define mp(x,y) make_pair(x,y)
#define x first
#define y second
#define ll unsigned long long int
#define pp pair<int,int>
#define heap priority_queue<pp, vector<pp>, greater<pp>>
using namespace std;
map<int, int> marked;
vector<vector<int>> Sheet;
string s;
bool satisfy(vector<pair<int, char>> conditions,int n) {
	s = to_string(n);
	for (auto condition : conditions) {
		if (s[condition.x - 1] != condition.y)
			return false;
	}
	return true;
}

int main()
{
	//freopen("test.txt", "r", stdin);
	int n, m;
	int num=-1;
	cin >> n >> m;
	int in1;
	char in2;
	vector<pair<int,char>> conditions;
	for (int i = 0; i < m; i++) {
		cin >> in1 >> in2;
		conditions.push_back(mp(in1, in2));
	}
	int limit = pow(10, n);
	for (int i = 0; i < limit; i++) {
		if (satisfy(conditions, i)) {
			cout << i;
			return 0;
		}
	}
	cout << -1;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:45:21: error: 'pow' was not declared in this scope
   45 |         int limit = pow(10, n);
      |                     ^~~
Language: C++

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

int main(){
    int n,m;
    cin >> n >> m;
    vector<P> p(m);
    
    rep(i,m) cin >>p[i].first >>p[i].second;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'i' was not declared in this scope
   11 |     rep(i,m) cin >>p[i].first >>p[i].second;
      |         ^
a.cc:2:23: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (i=0;i<(n);++i)
      |                       ^
a.cc:13:9: error: 'x' was not declared in this scope
   13 |     rep(x,1000){
      |         ^
a.cc:2:23: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (i=0;i<(n);++i)
      |                       ^
a.cc:25:13: error: 'i' was not declared in this scope
   25 |         rep(i,m){
      |             ^
a.cc:2:23: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (i=0;i<(n);++i)
      |                       ^
Language: Java

import java.util.Scanner;
import java.util.Arrays;
public class c{
	public static void Main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int a[] = new int[n];Arrays.fill(a,-1);
		boolean f = false;
		for(int i=0;i<m;i++){
			int s = sc.nextInt()-1;
			int c = sc.nextInt();
			if(a[s]==-1||a[s]==c){
				a[s]=c;
			}else{
				f=true;
			}
		}


		if(m==0){
			if(n==1){
				a[0]=0;
			}else{
				a[0]=1;
			}
		}

		if(a[0]==0&&n>1)f=true;

		if(a[0]==-1){
			if(n>1){
				a[0]=1;
			}else{
				a[0]=0;
			}
		}


		if(!f){
			for(int i:a){
				int an = i == -1 ? 0 : i;
				System.out.print(an);
			}
			System.out.println();
		}else{
			System.out.println(-1);
		}
	}
}


Compiler output:
Main.java:3: error: class c is public, should be declared in a file named c.java
public class c{
       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,m;
    cin>>n>>m;
    string s;
    for(int i=0;i<n;i++)
        s+='0';
    bool fg=true;
    bool vis[n];
    for(int i=0;i<n;i++)vis[i]=false;
    for(int i=0;i<m;i++)
    {
        ll ss,c;
        cin>>ss>>c;
        ss--;
        if(vis[ss]==false)
        {
            s[ss]=char('0'+c);
            vis[ss]=true;
        }
        else if(vis[ss]==true)
        {
            if(s[ss]!=char('0'+c)){fg=false;}
        }
    }
    if(!fg){cout<<-1;return 0;}
    if(vis[0]==false){ if(n==1)cout<<0; else(s[0]='1';cout<<s;)return 0;}
    if(vis[0]!=false )
    {
        if(s[0]=='0' && n>1)
            cout<<-1;
        else
            cout<<s;
        return 0;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:54: error: expected ')' before ';' token
   30 |     if(vis[0]==false){ if(n==1)cout<<0; else(s[0]='1';cout<<s;)return 0;}
      |                                             ~        ^
      |                                                      )
a.cc:30:63: error: expected primary-expression before ')' token
   30 |     if(vis[0]==false){ if(n==1)cout<<0; else(s[0]='1';cout<<s;)return 0;}
      |                                                               ^
Language: C++

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

int main() {
    int n, m;
    cin >> n >> m;
    int res = -1;
    string current;
    for(int i = 0; i < 1000; i++){
        current = to_string(i);
        if(current.size != n) continue;
        int j = 0;
        for(int j = 0; j < m; j++){
            int s;
            cin >> s, s--;
            char c;
            cin >> c;
            if(current[s] != c) break;
        }
        if(j + 1 == m){
            res = i;
            break;
        }
    }
    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: 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 '()' ?)
   11 |         if(current.size != n) continue;
      |            ~~~~~~~~^~~~
      |                        ()
Language: Java

import java.util.Scanner;

public class abc157c {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		int n,m;
		String num = new String();
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();m=sc.nextInt();
		int[] s = new int[m];
		int[] c = new int[m];

		for(int i = 0; i < m; i++) {
			s[i] = sc.nextInt();
			c[i] = sc.nextInt();
		}

		for(int i = 0 ; i < 1000; i++) {//1to1000までの数
			String temp = String.valueOf(i);
			if(temp.length() !=n) {//桁数と要求されたのが違うとき
				continue;
			}
			for(int j = 0; j < m; j++) {
				if(temp.charAt(s[j]-1)-'0'!=c[j]) {
					break;
				}else {
					if(j == m -1) {
						System.out.println(i);
						return;
					}
				}
			}
		}

		if(m == 0&&n==1) {
			System.out.println(0);
			return;
		}
		System.out.println(-1);
		return;




	}

}


Compiler output:
Main.java:3: error: class abc157c is public, should be declared in a file named abc157c.java
public class abc157c {
       ^
1 error
Language: C++

#include <iostream>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n] = {0};
  while (m--) {
  	int pos, num;
    cin >> pos >> num;
    a[n - pos] = min(num, a[n - pos]);  
  }
  if (c[0] == 0) {
    cout << -1;
  } else {
  	for (int ar : a) {
    	cout << ar;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'c' was not declared in this scope
   12 |   if (c[0] == 0) {
      |       ^
Language: C++

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

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

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

    vector<int> res(n, -1);
    for(int i=0; i<m; ++i){
        if(res.at(s.at(i)-1) != -1 && res.at(s.at(i)-1) != c.at(i) ){
            cout << -1;
            return 0;
        }

        res.at(s.at(i)-1) = c.at(i);
        if(n!= 1 && s.at(i) == 1 && c.at(i) == 0){
            cout << -1;
            return 0;
        }

        if(n==1 && s.at(i)==1 && c.at(i)==0){
            cout << 0;
            return 0;
        }
    }
    
    for(int i=0; i<pow(10, n); i++){
        bool flag = true;
        string str = to_string(i);
        if(str.length != n) continue;
        for(int j=0; j<n; j++){
            if(!(res.at(j) == -1 || res.at(j) == str[j]-'0' )){
                flag = false;
                break;
            }
        }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:36:16: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   36 |         if(str.length != n) continue;
      |            ~~~~^~~~~~
      |                      ()
Language: Java

import java.util.Scanner;
import java.util.Arrays;
public class c{
	public static void Main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int a[] = new int[3];Arrays.fill(a,-1);
		boolean f = false;
		for(int i=0;i<m;i++){
			int s = sc.nextInt()-1;
			int c = sc.nextInt();
			if((a[s]!=-1&&a[s]!=c)||(s==0&&c==0&&n!=1)){
				f = true;
			}else{
				a[s]=c;
			}
		}
		if(!f){
			for(int i=0;i<n;i++){
				if(a[i]==-1&&i==0&&m!=0){
					System.out.print(1);
				}else if(a[i]==-1){
					System.out.print(0);
				}else{
					System.out.print(a[i]);
				}
			}
			System.out.println();
		}else{
			System.out.println(-1);
		}
	}
}


Compiler output:
Main.java:3: error: class c is public, should be declared in a file named c.java
public class c{
       ^
1 error
Language: C++

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

int main(){
  int n, m;
  cin>>n >>m;
  char s[n];
  int b, c;
  for(int i=0;i<m;i++){
    cin>>b >>c;
    if((!s[b-1]) && (s[b-1]!=(char)c)){
      cout<<-1<<endl;
      return 0;
    }
    s[b-1]=(char)c;
  }
  if(s[0]=='0'){
    cout<<-1<<endl;
    return 0;
  }
  
  cout<<(int)s<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: cast from 'char*' to 'int' loses precision [-fpermissive]
   22 |   cout<<(int)s<<endl;
      |         ^~~~~~
Language: C++

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

int main(){
  int n, m;
  cin>>n >>m;
  char s[n];
  int b, c;
  for(int i=0;i<m;i++){
    cin>>b >>c;
    if((!s[b-1]) && (s[b-1]!=(char)c)){
      cout<<-1<<endl;
      return 0;
    }
    s[b-1]=(char)c;
  }
  if(s[0]=='0'){
    cout<<-1<<endl;
    return 0;
  }
  
  cout<<(int)s<<endl;
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
    1 | #incldue<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n >>m;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incldue<bits/stdc++.h>
a.cc:12:7: error: 'cout' was not declared in this scope
   12 |       cout<<-1<<endl;
      |       ^~~~
a.cc:12:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:17: error: 'endl' was not declared in this scope
   12 |       cout<<-1<<endl;
      |                 ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incldue<bits/stdc++.h>
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout<<-1<<endl;
      |     ^~~~
a.cc:18:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:15: error: 'endl' was not declared in this scope
   18 |     cout<<-1<<endl;
      |               ^~~~
a.cc:18:15: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:22:3: error: 'cout' was not declared in this scope
   22 |   cout<<(int)s<<endl;
      |   ^~~~
a.cc:22:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:9: error: cast from 'char*' to 'int' loses precision [-fpermissive]
   22 |   cout<<(int)s<<endl;
      |         ^~~~~~
a.cc:22:17: error: 'endl' was not declared in this scope
   22 |   cout<<(int)s<<endl;
      |                 ^~~~
a.cc:22:17: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

import io.StdIn._

object Main extends App {

  val NM = readLine.split(" ").map(_.toInt)
  val N = NM(0)
  val M = NM(1)

  val constraints = Range(0, M).map { _ =>
    val SC = readLine.split(" ").map(_.toInt)
    (SC(0), SC(1))
  }

  val ans = Range.inclusive(0, 999).find { n =>
    var keta = N
    val ketaToDigit = Array.fill[Int](N)(0)
    var nx = n

    do {
      ketaToDigit(keta) = nx % 10
      nx /= 10
      keta -= 1
    } while (nx >= 10)

    keta == 1 && constraints.forall { case (s, c) => ketaToDigit(s) == c }
  }

  println(ans.getOrElse(-1))
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import io.StdIn._
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main() {

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

}


Compiler output:
a.cc:5:7: error: expected nested-name-specifier before 'P'
    5 | using P pair<int,int>;
      |       ^
a.cc: In function 'int main()':
a.cc:11:10: error: 'P' was not declared in this scope
   11 |   vector<P> p(m);
      |          ^
a.cc:11:11: error: template argument 1 is invalid
   11 |   vector<P> p(m);
      |           ^
a.cc:11:11: error: template argument 2 is invalid
a.cc:12:18: error: invalid types 'int[int]' for array subscript
   12 |   rep(i,m) cin>>p[i].first>>p[i].second;
      |                  ^
a.cc:12:30: error: invalid types 'int[int]' for array subscript
   12 |   rep(i,m) cin>>p[i].first>>p[i].second;
      |                              ^
a.cc:26:13: error: invalid types 'int[int]' for array subscript
   26 |       if(d[p[i].first-1]!=p[i].second)ok=false
      |             ^
a.cc:26:28: error: invalid types 'int[int]' for array subscript
   26 |       if(d[p[i].first-1]!=p[i].second)ok=false
      |                            ^
a.cc:26:47: error: expected ';' before '}' token
   26 |       if(d[p[i].first-1]!=p[i].second)ok=false
      |                                               ^
      |                                               ;
   27 |     }
      |     ~
Language: C++

#include <cstdio>
using namespace std;

int main(int argc, char** argv)
{
	int n, m;
	scanf("%d%d", &n, &m);
	char res[5], temp_output = '\0';
	for(int i=0; i<n; i++) res[i] = '0';
	int lastc[5] = {-1, -1, -1, -1, -1};
	for(int i=0; i<m; i++)
	{
		int s, c;
		scanf("%d%d", &s, &c);
		if(s > n) {puts("-1"); return 0;}
		if(lastc[--s] != -1)
		{
			if(lastc[s] == c) continue;
			puts("-1");
			return 0;
		}
		if(s == 0)
		{
			if(n == 1) temp_output = c + '0';
			else if(c == 0) {puts("-1"); return 0;}
		}
		lastc[s] = c, cnt ++;
		res[s] = c + '0';
	}
	if(temp_output) {putchar(temp_output); putchar('\n'); return 0;}
	if(n == 1) {puts("0"); return 0;}
	if(res[0] == '0') res[0] = '1';
	puts(res);
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:27:31: error: 'cnt' was not declared in this scope; did you mean 'int'?
   27 |                 lastc[s] = c, cnt ++;
      |                               ^~~
      |                               int
Language: C++

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

using namespace std;

signed main (){
	int ans = 0;
	int n,m;
	cin >> n >> m;
	vector<pair<int,int>> sc(m);
	vector<int> num(n,0);
	int flag = 0;
	int digit = 0;
	rap(i,m){
		cin >> sc.at(i).first >> sc.at(i).second;
		num[sc[i].first-1] = sc[i].second;
	}
	rap(i,m){
		if(num[sc[i].first-1] != sc[i].second){
			flag = 1;
		}
	}
	if(m>1){
		if(num[0]==0){
			flag = 1;
		}
	}
	if(flag==1){
		cout<<-1<<endl;
	}else{
		int ans = 0;
		rap(i,n){
			ans += num[i] * pow(10,m-1-i);
		}
		cout<<ans<<endl;
	}
	return 0;
}

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

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

int main(){ 
    int N;
    int M;
    
    cin >> N;
    cin >> M;
    
    vector<int> ans(N, 10);
  
    //整数入力
    for(int i = 0; i < M; i++){
        int s, c;
        cin >> s; cin >> c;
        
        if(ans.at(s-1) > 9){
            ans.at(s-1) = c;
        }else{
            if(ans.at(s-1) != c){
                cout << "-1" << endl;
                return 0;
            }
        }
    }
    
    // 最上位が0かつ桁数が1より大きい場合存在しない    
    if(ans.at(0) == 0 && N > 1){
        cout << "-1" << endl;
        return 0;
    }

    //最上位が定義されていなかった場合、1を設定
    if(ans.at(0) > 9){
        if(N > 1){
            ans.at(0) = 1;
        }else{
            ans.at(0) = 0;
    }

    //最上位から値を出力。定義されていなかった場合0を出力
    for(int i = 0; i < N; i++){
        if(ans.at(i) > 9){
            cout << 0;
        }else{
            cout << ans.at(i);
        }
    }
    cout << endl;
    return 0;
}
        


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

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

using namespace std;

signed main (){
	int ans = 0;
	int n,m;
	cin >> n >> m;
	vector<pair<int,int>> sc(m);
	vector<int> num(n,-1);
	int flag = 0;
	int digit = 0;
	rap(i,m){
		cin >> sc.at(i).first >> sc.at(i).second;
		if(num[sc[i].first-1]==-1){
			num[sc[i].first-1] = sc[i].second;
		}else{
			if(num[sc[i].first-1] != sc[i].second){
				flag = 1;
			}
		}
	}

	rap(i,n){
		if(num[i] != -1){
			ans += num[i] * pow(10,n-1-i);
		}
	}
	if(flag== 1){
		cout<<-1<<endl;
		return 0;
	}
	if(ans == 0 && n>1){
		cout<<-1<<endl;
		return 0;
	}
	cout<<ans<<endl;
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
using llong = long long;
using P = pair<int, int>;
const int inf = 1 << 20;
const int mod = 1e9 + 7;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: 'x' was not declared in this scope; did you mean 'nx'?
   17 |       int nx = x / 10;
      |                ^
      |                nx
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
 
 
int main() {
 
	int n, m;
 
	scanf("%d %d", &n, &m);
 
	int tmp[3] = {10, 10, 10};
	int s[5];
	int c[5];
 
	for(int i = 0; i < m; i++) {
		scanf("%d %d", &s[i], &c[i]);
	}
 
 
	for(int i = 0; i < m; i++) {
		if( (tmp[s[i] -1]) == 10) {
			tmp[s[i] -1] = c[i];
		}
		else if( (tmp[s[i] -1]) == c[i]){
			continue;
		}
		else{
			printf("-1\n");
			return 0;
		}
	}
 
	for(int i = 0; i < n; i++) {
		if(tmp[i-1] == 10) {
			tmp[i-1] = 0;
		}
	}
 
	int ans = 0;
	if(n == 3) {
		for(int i = 0; i < m; i++) {
			if( (s[i] == 1) && (c[i] == 0) ){
				printf("-1\n");
				return 0;
			}
		}
		ans = tmp[0] * 100 + tmp[1] * 10 + tmp[2];
	} else if( n == 2) {
		for(int i = 0; i < m; i++) {
			if( (s[i] == 1) && (c[i] == 0) ){
				printf("-1\n");
				return 0;
			}
		}
		ans = tmp[0] * 10 + tmp[1];
	} else if( n == 1) {
		for(int i = 0; i < m; i++) {
			if(c[i] == 0){
				printf("-1\n");
				return 0;
			}
		}
		ans = tmp [0];
	}
 
 
	printf("%d", ans);
 
	return 0;
 
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>


int main() {

	int n, m;

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

	int tmp[3] = {10, 10, 10};
	int s[5];
	int c[5];

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


	for(int i = 0; i < m; i++) {
		if( (tmp[s[i] -1]) == 10) {
			tmp[s[i] -1] = c[i];
		}
		else if( (tmp[s[i] -1]) == c[i]){
			continue;
		}
		else{
			printf("-1\n");
			return 0;
		}
	}

	for(int i = 0; i < n; i++) {
		if(tmp[i-1] == 10) {
			tmp[i-1] = 0;
		}
	}

	int ans = 0;
	if(n == 3) {
		for(int i = 0; i < m; i++) {
			if( (s[i] == 1) && (c[i] == 0) ){
				printf("-1\n");
				return 0;
			}
		}
		ans = tmp[0] * 100 + tmp[1] * 10 + tmp[2];
	} else if( n == 2) {
		for(int i = 0; i < m; i++) {
			if( (s[i] == 1) && (c[i] == 0) ){
				printf("-1\n");
				return 0;
			}
		}
		ans = tmp[0] * 10 + tmp[1];
	} else if( n == 1) {

		ans = tmp [0];
	}


	printf("%d", ans);

	return 0;

}

Compiler output:
main.c:80:5: error: redefinition of 'main'
   80 | int main() {
      |     ^~~~
main.c:7:5: note: previous definition of 'main' with type 'int()'
    7 | int main() {
      |     ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: expression cannot be used as a function
   11 |     rep(i, m) cin >> p[i].first() >> p[i].second();
      |                      ~~~~~~~~~~^~
a.cc:11:49: error: expression cannot be used as a function
   11 |     rep(i, m) cin >> p[i].first() >> p[i].second();
      |                                      ~~~~~~~~~~~^~
Language: C++

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

using namespace std;

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

	vector<vector<int>> num(N, vector<int>(2));
	if (N == 1) {
		num.at(0).at(0) = 0;
	}
	else {
		num.at(0).at(0) = 1;
	}
	num.at(0).at(1) = 0

	bool ans = true;

	for (int i = 1; i < N; i++) {
		num.at(i).at(0) = 0;
		num.at(i).at(1) = 0;
	}

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

		if (num.at(s - 1).at(1) > 0) {
			if (num.at(s - 1).at(0) != c) {
				ans = false;
			}
		}
		
		num.at(s - 1).at(0) = c;
		num.at(s - 1).at(1)++;
	}

	if (num.at(0).at(0) == 0 && N != 1) ans = false;
	int x = 1;

	if (ans) {
		x = num.at(0).at(0);
		if (N > 1) {
			for (int i = 1; i < N; i++) {
				x *= 10;
				x += num.at(i).at(0);
			}
		}
	}
	else {
		x = -1;
	}

	cout << x << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:28: error: expected ';' before 'bool'
   20 |         num.at(0).at(1) = 0
      |                            ^
      |                            ;
   21 | 
   22 |         bool ans = true;
      |         ~~~~                
a.cc:35:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |                                 ans = false;
      |                                 ^~~
      |                                 abs
a.cc:43:45: error: 'ans' was not declared in this scope; did you mean 'abs'?
   43 |         if (num.at(0).at(0) == 0 && N != 1) ans = false;
      |                                             ^~~
      |                                             abs
a.cc:46:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |         if (ans) {
      |             ^~~
      |             abs
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int n, m; cin>> n >> m;
  	
	vector<int> v(n, -1);
  
	int index, num;
	bool possible = true;
  
  	
	for(int i = 0; i < m; ++i)
	{
		cin >> index >> num; --index;
        if(n > 1 and index == 0 and num == 0)
        {
            possible = false; break;
        }
		if(v[index] == -1)
			v[index] = num;
		else if (v[index] != num)
		{
			possible = false; break;
		}
	}
	
	if(possible)
	{
		 if(v[0] == -1) v[0] = 1;
      	if(m==0 and n==1)
          v[0] = 0;
          for(int i = 1; i < n; ++i)
		 {
			if(v[i] == -1) v[i] = 0;
		 }
		 
		 copy(v.begin(), v.end(), ostream_iterator<int>(cout, ""));
        
	}
    else	
	cout << -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:43: error: 'ostream_iterator' was not declared in this scope
   41 |                  copy(v.begin(), v.end(), ostream_iterator<int>(cout, ""));
      |                                           ^~~~~~~~~~~~~~~~
a.cc:3:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
    2 | #include <vector>
  +++ |+#include <iterator>
    3 | 
a.cc:41:60: error: expected primary-expression before 'int'
   41 |                  copy(v.begin(), v.end(), ostream_iterator<int>(cout, ""));
      |                                                            ^~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int n, m; cin>> n >> m;
	vector<int> v(n, -1);
	int index, num;
	bool possible = true;
	for(int i = 0; i < m; ++i)
	{
		cin >> index >> num; --index;
        if(n >= 1 and index == 0 and num == 0)
        {
            possible = false; break;
        }
		if(v[index] == -1)
			v[index] = num;
		else if (v[index] != num)
		{
			possible = false; break;
		}
	}
	
	if(possible)
	{
		 if(v[0] == -1) v[0] = 1;
		 for(int i = 1; i < n; ++i)
		 {
			if(v[i] == -1) v[i] = 0;
		 }
		 
		 copy(v.begin(), v.end(), ostream_iterator<int>(cout, " "));
        
	}
    else	
	cout << -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:43: error: 'ostream_iterator' was not declared in this scope
   35 |                  copy(v.begin(), v.end(), ostream_iterator<int>(cout, " "));
      |                                           ^~~~~~~~~~~~~~~~
a.cc:3:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
    2 | #include <vector>
  +++ |+#include <iterator>
    3 | 
a.cc:35:60: error: expected primary-expression before 'int'
   35 |                  copy(v.begin(), v.end(), ostream_iterator<int>(cout, " "));
      |                                                            ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:43:11: error: 'i' was not declared in this scope
   43 |         a[i]=0;
      |           ^
Language: C++

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

int main(){
  int n, m;
  cin >> n >> m;
  vector<pair<int, char>> a(m);
  for(auto& i : a){
    cin >> i.first >> i.second;
    i.first--;
  }
  for(int i = 0; i < 1000; i++){
    string s = to_string(i);
    if(s.size() != n) continue;
    if(any_of(a.begin(), a.end(), [](auto i){ return s[i.first] != i.second; })) continue;
    cout << s << endl;
    return 0;
  }
  cout << -1 << endl;
}

Compiler output:
a.cc: In lambda function:
a.cc:15:54: error: 's' is not captured
   15 |     if(any_of(a.begin(), a.end(), [](auto i){ return s[i.first] != i.second; })) continue;
      |                                                      ^
a.cc:15:36: note: the lambda has no capture-default
   15 |     if(any_of(a.begin(), a.end(), [](auto i){ return s[i.first] != i.second; })) continue;
      |                                    ^
a.cc:13:12: note: 'std::string s' declared here
   13 |     string s = to_string(i);
      |            ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

double getTime() {
  return clock() / (double) CLOCKS_PER_SEC;
}

void read() {};

template<typename T, typename... Args>
void read(T& a, Args&... args) {
  cin >> a;
  read(args...);
}

void print() {};

template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " \n"[sizeof...(args) == 0];
  print(args...);
}

int main() {
  int n, m; cin >> n >> m;
  vector <int> ans(n);
  for(int i = 0; i < m; i++) {
    int x, y; cin >> x >> y;
    ans[x - 1] = y;
  }
  for(int i = 0; i < n; i++) {
    if(ans[i]) continue;
    if(i == 0 and n == 1) ans[i] = 0;
    else if(i == 0) ans[i] = 1;
    else ans[i] = 0;
  }
  if()
  for(auto x : ans) cout << x;
  puts("");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:6: error: expected primary-expression before ')' token
   40 |   if()
      |      ^
Language: C++

#include <stdio.h>
#include <algorithm>
int main(){
  int n,m,cnt=0;
  scanf("%d",&n);
  scanf("%d",&m);
  int s[m],c[m],num[n];
  for(int i=0;i<n;i++) num[i]=10;
  for(int i=0;i<m;i++){
    scanf("%d",&s[i]);
    scanf("%d",&c[i]);
  }
  for(int i=0;i<m;i++){
    if(num[n-s[i]]!=10)num[n-s[i]]=c[i];
    else c++;
  }
  for(int i=0;i<n;i++) if(num[i]==10) num[i]=0;
  if((num[n-1]==0&&n!=1)||cnt>0) printf("-1\n");
  else if(n==1&&num[n-1]==0&&cnt==0) printf("0\n");
  else{
    for(int i=1;i<=n;i++) printf("%d",num[n-i]);
    printf("\n");
  }
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: lvalue required as increment operand
   15 |     else c++;
      |          ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: conflicting declaration 'int c [m]'
    7 |   int s[m],c[m],num[n];
      |            ^
a.cc:4:11: note: previous declaration as 'int c'
    4 |   int n,m,c=0;
      |           ^
a.cc:11:18: error: invalid types 'int[int]' for array subscript
   11 |     scanf("%d",&c[i]);
      |                  ^
a.cc:14:37: error: invalid types 'int[int]' for array subscript
   14 |     if(num[n-s[i]]!=10)num[n-s[i]]=c[i];
      |                                     ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);


int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int dp[1010][1010];
int bingo[3][3];
bool flag[3][3];

int main() {
	int n, m;
	cin >> n >> m;
	vector<int>s(m), c(m);
	rep(i, m) {
		cin >> s[i] >> c[i];
	}
	rep(i, 1000) {
		vector<int>d(1, i % 10);
		bool flag = true;
		int keta = 1;
		int res = i/10;
		while (res > 0) {
			keta++;
			d.push_back(res % 10);
			res /= 10;
		}
		if (keta != n)continue;
		reverse(d.begin(), d.end());
		rep(j, m) {
			if (S[s[j] - 1] != 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:62:29: error: 'S' was not declared in this scope
   62 |                         if (S[s[j] - 1] != c[j])flag=false;
      |                             ^
Language: C++

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

int main()
{
    int N,M,mcount = 0;
    bool doublecheck = false;
    int num[1005] = {};
    int ketacheck[5]={};
    bool bketacheck[5];

    for(int i = 0;i < 5; i++)
    {
        bketacheck[i] = false;
    }


    cin>>N>>M;
    for(int i = 0;i<M;i++)
    {
        int s,c;
        cin>>s>>c;
        //同じ桁に違う値を指定するという矛盾を起こしていないか
        if(bketacheck[s] && ketacheck[s]!=c)
        {
            //cout<<"doublecheck"<<endl;
            doublecheck = true;
        }
        ketacheck[s] = c;
        bketacheck[s] = true;

        //ありうる値の範囲内から条件に合う数字を選ぶ
        for(int j = 0;j < 1000; j++)
        {
            int cn = j;
            int nownum;
            for(int k = 0; k < 4 - s; k++)
            {
                nownum = cn % 10;
                cn /= 10;
            }
            if(nownum == c)
            {
                num[j]++;
            }
        }
        mcount++;
    }

    if(doublecheck)
    {
        //cout<<"muzyun"<<endl;
        cout<<-1<<endl;
        return 0;
    }

    int ans = -1;
    //cout<<"mcount = "<<mcount<<endl;
    for(int i = 0; i < 1000; i++)
    {
        //cout<<"num "<<i<<" = "<<num[i]<<endl;
        if(num[i] != 0 && num[i] == mcount)
        {
            ans = i;
            break;
        }
    }
    if(N>=2&&ans=0)ans = -1;

    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:12: error: lvalue required as left operand of assignment
   68 |     if(N>=2&&ans=0)ans = -1;
      |        ~~~~^~~~~
Language: C++

#include <iostream>

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

	std::cin >> N >> M;

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

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

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

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

out:
	std::cout << ans;

	return 0;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:51:40: error: 'pow' was not declared in this scope
   51 |                                 ans += pow(10, N - s[i]) * c[i];
      |                                        ^~~
a.cc:77:40: error: 'pow' was not declared in this scope
   77 |                                 ans += pow(10, N - s[i]) * c[i];
      |                                        ^~~