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

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


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

#include<stdio.h>
int main(void){
    int N, M, d, e, check = 0, keta, jyousuu;
    scanf("%d", &N);
    scanf("%d", &M);
    int s[M], c[M], A[N];
    for(int i = 0; i < M; i++){
        scanf("%d", &s[i]);
        scanf("%d", &c[i]);
    }
    //事前準備として、答えのもとになるA[N]を初期化
    for(i = 0; i < N; i++){
        A[i] = 0;
    }
    //まずs[M]を基準に降順にしたい
    for(i = 0; i < M; i++){
        for(int j = i + 1; j < M; j++){
            if(s[i] < s[j]){
                d = s[i];
                s[i] = s[j];
                s[j] = d;
                d = c[i];
                c[i] = c[j];
                c[j] = d;
            }
        }
    }
    //入力で同じ桁に異なる数値が定義されていないかチェック
    for(i = 0; i < M - 1; i++){
        e = i + 1;
        if(s[i] == s[e]){
            if(c[i] != c[e]){
                printf("-1\n");
                check += 1;
            }
        }
    }
    //入力される最大桁数がNより大きいと絶対にアウト
    if(N < s[0]){
        printf("-1\n");
        check += 1;
    }
    //(N-1)桁目から指定されてる最大桁数までの数を0に
    if(s[0] > 1){
       A[0] = 1;
       for(i = 1; i < s[0]; i++ ){
           A[i] = 0;
       } 
    }
    //あとは各桁どんどん代入してく
    for(i = 0; i < M; i++){
        keta = s[i] - 1;
        A[keta] = c[i];
    }
    //最後にcheckを活用し、エラーがなければ答えを出力
    if(check == 0){
        int a = 0, x;
        for(i = 0; i < N; i++){
            jyousuu = 1; x = N - i - 1;
            for(int k = 0; k < i; k++) jyousuu *= 10;
            a += A[x] * jyousuu;
        }
        printf("%d", a);
    }
    return 0;

}

Compiler output:
main.c: In function 'main':
main.c:12:9: error: 'i' undeclared (first use in this function)
   12 |     for(i = 0; i < N; i++){
      |         ^
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

import java.util.Scanner;
 
public class Main {
	static int solve(int N , int s[] , int c[]){
		for(int n = 0 ; n <= 1000 ; ++n){
			String st = String.valueOf(n);
			if(st.length() != N){
				continue;
			}
			boolean f = true;
			for(int i = 0 ; i < s.length ; ++i){
				if(st.charAt(s[i] - 1) != c[i]){
					f = false;
				}
			}
			if(f)return n;
		}
		return -1;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int s[] = new int[M];
		int c[] = new int[M];
		for(int i = 0 ; i < M ; ++i){
			s[i] = sc.nextInt();
			c[i] = sc.nextInt();
		}
		System.out.println(solve(N, s, c));
	}
}

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

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

using namespace std;

int main(void)
{
  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];

  for (int i = 0; i < 1000; i++) {
    bool flag = true;
    string str = to_string(i);
    if (str.length() < n)
      continue;
    for (int j = 0; j < m; j++) {
      if (str[s[j] - 1] != c[j])
        flag = false;
    }
    if (flag) {
      cout << str << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(void)
{
  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];

  for (int i = 0; i < 1000; i++) {
    bool flag = true;
    string str = to_string(i);
    if (str.length() < n)
      continue;
    for (int j = 0; j < m; j++) {
      if (str[s[j] - 1] != c[j])
        flag = false;
    }
    if (flag) {
      cout << str << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(void)
{
  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];

  for (int i = 0; i < 1000; i++) {
    bool flag = true;
    string str = to_string(i);
    if (str.length() < n)
      continue;
    for (int j = 0; j < m; j++) {
      if (str[s[j] - 1] != c[j])
        flag = false;
    }
    if (flag) {
      cout << str << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}


Compiler output:
a.cc:41:5: error: redefinition of 'int main()'
   41 | int main(void)
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main(void)
      |     ^~~~
a.cc:75:5: error: redefinition of 'int main()'
   75 | int main(void)
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main(void)
      |     ^~~~
Language: C++

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

using namespace std;

int main(void)
{
  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];

  for (int i = 0; i < 1000; i++) {
    bool flag = true;
    string str = to_string(i);
    if (str.length() < n)
      continue;
    for (int j = 0; j < m; j++) {
      if (str[s[j] - 1] != c[j])
        flag = false;
    }
    if (flag) {
      cout << str << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}
v

Compiler output:
a.cc:35:1: error: 'v' does not name a type
   35 | v
      | ^
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;//左からfirst桁目がsecond(数字)
  rep(x,1000){
    int keta=1;//0が1桁だから1を初期値にしている
    int nx=x/10;//nx=計算用の変数
    vector<int> d(1,x%10);
    //nxが0になるまで割る10を繰り返す
    while (nx) {
      keta++;
      d.push_back(nx%10);
      nx/=10;
    }
    //この操作では例えば702が合ったら2,0,7の順番で取り出されるからそれを逆順に並び替えれば復元される 
    reverse(d.begin(),d.end());
    if (keta!=n) continue;
    bool ok=true;
    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:4:12: error: 'Long' does not name a type; did you mean 'long'?
    4 | using ll = Long Long;
      |            ^~~~
      |            long
Language: C++

#include<bits/stdc++.h>
using namespace std;
int i,j,n,m,c,d,a,b,e,k;
map<int,int> ans;
int main(){
  for(cin>>n>>m;i<m;i++){
    cin>>b>>c;
    if(b>n)return cout<<-1,0;
    if((n!=1&&b==1&&c==0)return cout<<-1,0;
    if(ans[b]==0||ans[b]==c)ans[b]=c;
    else return cout<<-1, 0;
  }
  if(n==3){
    if(ans[1]==0)ans[1]=1;
    cout<<ans[1]*100+ans[2]*10+ans[3];
  }else if(n==2){
    if(ans[1]==0)ans[1]=1;
    cout<<ans[1]*10+ans[2];
  }else{
    cout<<ans[1];
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected ';' before 'return'
    9 |     if((n!=1&&b==1&&c==0)return cout<<-1,0;
      |                          ^~~~~~
      |                          ;
a.cc:10:5: error: expected primary-expression before 'if'
   10 |     if(ans[b]==0||ans[b]==c)ans[b]=c;
      |     ^~
a.cc:9:44: error: expected ')' before 'if'
    9 |     if((n!=1&&b==1&&c==0)return cout<<-1,0;
      |       ~                                    ^
      |                                            )
   10 |     if(ans[b]==0||ans[b]==c)ans[b]=c;
      |     ~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int i,j,n,m,c,d,a,b,e,k;
map<int,int> ans;
int main(){
  for(cin>>n>>m;i<m;i++){
    cin>>b>>c;
    if(b>n&&c==0)return cout<<-1,0;
    if(ans[b]==0||ans[b]==c)ans[b]=c;
    else return cout<<-1, 0;
  }
  if(n==3){
    if(ans[1]==0)ans[1]=1;
    cout<<ans[1]*100+ans[2]*10+ans[3];
  }else if(n==2){
    if(ans[1]==0)a[1]=1;
    cout<<ans[1]*10+ans[2];
  }else{
    cout<<ans[1];
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: invalid types 'int[int]' for array subscript
   16 |     if(ans[1]==0)a[1]=1;
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int i,j,n,m,c,d,a,b,e,k;
map<int,int> ans;
int main(){
  for(cin>>n>>m;i<m;i++){
    cin>>b>>c;
    if(b>n&&c==0)return cout<<-1,0;
    if(ans[b]==0||ans[b]==c)ans[b]=c;
    else return cout<<-1, 0;
  }
  if(n==3){
    if(ans[1]==0)ans[1]==1;
    cout<<ans[1]*100+ans[2]*10+ans[3];
  }else if(n==2){
    if(ans[1]==0)a[1]==1;
    cout<<ans[1]*10+ans[2];
  }else{
    cout<<ans[1];
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: invalid types 'int[int]' for array subscript
   16 |     if(ans[1]==0)a[1]==1;
      |                   ^
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
  int n,m,s[6],c[6],ans;
  bool bb;
  cin>>n>>m;
  for(int i=0;i<m;i++){
    cin>>s[i]>>c[i];
  }
  
  for(int u=0;u<1000;u++){
    if(n==1 && u>9)continue;
    else (pow(10,n-1)>u && u>=pow(10,n))continue;
    
    bb=true;
    for(int i=0;i<m;i++){
      if(n==3){
        if(s[i]==1 && (u/100!=c[i] or c[i]==0)){bb=false; break;}
        else if(s[i]==2 && (u%100)/10!=c[i]){bb=false; break;}
        else if(s[i]==3 && u%10!=c[i]){bb=false; break;}}
      
      else if(n==2){
        if(s[i]==1 && ((u%100)/10!=c[i] or c[i]==0)){bb=false; break;}
        else if(s[i]==2 && u%10!=c[i]){bb=false; break;}
      }
      
      else{
        if(s[i]==1 && u%10!=c[i]){bb=false; break;}
      }   
    }
    if(bb){ans=u; break;}
    else ans=-1;
  }
  cout<<ans<<endl;
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:15:41: error: expected ';' before 'continue'
   15 |     else (pow(10,n-1)>u && u>=pow(10,n))continue;
      |                                         ^~~~~~~~
      |                                         ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
ll strtoint(string str);
int main(){
	fast;
	ll n,m,s,c;
	cin>>n>>m;
	vector<int> arr(n,-1);
	vector<bool> ok(n,1);
	bool tmp=1;
	map<ll,ll> mp;
	for(auto i=0;i<m;++i){
		cin>>s>>c;
		if(ok[s-1]){
			arr[s-1]=c;
			ok[s-1]=0;
			mp[s-1]=c;
		}
		if(!ok[s-1] && mp[s-1]!=c)tmp=0;
	}
	for(auto i=0;i<n;++i){
		if(ok[i]){
			if(i==0)arr[i]=1;
			else
				arr[i]=0;
		}
	}
	if(arr[0]==0 && n>1){
		cout<<"-1\n";
		return 0;
	}
	else
		if(n===1 && ok[0]){cout<<0<<'\n'; return 0;}
	if(tmp){
		for(auto i=0;i<n;++i)cout<<arr[i];
	}
	else
		cout<<"-1";
	cout<<'\n';
	return 0;
}
ll strtoint(string str){
	ll x=0;
	stringstream ss;
	ss<<str;
	ss>>x;
	return x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:23: error: expected primary-expression before '=' token
   35 |                 if(n===1 && ok[0]){cout<<0<<'\n'; return 0;}
      |                       ^
Language: C++

ok = True

NM = [map(int, input().split())]
N, M = [list(i) for i in zip(*NM)]
sc = [map(int, input().split()) for _ in range(M[0])]
s, c = [list(i) for i in zip(*sc)]

l = [-1] * N[0]


for i in range(M[0]):
    if l[s[i]-1] == -1:
        l[s[i]-1] = c[i]
    elif l[s[i]-1] != c[i]:
        ok = False
        break
        
if l[0] == 0:
    ok = False
elif l[0] == -1:
    l[0] = 1
    
for i in range(1,N[0]):
    if l[i] == -1:
        l[i] = 0
    
ans = ""   
if ok:
    for i in range(len(l)):
        ans = ans + str(l[i])
    print(ans)
else:
    print("-1")

#print(M[0],N[0])
#print(s[0],c[0])

Compiler output:
a.cc:35:2: error: invalid preprocessing directive #print
   35 | #print(M[0],N[0])
      |  ^~~~~
a.cc:36:2: error: invalid preprocessing directive #print
   36 | #print(s[0],c[0])
      |  ^~~~~
a.cc:1:1: error: 'ok' does not name a type
    1 | ok = True
      | ^~
Language: C++

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

int main() {
    int n, m;
    cin >> n >> m;
    map<int, int> mp;
    rep(i,n) {
        mp[i] = -1;
    }
    bool flag = true;
    rep(i,m) {
        int s, c;
        cin >> s >> c;
        if (mp[s-1] == -1) mp[s-1] = c;
        else {
            if (mp[s-1] == c) continue;
            else {
                flag = false;
                break;
            }
        }
    }
    if (mp[0] == 0) flag = false;
    rep(i,n) {
        if (i != 0 && mp[i] == -1) mp[i] = 0;
        if (i == 0 && mp[i] == -1) mp[i] = 1;
    }
    flag2 = false;
    rep(i,n) {
        if (mp[i] != 0) flag2 = true;
    }
    if (flag) flag = flag2;
    if (flag) {
        rep(i,n) {
            if (i != n-1) printf("%d", mp[i]);
            else printf("%d\n", mp[i]);
        }
    } else printf("-1\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'flag2' was not declared in this scope; did you mean 'flag'?
   31 |     flag2 = false;
      |     ^~~~~
      |     flag
Language: C++

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower

using namespace std;
using ll = long long;

#define rep(i,N) for(int i=0;i<(int)N;++i)

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

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

	rep(i, M) cin >> s[i] >> c[i];

	int ans=0;

	for (int i = 0; i < M; ++i) {
		if (s[i] == 1 && c[i] == 0) { cout << -1 << endl; goto xyz; }
		if (i >= 1)
			for (int j = 0; j < i; ++j) {
				if (s[j] == s[i]) {
					if (c[j] != c[i]) { cout << -1 << endl; goto xyz; }
					else { goto pqr; }
				}
			}
		ans += c[i] * round(pow(10, N - s[i]));
	pqr:;
	}
	cout << ans << endl;
xyz:;
}

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



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

#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;


int main() {


	int  N, M;
	cin >> N >> M;
	vector<int> s(M);
	vector<int> c(M);
	rep(i, M) cin >> s[i] >> c[i];
	rep(i, M) s[i]--;
	if (N > M)
	{
		cout << -1 << endl;
		return 0;
	}

	vector<int> ans(N);

	rep(i, N) ans[i] = 0;



	rep(i, M) ans[s[i]] = c[i];

	int x = 0;

	for (int i = 0; i<N; i++)
	{
		cout << ans[i] << endl;

		x += ans[i] * pow(10, N-i-1);
	}

	cout << x << endl;

	return 0;
}




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

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

}

Compiler output:
a.cc:1:1: error: 'nt' does not name a type; did you mean 'int'?
    1 | nt main(){
      | ^~
      | int
Language: C++

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace C
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var nm = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            if (nm[0] == 1 && nm[1] == 0)
            {
                Console.WriteLine(0);
                return;
            }
            var digits = new int[nm[0]];
            for (var i = 0; i < nm[1]; i++)
            {
                var sc = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
                if (sc[0] == 1 && sc[1] == 0)
                {
                    Console.WriteLine(-1);
                    return;
                }
                if (digits[sc[0] - 1] != 0 && digits[sc[0] - 1] != sc[1])
                {
                    Console.WriteLine(-1);
                    return;
                }
                digits[sc[0] - 1] = sc[1];
            }
            if (digits[0] == 0) digits[0] = 1;
            Console.WriteLine(int.Parse(string.Join("", digits)));
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.IO;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Linq;
      |       ^~~~~~
a.cc:9:5: error: expected unqualified-id before 'public'
    9 |     public class Program
      |     ^~~~~~
Language: Java

import java.util.*;
import java.io.*;

public class Main1 implements Runnable{
    static Scanner sc = new Scanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException{
        new Thread(null, new Main1(), "", 32 * 1024 * 1024).start();
        Thread.setDefaultUncaughtExceptionHandler((t,e)->System.exit(1));
        out.flush();
    }

    public void run(){
        boolean check = false;
        int N = Integer.parseInt(sc.next());
        int[] keta = new int[N];
        int M = Integer.parseInt(sc.next());
        int[] s = new int[N];
        int[] c = new int[N];
        for(int i = 0; i < N; i++){
            keta[i] = -1;
        }
        for(int i = 0; i < M; i++){
            s[i] = Integer.parseInt(sc.next());
            c[i] = Integer.parseInt(sc.next());
            if(keta[s[i]-1] == -1){
                keta[s[i]-1] = c[i];
            }else if(keta[s[i]-1] == c[i]){

            }else{
                check = true;
            }
        }
        if(check){
            System.out.println(-1);
        }else{
            if(keta[0] <= 0){
                System.out.print(1);
            }else{
                System.out.print(keta[0]);
            }
            for(int i = 1; i < N; i++){
                if(keta[i] <= -1){
                    System.out.print(0);
                }else{
                    System.out.print(keta[i]);
                }
            }
            System.out.println();
        }

        out.flush();
    }

}

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

#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
#define rep(N) for(int i=0;i<N;i++)
#define rep2(N1,N2) for(int i=0;i<N1;i++)for(int j=0;j<N2;j++)
#define rep3(N1,N2,N3)for(int i=0;i<N1;i++)for(int j=0;j<N2;j++)for(int k=0;k<N3;k++)
#define For(i,N) for(int i=0;i<N;i++)
void yn(bool b) {
	if (b)printf("yes\n");
	else printf("no\n");
}

void Yn(bool b) {
	if (b)printf("Yes\n");
	else printf("No\n");
}

void YN(bool b) {
	if (b)printf("YES\n");
	else printf("NO\n");
}

int main(){
	int N, M;
	cin >> N >> M;
	vector<int>s(M);
	vector<int>c(M);
	rep(M)
		cin >> s[i] >> c[i];
	vector<int>num(N,-1);
	int ans = 0;
	rep(M) {
		if (num[s[i]-1] != -1 && num[s[i]-1] != c[i]) {
			ans = -1;
			break;
		}
		else
			num[s[i]-1] = c[i];
	}
	if (ans == 0) {
		if (num[0] == -1)
			num[0] = 1;
		rep(N) {
			if (num[i] == -1)
				num[i] = 0;
		}
		rep(N) {
			ans = ans + pow(10, N - 1-i)*num[i];
		}
	}
	if (N > 1 && num[0] == 0)
		ans = -1;
	cout << ans;

}

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

#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    int N,M;
    cin >> N >> M;
    int *digit;
    digit = new int[M+1];
    for(int i=0;i<=M;i++){
        digit[i] = -1;
    }

    int s,c;
    for(int k=0;k<M;k++){
        cin >> s >> c;
        if(digit[s]==-1){
            digit[s]=c;
        }else if(digit[s]!=c){
            cout << -1 << endl;
            return 0;
        }
    }
    if(M>1&&digit[1]==0)[
        cout << -1 << endl;
        return 0;
    ]

    int ans = 0;
    for(int i=M;i>0;i--){
        if(digit[i]!=-1){
            ans += digit[i]*pow(10,M-i);
        }
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: warning: capture of variable 'std::cout' with non-automatic storage duration
   27 |         cout << -1 << endl;
      |         ^~~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::ostream std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:27:13: error: expected ',' before '<<' token
   27 |         cout << -1 << endl;
      |             ^~~
      |             ,
a.cc:27:14: error: expected identifier before '<<' token
   27 |         cout << -1 << endl;
      |              ^~
a.cc:27:27: error: expected ']' before ';' token
   27 |         cout << -1 << endl;
      |                           ^
      |                           ]
a.cc: In lambda function:
a.cc:27:27: error: expected '{' before ';' token
a.cc: In function 'int main()':
a.cc:29:5: error: expected primary-expression before ']' token
   29 |     ]
      |     ^
a.cc:34:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |             ans += digit[i]*pow(10,M-i);
      |             ^~~
      |             abs
a.cc:37:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   37 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

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

#define F first
#define S second
typedef double db;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

ll gcd(ll x,ll y){
return y? gcd(y,x%y):x;
}

int main(){
  ll n,m;
  string s="0";
  cin>>n>>m;
  vector<pair<int,string>> v(m);
  rep(i,m){cin>>v[i].F>>v[i].S;}
  
  rep(i,n-1){s+="0";}
  rep(i,m){
  if(s[v[i].F-1]=='0'||s[v[i].F-1]==v[i].S[0]){
    s.replace(v[i].F-1,1,v[i].S);
  }
  else s="-1";
  }
  if(s[0]=='0'&&n!=1)s="-1";
  cout<<s<<endl;
return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:11:9: error: 'pair' does not name a type
   11 | typedef pair<int,int> pii;
      |         ^~~~
a.cc:12:9: error: 'pair' does not name a type
   12 | typedef pair<ll,ll> pll;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:20:3: error: 'string' was not declared in this scope
   20 |   string s="0";
      |   ^~~~~~
a.cc:21:3: error: 'cin' was not declared in this scope
   21 |   cin>>n>>m;
      |   ^~~
a.cc:22:3: error: 'vector' was not declared in this scope
   22 |   vector<pair<int,string>> v(m);
      |   ^~~~~~
a.cc:22:10: error: 'pair' was not declared in this scope
   22 |   vector<pair<int,string>> v(m);
      |          ^~~~
a.cc:22:15: error: expected primary-expression before 'int'
   22 |   vector<pair<int,string>> v(m);
      |               ^~~
a.cc:23:17: error: 'v' was not declared in this scope
   23 |   rep(i,m){cin>>v[i].F>>v[i].S;}
      |                 ^
a.cc:25:14: error: 's' was not declared in this scope
   25 |   rep(i,n-1){s+="0";}
      |              ^
a.cc:27:6: error: 's' was not declared in this scope
   27 |   if(s[v[i].F-1]=='0'||s[v[i].F-1]==v[i].S[0]){
      |      ^
a.cc:27:8: error: 'v' was not declared in this scope
   27 |   if(s[v[i].F-1]=='0'||s[v[i].F-1]==v[i].S[0]){
      |        ^
a.cc:32:6: error: 's' was not declared in this scope
   32 |   if(s[0]=='0'&&n!=1)s="-1";
      |      ^
a.cc:33:3: error: 'cout' was not declared in this scope
   33 |   cout<<s<<endl;
      |   ^~~~
a.cc:33:9: error: 's' was not declared in this scope
   33 |   cout<<s<<endl;
      |         ^
a.cc:33:12: error: 'endl' was not declared in this scope
   33 |   cout<<s<<endl;
      |            ^~~~
Language: C++

#include <bits/stdc++.h>
#include <cmath>
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[i] >> C[i];
  }
   for (int j = 0;j < M;j++) {
   	for (int k = 0;k < M;k++) {
    	if (S[j] == S[k]) {
        cout << -1 << endl;
        return 0;}
    }
   }
  vector<int> ans(N,0);
  for (int l = 0;l < M;l++) {
  ans[S[i]-1] = C[i];
  }
  if (ans[0] == 0) {
  ans[0] = 1;
  }
  for (int m = 0;m < N;m++) {
  cout << ans[m];
  }
  cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'i' was not declared in this scope
   22 |   ans[S[i]-1] = C[i];
      |         ^
Language: C++

#include <bits/stdc++.h>
#include <cmath>
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[i] >> C[i];
  }
   for (int j = 0;j < M;j++) {
   	for (int k = 0;k < M;k++) {
    	if (S[j] == S[k]) {
        cout << -1 << endl;
        return 0;}
    }
   }
  vector<int> ans(N,0);
  for (int l = 0;l < M;i++) {
  ans[S[i]-1] = C[i];
  }
  if (ans[0] == 0) {
  ans[0] = 1;
  }
  for (int m = 0;m < N;m++) {
  cout << ans[m];
  }
  cout << endl;
}


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

#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    
    vector<pair<int,int>> sc(m);
    for(int i=0;i<m;i++){
        int s,c;
        cin>>s>>c;
        sc[i]=make_pair(s-1,c);
    }
    
    sort(sc.begin(),sc.end());
    vector<int> memo(n,0);
    for(int i=0;i<m;i++){
        if(0==sc[i].first&0==sc[i].second&1!=n){
            cout<<-1;
            return 0;
        }
        if(0!=memo[sc[i].first]&sc[i].second!=memo[sc[i].first]){
            cout<<-1;
            return 0;
        }
        memo[sc[i].first]=sc[i].second;
    }
    int ret=0;
    for(int i=0;i<n;i++){
        ret+=memo[i]*pow(10,n-i-1);
    }
    cout<<ret<<endl;
    return 0;
}

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

N, M = map(int, input().split())
sc = []
for i in range(M):
    sp, cp = map(int, input().split())
    sc.append((sp, cp))

ans = 10000

if N == 1:
    for i in range(10):
        num = str(i)
        flag = True
        for pair in sc:
            if (num[pair[0] - 1] != str(pair[1])):
                flag = False
                break
        if flag:
            ans = min(ans, i)
else:
    for i in range(10 ** (N - 1), 10 ** N):
        num = str(i)
        flag = True
        for pair in sc:
            if (num[pair[0] - 1] != str(pair[1])) or len(num) < pair[0]:
                flag = False
                break
        if flag:
            ans = min(ans, i)

if ans == 10000:
    ans = -1
print(ans)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, M = map(int, input().split())
      | ^
Language: C++

#include<iostream>
#include<vector>
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[m] >> c[m];
  }
  vector<int> integer(n,0);
  for(int i=0;i<m;i++){
    if(integer[s[m]-1] == 0){
      integer[s[m]-1]=c[m];
    }else if(integer[s[m]-1] != 0){
      if(integer[s[m]-1]>c[m])
      else integer[s[m]-1]=c[m];
    }
  }
  if(integer[0]==0){
    cout << "-1" << endl;
  }else{
    for(int i=0;i<n;i++){
      cout << integer[i];
    }
    cout << endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: expected primary-expression before 'else'
   19 |       else integer[s[m]-1]=c[m];
      |       ^~~~
Language: C++

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

const long long MOD = 1000000007;
const long long INF = 1LL << 60;
const int INT_INF = 1000000000;

int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  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];
  }
  string ans;
  for (int i = 0; i < pow(10, N); i++)
  {
    bool ok = true;
    string tmp = to_string(i);
    for (int j = 0; j < M; j++)
    {
      if (tmp[s[j] - 1] != c[j])
        ok = false;
      if ((N == 2 or N == 3) && s[j] == 1 && c[j] == '0')
      {
        cout << -1 << endl;
        return;
      }
    }
    if (ok)
    {
      ans = tmp;
      cout << ans << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   38 |         return;
      |         ^~~~~~
Language: C

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


int main () 
{

 int N , M;
 scanf("%d %d",&N,&M);


 if (M==0 && N==3)
 {
 printf("100");
 return 0;
 }
 else if (M==0 && N==1)
 {
 printf("0");
 return 0;
 }
 else if (M>1 && && N==1)
 {
 printf("-1");
 return 0;
 }
 else if (M==0 && N==2)
 {
 printf("10");
 return 0;
 }
 int S[M];
 int C[M];
 int res[M];

memset(res,0,sizeof(res[0]) * M);

 for (int i = 0;i<M;i++)
 {
   scanf("%d %d",&S[i],&C[i]);
 }

  for (int i = 0;i<M;i++)
  {
     res[ S[i]-1 ] = C[i];
  }

 for (int i = 0;i<M;i++)
  {
    if (res[ S[i] -1  ] > C[i] )res[ S[i] - 1]=C[i];
  }

 if (res[0]==0)
  {
   printf("-1");
   return 0 ;
  }




  for (int i = 0;i<N;i++)
  { 
    printf("%d",res[i]);
 
  }
  
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:22: warning: comparison between pointer and integer
   24 |  else if (M>1 && && N==1)
      |                      ^~
main.c:24:2: error: label 'N' used but not defined
   24 |  else if (M>1 && && N==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++){
    if(i==0)
      S+='1';
    else 
    S+='0';
  }
  map<int,char>M;
  bool ans=true;
  for(int i=0;i<m;i++){
    int s; char c;
    cin>>s>>c;
    if(!M.count(s-1))
      M[s-1]=c;
    else
    if(M.at(s-1)!=c){
     ans=false; break;
    }
   
  
  }if(!ans)
    cout<<-1<<endl;
  else{
  for(auto p:M){
  auto k=p.first;
    auto v=p.second;
    S.at(k)=M.at(k);
  }if(S.at(0)=='0'){
    if(N==1) cout<<0<<endl;
    else
    cout<<-1<<endl;
  }
    else{
      if(N==1 && !M.cout(0))
        cout<<0<<endl;
      else
      cout<<S<<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:21: error: 'class std::map<int, char>' has no member named 'cout'; did you mean 'count'?
   39 |       if(N==1 && !M.cout(0))
      |                     ^~~~
      |                     count
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++){
     if(i==0)
       S+='1'
    else 
      S+='0';
  }
  map<int,char>M;
  bool ans=true;
  for(int i=0;i<m;i++){
    int s; char c;
    cin>>s>>c;
    if(!M.count(s-1))
      M[s-1]=c;
    else
    if(M.at(s-1)!=c){
     ans=false; break;
    }
   
  
  }if(!ans)
    cout<<-1<<endl;
  else{
  for(auto p:M){
  auto k=p.first;
    auto v=p.second;
    S.at(k)=M.at(k);
  }if(S.at(0)=='0'){
    if(N==1) cout<<0<<endl;
    else
    cout<<-1<<endl;
  }
    else
      cout<<S<<endl;
  
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected ';' before 'else'
    9 |        S+='1'
      |              ^
      |              ;
   10 |     else
      |     ~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,m;
  cin>>N>>m;
 if(N==1 && m==0)
   cout<<0<<endl;
   else
 {string S="";
  for(int i=0;i<N;i++){
     if(i==0)
       S+='1'
    else 
      S+='0';
  }
  map<int,char>M;
  bool ans=true;
  for(int i=0;i<m;i++){
    int s; char c;
    cin>>s>>c;
    if(!M.count(s-1))
      M[s-1]=c;
    else
    if(M.at(s-1)!=c){
     ans=false; break;
    }
   
  
  }if(!ans)
    cout<<-1<<endl;
  else{
  for(auto p:M){
  auto k=p.first;
    auto v=p.second;
    S.at(k)=M.at(k);
  }if(S.at(0)=='0'){
    if(N==1) cout<<0<<endl;
    else
    cout<<-1<<endl;
  }
    else
      cout<<S<<endl;
  
  }};
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: expected ';' before 'else'
   12 |        S+='1'
      |              ^
      |              ;
   13 |     else
      |     ~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,m;
  cin>>N>>m;
 if(N==1 && m==0)
   cout<<0<<endl;
   else
 {string S="";
  for(int i=0;i<N;i++){
     if(i==0)
       S+='1'
    else 
      S+='0';
  }
  map<int,char>M;
  bool ans=true;
  for(int i=0;i<m;i++){
    int s; char c;
    cin>>s>>c;
    if(!M.count(s-1))
      M[s-1]=c;
    else
    if(M.at(s-1)!=c){
     ans=false; break;
    }
   
  
  }if(!ans)
    cout<<-1<<endl;
  else{
  for(auto p:M){
  auto k=p.first;
    auto v=p.second;
    S.at(k)=M.at(k);
  }if(S.at(0)=='0'){
    if(N==1) cout<<0<<endl;
    else
    cout<<-1<<endl;
  }
    else
      cout<<S<<endl;
  
  }}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: expected ';' before 'else'
   12 |        S+='1'
      |              ^
      |              ;
   13 |     else
      |     ~~~~
Language: C++

N, M = map(int, input().split())
sc_list = []
for i in range(M):
    sc = list(map(int, input().split()))
    sc_list.append(sc)
ans = -1
for i in range(10**N):
    tmp = str(i)
    if len(tmp)==N:
        flag = True
        for j in sc_list:
            if int(tmp[j[0]-1])!=j[1]:
                flag = False
        if flag:
            ans = int(tmp)
            break
print(ans)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, M = map(int, input().split())
      | ^
Language: C++

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

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

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

#include<iostream>
#include<string>
#include<iomanip>
#include<sstream>
#include<regex>

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

using namespace std;

int main()
{
    ostringstream oss;
    int n,m,a=1,b,x,y,sum=0;
    int flag = 0;
    char c;
    string s;
    cin >> n >> m;
  	if(n==1){
      cout << "0" << endl;
      return 0;
    }
    rep(i,n-1) a  *= 10;
    oss << a;
    s = oss.str();
    rep(i,m){
        cin >> x >> c;
        if(x == 1 && c == '0' && n != 1 || n < x){
            flag = 1;
            break;
        }
        if(s[x-1] == '0' || s[x-1] == c){
            s[x-1] = c; 
        }else if(x==1&&s[x-1]=='1'){
             s[x-1] = c;
        }else{
            flag = 1;
            break;
        }
    }
    if(!flag) cout << s << endl;
    if(flag) cout << "-1" << endl
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:34: error: expected ';' before 'return'
   42 |     if(flag) cout << "-1" << endl
      |                                  ^
      |                                  ;
   43 |     return 0;
      |     ~~~~~~
Language: C++

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

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)


bool check(vector<int>& s, vector<int>& c, vector<int>& ans)
{
    int N = ans.size();
    REP(i, M){
        if(ans[s[i]] == -1 or ans[s[i]] == c[i]) ans[s[i]] = c[i];
        else return false;
    }
    // 0 check
    bool largest_digit = false;
    REP(i, N){
        if((ans[i] == 0 or ans[i] == -1) and !largest_digit) return false;
        if(ans[i] > 0) largest_digit = true;
        else ans[i] = 0;
    }

    return true;
}


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

    vector<int> ans(N, -1);
    if(check(s, c, ans)){
        REP(i, N) cout << ans[i];
        cout << endl;
    }else cout << -1 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'bool check(std::vector<int>&, std::vector<int>&, std::vector<int>&)':
a.cc:13:12: error: 'M' was not declared in this scope
   13 |     REP(i, M){
      |            ^
a.cc:6:44: note: in definition of macro 'REP'
    6 | #define REP(i, n) for(int i = 0; i < (int)(n); ++i)
      |                                            ^
Language: C++

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

int main() {
	int n,m;
	cin>>n>>m;
	vector<P> p(m);//vectorのvector
	
	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){//nxが0にならない限り
			keta++;
			d.push_back(nx%10);
			nx/=10;
		}
		if(keta!=n)continue;
		bool ok=true;
		reverse(d,begin(),d.end());
		rep(i,m){
			if(d[p[i].first-1]!=p[i].second)ok=false;
		}
		if(ok){
			cout<<x<<endl;
			return 0;
		}
	}
	cout<<-1<<endl;
	return 0;
}

//vectorでCE




Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'i' was not declared in this scope
   11 |         rep(i,m)cin>>p[i].first>>p[i].second;
      |             ^
a.cc:11:9: error: 'rep' was not declared in this scope
   11 |         rep(i,m)cin>>p[i].first>>p[i].second;
      |         ^~~
a.cc:12:13: error: 'x' was not declared in this scope
   12 |         rep(x,1000){
      |             ^
Language: C++

//#include<bits/stdc++.h>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<stack>
#include<set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define int long long
#define ll long long
#define str string
#define db double
#define ac() cout<<"Yes"<<endl
#define wa()  cout<<"No"<<endl
#define ddd cout<<"---debug---"<<endl;
#define ff(a,b) for(signed long long (a)=1;(a)<=(b);(a)++)
#define fff(a,b) for(signed long long (a)=0;(a)<(b);(a)++)
#define re readdd()
#define pr(a) printtt(a)
#define pee puts("");
#define eee putchar(' ');
#define pss(a) push_back(a)
#define ps(a) push(a)
#define SZ(x) x.size()
#define epp empty()
#define all(x) x.begin(),x.end()
typedef vector<int> VE;
int gcd(int a,int b){return b==0?a:gcd(b,a%b);}//
int ppow(int a,int b,int mod){a%=mod;//
int ans=1%mod;while(b){if(b&1)ans=(long long)ans*a%mod;
a=(long long)a*a%mod;b>>=1;}return ans;}
int readdd(){int x=0,f=1;char c=getchar();//
while(!isdigit(c)&&c!='-')c=getchar();
if(c=='-')f=-1,c=getchar();
while(isdigit(c))x=x*10+c-'0',c=getchar();
return f*x;}
void printtt(int x){if(x<0)putchar('-'),x=-x;
if(x>=10)printtt(x/10);putchar(x%10+'0');}
bool addd(int a,int b){return a>b;};
//
const int maxm=1e5+5;
int a[maxm];
signed main(){
    memset(a,-1,sizeof a);
    int n=re,m=re;
    ff(mm,m){
        int x=re,xx=re;
        if(a[x]!=-1&&a[x]!=xx){
            puts("-1");return ;
        }
        a[x]=xx;
    }
    if(a[1]==-1)a[1]=1;
    ff(i,n){
        if(a[i]==-1)a[i]=0;
    }
    ff(i,n)pr(a[i]);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:24: error: return-statement with no value, in function returning 'int' [-fpermissive]
   54 |             puts("-1");return ;
      |                        ^~~~~~
Language: C++

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

int main() {
  int n;
  int m;
  cin >> n >> m;
  int s[m];
  char c[m];
  for(int i=0;i<m;i++){
    cin >> s[i] >> c[i];
  }
  string p;
  for(int i=0;i<pow(10,n);i++){
    p = str(i);
    if(n==p.size()){
      for(int j=0;j<m;j++){
        if(p.at(s[j])==c[j]){
          if(j==m-1){
            cout << i;
          }
          continue;
        }
        break;
      }
    }
  }
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'str' was not declared in this scope; did you mean 'std'?
   15 |     p = str(i);
      |         ^~~
      |         std
a.cc: At global scope:
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
	int n,m;
	cin>>n>>m;
	int s[m],c[m];
	int q[m]={0};
	int flag=0;
	for(int i=0;i<m;i++){
		cin>>s[i]>>c[i];
	}
	for(int i=0;i<m;i++){
		if(q[s[i]-1]==0){
			q[s[i]-1]=c[i];
		}
		else{
			if(q[s[i]-1]!=c[i]){
				cout<<-1<<endl;
				flag=1;
				break;
			}
		}
	}
	int k;
	int sum=0;
	for(int i=0;i<m;i++){
		k=m-i-1;
		q[i]=q[i]*pow(10,k);
		sum=sum+q[i];
	}
	if(flag==0 && sum!=0){
	
		cout<< sum;
	}
	else if(flag==0) {
		cout<<-1<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:27: error: 'pow' was not declared in this scope
   29 |                 q[i]=q[i]*pow(10,k);
      |                           ^~~
Language: C++

#include <iostream>
using namespace std;
using ll=long long;
using P=pair<int,int>;

int main() {
	int n,m;
	cin>>n>>m;
	vector<P> p(m);//vectorのvector
	
	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){//nxが0にならない限り
			keta++;
			d.push_back(nx%10);
			nx/=10;
		}
		if(keta!=n)continue;
		bool ok=true;
		reverse(d,begin(),d.end());
		rep(i,m){
			if(d[p[i].first-1]!=p[i].second)ok=false;
		}
		if(ok){
			cout<<x<<endl;
			return 0;
		}
	}
	cout<<-1<<endl;
	return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'vector' was not declared in this scope
    9 |         vector<P> p(m);//vectorのvector
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:9:17: error: expected primary-expression before '>' token
    9 |         vector<P> p(m);//vectorのvector
      |                 ^
a.cc:9:19: error: 'p' was not declared in this scope
    9 |         vector<P> p(m);//vectorのvector
      |                   ^
a.cc:11:13: error: 'i' was not declared in this scope
   11 |         rep(i,m)cin>>p[i].first>>p[i].second;
      |             ^
a.cc:11:9: error: 'rep' was not declared in this scope
   11 |         rep(i,m)cin>>p[i].first>>p[i].second;
      |         ^~~
a.cc:12:13: error: 'x' was not declared in this scope
   12 |         rep(x,1000){
      |             ^
Language: C++

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

int main{
  cout << -1;
}

Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:13: error: expected '}' before ';' token
    6 |   cout << -1;
      |             ^
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:6:8: error: invalid user-defined conversion from 'std::basic_ostream<char>' to 'int' [-fpermissive]
    6 |   cout << -1;
      |   ~~~~~^~~~~
In file included from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/istream:40,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_ios.h:121:16: note: candidate is: 'std::basic_ios<_CharT, _Traits>::operator bool() const [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
  121 |       explicit operator bool() const
      |                ^~~~~~~~
/usr/include/c++/14/bits/basic_ios.h:121:16: note:   return type 'bool' of explicit conversion function cannot be converted to 'int' with a qualification conversion
a.cc:7:1: error: expected declaration before '}' token
    7 | }
      | ^