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

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
// 
void yes(){
  cout <<"Yes"<<endl ;
}
void no(){
  cout <<"No"<<endl ;
}


//-------------------------------------------------
// メモ




//-------------------------------------------------


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n, m ;
  cin >> n >> m ;
  bool fl = true ;
  
  vector<int> vec(n,0) ;
  vec.at(0) = 1  ;
  vector<int> che(n,0) ;
  
  REP(i,m){
    int a, b ;
    cin >> a >> b ;
    che.at(a-1)++ ;
    
    if(che.at(a-1)==1){
      vec.at(a-1) = b ;
    }
    
    else{
      if(vec.at(a-1)!=b){
        fl = false ;
      }
    }
  }
  
  if(n=>2 && vec.at(0)==0){
    fl = false ;
  }
  
  if(fl){
    REP(i,n){
      cout << vec.at(i) ;
    }
    cout <<endl ;
  }
  
  else{
    cout << -1 <<endl ;
  }
      
    
    
 
  
  return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:77:8: error: expected primary-expression before '>' token
   77 |   if(n=>2 && vec.at(0)==0){
      |        ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:20:31: error: expected ';' before 'printf'
   20 |         else(i == 1 && n != 1) printf("1");
      |                               ^~~~~~~
      |                               ;
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include <cmath>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: lvalue required as left operand of assignment
   26 |                 if (M==0&&N=1)num[0]=0;
      |                     ~~~~^~~
Language: Java

import java.util.Scanner;

public class GuessTheNumber {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int M=sc.nextInt();
		int[] c100=new int[N];
		c100[0]=c100[1]=0;
		int[] c10=new int[N];
		c10[0]=c10[1]=0;
		int[] c1=new int[N];
		c1[0]=c1[1]=0;
		boolean ju=true;
		for(int i=0;i<M;i++){
			int k=sc.nextInt();
			int j=sc.nextInt();
			//100の位
			if(k==1){
				if(j!=0&&c100[0]==0&&N>1){
					c100[1]=j;
					c100[0]+=1;
				}else{
					if(c100[1]!=j||j==0)
						ju=false;
				}
			}
			//10の位
			if(k==2){
				if(c10[0]==0&&(j!=0&&N>=1&&N<3)){
					c10[1]=j;
					c10[0]+=1;
				}else{
					if(c10[1]!=j)
						ju=false;
				}
			}
			//1の位
			if(k==3){
				if(c1[0]==0){
					c1[1]=j;
					c1[0]+=1;
				}
				if(c1[0]!=0){
					if(c1[1]!=j)
						ju=false;
				}
			}
		}
		if(!(ju)||c100[1]==0)
			System.out.print("-1");
		else{
			if(c10[0]==0&&c100[1]!=0)
				c10[1]=0;
			if(c10[0]==0&&N==2)
				c10[1]=1;
			if(c1[0]==0&&c10[1]!=0&&c100[1]!=0)
				c1[1]=0;
			System.out.print(c100[1]*100+c10[1]*10+c1[1]*10);
		}
		}
}


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

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

int main(){
    int N, M; cin >> N >> M;
    vector<int> s_al(N,-1);

    if( N == 1 ){

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

        if( s_al[0] == -1 ) s_al[0] = 0;

        cout << s_al[0] << endl;

    } else {

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

        for( int i = 0; i < N; i++ ){
            if( s_al[i] == -1 && i == 0 ) s_al[i] = 1;
            if( s_al[i] == -1 && i != 0 ) s_al[i] = 0;
        }

        reverse(s_al.begin(),s_al.end());
        int ans = 0;
        if( s_al == {0,0,-1} ) ans = 0;
        else{
            for( int i = 0; i < N; i++ ){
                ans += s_al[i] * pow(10,i);
            }
        }

        cout << ans << endl;

    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:21: error: expected primary-expression before '{' token
   48 |         if( s_al == {0,0,-1} ) ans = 0;
      |                     ^
a.cc:48:20: error: expected ')' before '{' token
   48 |         if( s_al == {0,0,-1} ) ans = 0;
      |           ~        ^~
      |                    )
Language: C++

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

void solve() {
  int n, m;
  std::cin >> n >> m;
  std::vector<std::pair<int, int> > c(m);
  // first:s second:c
  rep(i,m) std::cin >> c[i].first >> c[i].second;
  rep(x, std::pow(10, n-1) {
    std::vector<int> d(1, x%10);
    int nx = x / 10;
    while (nx) {
      d.push_back(nx%10);
      nx /= 10;	
    }
    std::reverse(d.begin(), d.end());
    if (d.size() != n) continue;
    bool ok = true;
    rep(i,m) if (d[c[i].first-1] != c[i].second) ok = false;
    if (ok) {
      std::cout << x << std::endl;
      return;
    }
  }
  std::cout << -1 << std::endl;
  return;
}

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

Compiler output:
a.cc:33:2: error: unterminated argument list invoking macro "rep"
   33 | }
      |  ^
a.cc: In function 'void solve()':
a.cc:10:3: error: 'rep' was not declared in this scope
   10 |   rep(x, std::pow(10, n-1) {
      |   ^~~
a.cc:10:6: error: expected '}' at end of input
   10 |   rep(x, std::pow(10, n-1) {
      |      ^
a.cc:4:14: note: to match this '{'
    4 | void solve() {
      |              ^
Language: C++

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

void solve() {
  int n, m;
  std::cin >> n >> m;
  std::vector<std::pair<int, int> > c(m);
  // first:s second:c
  rep(i,m) std::cin >> c[i].first >> c[i].second;
  rep(x, std::pow(10, n-1) {
    std::vector<int> d(1, x%10);
    int nx = x / 10;
    while (nx) {
      d.push_back(nx%10);
      nx /= 10;	
    }
    std::reverse(d.begin(), d.end());
    if (d.size() != n) continue;
    bool ok = true;
    rep(i,m) if (d[c[i].first-1] != c[i].second) ok = false;
    if (ok) {
      std::cout << x << std::endl;
      return;
    }
  }
  std::cout << -1 << std::endl;
  return;
}

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

Compiler output:
a.cc:33:2: error: unterminated argument list invoking macro "rep"
   33 | }
      |  ^
a.cc: In function 'void solve()':
a.cc:10:3: error: 'rep' was not declared in this scope
   10 |   rep(x, std::pow(10, n-1) {
      |   ^~~
a.cc:10:6: error: expected '}' at end of input
   10 |   rep(x, std::pow(10, n-1) {
      |      ^
a.cc:4:14: note: to match this '{'
    4 | void solve() {
      |              ^
Language: C++

#include <bits/cstd++.h>
#define rep(i,n) for (int i = 0; i < n; i++)

void solve() {
  int n, m;
  std::cout >> n >> m;
  std::vector<std::pair<int, int> > c(m);
  // first:s second:c
  rep(i,m) std::cin >> c[i].first >> c[i].second;
  rep(x, std::pow(10, n-1) {
    std::vector<int> d(1, x%10);
    int nx = x / 10;
    while (nx) {
      d.push_back(nx%10);
      nx /= 10;	
    }
    std::reverse(d.begin(), d.end());
    if (d.size() != n) continue;
    bool ok = true;
    rep(i,m) if (d[c[i].first-1] != c[i].second) ok = false;
    if (ok) {
      std::cout << x << std::endl;
      return;
    }
  }
  std::cout << -1 << std::endl;
  return;
}

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

Compiler output:
a.cc:1:10: fatal error: bits/cstd++.h: No such file or directory
    1 | #include <bits/cstd++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <map>
#include <utility>
#include <iostream>

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

void solve() {
  int n, m;
  std::cin >> n >> m;
  std::map<int, int> num;
  rep(i,3) num.insert(std::pair<int, int>((i+1), -1));
  int s[5];
  int c[5];
  rep(i,5) s[i] = c[i] = -1;
  rep(i,m) std::cin >> s[i] >> c[i];
  bool ans = true;
  rep(i,m) {
    if (num[s[i]] == -1) num[s[i]] = c[i];
    else if (num[s[i]] != c[i]) {
      ans = false;
      break;
    }
  }
  int real_num = 0;
  if (ans) {
    rep(i,n) {
      if (i == n-1 && n > 1 &&  num[n] == -1) real_num += std::pow(10, i);
      else real_num += ((num[i+1] == -1 ? 0 : num[i+1]) * std::pow(10, i));
    }
    std::cout << real_num << std::endl;
  } else {
    std::cout << -1 << std::endl; 
  }
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:27:64: error: 'pow' is not a member of 'std'
   27 |       if (i == n-1 && n > 1 &&  num[n] == -1) real_num += std::pow(10, i);
      |                                                                ^~~
a.cc:28:64: error: 'pow' is not a member of 'std'
   28 |       else real_num += ((num[i+1] == -1 ? 0 : num[i+1]) * std::pow(10, i));
      |                                                                ^~~
Language: C++

#include <map>
#include <utility>
#include <iostream>

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

void solve() {
  int n, m;
  std::map<int, int> num;
  rep(i,3) num.insert(std::pair<int, int>((i+1), -1)));
  int s[5];
  int c[5];
  rep(i,5) s[i] = c[i] = -1;
  rep(i,m) std::cin >> s[i] >> c[i];
  
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:10:54: error: expected ';' before ')' token
   10 |   rep(i,3) num.insert(std::pair<int, int>((i+1), -1)));
      |                                                      ^
      |                                                      ;
Language: C++

#include <bits/stdc++.h>
//PDFの写し。
using namespace std;

int main()
{
  int n, m;
  cin >> n >> m;
  //int,intのペアを要素として持つsize==mのvector pを宣言。
  vector<pair<int, int> > p(m);
  //pに条件データを全部入れる
  for(int i = 0; i < m; i++){
    cin >> p[i].first >>p[i].second;
  }
  /*
  *オーダーがO(1000)と小さいので全ての要素について調べる。
  *xについて、一桁ずつvector dに入れる。
  *桁が指定と違えば次のxについて調べる
  *pに格納した条件を用いて、dに格納したxが正しいか一桁ずつ判定する。条件と違う桁があれば次のxについて調べる。
  *条件をスルーすればxを出力し、最後までループが回れば条件と一致するものは見つからなかったということなので-1を出力する。
  */
  for(int x = 0; x < 1000; x++){
    int keta = 1;
    int nx = x/10;
    vector<int> d(1,x%10);
    while(nx){
      keta++;
      //1の位から左に入れていく。例890 => 098 のようになる。
      d.push_back(nx%10);
      nx /= 10;
    }
    if(keta != n) continue;
    bool ok = true;
    //ここで正しい数字の順にしている。先の例を持ち出せば。098 => 890 のようになる。
    reverse(d.begin(), d.end());
    for(int i = 0; i < m; i++){
      if(d[p[i].first-1] != p[i].second) ok = false;
    }
    if(ok){
      cout << x << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
/*
*同じ桁に複数の指定があっても、どちらかは確実にfalseをはいてくれる。
*

Compiler output:
a.cc:47:1: error: unterminated comment
   47 | /*
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
  int n, m;
  cin >> n >> m;
  //int,intのペアを要素として持つsize==mのvector pを宣言。
  vector<pair<int, int>> p(m);
  //pに条件データを全部入れる
  for(int i = 0; i < m; i++){
    cin >> p[i].first >>p[i].second;
  }
  /*
  *オーダーがO(1000)と小さいので全ての要素について調べる。
  *xについて、一桁ずつvector dに入れる。
  *桁が指定と違えば次のxについて調べる
  *pに格納した条件を用いて、dに格納したxが正しいか一桁ずつ判定する。条件と違う桁があれば次のxについて調べる。
  *条件をスルーすればxを出力し、最後までループが回れば条件と一致するものは見つからなかったということなので-1を出力する。
  */
  for(int x = 0; x < 1000; x++){
    int keta = 1;
    int nx = x/10;
    vector<int> d(1,x%10);
    while(nx){
      keta++;
      //1の位から左に入れていく。例890 => 098 のようになる。
      d.push_back(nx%10);
      nx /= 10;
    }
    if(keta != n) continue;
    bool ok = true;
    //ここで正しい数字の順にしている。先の例を持ち出せば。098 => 890 のようになる。
    reverse(d.begin(), d.end());
    for(int i = 0; i < m; i++){
      if(d[p[i].first-1] != p[i].second) ok = false;
    }
    if(ok){
      cout << x << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
/*
*同じ桁に複数の指定があっても、どちらかは確実にfalseをはいてくれる。
*

Compiler output:
a.cc:47:1: error: unterminated comment
   47 | /*
      | ^
Language: C++

#include <bits/stdc++.h>
//解説PDAの写し
using namespace std;

int main()
{
  int n, m;
  cin >> n >> m;
  //int,intのペアを要素として持つsize==mのvector pを宣言。
  pair<int, int> P;
  vector<P> p(m);
  //pに条件データを全部入れる
  for(int i = 0; i < m; i++){
    cin >> p[i].first >>p[i].second;
  }
  /*
  *オーダーがO(1000)と小さいので全ての要素について調べる。
  *xについて、一桁ずつvector dに入れる。
  *桁が指定と違えば次のxについて調べる
  *pに格納した条件を用いて、dに格納したxが正しいか一桁ずつ判定する。条件と違う桁があれば次のxについて調べる。
  *条件をスルーすればxを出力し、最後までループが回れば条件と一致するものは見つからなかったということなので-1を出力する。
  */
  for(int x = 0; x < 1000; x++){
    int keta = 1;
    int nx = x/10;
    vector<int> d(1,x%10);
    while(nx){
      keta++;
      //1の位から左に入れていく。例890 => 098 のようになる。
      d.push_back(nx%10);
      nx /= 10;
    }
    if(keta != n) continue;
    bool ok = true;
    //ここで正しい数字の順にしている。先の例を持ち出せば。098 => 890 のようになる。
    reverse(d.begin(), d.end());
    for(int i = 0; i < m; i++){
      if(d[p[i].first-1] != p[i].second) ok = false;
    }
    if(ok){
      cout << x << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
/*
*同じ桁に複数の指定があっても、どちらかは確実にfalseをはいてくれる。
*

Compiler output:
a.cc:48:1: error: unterminated comment
   48 | /*
      | ^
a.cc: In function 'int main()':
a.cc:11:11: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
   11 |   vector<P> p(m);
      |           ^
a.cc:11:11: note:   expected a type, got 'P'
a.cc:11:11: error: template argument 2 is invalid
a.cc:14:13: error: invalid types 'int[int]' for array subscript
   14 |     cin >> p[i].first >>p[i].second;
      |             ^
a.cc:14:26: error: invalid types 'int[int]' for array subscript
   14 |     cin >> p[i].first >>p[i].second;
      |                          ^
a.cc:38:13: error: invalid types 'int[int]' for array subscript
   38 |       if(d[p[i].first-1] != p[i].second) ok = false;
      |             ^
a.cc:38:30: error: invalid types 'int[int]' for array subscript
   38 |       if(d[p[i].first-1] != p[i].second) ok = false;
      |                              ^
Language: C++

#include <bits/stdc++.h>
//解説PDFの写しに解釈と解説を追加しただけのやつ。
//author is not me
using namespace std;

int main()
{
  int n, m;
  cin >> n >> m;
  //int,intのペアを要素として持つsize==mのvector pを宣言。
  vector<pair<int, int>> p(m);
  //pに条件データを全部入れる
  for(int i = 0; i < m; i++){
    cin >> p[i].first >>p[i].second;
  }
  /*
  *オーダーがO(1000)と小さいので全ての要素について調べる。
  *xについて、一桁ずつvector dに入れる。
  *桁が指定と違えば次のxについて調べる
  *pに格納した条件を用いて、dに格納したxが正しいか一桁ずつ判定する。条件と違う桁があれば次のxについて調べる。
  *条件をスルーすればxを出力し、最後までループが回れば条件と一致するものは見つからなかったということなので-1を出力する。
  */
  for(int x = 0; x < 1000; x++){
    int keta = 1;
    int nx = x/10;
    vector<int> d(1,x%10);
    while(nx){
      keta++;
      //1の位から左に入れていく。例890 => 098 のようになる。
      d.push_back(nx%10);
      nx /= 10;
    }
    if(keta != n) continue;
    bool ok = true;
    //ここで正しい数字の順にしている。先の例を持ち出せば。098 => 890 のようになる。
    reverse(d.begin(), d.end());
    for(int i = 0; i < m; i++){
      if(d[p[i].first-1] != p[i].second) ok = false;
    }
    if(ok){
      cout << x << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
/*
*同じ桁に複数の指定があっても、どちらかは確実にfalseをはいてくれる。
*

Compiler output:
a.cc:48:1: error: unterminated comment
   48 | /*
      | ^
Language: Java

import java.util.*;
import java.lang.Math;

public class Main{
	public static void main(String args[]){
		call();
	}

	public static void call(){
		Scanner sc = new Scanner(System.in);
		int keta = sc.nextInt();
		int numOfData = sc.nextInt();
      if(keta == 1){
        int M = sc.nextInt();
        int key = sc.nextInt();
        int value = sc.nextInt();
        if(key != 1 || M!= 1){
          System.out.println(-1);
          return;
        }else{
          System.out.println(value);
          return;
        }
		Map<Integer,Integer> map = new HashMap<>(numOfData);
		//mapに桁数と値を入れる
		//キーの値が更新されそうになったら、-1を出力して終了する
		for(int i = 0; i < numOfData; i++){
			int key = 0;
			int value = 0;
			key = sc.nextInt();
			value = sc.nextInt();
			if(map.containsKey(key) && map.get(key) != value){
				System.out.println(-1);
				return;
			}
			map.put(key,value);
		}
		//一桁目が0になる指定があれば、-1を出力して終了する
		if(map.containsKey(1) && map.get(1) == 0/*左の条件がfalseならここは検査されない(はず)*/){
			if(keta == 1){
				System.out.println(0);
				return;
			}else{
				System.out.println(-1);
				return;
			}
		}
		//指定された桁に値を代入する
		int ans = 0;
		for(int key: map.keySet()){
			ans += map.get(key) * Math.pow(10, keta - key);
		}
		//答えが指定された桁数より小さければ、桁数を10の累乗を足すことで合わせる
		if(ans < Math.pow(10, keta -1)){
			ans += Math.pow(10, keta -1);
		}
		System.out.println(ans);
		return;
	}
}


Compiler output:
Main.java:60: error: reached end of file while parsing
}
 ^
1 error
Language: C++

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

int main() {
  int n,m;
  cin >> n >> m;
  vector<int> vec(n,0);
  vector<int> count(n,0);
  bool flag = true;
  
  for(int i=0;i<m;i++){
    int a,b;
    cin >> a >> b;
    if (count[a-1] == 0){
      vec[a-1] = b;
      count[a-1] = 1;
    } 
    else{
      if (vec[a-1] != b) flag = false;
    }
  }
  
  if (n==1 && m==0) cout << 0 << endl;
  else if(n==1 && m>0){
    if (flag == true) cout << vec[0] << endl;
    else cout << -1 << endl;
  else if (n==2 && m==0) cout << 10 << endl;
  else if (n==3 && m==0) cout << 100 << endl;
  else if (n>1){
    if(flag=true&&vec[0]!=0){
      for(int i:vec){
        cout << i;
      }
      cout << endl;
    }
  else cout << -1 << endl;
  }
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: expected '}' before 'else'
   27 |   else if (n==2 && m==0) cout << 10 << endl;
      |   ^~~~
a.cc:24:23: note: to match this '{'
   24 |   else if(n==1 && m>0){
      |                       ^
a.cc: At global scope:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

    #include<bits/stdc++.h>
     
    using namespace std;
     int vec[3],vec2[3];
     
    int main(){
        bool flag = true;
        int n,m ,s ,c;

        cin >> n >> m;

        if(n == 1 && m == 0){
            cout<<0 << "\n";
            return 0;
        }
        for (int i = 0; i < m; i++)
        {
            cin >> s >> c;

           
            else if(c != vec[n-s] && vec[n-s]> 0){
                flag = false;
                continue;
            }
            vec[n-s] = c;
            vec2[n-s]++;
            

        }
        
        if(flag){
        
        if(vec[2] == 0 && vec[1] == 0 && n == 3)
            cout<< 100+vec[0]<< "\n";
        
        else if(vec[2] == 0 && n == 3)
            cout<< 100 + vec[1]*10 + vec[0]<< "\n";
        else if(vec[1] == 0 && n == 2)
            cout<< 10+vec[0]<< "\n";
        else if( n == 1)
            cout<< vec[0]<< "\n";
        
        else{
            cout<< 100*vec[2] + 10*vec[1] +vec[0] << "\n";
        }
            }
        else{
            cout<< "-1"<< "\n";
        }

       return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: 'else' without a previous 'if'
   21 |             else if(c != vec[n-s] && vec[n-s]> 0){
      |             ^~~~
Language: C++

    #include<bits/stdc++.h>
     
    using namespace std;
     int vec[3],vec2[3];
     
    int main(){
        bool flag = true;
        int n,m ,s ,c;

        cin >> n >> m;

        if(n == 1 && m == 0){
            cout<<0 << "\n";
            return 0;
        }
        for (int i = 0; i < m; i++)
        {
            cin >> s >> c;

            if(n >1 && s == 1 && c == 0){
                vis = false;
                continue;
            }
            else if(c != vec[n-s] && vec[n-s]> 0){
                flag = false;
                continue;
            }
            vec[n-s] = c;
            vec2[n-s]++;
            

        }
        
        if(flag){
        
        if(vec[2] == 0 && vec[1] == 0 && n == 3)
            cout<< 100+vec[0]<< "\n";
        
        else if(vec[2] == 0 && n == 3)
            cout<< 100 + vec[1]*10 + vec[0]<< "\n";
        else if(vec[1] == 0 && n == 2)
            cout<< 10+vec[0]<< "\n";
        else if( n == 1)
            cout<< vec[0]<< "\n";
        
        else{
            cout<< 100*vec[2] + 10*vec[1] +vec[0] << "\n";
        }
            }
        else{
            cout<< "-1"<< "\n";
        }

       return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'vis' was not declared in this scope
   21 |                 vis = false;
      |                 ^~~
Language: C++

N,M=map(int,input().split())
sc=[[int(i) for i in input().split()] for j in range(M)]
res=["x"]*N
flag=True
for s,c in sc:
    if N<s or res[s-1] not in ['x', str(c)]:
        flag=False
        break
    res[s-1]=str(c)
if len(res)>1 and res[0]=='0':flag=False
if not flag:
    print(-1)
else:
    if res[0]=='x':
        res[0] = '0' if len(res)==1 else '1'
    for i in range(1,N):
        if(res[i]=='x'):
            res[i]='0'
    print(''.join(res))


Compiler output:
a.cc:19:11: error: empty character constant
   19 |     print(''.join(res))
      |           ^~
a.cc:1:1: error: 'N' does not name a type
    1 | N,M=map(int,input().split())
      | ^
Language: C

#include <stdio.h>

int main()
{
	int num[4] = { 0,-1,-1,-1 };
	int N, M;
	scanf_s("%d %d", &N, &M);
	int s[5], c[5];
	for (int i = 1;i <= M;i++)
	{
		scanf_s("%d %d", &s[i], &c[i]);
		if (num[s[i]] == -1 || num[s[i]] == c[i])
			num[s[i]] = c[i];
		else
		{
			printf("-1");
			return 0;
		}
	}
	if (num[1] == 0)
	{
		if (N > 1)
			return 0;
	}
	if (num[1] == -1)
	{
		if (N > 1)
			num[1] = 1;
	}
	for (int i = 1;i <= N;i++)
	{
		if (num[i] == -1)
			num[i] = 0;
		printf("%d", num[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |         scanf_s("%d %d", &N, &M);
      |         ^~~~~~~
      |         scanf
Language: C++

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

Compiler output:
a.cc:17:2: error: 'b' does not name a type
   17 | }b
      |  ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int MAX = 5;
pair<int, int> s[5 + 1];

vector<char> nums(5);

void itoa(int a, int len) {
    int pos = 0;
    while (a > 0) {
        nums[pos++] = a % 10;
        a /= 10;
    }

    reverse(nums.begin(), nums.begin() + len);
}

int main() {

    int n, m;
    cin >> n >> m;
    for (int j = 1; j <= m; ++j) {
        cin >> s[j].first >> s[j].second;
    }

    for (int i = 0; i < 1e3; ++i) {
        int len = 1;
        if (i >= 10) len++;
        if (i >= 100) len++;

        if (len != n) {
            continue;
        }

        itoa(i, len);
        int find = true;
        for (int j = 1; j <= m; ++j) {
            if (nums[s[j].first - 1] != s[j].second) {
                find = false;
            }
        }

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

    cout << -1;
    return 0;
}

Compiler output:
a.cc: In function 'void itoa(int, int)':
a.cc:18:5: error: 'reverse' was not declared in this scope
   18 |     reverse(nums.begin(), nums.begin() + len);
      |     ^~~~~~~
Language: C++

int main() {
	int n, m, i, x[3] = { 10,10,10 }, c, s;
	cin >> n >> m;
	if (n == 1) {
		for (i = 0; i < m; i++) {
			cin >> s >> c;
			if (x[0] != 10 && x[0] != c) {
				cout << "-1";
				return 0;
			}
			if (s == 1 && c == 0) {
				cout << "-1";
				return 0;
			}
			else x[0] = c;
		}
		cout << x[0];
		return 0;
	}
	if (n == 2) {
		for (i = 0; i < m; i++) {
			cin >> s >> c;
			if (x[s-1] != 10 && x[s-1] != c) {
				cout << "-1";
				return 0;
			}
			if (s==1&&c==0) {
				cout << "-1";
				return 0;
			}
			else x[s-1] = c;
		}
		if (x[0] == 10)x[0] = 1;
		if (x[1] == 10)x[1] = 0;
		cout << x[0] << x[1];
	}
	if (n == 3) {
		for (i = 0; i < m; i++) {
			cin >> s >> c;
			if (x[s - 1] != 10 && x[s - 1] != c) {
				cout << "-1";
				return 0;
			}
			if (s == 1 && c == 0) {
				cout << "-1";
				return 0;
			}
			else x[s - 1] = c;
		}
		if (x[0] == 10)x[0] = 1;
		if (x[1] == 10)x[1] = 0;
		if (x[2] == 10)x[2] = 0;
		cout << x[0] << x[1]<<x[2];
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> n >> m;
      |         ^~~
a.cc:8:33: error: 'cout' was not declared in this scope
    8 |                                 cout << "-1";
      |                                 ^~~~
a.cc:12:33: error: 'cout' was not declared in this scope
   12 |                                 cout << "-1";
      |                                 ^~~~
a.cc:17:17: error: 'cout' was not declared in this scope
   17 |                 cout << x[0];
      |                 ^~~~
a.cc:24:33: error: 'cout' was not declared in this scope
   24 |                                 cout << "-1";
      |                                 ^~~~
a.cc:28:33: error: 'cout' was not declared in this scope
   28 |                                 cout << "-1";
      |                                 ^~~~
a.cc:35:17: error: 'cout' was not declared in this scope
   35 |                 cout << x[0] << x[1];
      |                 ^~~~
a.cc:41:33: error: 'cout' was not declared in this scope
   41 |                                 cout << "-1";
      |                                 ^~~~
a.cc:45:33: error: 'cout' was not declared in this scope
   45 |                                 cout << "-1";
      |                                 ^~~~
a.cc:53:17: error: 'cout' was not declared in this scope
   53 |                 cout << x[0] << x[1]<<x[2];
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std ; 

int main () { 
	int  t ; 
	ios_base::sync_with_stdio(false);
	cin.tie(NULL) ;
	
	int n , m  ; 
	cin >> n >> m ;
	int arr[n] ; 
	for ( int i = 0 ; i < n ; i ++ ) {
		arr[i] = -1 ; 
	} 
	int s ; 
	int v ; 
	for ( int i = 0 ; i < m ; i ++ ) { 
		cin >> s >> v ; 
		if (arr[s-1] == -1 || arr[s-1] == v )
			arr[s-1] = v ; 
		else {
			if ( arr[s-1] != v ){
				cout << -1 << endl ; 
				return 0 ; 
			}
				
		}
	}
	
	if ( n > 1 && arr[0] == 0 ) 
		cout << -1 << endl ; 
		return 0;  
	else 
		if (arr[0] == -1 )
			arr[0] = 1 ; 
		if ( arr[1] == -1 )
			arr[1] = 0 ; 
		if (arr[2] == -1 )
			arr[2] = 0 ; 
		for ( int i = 0 ; i < n ; i ++ ) 
			cout << arr[i] ;
			cout << endl ; 
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'else' without a previous 'if'
   34 |         else
      |         ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int     idx = 0, dig = 0, in = 0, num = 0;
    int     ans[3] = {0, 0 ,0};
    cin >> dig >> in;
    if (in == 0)
    {
        cout << -1 << endl;
        return (0):
    }
    while (in-- > 0)
    {
        cin >> idx >> num;
        ans[idx - 1] = num;
    }
    for (int i = 0; i < dig; i++)
    {
        if (dig > 1 && ans[3 - dig] == 0)
        {
            cout << -1 << endl;
            return (0);
        }
        cout << ans[i];
    }
    cout << endl;
    return (0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before ':' token
   11 |         return (0):
      |                   ^
      |                   ;
a.cc:11:19: error: expected primary-expression before ':' token
Language: C++

/******************************************************************************
 
                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
 
*******************************************************************************/
 
#include <iostream>
#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{   
    int n = 0, m = 0, a = 0, b = 0,x = 0 ;
    cin >> n >> m; 
    
    int array[n];
    
    for (int i = 0; i < n ; i++){ 
        array[i] = 10; 
    } 
    
 
    vector<pair<int,int>> cor;
    for(int i = 0; i < m; i ++){
        cin >> a >> b; 
        cor.push_back(make_pair(a,b));
    }
    
    for(int i = 0; i < cor.size(); i++){
        if(array[cor[i].first - 1] == 10 || array[cor[i].first - 1] == cor[i].second){
 
            array[cor[i].first - 1] = cor[i].second;
            
            
        }else{
            cout << -1;
            return 0;
        }
    }
    
    if(array[0] == 0 && n = 1){
        cout << 0; 
        return 0; 
    }
        
    
    if(array[0] == 0){
        cout << -1;
        return 0;
    }else{
        
        if(array[0] == 10 && n != 1){
            cout << 1; 
            x = 1; 
        }
            
        for(int i = x; i < n; i++){
            if(array[i] == 10){
                cout << 0;
            }else{
              cout << array[i];
            }
        }
    }
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:22: error: lvalue required as left operand of assignment
   44 |     if(array[0] == 0 && n = 1){
      |        ~~~~~~~~~~~~~~^~~~
Language: C++

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

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

    int a[N] = {0};

    for (int m=0;m<M;m++) {
        int s, c;
        cin >> s >> c;
        int idx = s - 1;
        int idx_n = a[idx];
        if (c != 0) {
            if (idx_n == 0 || c < idx_n) {
                a[idx] = c
            }
        }
    }
    if (1 < N && a[0] == 0) {
        cout << "-1" << endl;
    } else {
        for (int i=0;i<N;i++) {
            cout << a[i];
        }
        cout << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: expected ';' before '}' token
   17 |                 a[idx] = c
      |                           ^
      |                           ;
   18 |             }
      |             ~
Language: C++

#include <stdio.h>

void input(int *N, int *M, int *s, int *c);
	void get2Num(int *, int*);
int iCalc(int *N, int *M, int *s, int *c);
	int iPow(int a, int b);

int main() {
	int N, M, s[5], c[5];
	input(&N, &M, &s[0], &c[0]);

	int ans = iCalc(&N, &M, &s[0], &c[0]);
	
	printf("%d\n", ans);
	
	return 0;
}

void input(int *N, int *M, int *s, int *c) {
	get2Num(N, M);
	for (int i = 0; i < *M; i++)
		get2Num(&s[i], &c[i]);
	return;
}

void get2Num(int *a, int *b) {
	scanf("%d %d", a, b);
	return;
}

int iCalc(int *N, int *M, int *s, int *c) {
	if (*M == 0) {
		switch *N
		case 1:
			return 0;
		case 2:
			return 10;
		case 3:
			return 100;
	}

	bool bAlready[*N + 1];
	for (int i = 0; i < *N; i++)
		bAlready[i + 1] = false; 
	int iRet = 0, digit, iVal[*N + 1];
	
	for (int i = 0; i < *M; i++) {
		if (s[i] == 1 && c[i] == 0 && *N != 1)
			return -1;

		if (!bAlready[s[i]]) {
			digit = *N - s[i];
			iRet +=  iPow(10, digit) * c[i];
			bAlready[s[i]] = true;
			iVal[s[i]] = c[i];
		} else if (iVal[s[i]] != c[i])
			return -1;
	}
	if (!bAlready[1])
		iRet += iPow(10, *N - 1);

	return iRet;
}

int iPow(int a, int b) {
	int iRet = 1;
	for (int i = 0; i < b; i++)
		iRet *= a;
	if (b == 0)
		iRet = 1;
	return iRet;
} 


Compiler output:
a.cc: In function 'int iCalc(int*, int*, int*, int*)':
a.cc:33:24: error: expected '(' before '*' token
   33 |                 switch *N
      |                        ^
      |                        (
a.cc:36:17: error: case label '2' not within a switch statement
   36 |                 case 2:
      |                 ^~~~
a.cc:38:17: error: case label '3' not within a switch statement
   38 |                 case 3:
      |                 ^~~~
Language: C++

import java.util.Scanner;

public class Main {

    public static boolean guess(int N, int M){
        Scanner sc=new Scanner(System.in);
        if(N<0 || N>3) return false;
        if(M<0 || M>5) return false;
        int[] a=new int[]{-1,-1,-1};
        for(int i=0;i<N;i++){
            int s=sc.nextInt()-1;
            int c=sc.nextInt();
            if(c<0 || c>9) return false;
            if(a[s]==-1)
                a[s]=c;
            else if(a[s]!=c)
                return false;
            if((N==2 && a[0]==0) ||(N==3 && a[0]==0))
                return false;
        }
        for(int i=0;i<N;i++){
            if(a[i]==-1)
                a[i]=0;
        }
        int sum=a[0]*100+a[1]*10+a[2];
        System.out.println(sum);
        return true;
    }
    
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int M=sc.nextInt();
           System.out.println(guess(N,M)?"":"-1");    
    }
    
}


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>
using namespace std;
int main(){
  int N,M; // M<=5,N<=3
  int sc[5][2]; // sc * M *2
  int ans[3]{-1,-1,-1}; // N<=3
  bool error{false};
  int ans_num{0};
  bool debug{true};
  
  cin >>N >> M;
  if(debug)cout << "N=" << N << "," << "M=" << M << endl;
    
  for (int i=0;i<M;i++){
    cin >> sc[i][0] >> sc[i][1];
    if(debug)cout << "s=" << sc[i][0] << "," << "c=" << sc[i][1] << endl; 
    
    if((ans[sc[i][0]-1]!=-1)and(ans[sc[i][0]-1]!=sc[i][1])){
        error=true;
        if(debug)cout<<"error1"<<endl;
    }else if(sc[i][1]<0){
        error=true;
        if(debug)cout<<"error2"<<endl;    

    }else if(sc[i][1]>9){
        error=true;
        if(debug)cout<<"error3"<<endl;    

    }else{
    ans[sc[i][0]-1]=sc[i][1];    
      
    }
  }
  
  for(int i=0;i<N;i++){
    if(ans[i]==-1){
      ans[i]=0;
    }
  }
  
  if(debug)cout << ans[0] <<ans[1] << ans[2] <<endl;
  
  if(error){
  	cout << -1;
  }else if((N==1)and(ans[0]==0))
    cout << -1;
  else if((N==2)and(ans[1]==0))
    cout << -1;
  else if((N==3)and(ans[2]==0))
    cout << -1;
  else{
    switch(N){
      case 1:
        ans_num= ans[2];
      case 2:
        ans_num= 10*ans[1]+1*ans[2];
      case 3:
       	ans_num= 100*ans[0]+10*ans[1]+1*ans[2];
      default:
        ans_num=-1
    }
    cout << ans_num;
  }
  
  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:19: error: expected ';' before '}' token
   60 |         ans_num=-1
      |                   ^
      |                   ;
   61 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
const ll INF = 1e9 + 7;
typedef pair<int,int> P;// pair型は２つの値の組を表せる

int main(){
    int n,m; cin >> n >> m; //桁数n,条件がm個
    vector<P> p(m);
    //p[i].firstが左から～桁目　
    //p[i].secondがその桁の数値
    rep(i,m) cin >> p[i].first >> p[i].second;　
    //候補0~999を試す
    rep(x,1000){
        int keta=1;//0桁が存在しないため
        int nx=x/10;
        vector <int> d(1,x%10);//下一桁をd配列に入れる！
        while(nx){
            keta++;
            d.push_back(nx%10);
            nx/=10;
        }
        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:13:47: error: extended character 　 is not valid in an identifier
   13 |     rep(i,m) cin >> p[i].first >> p[i].second;　
      |                                               ^
a.cc: In function 'int main()':
a.cc:13:47: error: '\U00003000' was not declared in this scope
   13 |     rep(i,m) cin >> p[i].first >> p[i].second;　
      |                                               ^~
a.cc:15:9: error: 'x' was not declared in this scope
   15 |     rep(x,1000){
      |         ^
a.cc:2:31: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0; i<(n); i++)
      |                               ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
const ll INF = 1e9 + 7;
typedef pair<int,int> P;// pair型は２つの値の組を表せる

int main(){
    int n,m; cin >> n >> m; //桁数ｎ、条件がm個
    vector<P> p(m);
    //p[i].firstが左から～桁目　
    //p[i].secondがその桁の数値
    rep(i,m) cin >> p[i].first >> p[i].second;　
    //候補0~999を試す
    rep(x,1000){
        int keta=1;//0桁が存在しないため
        int nx=x/10;
        vector <int> d(1,x%10);//下一桁をd配列に入れる！
        while(nx){
            keta++;
            d.push_back(nx%10);
            nx/=10;
        }
        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:13:47: error: extended character 　 is not valid in an identifier
   13 |     rep(i,m) cin >> p[i].first >> p[i].second;　
      |                                               ^
a.cc: In function 'int main()':
a.cc:13:47: error: '\U00003000' was not declared in this scope
   13 |     rep(i,m) cin >> p[i].first >> p[i].second;　
      |                                               ^~
a.cc:15:9: error: 'x' was not declared in this scope
   15 |     rep(x,1000){
      |         ^
a.cc:2:31: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0; i<(n); i++)
      |                               ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
const ll INF = 1e9 + 7;
typedef pair<int,int> P;// pair型は２つの値の組を表せる

int main(){
    int n,m; cin >> n >> m; //桁数ｎ、条件がm個
    vector<P> p(m);
    rep(i,m) cin >> p[i].first >> p[i].second;　//p[i].first..左から～桁目　p[i].second..その桁の数値
    //候補0~999を試す
    rep(x,1000){
        int keta=1;//0桁が存在しないため
        int nx=x/10;
        vector <int> d(1,x%10);//下一桁をd配列に入れる！
        while(nx){
            keta++;
            d.push_back(nx%10);
            nx/=10;
        }
        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:11:47: error: extended character 　 is not valid in an identifier
   11 |     rep(i,m) cin >> p[i].first >> p[i].second;　//p[i].first..左から～桁目　p[i].second..その桁の数値
      |                                               ^
a.cc: In function 'int main()':
a.cc:11:47: error: '\U00003000' was not declared in this scope
   11 |     rep(i,m) cin >> p[i].first >> p[i].second;　//p[i].first..左から～桁目　p[i].second..その桁の数値
      |                                               ^~
a.cc:13:9: error: 'x' was not declared in this scope
   13 |     rep(x,1000){
      |         ^
a.cc:2:31: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0; i<(n); i++)
      |                               ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
const ll INF = 1e9 + 7;
typedef pair<int,int> P;// pair型は２つの値の組を表せる

int main(){
    int n,m; cin >> n >> m; //桁数ｎ、条件がm個
    vector<P> p(m);
    rep(i,m) cin >> p[i].first >> p[i].second;　//p[i].first..左から～桁目　p[i].second..その桁の数値
    //候補0~999を試す
    rep(x,1000){
        int keta=1;//0桁が存在しないため
        int nx=x/10;
        vector <int> d(1,x%10);//下一桁をd配列に入れる！
        while(nx){
            keta++;
            d.push_back(nx%10);
            nx/=10;
        }
        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:11:47: error: extended character 　 is not valid in an identifier
   11 |     rep(i,m) cin >> p[i].first >> p[i].second;　//p[i].first..左から～桁目　p[i].second..その桁の数値
      |                                               ^
a.cc: In function 'int main()':
a.cc:11:47: error: '\U00003000' was not declared in this scope
   11 |     rep(i,m) cin >> p[i].first >> p[i].second;　//p[i].first..左から～桁目　p[i].second..その桁の数値
      |                                               ^~
a.cc:13:9: error: 'x' was not declared in this scope
   13 |     rep(x,1000){
      |         ^
a.cc:2:31: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0; i<(n); i++)
      |                               ^
Language: C++

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

void print_vector(vector<bool> firstTime)
{
    for(int i = 0; i < firstTime.size(); i++)
    {
        cout << firstTime[i] << " " ;
    }
    cout << endl;
}
void print_vector(vector<int> firstTime)
{
    for(int i = 0; i < firstTime.size(); i++)
    {
        cout << firstTime[i] << " " ;
    }
    cout << endl;
}

int main()
{
    int N, M;
    cin >> N >> M;
    // vector<vector<int>>vals(M, vector<int>(2));
    map<int, vector<int>>m;
    int pos, val;
    for(int i = 0; i < M; i++)
    {
        // cin >> vals[i-1][0] >> vals[i-1][1];
        cin >> pos >> val;
        // vals[pos - 1][0] = pos - 1;
        // vals[pos - 1][1] = val;
        m[i] = {pos - 1, val}; 
    }

    // for(int i = 0; i < M; i++)
    // {
    //     cout << vals[i][0] << " " << vals[i][1] << endl;
    // }
    vector<int> fillup(N, 0);
    vector<bool> first_time(N, false);
    for(auto it = m.begin(); it != m.end(); it++)
    {
        int pos = it->second[0];
        // If already present
        if(fillup[pos] != it->second[1] && first_time[pos])
        {
            cout << -1 << endl;
            return 0;
        }
        else    
        {
            fillup[pos] = it->second[1]; 
            first_time[pos] = true;
        // }
        // cout << "FILUP" << endl ;
        // print_vector(fillup);
        // cout << "FIRST TIME" << endl ;
        // print_vector(first_time);
    }

    string returningthis = "";
    for(int i = 0; i < N; i++)
    {
        if(fillup[i] == 0)
        {
            returningthis += '0';
        }
        else
        {
            returningthis += to_string(fillup[i]);
        }
    }

    // CHECK FOR LEAEDNIGN ZEROS
    int total_leading_zeros = 0;
    bool anything_else = false;
    for(int i = 0; i < returningthis.size(); i++)
    {
        if(returningthis[i] == '0' && anything_else == false)
        {
            total_leading_zeros ++;
        }
        else
        {
            anything_else = true;
        }
        
    }

    if(total_leading_zeros >= 1) 
    {
        cout << -1 << endl;
        return 0;
    }

    cout << returningthis << endl;


    return 0;
}

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

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

int main(){
  int n,m;
  int s[6],c[6];
  int a[4]={0,0,0,0};
  
  cin >> n >> m;
  for(int i=1;i<=m;i++)
    cin >> s[i] >> c[i];
  
  for(int j=1;j<=m;j++){
    for(int k=1;k<=m;k++){
      if(s[j]==s[k]&&c[j]!=c[k]){
        cout << "-1" << endl;
      exit(0);
      }
    }
  }
  
  if(n==1){
  for(int p=1;p<=m;p++){
    if(s[p]==1)
      a[1]=c[p];
    else if(s[p]==2)
      a[2]=c[p];
    else if(s[p]==3)
      a[3]=c[p];
}
    cout << a[1] << endl;
  }
  if(n!=1){
    a[1]=1;
    for(int p=1;p<=m;p++){
    if(s[p]==1)
      a[1]=c[p];
    else if(s[p]==2)
      a[2]=c[p];
    else if(s[p]==3)
      a[3]=c[p];
}
  if(a[1]==0)
    cout << -1 << endl;
	
  else if(n==2)
    cout << a[1]*10+a[2] << endl;
  else
    cout << a[1]*100+a[2]*10+a[3] << endl;
  
  return 0;
}
      
    


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

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

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int digitnum;
    int opnum;
    cin>>digitnum>>opnum;
    vector<int> digit_arr(digitnum,0);
    while(opnum>0)
    {
        int s;
        int c;
        cin>>s>>c;
        if(digit_arr[s-1]>c)
            digit_arr[s-1]=c;
        opnum--;
    }
    if(digitnum>1)
    {
        if(digit_arr[0]==0)
            cout<<-1<<endl;;
        else
        {
            int sum=0;
            int mul=1;
            for(int i=digit_arr.size()-1;i>0;i--)
            {
                sum+=digit_arr[i]*mul;
                mul*=10;
            }
            cout<<sum<<endl;
        }
    }
    else
        cout<<digit_arr[0]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: expected '}' before 'else'
   22 |         else
      |         ^~~~
a.cc:19:5: note: to match this '{'
   19 |     {
      |     ^
a.cc: At global scope:
a.cc:34:5: error: expected unqualified-id before 'else'
   34 |     else
      |     ^~~~
a.cc:36:5: error: expected unqualified-id before 'return'
   36 |     return 0;
      |     ^~~~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^