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

#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<stack>
#include<cmath>
#include<algorithm>
#include<map>
typedef long long ll;
using namespace std;
#define INF 0x3f3f3f3f
int main()
{
	int n,i,j,t,m,a[10],b[10],q=1,w=1,e=1;
	cin>>n>>m;
	if(n==1&&m==0) {
		cout<<0;return 0;
	}
		if(n!=1&&m==0) {
		cout<<-1;return 0;
	}
	for(i=1;i<=m;i++)
	{
		cin>>a[i]>>b[i];
		if(b[i]==0&&a[i]==1&&n>1) {
			cout<<-1;return 0;
		} 
		
	}
	for(j=1;j<=m;j++)
	{
		for(i=j+1;i<=m;i++)
		{
			if(i!=j&&a[j]==a[i]&&b[j]!=b[i]) {
				cout<<-1;return 0;
			} 
		}
	}
	for(i=1;i<=m;i++)
	if(n==1&&a[i]==1&&b[i]==0)
		{
			cout<<0;return 0;
		}
  if(n==3)
  {
  		
			if(a[i]==1) {
				q=0;cout<<b[i]; break;
			}
		}
		if(q) cout<<1;
for(i=1;i<=m;i++)
		{
			
			if(a[i]==2) {
				cout<<b[i];w=0;break;
			}
		}
		if(w) cout<<0;
for(i=1;i<=m;i++)
		{
			if(a[i]==3) {
				cout<<b[i];e=0;break;
			}
		}
	if(e) cout<<0;
  }
  else if(n==2)
  {
  		
			if(a[i]==1) {
				q=0;cout<<b[i];break;
			}
		}
		if(q) cout<<1;
for(i=1;i<=m;i++)
		{
			if(a[i]==2) {
				cout<<b[i];w=0;break;
			}
		}
		if(w) cout<<0;

  }
   else if(n==1){
   	for(i=1;i<=m;i++)
		{
			if(a[i]==1) {
				q=0;cout<<b[i];break;
			}
		}
		if(q) cout<<1;
   }
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:48:49: error: break statement not within loop or switch
   48 |                                 q=0;cout<<b[i]; break;
      |                                                 ^~~~~
a.cc: At global scope:
a.cc:68:3: error: expected unqualified-id before 'else'
   68 |   else if(n==2)
      |   ^~~~
a.cc:75:17: error: expected unqualified-id before 'if'
   75 |                 if(q) cout<<1;
      |                 ^~
a.cc:76:1: error: expected unqualified-id before 'for'
   76 | for(i=1;i<=m;i++)
      | ^~~
a.cc:76:9: error: 'i' does not name a type
   76 | for(i=1;i<=m;i++)
      |         ^
a.cc:76:14: error: 'i' does not name a type
   76 | for(i=1;i<=m;i++)
      |              ^
a.cc:82:17: error: expected unqualified-id before 'if'
   82 |                 if(w) cout<<0;
      |                 ^~
a.cc:84:3: error: expected declaration before '}' token
   84 |   }
      |   ^
a.cc:85:4: error: expected unqualified-id before 'else'
   85 |    else if(n==1){
      |    ^~~~
a.cc:94:2: error: expected declaration before '}' token
   94 |  }
      |  ^
Language: C

#include <stdio.h>

int main() {
	int N = 0;
	int M = 0;
	int s[6] = { 0 };
	int c[6] = { 0 };
	int ans[3] = { 0 };
	int ans_num = 0;
	int count[3] = { 0 };
	scanf("%d %d", &N, &M);
	for (int i = 0; i < M; i++) scanf("%d %d", &s[i], &c[i]);
	for (int i = 0; i < M; i++) {
		if (count[N-(s[i] - 1)] == 0) {
			ans[N-(s[i] - 1)] = c[i];
			count[N-(s[i] - 1)]++;
		}
		else {
			if (ans[N-(s[i] - 1)]] != c[i]) {
				printf("-1\n");
				return 0;
			}
		}
	}
	ans_num = ans[0] * 100 + ans[1] * 10 + ans[2];
	if (N == 1) {
		if ((ans_num < 10)&&(ans_num>=0)) {
			printf("%d\n", ans_num);
		}
		else {
			printf("-1\n");
		}
	}
	else if (N == 2) {
		if ((ans_num < 100) && (ans_num >= 10)) {
			printf("%d\n", ans_num);
		}
		else {
			printf("-1\n");
		}
	}
	else if (N == 3) {
		if ((ans_num < 1000) && (ans_num >= 100)) {
			printf("%d\n", ans_num);
		}
		else {
			printf("-1\n");
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:46: error: expected ')' before ']' token
   19 |                         if (ans[N-(s[i] - 1)]] != c[i]) {
      |                            ~                 ^
      |                                              )
main.c:19:46: error: expected statement before ']' token
main.c:19:48: error: expected expression before '!=' token
   19 |                         if (ans[N-(s[i] - 1)]] != c[i]) {
      |                                                ^~
main.c:19:55: error: expected statement before ')' token
   19 |                         if (ans[N-(s[i] - 1)]] != c[i]) {
      |                                                       ^
Language: Java


Beta

  paiza.IO
Java Split Button!	
Main.java 
Success  

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
                result[0] = -1;
                break;
            }else{
                if(result[s[i] - 1] != 0 && result[s[i] - 1] != c[i]){
                    result[0] = -1;
                    break;
                }else{
                    result[s[i] - 1] = c[i];
                }
            }
        }
        if(result[0] == -1){
            System.out.println(result[0]);
        }else{
            switch(N){
                case 1:
                    System.out.println(result[0]);
                    break;
                case 2:
                    System.out.println(result[0] * 10 + result[1]);
                    break;
                case 3:
                    System.out.println(result[0] * 100 + result[1] * 10 + result[2]);
                    break;
            }
        }
    }
}
  実行 (Ctrl-Enter) Split Button!              
出力
入力
コメント 0
(0.07 sec)
 
30
 

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
Beta
^
Main.java:39: error: class, interface, enum, or record expected
                break;
                ^
Main.java:40: error: class, interface, enum, or record expected
            }else{
            ^
Main.java:43: error: class, interface, enum, or record expected
                    break;
                    ^
Main.java:44: error: class, interface, enum, or record expected
                }else{
                ^
Main.java:46: error: class, interface, enum, or record expected
                }
                ^
Main.java:51: error: class, interface, enum, or record expected
        }else{
        ^
Main.java:55: error: class, interface, enum, or record expected
                    break;
                    ^
Main.java:56: error: class, interface, enum, or record expected
                case 2:
                ^
Main.java:58: error: class, interface, enum, or record expected
                    break;
                    ^
Main.java:59: error: class, interface, enum, or record expected
                case 3:
                ^
Main.java:61: error: class, interface, enum, or record expected
                    break;
                    ^
Main.java:62: error: class, interface, enum, or record expected
            }
            ^
13 errors
Language: C++

lydkutdjrshgfdchcnbvcn
itf
int f;
kugc
lhvityf7uvl\
long retyrn l
oguci


Compiler output:
a.cc:1:1: error: 'lydkutdjrshgfdchcnbvcn' does not name a type
    1 | lydkutdjrshgfdchcnbvcn
      | ^~~~~~~~~~~~~~~~~~~~~~
a.cc:4:1: error: 'kugc' does not name a type
    4 | kugc
      | ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void) {
	int N, M, inputs, inputc, ans = 0;
	int checkNum = 0;
	vector<int> s;
	vector<int> c;
	cin >> N >> M;
	vector<vector<int>> sc(N, vector<int>(10, 0));
	for (int i = 0; i < M; i++) {
		cin >> inputs;
		s.emplace_back(inputs);
		cin >> inputc;
		c.emplace_back(inputc);
		sc[inputs - 1][inputc]++;
	}
	if (M == 1 && c[0] == 0) {
		ans = -1;
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 10; j++) {
			if (sc[i][j] >= 1) {
				checkNum++;
			}
		}
		if (checkNum > 1) {
			ans = -1;
			break;
		}
		else {
			checkNum = 0;
		}
	}
	if (ans != -1) {
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < 10; j++) {
				if (sc[i][j] >= 1) {
					ans += j * pow(10, 3 - i - 1);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:52: error: 'pow' was not declared in this scope
   41 |                                         ans += j * pow(10, 3 - i - 1);
      |                                                    ^~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define f(i, x, n) for(int i = x; i < n; i++)
#define dbg(x) cout << x << endl
#define dbg2(x, y) cout << x << "  " << y << endl
#define dbg3(x, y, z) cout << x << "  " << y << "  " << z << endl
#define mod 1000000007
using namespace std;

int main(){
    ios::sync_with_stdio(0);
    int n, m;
    cin >> n >> m;
    int num[n];
    f(i, 0, n){
        num[i] = 0;
    }
    int s, c;
    f(i, 0, m){
        cin >> s >> c;
        if(num[s-1] != 0 && c != num[s-1]){
            dbg("-1");
            return 0;
        }
        else{
            num[s-1] = c;
        }
    }
    
    int number = 0;
    f(i, 0, n){
        number += num[i] * ceilf(pow(10, n-i-1));
    }
    if(number < pow(10, n-1){
        if(number == 0 && n == 1){
            dbg(number);
            return 0;
        }
        dbg("-1");
        return 0;
    }
    dbg(number);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:29: error: expected ';' before '{' token
   34 |     if(number < pow(10, n-1){
      |                             ^
      |                             ;
a.cc:42:16: error: expected ')' before ';' token
   42 |     dbg(number);
      |                ^
a.cc:34:7: note: to match this '('
   34 |     if(number < pow(10, n-1){
      |       ^
Language: C++

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

#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;

  int s[M], c[M];
  int ans[N];
  rep(i,N) {
    ans[i] = -1;
  }
  bool flag = true;
  rep(i,M) {
    cin >> s[i] >> c[i];
    if (ans[s[i]-1] != -1 && ans[s[i]-1] != c[i]) {
      cout << -1 << endl;
      flag = false;
    }
    ans[s[i]-1] = c[i];
  }

  if (ans[0] == 0 && flag) {
    if (N > 1) cout << -1 << endl;
    else cout << 0 << endl;
  } else if (flag) {
    rep(i,N) {
      if (ans[i] == -1) {
        if (i == 0) {
          cout << 1;
        } else {
          cout << 0;
        }
      } else {
        cout << ans[i];
      }
    }
    cout << endl;
  }

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

import java.util.*;

class Math{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        Map map = new HashMap();
        boolean ans = true;
        int num = 0;

        for(int i = 0; i < m ; i++){
            int k = scan.nextInt();
            int v = scan.nextInt();

            if(map.containsKey(k)){
                if(!(map.get(k).equals(v))) ans = false;
            }
            else if(n > 1 && k == 1 && v == 0){ans = false; break;}
            else{
                map.put(k,v);
            }
        }

        scan.close();

        if(ans){
            for(int j = 0; j < n; j++){
                if(map.containsKey(j)){
                    int k = (int)map.get(j);
                    if(j == 0) num += k * 100;
                    else if(j == 1) num += k * 10;
                    else num += k;
                }
            }

            System.out.println(num);
        }
        else System.out.println("-1");
    }
}

Compiler output:
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Language: C++

void ABC157C()
{
	int N, M;
	cin >> N >> M;
	vi A(N, -1);
	for (int i = 0; i < M; ++i)
	{
		int s, c;
		cin >> s >> c;
		--s;
		if (A[s] > -1 && A[s] != c)
		{
			cout << "-1" << endl;
			return;
		}
		A[s] = c;
	}
	if (N > 1 && A[0] == 0)
	{
		cout << "-1" << endl;
		return;
	}
	if (A[0] == -1)
		A[0] = 1;
	int ans = 0;
	for (int i = 0; i < N; ++i)
	{
		ans *= 10;
		ans += max(A[i],0);
	}
	cout << ans << endl;

}

int main()
{
	ABC157C();
	return 0;
}

Compiler output:
a.cc: In function 'void ABC157C()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> N >> M;
      |         ^~~
a.cc:5:9: error: 'vi' was not declared in this scope
    5 |         vi A(N, -1);
      |         ^~
a.cc:11:21: error: 'A' was not declared in this scope
   11 |                 if (A[s] > -1 && A[s] != c)
      |                     ^
a.cc:13:25: error: 'cout' was not declared in this scope
   13 |                         cout << "-1" << endl;
      |                         ^~~~
a.cc:13:41: error: 'endl' was not declared in this scope
   13 |                         cout << "-1" << endl;
      |                                         ^~~~
a.cc:16:17: error: 'A' was not declared in this scope
   16 |                 A[s] = c;
      |                 ^
a.cc:18:22: error: 'A' was not declared in this scope
   18 |         if (N > 1 && A[0] == 0)
      |                      ^
a.cc:20:17: error: 'cout' was not declared in this scope
   20 |                 cout << "-1" << endl;
      |                 ^~~~
a.cc:20:33: error: 'endl' was not declared in this scope
   20 |                 cout << "-1" << endl;
      |                                 ^~~~
a.cc:23:13: error: 'A' was not declared in this scope
   23 |         if (A[0] == -1)
      |             ^
a.cc:29:28: error: 'A' was not declared in this scope
   29 |                 ans += max(A[i],0);
      |                            ^
a.cc:29:24: error: 'max' was not declared in this scope
   29 |                 ans += max(A[i],0);
      |                        ^~~
a.cc:31:9: error: 'cout' was not declared in this scope
   31 |         cout << ans << endl;
      |         ^~~~
a.cc:31:24: error: 'endl' was not declared in this scope
   31 |         cout << ans << endl;
      |                        ^~~~
Language: C++

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

int main() {
  const int INF = 9999;
  int N, M;
  cin >> N >> M;
  vector<int> value(3, INF);
  rep(i, M){
    int s
    char c;
    cin >> s >> c;
    if(value.at(3-s) == INF || value.at(3-s) == c){
      value.at(3-s) = c;
    }
    else{
      cout << -1 << endl;
      return 0;
    }
  }
  for(int i = N; i < 3; ++i){
    if(value.at(i) != INF){
      cout << -1 << endl;
      return 0;
    }
  }
  if(value.at(N-1) == 0){
    cout << -1 << endl;
    return 0;
  }
  if(value.at(N-1) == INF){
    value.at(N-1) = 1;
  }
  rep(i,N-1){
    if(value.at(i)==INF){
      value.at(i) = 0;
    }
  }
  cout << value.at(0) + value.at(1)*10 + value.at(2)*100 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: expected initializer before 'char'
   14 |     char c;
      |     ^~~~
a.cc:15:12: error: 's' was not declared in this scope
   15 |     cin >> s >> c;
      |            ^
a.cc:15:17: error: 'c' was not declared in this scope
   15 |     cin >> s >> c;
      |                 ^
Language: C++

//omajinai c++
#include <iostream>
#include<cmath>
#include<vector>
#include <algorithm>
#include <limits>
#include <numeric>
#include <type_traits>
#include <map>
#include <string>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
constexpr auto mod = 1000000007;
using namespace std;
int main(void) {

	int n, m;
	cin >> n >> m;
	vector<int> s(m);
	vector<int> c(m);
	rep(i, m) {
		cin >> s[i] >> c[i];
	}
	vector<int> a(n);
	rep(i, n) {
		a[i] = -1;
	}
	int flag = 0;
	rep(i, n) {
		if (s[i] == 1 && c[i] == 0) {
			flag = -1;
			break;
		}
	}
	rep(i, n) {
		if (a[s[i]] == -1) {
			a[s[i]] = c[i];
		}
		else {
			if (a[s[i]] != c[i]) {
				flag = -1;
				break;
			}
		}
	}

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

	else {
		if (n != 1) {
			for (int i = 0; i < n; i++) {
				if (a[i] == -1) {
					if (i == 0) {
						cout << 1;
					}
					else {
						cout << 0;
					}
				}
				else {
					cout << a[i];
				}
			}
		}
	
	else {
	cout << 0;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:2: error: expected '}' at end of input
   71 | }
      |  ^
a.cc:15:16: note: to match this '{'
   15 | int main(void) {
      |                ^
Language: C

#include <stdio.h>

int main(void){
  int n, m;
  int s[5], c[5];
  
  scanf("%d %d", &n, &m);
  for(int i=0; i<m; i++){
    scanf("%d %d", &s[i], &c[i]);
  }
  if(n==1){
    int a1 = 0;
    int flag1 = 0;
    for(int i=0; i<m; i++){
      if(s[i] == 1){
        a1 = a1 + c[i];
        flag1++;
      }
    }
    if(flag1==1){
      printf("%d", a1);
      return 0;
    }else{
      printf("%d", -1);
      return 0;
    }
  }else if(n==2){
    int a1 = 0;
    int a10 = 0;
    int flag1 = 0;
    int flag10 = 0;
    for(int i=0; i<m; i++){
       if(s[i] == 2){
          a1 = c[i];
          flag1++;
        }else if(s[i] == 1){
          a10 = c[i]*10;
         flag10++;
       }
    }
    if(flag1 == 1 && flag10 == 1){
      printf("%d", a1 + a10);
      return 0;
    }else{
      printf("%d", -1);
      return 0;
    }
  }else if(n==3){
    int a1 = 0;
    int a10 = 0;
    int a100 = 0;
    int flag1 = 0;
    int flag10 = 0;
    int flag100 = 0;
    for(int i=0; i<m; i++){
      if(s[i] == 3){
          a1 = c[i];
          flag1++;
      }else if(s[i] == 2){
          a10 = c[i]*10;
         flag10++;
      }else if(s[i] == 1){
        a100 = c[i]*100;
        flag100 ++;
      }
    }
    if(flag1 == 1 && flag10 == 1 flag100 == 1){
      printf("%d", a1 + a10 + a100);
      return 0;
    }else{
      printf("%d", -1);
      return 0;
    }
  }else{
    printf("%d", -1);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:67:33: error: expected ')' before 'flag100'
   67 |     if(flag1 == 1 && flag10 == 1 flag100 == 1){
      |       ~                         ^~~~~~~~
      |                                 )
Language: C

#include <stdio.h>

int main(void){
  int n, m;
  int s[5], c[5];
  
  scanf("%d %d", &n, &m);
  for(int i=0; i<m; i++){
    scanf("%d %d", &s[i], &c[i]);
  }
  if(n==1){
    int a1 = 0;
    int flag1 = 0;
    for(int i=0; i<m; i++){
      if(s[i] == 1){
        a1 = a1 + c[i];
        flag1++;
      }
    }
    if(flag==1){
      printf("%d", a1);
      return 0;
    }else{
      printf("%d", -1);
      return 0;
    }
  }else if(n==2){
    int a1 = 0;
    int a10 = 0;
    int flag1 = 0;
    int flag10 = 0;
    for(int i=0; i<m; i++){
       if(s[i] == 2){
          a1 = c[i];
          flag1++;
        }else if(s[i] == 1){
          a10 = c[i]*10;
         flag10++;
       }
    }
    if(flag1 == 1 && flag10 == 1){
      printf("%d", a1 + a10);
      return 0;
    }else{
      printf("%d", -1);
      return 0;
    }
  }else if(n==3){
    int a1 = 0;
    int a10 = 0;
    int a100 = 0;
    int flag1 = 0;
    int flag10 = 0;
    int flag100 = 0;
    for(int i=0; i<m; i++){
      if(s[i] == 3){
          a1 = c[i];
          flag1++;
      }else if(s[i] == 2){
          a10 = c[i]*10;
         flag10++;
      }else if(s[i] == 1){
        a100 = c[i]*100;
        flag100 ++;
      }
    }
    if(flag1 == 1 && flag10 == 1 flag100 == 1){
      printf("%d", a1 + a10 + a100);
      return 0;
    }else{
      printf("%d", -1);
      return 0;
    }
  }else{
    printf("%d", -1);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:20:8: error: 'flag' undeclared (first use in this function); did you mean 'flag1'?
   20 |     if(flag==1){
      |        ^~~~
      |        flag1
main.c:20:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:67:33: error: expected ')' before 'flag100'
   67 |     if(flag1 == 1 && flag10 == 1 flag100 == 1){
      |       ~                         ^~~~~~~~
      |                                 )
Language: C++

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

int main() {
	int N,M;
  cin >> N >> M;
  vector <int>s(M);
  vector <int>c(M);
 vector<int> Ans(N,0);
  vector<int> zero(N,0);
  
  
  int A = -2;
  
  for(int i = 0; i < M; i++){
  cin >> s.at(i) >> c.at(i);
  }
  
  for(int i = 0; i < M; i++){
  	if(N == 1 && c.at(i) == 0){
    A = 0;
    }
    else if(s.at(i) == 1 && c.at(i) == 0){
  		A = -1;
    }
  }
  
  for(int i = 0; i < M; i++){
    for(int j = i; j < M; j++){
  		if(s.at(i) == s.at(j) && c.at(i) != c.at(j)){
  			A = -1;
    	}
    }
  }
  
  for(int i = 0; i < M; i++){
  	Ans.at(s.at(i)-1) = c.at(i);
  }

  if (Ans = zero){
  A = 0;
  }
  
  if(A == 0){
    
    cout << A;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:40:11: error: could not convert 'Ans.std::vector<int>::operator=(zero)' from 'std::vector<int>' to 'bool'
   40 |   if (Ans = zero){
      |       ~~~~^~~~~~
      |           |
      |           std::vector<int>
Language: C++

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<stack>
#include<vector>
#include<queue>
#include<set>
#include<algorithm>
#define INF 0x3f3f3f3f
#define mod 1000000009
#define e  2.718281828459045
#define eps 1.0e18
#define PI acos(-1)
#define lowbit(x) (x&(-x))
#define memset(x,y) memset(x,y,sizeof(x))
#define lson i << 1,l,m
#define rson i << 1 | 1,m + 1,r
#define ll long long
using namespace std;
int a[N];
bool vis[N];

int main()
{
    int n,m,pos,val;
	scanf("%d%d",&n,&m);
	
	bool f = 0;
	for(int i = 1;i <= m;++i){
		scanf("%d%d",&pos,&val);
		if(vis[pos]){
			if(val != a[pos]) f = 1;
			continue;
		}
		vis[pos] = 1;
		a[pos] = val;
	}
	if(f) printf("-1\n");
	else{
		if(n == 1) printf("%d",a[1]);
		else{
			if(!vis[1]) a[1] = 1;
			if(!a[1]) printf("-1\n");
			else{
				for(int i = 1;i <= n;++i) printf("%d",a[i]);
			}
		}
	}
    return 0;
}



Compiler output:
a.cc:24:7: error: 'N' was not declared in this scope
   24 | int a[N];
      |       ^
a.cc:25:10: error: 'N' was not declared in this scope
   25 | bool vis[N];
      |          ^
a.cc: In function 'int main()':
a.cc:35:20: error: 'vis' was not declared in this scope
   35 |                 if(vis[pos]){
      |                    ^~~
a.cc:36:35: error: 'a' was not declared in this scope
   36 |                         if(val != a[pos]) f = 1;
      |                                   ^
a.cc:39:17: error: 'vis' was not declared in this scope
   39 |                 vis[pos] = 1;
      |                 ^~~
a.cc:40:17: error: 'a' was not declared in this scope
   40 |                 a[pos] = val;
      |                 ^
a.cc:44:40: error: 'a' was not declared in this scope
   44 |                 if(n == 1) printf("%d",a[1]);
      |                                        ^
a.cc:46:29: error: 'vis' was not declared in this scope
   46 |                         if(!vis[1]) a[1] = 1;
      |                             ^~~
a.cc:46:37: error: 'a' was not declared in this scope
   46 |                         if(!vis[1]) a[1] = 1;
      |                                     ^
a.cc:47:29: error: 'a' was not declared in this scope
   47 |                         if(!a[1]) printf("-1\n");
      |                             ^
Language: C

#include <stdio.h>

int main(void){
  int n, m;
  int s[5], c[5];
  
  scanf("%d %d", &n, &m);
  for(int i; i<m; i++){
    scanf("%d %d", &s[i], &c[i]);
  }
  if(n==1){
    int a1 = 0;
    int flag1 = 0;
    for(int=0; i<m; i++){
      if(s[i] == 1){
        a1 = a1 + c[i];
        flag1++;
      }
    }
    if(flag==1){
      printf("%d", a1);
      return 0;
    }else{
      printf("%d", -1);
      return 0;
    }
  }else if(n==2){
    int a1 = 0;
    int a10 = 0;
    int flag1 = 0;
    int flag10 = 0;
    for(int=0; i<m; i++){
       if(s[i] == 2){
          a1 = c[i];
          flag1++;
        }else if(s[i] == 1){
          a10 = c[i]*10;
         flag10++;
       }
    }
    if(flag1 == 1 && flag10 == 1){
      printf("%d", a1 + a10);
      return 0;
    }else{
      printf("%d", -1);
      return 0;
    }
  }else if(n==3){
    int a1 = 0;
    int a10 = 0;
    int a100 = 0;
    int flag1 = 0;
    int flag10 = 0;
    int flag100 = 0;
    for(int=0; i<m; i++){
      if(s[i] == 3){
          a1 = c[i];
          flag1++;
      }else if(s[i] == 2){
          a10 = c[i]*10;
         flag10++;
      }else if(s[i] == 1){
        a100 = c[i]*100;
        flag100 ++;
      }
    }
    if(flag1 == 1 && flag10 == 1 flag100 == 1){
      printf("%d", a1 + a10 + a100);
      return 0;
    }else{
      printf("%d", -1);
      return 0;
    }
  }else{
    printf("%d", -1);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:12: error: expected identifier or '(' before '=' token
   14 |     for(int=0; i<m; i++){
      |            ^
main.c:14:16: error: 'i' undeclared (first use in this function)
   14 |     for(int=0; i<m; i++){
      |                ^
main.c:14:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:8: error: 'flag' undeclared (first use in this function); did you mean 'flag1'?
   20 |     if(flag==1){
      |        ^~~~
      |        flag1
main.c:32:12: error: expected identifier or '(' before '=' token
   32 |     for(int=0; i<m; i++){
      |            ^
main.c:55:12: error: expected identifier or '(' before '=' token
   55 |     for(int=0; i<m; i++){
      |            ^
main.c:67:33: error: expected ')' before 'flag100'
   67 |     if(flag1 == 1 && flag10 == 1 flag100 == 1){
      |       ~                         ^~~~~~~~
      |                                 )
Language: C++

#include<bits/stdc++.h>
using namespace std;
    static const double pi = 3.141592653589793;
 
 
int main(){
int a,b;
  cin>>a>>b;
  int dp[b];
  int gh[b];
  for(int i=0;i<b;i++)
  {
  int x,y;
    cin>>x>>y;
    dp[i]=x;
    gh[i]=y;
  }
 
  int z=0;
  for(int i=0;i<b;i++)
  {
  for(int j=0;j<b;j++)
  {
  if(dp[i]==dp[j] & gh[i]!=gh[j]) 
  {
    z=1;
  
  }
  }
  }
  
  if(z==1) cout<<-1;
  else {
  int t=0;
   vector<int>ys(a);
    for(int i=0;i<b;i++)
    {
  ys.at(dp[i]-1)=gh[i];
    }
    int q=0;
    for(int i=0;i<b;i++)
    {
    if(dp[i]==1) q=1;
    }
    if(q==0) ys.at(0)=1;
    if(a==1) t=ys.at(0);
    else if(a==2) t=ys.at(0)*10+ys.at(1);
    else if(a==3) t=ys.at(0)*100+ys.at(1)*10+ys.at(2);
     if(a==1) cout<<t;
    else if(a==2 & t>=10) cout<<t;
    else if(a==3 & t>=100) cout<<t;
    else cout<<-1;
    
  }
  

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

// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)
#pragma GCC optimize("unroll-loops")
// -------------------</optimizations>--------------------
 
#include <bits/stdc++.h>
 
using namespace std;
 
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define f first
#define s second
#define sz(x) ll(x.size())
#define endl '\n'
#define forn(i,n) for(int i=0;i<n;++i)
#define fore(i,l,r) for(int i=int(l);i<=int(r);++i)
#define rep(i,begin,end) for(__typeof(end) i=(begin);i!=(end);i++)
#define fill(a,value) memset(a,value,sizeof(a));
#define gcd(a,b) __gcd((a),(b))
#define watch1(x) cout << (x) << endl
#define watch2(x,y) cout << (x) << " " << (y) << endl
#define watch3(x,y,z) cout << (x) << " " << (y) << " " << (z) << endl
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
 
typedef long long ll;
typedef long double ld; 
typedef pair<ll,ll> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
 
const ll mod = 1e9 + 7;
const int inf = 1e9 + 5;
const int N = 1e5 + 5;

int s[10],c[10];

signed main(){
    fastio;
    int i,n,m;
    cin>>n>>m;
    bool ok=1;
    map<int,int> mp;
    for(i=1;i<=m;++i){
        cin>>s[i]>>c[i];
        if(mp.find(s[i])!=mp.end()){
            if(mp[s[i]]!=c[i]){
                ok=0;
                break;
            }
        }
        else{
            if(s[i]==1 && c[i]==0 && n!=1){
                ok=0;
                break;
            }
            mp[s[i]]=c[i];
            ans+=pow(10,n-s[i])*c[i];
        }
    }
    if(mp.find(1)==mp.end())
        ans+=pow(10,n-1);
    if(!ok)
        cout<<-1;
    else if(!ans && n!=1)
        cout<<-1;
    else if(!ans && n==1)
        cout<<0;
    else
        cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   64 |             ans+=pow(10,n-s[i])*c[i];
      |             ^~~
      |             abs
a.cc:68:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   68 |         ans+=pow(10,n-1);
      |         ^~~
      |         abs
a.cc:71:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   71 |     else if(!ans && n!=1)
      |              ^~~
      |              abs
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
#define print(x) cout<<'>'<<#x<<':'<<x<<endl;
#define F first
#define S second
const int mod=1000000007;

void solve(){
    int n,m;
    cin>>n>>m;
    int s[m];char c[m];
    string num="";
    for (int i=0;i<n;i++)num+="0";
    for (int i=0;i<m;i++)cin>>s[i]>>c[i];
    for (int i=0;i<m;i++){
        if (s[i]>n){
            cout<<-1<<endl;
            return;
        }else{
            if ((c[i]==0)&&(s[i]==1)){
                if (n!=1)(cout<<-1<<endl;return;}
            }
            if (num[s[i]-1]!=c[i]){
                if (num[s[i]-1]!='0'){
                    cout<<-1<<endl;
                    return;
                }else{
                    num[s[i]-1]=c[i];
                }
            }
        }
    }if (num[0]=='0'){
        if (n==1){cout<<0<<endl;return;}
        else num[0]='1';
    }cout<<num<<endl;
}

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

    solve();

    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:25:41: error: expected ')' before ';' token
   25 |                 if (n!=1)(cout<<-1<<endl;return;}
      |                          ~              ^
      |                                         )
a.cc: At global scope:
a.cc:36:6: error: expected unqualified-id before 'if'
   36 |     }if (num[0]=='0'){
      |      ^~
a.cc:39:6: error: 'cout' does not name a type
   39 |     }cout<<num<<endl;
      |      ^~~~
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector>
#include <utility>
#include <string>
#include <algorithm>
 
#define rep(i,n) for(int i = 0; i < n; i++)
 
typedef long long ll;
 
using namespace std;
 
const ll INF = ll(1e18)+1;
const double PI=3.14159265358979323846;
 
int main(){
  int N,M;
  cin >> N >> M;
  vector<pair<int,int> > vp(M);
  rep(i,M) cin >> vp[i].first >> vp[i].second;
  sort(vp.begin(), vp.end());

  bool same = false;
  if(M==0 && N==1){
    cout << 0 << endl;
    break;
  }
  else if(M==0 && N==2){
    cout << 10 << endl;
    break;
  }
  else if(M==0 && N==3){
    cout << 100 << endl;
    break;
  }
  rep(i,M){
    if(i!=0 && vp[i-1].first==vp[i].first) same = true;
    else same = false;
    if((vp[i].first==1 && vp[i].second==0) || \
       (same && vp[i-1].second!=vp[i].second)){
      cout << -1 << endl;
      return 0;
    }    
  }
  string ans = "";
  rep(i,N){
    bool done;
    rep(j,M){
      if(i==(vp[j].first-1)){
	ans+=to_string(vp[j].second);
	done = true;
	break;
      }
      else done=false;
    }
    if(i==0 && !done) ans+="1";
    else if(!done) ans+="0";
  }
  cout << ans << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,M;cin>>N>>M;
  vector<int> p(N+1,-1);
  bool ok=true;
  for(int i=0; i<M; i++){
    int s,c;cin>>s>>c;
    if(p[s]!=-1&&p[s]!=c)ok=false;
    p[s]=c;
    if(N!=1&&p[1]==0)ok=false;
  }
  if(N==1&&M=0){
    cout<<0<<endl;
  }else if(ok){
    if(N==1&&p[1]==0){
      cout<<0<<endl;
    //}else if(N==2&&p[1]==0){
    //  cout<<0<<endl; 
    }else{
      int ans=0;
      for(int i=1;i<=N;i++){
        if(p[i]==-1){
          p[i]=0;
          if(i==1)p[i]=1;
        }
        ans=ans*10+p[i];
      }
      cout<<ans<<endl;
    }
  }else{
    cout<<-1<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: lvalue required as left operand of assignment
   14 |   if(N==1&&M=0){
      |      ~~~~^~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,m,ans=0;
int s[10],c[10],vis[10];
int main()
{
	cin>>n>>m;
	memset(vis,0,sizeof(vis));
	for(int i=1;i<=m;i++)
	{
		int x;
		cin>>s[i]>>x;
		if(x==0&&s[i]==1&&n!=1){ printf("-1\n");return 0;}
		if(vis[s[i]]&&x!=c[s[i]]){ printf("-1\n");return 0;}
		  else { vis[s[i]]=1;c[s[i]]=x;}
	}
	for(int i=1;i<=n;i++)
	{
		if(vis[i])ans+=c[i]*pow(10,n-i);
		  else{
		  	if(i!=1)ans=ans;
		  	  else ans+=pow(10,n-i);
		  }
	}
	printf("%d\n",ans);
	return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

int main(){
    int n,m,ans;
    ans=0;
    cin >> n >> m;
    int s[m],c[m];
    for (int i=0;i<m;i++){
        cin >> s[i] >> c[i];
    }
    int x[n];
    for(int i=0;i<n;i++){
        x[i]=-1;
    }
    for(int i=0;i<m;i++){
        if(s[i]==1&&c[i]==0){
            ans=-1;
            break;
        }
        if(x[s[i]-1]==-1){
            x[s[i]-1]=c[i];
        }
        else if(x[s[i]-1]!=c[i]){
            ans=-1;
            break;
        }
    }
    if(ans!=-1){
        if(x[0]==-1){
            x[0]=1;
        }
        for(int i=0;i<n;i++){
            if(x[i]==-1){
                x[i]=0;
            }
            ans+=x[i]*pow(10,n-i-1);
        }
    }

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

#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <queue>
#include <stack>
#include <stdlib.h>
using namespace std;
#define rep(i,n) for (int (i) = 0; (i) <(n); (i)++) 
#include <math.h>
#include <bits/stdc++.h>
using namespace std;
int binary(int bina){
    int ans = 0;
    for (int i = 0; bina>0 ; i++)
    {
        ans = ans+(bina%2)*pow(10,i);
        bina = bina/2;
    }
    return ans;
}
long comb(int n, int r) {
    long ans = 1;
    for (int i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (int i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}
using namespace std;
/*int main(){
    int n;std::cin >> n;
    int keta=0;
    while(true){
        keta++;
        if(n/10==0)break;
        n=n/10;
    }
    keta=keta-1;
    if(n>=7)n=3;
    else if(n>=5)n=2;
    else if(n>=3)n=1;
    int k=0;
    for(int i=3;i<=keta;i++){
        k+=comb(i-1,2);
        std::cout << k << std::endl;
    }std::cout << k << std::endl;
    k+=n*(keta);
    
    std::cout << k << std::endl;
    
}


*/
int main(){
  coutstd::cout <<0 << std::endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:63:3: error: 'coutstd' has not been declared
   63 |   coutstd::cout <<0 << std::endl;
      |   ^~~~~~~
Language: C++

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

int main(){
    int N, M;
    std::cin >> N >> M;
    std::vector< int > s(M);
    std::vector< char > c(M);
    for(int i=0; i<M; i++){
        std::cin >> s[i] >> c[i];
    }
    
    int begin = 1;
    int end = 10;
    for(int i=1; i<N; i++){
        begin *= 10;
        end *= 10;
    }
    
    int ans = -1;
    for(int i=begin; i<end; i++){
        bool F = true;
        std::string num_str;
        sprintf(num_str, "%d", i);
        for(int j=0; j<M; j++){
            if(num_str[s[j]] == c[j]){
                F = false;
                break;
            }
        }
        if(F){
            ans = i;
            break;
        }
    }
    std::cout << ans << std::endl;
    

}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
   25 |         sprintf(num_str, "%d", i);
      |                 ^~~~~~~
      |                 |
      |                 std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdio.h:365:38: note:   initializing argument 1 of 'int sprintf(char*, const char*, ...)'
  365 | extern int sprintf (char *__restrict __s,
      |                     ~~~~~~~~~~~~~~~~~^~~
Language: C++

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

int pow(int x, int a);

int main()
{
    int N, M;
    bool f = false;
    cin >> N >> M;
    int ans = pow(10, N);
    int count = ans - 1;
    int min = pow(10, N - 1);
    vector<int> s(M), c(M);
    for (int i = count; i >= min; i--)
    {
        for (int j = 0; j < M; j++)
        {
            int div = pow(10, s.at(j) - 1);
            if (count / div != c.at(j))
            {
                break;
            }
            if (j == M - 1 && ans >= i)
            {
                f = true;
                ans = i;
            }
        }
    }
    if (f)
    {
        cout << ans << endl;
    }
    else
    {
        cout << "-1" << endl;
    }
}

int pow(int x, int a)
{
    if (a == 0)
    {
        return 1;
    }
    return x * f(x, a - 1);
}

Compiler output:
a.cc: In function 'int pow(int, int)':
a.cc:50:16: error: 'f' was not declared in this scope
   50 |     return x * f(x, a - 1);
      |                ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    string kq="";
    bool test[4];
    memset(test,false,4);
    test[0]=false;
    int m,n;
    cin >> n >> m;
    if (m==0)
    {
        cout << 1;
        for (int i=1; i<n; i++)
            cout << 0;
        return 0;
    }
    char tam;
    int a,b;
    for (int i=1; i<=n; i++)
        kq+='0';
    while (m--)
    {
        cin >> a >> b;
        tam=char(b+'0');
        if (kq[a-1]==tam)
            continue;
        if (test[a-1]==true)
        {
            cout << -1;
            return 0;
        }
        test[a-1]=true;
        kq[a-1]=tam;
    }
    if (kq[0]!='0' || n=1 )
        cout << kq;
    else
        cout << -1;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:20: error: lvalue required as left operand of assignment
   38 |     if (kq[0]!='0' || n=1 )
Language: C++

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

#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;

  int s[M], c[M];
  int ans[N];
  rep(i,N) {
    ans[i] = -1;
  }
  bool flag = true;
  rep(i,M) {
    cin >> s[i] >> c[i];
    if (ans[s[i]-1] != -1 && ans[s[i]-1] != c[i]) {
      cout << -1 << endl;
      flag = false;
    }
    ans[s[i]-1] = c[i];
  }

  if (ans[0] == 0) {
    if (N > 1) cout << -1 << endl;
    else cout << 0 << endl;
  } else if (flag) {
    bool flag2 = false;
    rep(i,N) {
      if (ans[i] == -1) {
        if (i == 0) {
          cout << 1;
          flag2 = true;
        }
        else if (flag2 && ans[i] = -1) {
          cout << 1;
        } else {
          cout << 0;
          flag2 = false;
        }
      } else {
        cout << ans[i];
      }
    }
    cout << endl;
  }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:24: error: lvalue required as left operand of assignment
   41 |         else if (flag2 && ans[i] = -1) {
      |                  ~~~~~~^~~~~~~~~
Language: C++

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

int main(void){
    int n,m;
    cin >> n >> m;
    int s[m],c[m];
    for(int i = 0;i < m;i++)cin >> s[i] >> c[i];
    bool check = true;
    int a[n];
    for(int j = 0;j < m;j++){
        for(int k = 0;k < m;k++){
            if(j == k)continue;
            if(s[j] == s[k] && c[j] != c[k])check = false;
        }
    }
    if(!check)cout << -1 << endl;
    else if(n == 1){
        for(int i = 0;i < m;i++){
            if(s[i] == 1 && c[j] == 0)check = false;
        }
        if(!check)cout << -1 << endl;
    } else {
        for(int i = 0;i < n;i++){
            int b = 0;
            for(int j = 0;j < m;j++){
                if(i+1 == s[j])b = c[j];
            }
            a[i] = b;
        }
        for(int i = 0;i < n;i++){
            if(i == 0 && a[i] == 0)cout << 1;
            else cout << a[i];
        }
        cout << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:31: error: 'j' was not declared in this scope
   23 |             if(s[i] == 1 && c[j] == 0)check = false;
      |                               ^
Language: C++

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

using ConditonType = std::map<int, int>;

int ExtractDigit(int value, int targetDigit)
{
    if (targetDigit == 1)
    {
        return value % 10;
    }

    return ExtractDigit(value / 10, targetDigit - 1);
}

bool IsMatchCondition(int value, const ConditonType& condition)
{
    for (const auto& current : condition)
    {
        if (ExtractDigit(value, current.first) != current.second)
        {
            return false;
        }
    }

    return true;
}

int main()
{
    int answerDigit = 0;
    std::cin >> answerDigit;

    int conditionCount = 0;
    std::cin >> conditionCount;

    ConditonType condition;
    for (auto count = 0; count < conditionCount; ++count)
    {
        int inputDigit = 0;
        std::cin >> inputDigit;
        // 計算上右からの桁数が扱いやすいので置き換える
        const auto digit = answerDigit + 1 - inputDigit;

        int value = 0;
        std::cin >> value;

        auto prev = condition.find(digit);
        if (prev != condition.end())
        {
            if (prev->second != value)
            {
                std::cout << -1;
                return 0;
            }
        }
        else
        {
            condition.insert(std::make_pair(digit, value));
        }
    }

    const auto startAnswer = static_cast<int>(std::pow(10, answerDigit - 1));
    const auto maxAnswer = static_cast<int>(std::pow(10, answerDigit));
    for (auto answer = startAnswer; answer < maxAnswer; ++answer)
    {
        if (IsMatchCondition(answer, condition))
        {
            std::cout << answer;
            return 0;
        }
    }

    std::cout << -1;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:52: error: 'pow' is not a member of 'std'
   64 |     const auto startAnswer = static_cast<int>(std::pow(10, answerDigit - 1));
      |                                                    ^~~
a.cc:65:50: error: 'pow' is not a member of 'std'
   65 |     const auto maxAnswer = static_cast<int>(std::pow(10, answerDigit));
      |                                                  ^~~
Language: C++

// #pragma GCC optimize "trapv" Uncomment when dealing with huge numbers
/*<----------PBDS---------->

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
template <typename T>
using order_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

order_set<datatype>oset;
Kth smallest : *oset.find_by_order(k-1); // 0 based index
No of elements less than k : oset.order_of_key(k);
Erase X : oset.erase(x)
<----------PBDS---------->*/
#include<iostream>
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define pb(x) push_back(x)
#define gcd(a,b) __gcd(a,b)
#define all(v) v.begin(),v.end()
#define lcm(a,b) (a*b)/gcd(a,b)
#define bits(x) __builtin_popcountll(x)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int32_t main()
{
		if(n==1 && m==0){
			cout<<"0";
			return 0;
		}
		int n,m; 
		cin >> n >> m;
		int a[n+1];
		memset(a,0,sizeof(a));
		bool can=true;
		vector<int>vis(n,0);
		int p=m;
		while(p--)
		{
			int x,y; 
			cin >> x >> y;
			x--;
			if(vis[x] && y!=a[x])
			{
				can=false; break;
			}
			vis[x]=1;
			a[x]=y;
		}
		string l="";
		if(!vis[0])
		{
			a[0]=1;
		}
		for(int i=0;i<n;i++)
		{
			l+=(a[i]+'0');
		}
 
		if(l.length()<n ||l.length()>n|| can==false || (l[0]=='0' && n!=1))
		{
			cout<<-1;return 0;
		}
		cout<<l;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:29:20: error: 'n' was not declared in this scope; did you mean 'yn'?
   29 |                 if(n==1 && m==0){
      |                    ^
      |                    yn
a.cc:29:28: error: 'm' was not declared in this scope; did you mean 'tm'?
   29 |                 if(n==1 && m==0){
      |                            ^
      |                            tm
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ketasu = sc.nextInt();
        int m = sc.nextInt();
        HashMap<Integer, Integer> map = new HashMap<>();
        boolean judge = true;
        int maxKetasu = 0;
        for(int i = 0; i < m; i++){
          int a = sc.nextInt();
          int b = sc.nextInt();
          if(map.containsKey(a) && b != map.get(a)){
            judge = false;
            break;
          }else{
            map.put(a, b);
          }
          if(maxKetasu < a)
            maxKetasu = a;
        }
        if(judge == false)
          System.out.println(-1);
        else if(!map.containsKey(1))
          System.out.println(-1);
        else if(map.get(1) == 0)
          System.out.print(-1);
        else{
          for(int i = 1; i <= Ketasu; i++){
            if(!map.containsKey(i))
              System.out.print(0);
            else
              System.out.print(map.get(i));
          }
        }
        System.out.println();
    }
}


Compiler output:
Main.java:30: error: cannot find symbol
          for(int i = 1; i <= Ketasu; i++){
                              ^
  symbol:   variable Ketasu
  location: class Main
1 error