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

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

int main(void){
    // Your code here!
   int n,m;
   cin >> n >> m;

   int num = 1;
   rep(i,n-1) num *= 10;
   //int d[n] ={};
   vector <int> d(n,0);
   
   string cou = to_string(num);
   
   int f = 0;
   rep(i,m){
     int a;
     char b;
     cin >> a >> b;

     if((a==1 && b=='0')  f = 1;
     if( d[a-1] ==1 && cou[a-1]!=b) f = 1;
     d[a-1] = 1;
     cou[a-1] = b;
    
   }  
   
   if (f == 1) cout << -1 << endl;
   else cout << cou << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: expected ';' before 'f'
   23 |      if((a==1 && b=='0')  f = 1;
      |                         ^ ~
      |                         ;
a.cc:24:6: error: expected primary-expression before 'if'
   24 |      if( d[a-1] ==1 && cou[a-1]!=b) f = 1;
      |      ^~
a.cc:23:33: error: expected ')' before 'if'
   23 |      if((a==1 && b=='0')  f = 1;
      |        ~                        ^
      |                                 )
   24 |      if( d[a-1] ==1 && cou[a-1]!=b) f = 1;
      |      ~~
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> value(3, 0);
  vector<bool> change(3, false);
  rep(i, M){
    int s;
    int c;
    cin >> s >> c;
    if(change.at(3-s) == false){
      value.at(3-s) = c;
      change.at(3-s) = true;
    }
    else if(value.at(3-s) == c){
      value.at(3-s) = c;
    }
    else{
      cout << -1 << endl;
      return 0;
    }
  }
  ans = value.at(0) + value.at(1)*10 + value.at(2)*100;
  int tmp = ans;
  int digit = 0;
  while(0 < tmp){
    tmp /= 10;
    digit++;
  }
  if(digit==N) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |   ans = value.at(0) + value.at(1)*10 + value.at(2)*100;
      |   ^~~
      |   abs
Language: C

nclude <stdio.h>
int main(void) 
{
    int N, M, s[100], c[100], i,t, number;
    int num[40] = {0};
    number = 0;
 
    scanf("%d%d", &N, &M);
 
    for (i = 1; i <= M; i++){
        scanf("%d%d", &s[i], &c[i]);
    }
 
    for (i = 1; i <= M; i++){
        if (N != 1 && s[i] == 1 && c[i] == 0)
        number = -1;
    }
 
    for (i = 1; i <= M; i++){
        for (t = 1; t <= M; t++){
            if (s[i] == s[t] && c[i] != c[t])
                number = -1;
        }
    }
 
    if (number == -1)
        printf("%d", number);    
    
    else{
        for (i = 1; i <= M; i++){
            switch (s[i]){
                case 1: num[1] = c[i]; break;
                case 2: num[2] = c[i]; break;
                case 3: num[3] = c[i]; break;
            }
        }
    if (N == 2 && num[1] == 0)
        num[1] = 1;
    if (N == 3 && num[1] == 0)
        num[1] = 1;
        
    if (N == 1)
        printf("%d", num[1]);
    else if (N == 2)
        printf("%d", 10*num[1] + num[2]);
    else 
        printf("%d", 100*num[1] + 10*num[2] + num[3]);
    }
    return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | nclude <stdio.h>
      |        ^
Language: C++

#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
typedef vector<long long> V;
typedef vector<V> VV;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
const long long INFLL = 1LL << 60;
const int INF = 1 << 28;
void solve(int a) { cout << (a ? "Yes" : "No") << endl; }
int main()
{
    int n, m;
    int ans = 0;
    cin >> n >> m;
    int a, b;
    vector<int> c(n+1,10);
    int d = 1;
  
    rep(i, m)
    {
        cin >> a >> b;
        if (c[a] == b or c[a] == 10)
        {
            c[a] = b;
        }
        else
        {
            ans = -1;
        }
    }
    if(n!=1 and c[1]==0){
        ans=-1;
    }
    if (ans != -1)
    {

        for(int i=n;i>=0;i--)
        {

            if (c[i] != 10)
            {
                ans += c[i] * d;
            }
            if(i==0 and c[i]==0){
                ans+=1*d
            }
            d *= 10;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:25: error: expected ';' before '}' token
   71 |                 ans+=1*d
      |                         ^
      |                         ;
   72 |             }
      |             ~
Language: C++

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:41:10: error: expected ';' before '}' token
   41 |   ans = 0
      |          ^
      |          ;
   42 |   }
      |   ~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.jar.Attributes.Name;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.Stream;


public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String[] nm = input.readLine().split(" ");
        int n = Integer.parseInt(nm[0]);
        int m = Integer.parseInt(nm[0]);
        String[] s = new String[m];
        String[] c = new String[m];
        int countOne = 0;
        int countTwo = 0;
        int countThree = 0;
        List<String> one = new ArrayList<String>();
        List<String> two = new ArrayList<String>();
        List<String> three = new ArrayList<String>();
        String ans = ""

        boolean flag = true;
        for(int i=0;i<m;i++){
            String[] sc = input.readLine().split(" ");
            s[i] = sc[0];
            c[i] = sc[1];            
        }
        for(int i=0;i<m;i++){
            if(n != 1 && s[i].equals("1")&& c[i].equals("0")){
                flag = false;
            }
        }
        for(int i=0;i<m;i++){
            if(s[i].equals("1")){
                countOne++;
                one.add(c[i]);
            }
            if(s[i].equals("2")){
                countTwo++;
                two.add(c[i]);
            }
            if(s[i].equals("3")){
                countThree++;
                three.add(c[i]);
            }
        }
        if(countOne>1){
            List<String> del = one.stream().distinct().collect(Collectors.toList());
            if(del.size()!=1){
                flag = false;
            }
        }
        if(countTwo>1){
            List<String> del = one.stream().distinct().collect(Collectors.toList());
            if(del.size()!=1){
                flag = false;
            }
        }
        if(countThree>1){
            List<String> del = one.stream().distinct().collect(Collectors.toList());
            if(del.size()!=1){
                flag = false;
            }
        }
        if(flag == false){
            System.out.println(-1);
            return;
        }
        for(int i=0;i<m;i++){
            if(s[i].equals("1")){
                ans = c[i];                
            }else{
                ans = "1";
            }
        }
        for(int i=0;i<m;i++){
            if(ans.length()==1){
            if(s[i].equals("2")){
                ans = ans + c[i];                
            }else{
                ans = "0";
            }
        }
        }
        for(int i=0;i<m;i++){
            if(ans.length()==2){

            if(s[i].equals("3")){
                ans = ans + c[i];                
            }else{
                ans = "0";
            }
        }
        
        }
        System.out.println(-1);

        

    }
}



Compiler output:
Main.java:29: error: ';' expected
        String ans = ""
                       ^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define INF (1LL << 60)

#define REP(i,m,n) for(ll (i)=(m),i##_len=(n);(i)<(i##_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define _PR(x) cout << (x) << endl
#define _PS(x) cout << (x) << " "
#define SZ(x) ((int)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back

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

    sort(ALL(_s));
    ll D = _s[M-1];

    vector<ll> num(N, 0);
    if(D > N) f = false;
    else {
        if(s[i] == 1 && c[i] != 0) f = false;
        else {
            REP(i,0,M) {
                if(num[N-s[i]] != 0 && num[N-s[i]] != c[i]) f = false;
                else {
                    num[N-s[i]] = s[i];
                }
            }
            if(N != 1 && num[N-1] == 0) num[N-1] = 1;
        }
    }

    if(f) REP(i,0,N) {cout << num[N-i-1]; cout << endl;}
    else _PR(-1);

    return 0;
}

/*



*/

Compiler output:
a.cc: In function 'int main()':
a.cc:32:15: error: 'f' was not declared in this scope
   32 |     if(D > N) f = false;
      |               ^
a.cc:34:14: error: 'i' was not declared in this scope
   34 |         if(s[i] == 1 && c[i] != 0) f = false;
      |              ^
a.cc:34:36: error: 'f' was not declared in this scope
   34 |         if(s[i] == 1 && c[i] != 0) f = false;
      |                                    ^
a.cc:37:61: error: 'f' was not declared in this scope
   37 |                 if(num[N-s[i]] != 0 && num[N-s[i]] != c[i]) f = false;
      |                                                             ^
a.cc:46:8: error: 'f' was not declared in this scope
   46 |     if(f) REP(i,0,N) {cout << num[N-i-1]; cout << endl;}
      |        ^
Language: C++

#include <iostream>

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

	std::cin >> N >> M;

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

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

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

		for (int j = 0; j < M; j++) 
		{
			if (s[i] == s[j] && c[j] != c[j])
			{
				ans = -1;
				goto out;
			}
			else#include <iostream>

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

	std::cin >> N >> M;

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

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

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

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

out:
	std::cout << ans;

	return 0;
} if(s[i] == s[j] && c[j] == c[j]&&i<j)
			{
				ans += (int)std::pow(10, N - s[i]) * c[i];
				a = false;
				break;
			}
		}
		if(a)
			ans += (int)std::pow(10, N - s[i]) * c[i];
	}

out:
	std::cout << ans;

	return 0;
}

Compiler output:
a.cc:45:29: error: stray '#' in program
   45 |                         else#include <iostream>
      |                             ^
a.cc: In function 'int main()':
a.cc:45:30: error: 'include' was not declared in this scope
   45 |                         else#include <iostream>
      |                              ^~~~~~~
a.cc:45:39: error: 'iostream' was not declared in this scope; did you mean 'std::iostream'?
   45 |                         else#include <iostream>
      |                                       ^~~~~~~~
      |                                       std::iostream
In file included from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/iosfwd:146:41: note: 'std::iostream' declared here
  146 |   typedef basic_iostream<char>          iostream;
      |                                         ^~~~~~~~
a.cc:47:1: error: expected primary-expression before 'int'
   47 | int main()
      | ^~~
a.cc:106:50: error: 'pow' is not a member of 'std'
  106 |                                 ans += (int)std::pow(10, N - s[i]) * c[i];
      |                                                  ^~~
a.cc:112:42: error: 'pow' is not a member of 'std'
  112 |                         ans += (int)std::pow(10, N - s[i]) * c[i];
      |                                          ^~~
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  //vector<vector<int>> data(m, vector<int>(2,0));
  vector<int> data(n, 0);
  vector<bool> flg(n, false);
  //int hud=0;
  //int ten=0;
  //int one=0;
  
  int x=0;
  int y=0;
  for(int i=0;i<m;i++){
    cin >> x >> y;
    if(flg.at(x-1)==false){
      data.at(x-1) = y;
      flg.at(x-1) = true;
    }else{
      data.at(x-1) = min(data.at(x-1),y);
    }
  }
  
  //先頭が0の場合を除外
  if(n=3){
    if(flg.at(0)==false || flg.at(1)==false || flg.at(2) ==false || (flg.at(0)==true && data.at(0)==0) || (flg.at(1)==true && data.at(0)==0)){
      cout << -1;
      return;
    }
  }else if(n=2){
    if(flg.at(0)==false || flg.at(1)==false  || (flg.at(0)==true && data.at(0)==0)){
      cout << -1;
      return;
    }
  }else{
    if(flg.at(0)==false){
      cout << -1;
      return;
    }
  }
  
  
  for(int j=0;j<m;j++){
    cout << data.at(j);
  }
}

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

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


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

	vector< int > s(M);
	for ( int &st : s )
	{
		cin >> st;
	}

	vector< int > c(M);
	for ( int &ct : c )
	{
		cin >> ct;
	}

    for(int i = pow(10,N-1); i < pow(10, N); i++){
        //桁確認
        string numstr;
        numstr = to_string(i)

        for(int j = 0; j < M; j++){
            if(numstr[s[j]-1] == c[j]){
                cout << i << endl;
                return 0;
            }
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:30: error: expected ';' before 'for'
   25 |         numstr = to_string(i)
      |                              ^
      |                              ;
   26 | 
   27 |         for(int j = 0; j < M; j++){
      |         ~~~                   
a.cc:27:24: error: 'j' was not declared in this scope
   27 |         for(int j = 0; j < M; j++){
      |                        ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define rep(i,a,b) for(long long i=a; i<b; i+=1)
#define repr(i,a,b) for(long long i=a; i<=b; i+=1)
#define vec vector<ll>
#define map map<string,int>
#define repa(p,A) for(auto p:A)
#define pb push_back
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())

using namespace std;
int main() {
  ll N,M;
  cin>>N>>M;
  vec A(M),B(M);
  rep(i,0,M) {
    cin>>A[i]>>B[i];
  }
  bool ans=true;
  rep(i,0,M-1) {
    rep(j,i+1,M) {
      if(A[i]==A[j]) {
        if(B[i]!=B[j]) {
          
          ans=false;
        }
        else
          A[i]=0;
          B[i]=0;
      }
    }
      
  }
  if(N>1) {
    rep(i,0,M) {
      if(A[i]==1 && B[i]==0)
        ans=false;
    }
  }
      
    
  if(ans) {
    if(N>1 && M>0) {
      ll K=0;
      rep(i,0,M) {
        K+=B[i]*pow(10,N-A[i]);
      }
      if(K<pow(10,N-1)) {
        cout<<K+pow(10,N-1)<<endl;
      }
      else
        cout<<K<<endl;
    }
    if(N>1 && M==0) {
      cout<<pow(10,N-1)<<endl;
    }
    if(N==1 && M==0)
      cout<<0<<endl;
    if(N==1 M==1) {
      if(A[i]==1 && B[i]==0)
        cout<<"0"<<endl;
    }
  }
 
  else
    cout<<"-1"<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:60:12: error: expected ')' before 'M'
   60 |     if(N==1 M==1) {
      |       ~    ^~
      |            )
a.cc:61:12: error: 'i' was not declared in this scope
   61 |       if(A[i]==1 && B[i]==0)
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

void printVector(const vector<int>& vec) {
	 for (int value : vec) {
		 cout << value << " ";
	 }
	 cout << endl;
}

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

	// printVector(s);
	// printVector(c);
	// if (s[0] == 0 || any_of(s.begin(), s.end(), [](int x) {return x != 1;}))
	if (!(any_of(s.begin(), s.end(), [](int x) {return x == 1;})))){
		cout << "-1" << endl;
	else if(s[0] == 0){
		cout << "-1" << endl;
	} else {
		for (int i=0; i<m; i++)
			ans[s[i]-1] = to_string(c[i]);
		for (auto i : ans)
			cout << i << endl;
	}

	// if (m < n)
	// 	cout << "-1" << endl;
	// else {
	// }

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:71: error: expected primary-expression before ')' token
   30 |         if (!(any_of(s.begin(), s.end(), [](int x) {return x == 1;})))){
      |                                                                       ^
a.cc:47:2: error: expected '}' at end of input
   47 | }
      |  ^
a.cc:18:12: note: to match this '{'
   18 | int main() {
      |            ^
Language: C++

// ConsoleApplication95.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

// ConsoleApplication94.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include<cstring>
#include<algorithm>
#include<iomanip>
#include<set>
#include<map>
#include<vector>
using namespace std;
long long gcd(long long a, long long b)
{
	if (b == 0)
		return a;
	return gcd(b, a % b);
}
long long exgcd(long long a, long long b, long long& x, long long& y) {
	if (b == 0) {
		x = 1, y = 0;
		return a;
	}
	long long d = exgcd(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int main()
{
	vector<pair<int, int>>lala;
	map<int, int>la;
	int a, b, n, m,zong=0;
	cin >> n >> m;
	for (int i=0; i < m; i++)
	{
		cin >> a >> b;
		lala.push_back(make_pair(a, b));
	}
	for (int i = 0; i < m; i++)
	{
		for (int w = i; w < m; w++)
		{
			if (lala[i].first == lala[w].first)
			{
				if (lala[i].second <= lala[w].second)
				{
					lala[w].second = lala[i].second;
				}
				else
				{
					lala[i].second = lala[w].second;
				}
			}
		}
	}
	for (auto& x : lala)
	{
		la.insert(make_pair(x.first, x.second));
	}
	if (la[1] == 0)
	{
		cout << "-1" << endl;
		return 0;
	}
	
	for (auto& x : la)
	{
		zong += pow(10, n - x.first) * x.second;
	}
	cout << zong << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:70:25: error: 'pow' was not declared in this scope
   70 |                 zong += pow(10, n - x.first) * x.second;
      |                         ^~~
Language: C++

/*
 * wafuIroha.cpp
 *
 *  Created on: 2020/02/23
 *      Author: black
 */
#include <iostream>
#include <algorithm>
#include <utility>
using namespace std;

// 配列の要素を出力
// in 配列
// in 配列サイズ
void trace(int* intArray, int arraySize){
	cout << intArray[0];
	for (int i = 1; i < arraySize; ++i){
		cout << " " << intArray[i];
	}
	cout << "\n";
}

int main(){
	int n, m;
	cin >> n >> m;
	int *x = new int[n];
	int *flag = new int[n];
	for (int i = 0; i<n; ++i){
		flag[i] = 0;
		x[i] = 10;
	}

	int s, c;

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

		if (x[s-1] == 10){
			x[s-1] = c;
			flag[s-1] = 1;
		}
		else{
			if (x[s-1] != c){
				flag = 2;
			}
		}
	}

	for(int i = 0; i<m; ++i){
		if (flag[i] == 2){
			cout << -1;
			return 0;
		}
	}

	if (n == 1 && x[0] == 0){
		cout << x[0];
		return 0;
	}

	if (flag[0] == 0){
		x[0] = 1;
	}

	if (x[0] == 0){
		cout << -1;
		return 0;
	}

	for (int i = 1; i<n; ++i){
		if (flag[i] == 0){
			x[i] = 0;
		}
	}


	for (int i = 0; i < n; ++i){
		cout << x[i];
	}



	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:40: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   45 |                                 flag = 2;
      |                                        ^
      |                                        |
      |                                        int
Language: C++

#include<iostream>
#include<string>
#include<map>
#include<set>
#define rep(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

int main(){
    int n,m,x,y;
    string s;
  	map<int,set<int>> p;
    cin>>n>>m;
    rep(i,n) s+='0';
    rep(i,m){
        cin>>x>>y;
      	map[x].insert(y);
      	
        if(map[x].size()>1) {cout<<-1;return 0;}
        else s[x-1]=y+'0';
    }
  	if(m==0) {if(n!=1) s[0]='1';}
    if(s.size()>1&&s[0]=='0') {cout<<-1;return 0;}
    cout<<s;
}   


Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: expected initializer before '.' token
   17 |         map[x].insert(y);
      |               ^
a.cc:17:15: error: expected ';' before '.' token
a.cc:19:15: error: expected unqualified-id before '[' token
   19 |         if(map[x].size()>1) {cout<<-1;return 0;}
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,c) for(int i=0;i<(int)c;i++)
#define print(var) cout<<var<<endl;
#define DEBUG(var) cerr<<var<<endl

const int inf = 1000000000;//10^9


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

  vector<vector<int> > data(M,vector<int>(2));


  rep(i,M) cin>>data[i][0]>>data[i][1];



  map<int,int> mp;
  rep(i,M){
    if(data[i][0]>N){
      print("-1");
      return 0;
    }

    if(!mp.count(data[i][0])){
      mp[data[i][0]]=data[i][1];
    }else if(mp[data[i][0]]==data[i][1]){
      continue;
    }else{
      print("-1");
      return 0;
    }
  }

  int ans=0;
  bool good=false;
  for(int i=N;i>0;i--){

    if(i==N&&!mp.count(i)&&N!=1){
    ans+= (int)pow(10,i);
  }
    if(mp.count(i)){
      if(mp[i]==0&&(!good)){
      print("-1");
      return 0;
    }
      ans+=(int)pow(10,N-i)*mp[i];
      if(mp[i]!==0){
        good=true;
      }
    }
  }
  print(ans);


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:17: error: expected primary-expression before '=' token
   51 |       if(mp[i]!==0){
      |                 ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main() {
    int a = -2,b = -2,c = -2;
    int n,m;
    cin >> n;
    cin >> m;
    for (int i = 0; i < m; i++)
    {
        int d,e;
        cin >> d;
        cin >> e;
        switch (d)
        {
        case 1:
            if (a != -2)
            {
                a = e;
            } else
            {
                if (a != e) {
                    std::cout << "-1" << endl;
                    return 0;
                }
            }
            break;
        case 2:
            if (b != -2) {
                b = e;
            } else {
                if (b != e)
                {
                    std::cout << "-1" << endl;
                    return 0;
                }
            }
            break;
        case 3:
            if (c != -2)
            {
                c = e;
            } else {
                if (c != e)
                {
                    std::cout << "-1" << endl;
                    return 0;
                }
                
            }
            break;
        default:
            break;
        }
    }
    if (a == -2)
    {
        a = 0;
    }
    if (b == -2)
    {
        b = 0;
    }
    if (c == -2)
    {
        c = 0;
    }
    int ret = 0;
    ret += (a * 100);
    ret += (b * 10);
    ret += c;
    if (to_string(ret).length != n) 
    {
        cout << "-1" << endl;
    }
    else {
        cout << ret << endl;
    }
    return 0;
}

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

#include <iostream>

int main() {
	int N, M;
	int s[10];
	int c[10];
	int num[10] = {-1};

	std::cin >> N >> M;
	for (int i = 0; i < M; i++)
		for (int j = 0; j < 2; j++)
			if (j == 0) std::cin >> s[i];
			else std::cin >> c[i];

	bool exist = true;
	for (int i = 0; i < M; i++) {
		if (num[s[i]-1] == -1) num[s[i]-1] = c[i];
		else if (num[s[i]-1] != c[i]) {
			exist = false;
			break;
		}
	}

	if (N != 1 && num[0] == 0) exist = false;

	int g_num = 0;
	if (exist) {
		for (int i = 0; i < N; ++i) {
			if (num[i] == -1) g_num += 0;
			else g_num += ((10 ** (N-i-1)) * num[i]);
		}
		std::cout << g_num << std::endl;
	} else {
		std::cout << -1 << std::endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:45: error: invalid type argument of unary '*' (have 'int')
   30 |                         else g_num += ((10 ** (N-i-1)) * num[i]);
      |                                             ^~~~~~~~~
Language: C++

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

int main(){
  int a;
  cin>>a;
  int b;
  cin>>b;  
  vector<int> vec(b*2);
  for (int i = 0; i < b*2; i++) {
    cin >> vec.at(i);
  }
  int count=0;
  vector<int> vec2(3);
  vec2[0]=0;
  vec2[1]=0;
  vec2[2]=0;
  int error1=0;
   int error2=0;
    int error3=0;
  int charenge1 =0;
    int charenge2 =0;
      int charenge3 =0;
  
  
  
  
  for (int n = 0; n < b*2; n++) { 
    if(n%2==0){
      if(vec[n]==1){
          if(vec2[0]==0) vec2[0]=vec[n+1]*pow(10,(a-1));
          else if(vec2[0]>0){
              charenge1++;
             error1 = vec2[0]-vec[n+1]*pow(10,(a-1));
          }
            }
      if(vec[n]==2){
            if(vec2[1]==0) vec2[1]=vec[n+1]*pow(10,(a-2)); 
            else if(vec2[1]>0){
                charenge2++;
             error2 = vec2[1]-vec[n+1]*pow(10,(a-2));
          }
          }
      if(vec[n]==3){
           if(vec2[2]==0) vec2[2]=vec[n+1]*pow(10,(a-3));
            else if(vec2[2]>0){
                charenge3++;
             error3 = vec2[2]-vec[n+1]*pow(10,(a-3));
          }
          }
    }
  }
    for (int n = 0; n < b*2; n++) { 
    if(n%2==0){
      if(vec[n]==a){
        int root =vec[n+1];
      }
    }
    }
  
  count = vec2[0]+vec2[1]+vec2[2];
  if(charenge1>0 && error1!=0)cout <<"-1"<<endl;
  else if(charenge2>0 && error2!=0)cout <<"-1"<<endl;
  else if(charenge3>0 && error3!=0)cout <<"-1"<<endl;
  else if(count==0)cout <<"-1"<<endl;
  else if(root==0)cout <<"-1"<<endl;
  else{cout <<count<<endl;}
 
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:11: error: 'root' was not declared in this scope
   67 |   else if(root==0)cout <<"-1"<<endl;
      |           ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int N,M;
    cin >>N;
    int s[6];
    int c[6];
    for(int i=0;i<M;i++){cin >> s[i] >>c[i];}
    int ans[3]={-1,-1,-1};
    int correct=0;
    for(int i=0;i<M;i++){
        if(ans[s[i]+(4-N)]==-1 || ans[s[i]+(4-N)]==c[i])ans[s[i]+(4-N)]=c[i];
        else correct++;    
    }
    int kotae=0;
    if(correct==0){
        if(N==1 && s[2]==-1)cout << 0<<endl;
        else if(N==1){cout<<ans[2]<<endl};
       else if(N==2 ){
           cout<<a[1]<<a[2]<<endl;
       }
       else if(N==3){

               cout<<a[0]<<a[1]<<a[2]<<endl;
       }
    }
    else {cout<<-1<<endl;}
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:41: error: expected ';' before '}' token
   19 |         else if(N==1){cout<<ans[2]<<endl};
      |                                         ^
      |                                         ;
a.cc:20:8: error: expected '}' before 'else'
   20 |        else if(N==2 ){
      |        ^~~~
a.cc:17:19: note: to match this '{'
   17 |     if(correct==0){
      |                   ^
a.cc:21:18: error: 'a' was not declared in this scope
   21 |            cout<<a[1]<<a[2]<<endl;
      |                  ^
a.cc:25:22: error: 'a' was not declared in this scope
   25 |                cout<<a[0]<<a[1]<<a[2]<<endl;
      |                      ^
a.cc: At global scope:
a.cc:28:5: error: expected unqualified-id before 'else'
   28 |     else {cout<<-1<<endl;}
      |     ^~~~
a.cc:29:5: error: expected unqualified-id before 'return'
   29 |     return 0;
      |     ^~~~~~
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

#include <iostream>

int main() {
	int N, M;
	int s[10];
	int c[10];
	int num[10] = {-1};

	std::cin >> N >> M;
	for (int i = 0; i < M; i++)
		for (int j = 0; j < 2; j++)
			if (j == 0) std::cin >> s[i];
			else std::cin >> c[i];

	bool exist = true;
	for (int i = 0; i < M; i++) {
		if (num[s[i]-1] == -1) num[s[i]-1] = c[i];
		else if (num[s[i]-1] != c[i]) {
			exist = false;
			break;
		}
	}

	if (N != 1 && num[0] == 0) exist = false;

	int g_num = 0;
	if (exist) {
		for (int i = 0; i < N; ++i) {
			if (num[i] == -1) g_num += 0;
			else g_num += (((10 ** (N-i-1)) * num[i]);
		}
		std::cout << g_num << std::endl;
	} else {
		std::cout << -1 << std::endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:46: error: invalid type argument of unary '*' (have 'int')
   30 |                         else g_num += (((10 ** (N-i-1)) * num[i]);
      |                                              ^~~~~~~~~
a.cc:30:66: error: expected ')' before ';' token
   30 |                         else g_num += (((10 ** (N-i-1)) * num[i]);
      |                                       ~                          ^
      |                                                                  )
Language: C++

// ConsoleApplication95.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

// ConsoleApplication94.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include<cstring>
#include<algorithm>
#include<iomanip>
#include<set>
#include<map>
#include<vector>
using namespace std;
long long gcd(long long a, long long b)
{
	if (b == 0)
		return a;
	return gcd(b, a % b);
}
long long exgcd(long long a, long long b, long long& x, long long& y) {
	if (b == 0) {
		x = 1, y = 0;
		return a;
	}
	long long d = exgcd(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int main()
{
	vector<pair<int, int>>lala;
	map<int, int>la;
	int a, b, n, m,zong=0;
	cin >> n >> m;
	for (int i=0; i < m; i++)
	{
		cin >> a >> b;
		lala.push_back(make_pair(a, b));
	}
	for (int i = 0; i < m; i++)
	{
		for (int w = i; w < m; w++)
		{
			if (lala[i].first == lala[w].first)
			{
				if (lala[i].second <= lala[w].second)
				{
					lala[w].second = lala[i].second;
				}
				else
				{
					lala[i].second = lala[w].second;
				}
			}
		}
	}
	for (auto& x : lala)
	{
		la.insert(make_pair(x.first, x.second));
	}
	if (la[1] == 0)
	{
		cout << "-1" << endl;
		return 0;
	}
	
	for (auto& x : la)
	{
		zong += pow(10, n - x.first) * x.second;
	}
	cout << zong << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:70:25: error: 'pow' was not declared in this scope
   70 |                 zong += pow(10, n - x.first) * x.second;
      |                         ^~~
Language: C++

#include<iostream>
#include<string>
#define rep(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

int main(){
    int n,m,x,y;
    string s;
  	map<int,set<int>> p;
    cin>>n>>m;
    rep(i,n) s+='0';
    rep(i,m){
        cin>>x>>y;
      	map[x].insert(y);
      	
        if(map[x].size()>1) {cout<<-1;return 0;}
        else s[x-1]=y+'0';
    }
  	if(m==0) {if(n!=1) s[0]='1';}
    if(s.size()>1&&s[0]=='0') {cout<<-1;return 0;}
    cout<<s;
}   


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'map' was not declared in this scope
   10 |         map<int,set<int>> p;
      |         ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include<iostream>
  +++ |+#include <map>
    2 | #include<string>
a.cc:10:13: error: expected primary-expression before 'int'
   10 |         map<int,set<int>> p;
      |             ^~~
Language: C++

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

int main(){

  int N,M;
  cin >> N >> M;

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

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

  int X1=0;
  int X2=0;
  int X3=0;

  int count=0;
  for (int i = 0; i < M; i++) {
    if (s.at(i)==1 && c.at(i)==0) count=-1;
  }

  vector<int> A(5);
  A.at(1)=-1;
  A.at(2)=-1;
  A.at(3)=-1;
  int Z;
  for (int i = 0; i < M; i++) {
    Z=s.at(i);
    if (A.at(Z)==-1) A.at(Z)=c.at(i);
    else{
      if (A.at(Z)!=c.at(i)) count=-1;
    }
  }

  if (M==0) count=-1;

  for (int i = 0; i < M; i++) {
    if (s.at(i)==1 && X1==0 && count!=-1) {
      if (N==1) count+=c.at(i);
      else if(N==2) count+=10*c.at(i);
      else if(N==3) count+=100*c.at(i);
      X1=1;
    }
    else if(s.at(i)==2 && X2==0 &&  count!=-1){
      if (N==1) count=-1;
      else if(N==2) count+=c.at(i);
      else if(N==3) count+=10*c.at(i);
      X2=1;
    }
    else if(s.at(i)==3 && X3==0 &&  count!=-1){
      if (N==1) count=-1;
      else if(N==2) count=-1;
      else if(N==3) count+=c.at(i);
      X3=1;
    }
    if (count==-1) break;
  }

  if (count!=-1){

    int sum=0
    int ncm=count;
    while (ncm>0){
      sum+=1;
      ncm/=10;
    }

    if (N==2 && sum==1){
      count+=10;
    }
    else if (N==3 && sum==1){
      count+=100;
    }
    else if (N==3 && sum==2){
      count+=100;
    }

  }

  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:5: error: expected ',' or ';' before 'int'
   66 |     int ncm=count;
      |     ^~~
a.cc:67:12: error: 'ncm' was not declared in this scope
   67 |     while (ncm>0){
      |            ^~~
Language: C++

#include <iostream>

int main() {
	int N, M;
	int s[10];
	int c[10];
	int num[10] = {-1};

	std::cin >> N >> M;
	for (int i = 0; i < M; i++)
		for (int j = 0; j < 2; j++)
			if (j == 0) std::cin >> s[i];
			else std::cin >> c[i];

	for (int i = 0; i < M; i++) std::cout << s[i] << " ";
	std::cout << std::endl;
	for (int i = 0; i < M; i++) std::cout << c[i] << " ";
	std::cout << std::endl;

	bool exist = true;
	for (int i = 0; i < M; i++) {
		if (num[s[i]-1] == -1) num[s[i]-1] = c[i];
		else if (num[s[i]-1] != c[i]) {
			exist = false;
			break;
		}
	}

	if (N != 1 && num[0] == 0) exist = false;

	int num = 0;
	if (exist) {
		for (int i = 0; i < N; ++i) {
			if (num[i] == -1) num += 0;
			else num += ((10 ** (N-i-1)) * num[i])
		}
		std::cout << num << std::endl;
	} else {
		std::cout << -1 << std::endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:13: error: conflicting declaration 'int num'
   31 |         int num = 0;
      |             ^~~
a.cc:7:13: note: previous declaration as 'int num [10]'
    7 |         int num[10] = {-1};
      |             ^~~
a.cc:34:47: error: incompatible types in assignment of 'int' to 'int [10]'
   34 |                         if (num[i] == -1) num += 0;
      |                                           ~~~~^~~~
a.cc:35:43: error: invalid type argument of unary '*' (have 'int')
   35 |                         else num += ((10 ** (N-i-1)) * num[i])
      |                                           ^~~~~~~~~
Language: C++

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

int main(void) {
  string str;
  int n, m;
  int b, c;
  int a[3] = {};
  
  getline(cin, str);
  istringstream s(str);
  s >> n >> m;
  
  for(int i=0; i<m; i++){
    getline(cin, str);
    istringstream s(str);
    s >> b >> c;
    if(a[b-1] >= c || a[b-1]==0) {
      if(3-n == b-1 && c == 0) continue;
      a[b-1] = c;
    }
  }
  
  if(a[3-n]!=0){
    for(int i=0; i<n; i++){
      cout << a[i];
    }
    cout << endl;
  }
  else{
      cout << -1 << endl;
  }
  
  
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:36:12: error: expected '}' at end of input
   36 |   return 0;
      |            ^
a.cc:5:16: note: to match this '{'
    5 | int main(void) {
      |                ^
Language: C++

#include <iostream>

int main() {
	int N, M;
	int s[10];
	int c[10];
	int num[10] = {-1};

	std::cin >> N >> M;
	for (int i = 0; i < M; i++)
		for (int j = 0; j < 2; j++)
			if (j == 0) std::cin >> s[i];
			else std::cin >> c[i];

	bool exist = true;
	for (int i = 0; i < M; i++) {
		if (num[s[i]-1] == -1) num[s[i]-1] = c[i];
		else if (num[s[i]-1] != c[i]) {
			exist = false;
			break;
		}
	}

	if (N != 1 num[0] == 0) exist = false;

	int num = 0;
	if (exist) {
		for (int i = 0; i < N; ++i) {
			if (num[i] == -1) num += 0;
			else num += ((10 ** (N-i-1)) * num[i])
		}
		std::cout << num << std::endl;
	} else {
		std::cout << -1 << std::endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: expected ')' before 'num'
   24 |         if (N != 1 num[0] == 0) exist = false;
      |            ~      ^~~~
      |                   )
a.cc:26:13: error: conflicting declaration 'int num'
   26 |         int num = 0;
      |             ^~~
a.cc:7:13: note: previous declaration as 'int num [10]'
    7 |         int num[10] = {-1};
      |             ^~~
a.cc:29:47: error: incompatible types in assignment of 'int' to 'int [10]'
   29 |                         if (num[i] == -1) num += 0;
      |                                           ~~~~^~~~
a.cc:30:43: error: invalid type argument of unary '*' (have 'int')
   30 |                         else num += ((10 ** (N-i-1)) * num[i])
      |                                           ^~~~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: expected '(' before 'n'
    9 |   if n==1 ans = 0;
      |      ^
      |      (
Language: C++

#include <bits/stdc++.h>
#include <stdio.h>
#include <string>
#include <sstream>

using namespace std;

int main()
{
    int N;
    int M;
    cin >> N >> M;
    int S[M];
    int C[M];
    // vector<int> Ans(N);
    int Ans[N] = {};
    int Check[N] = {};
    for (int i = 0; i < M; i++) {
        cin >> S[i] >> C[i];
    }
    for (int i = 0; i < M; i++) {
        if(Check[S[i] - 1] == 0) {
            Ans[S[i] - 1] = C[i];
            Check[S[i] - 1] = 1;
        }else{
            cout << "-1" << endl;
            exit(0);
        }
    }
    if (Check[0] == 0){
        cout << "-1" << endl;
        exit(0);
    }

    string Answer-str;
    for (int j = 0; j < N; j++) {
        Answer-str += to_string(Ans[j]);
    }
    int Answer = atoi(Answer-str.c_str());
    cout << Answer << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:18: error: expected initializer before '-' token
   35 |     string Answer-str;
      |                  ^
a.cc:37:9: error: 'Answer' was not declared in this scope
   37 |         Answer-str += to_string(Ans[j]);
      |         ^~~~~~
a.cc:37:16: error: 'str' was not declared in this scope; did you mean 'std'?
   37 |         Answer-str += to_string(Ans[j]);
      |                ^~~
      |                std
a.cc:39:30: error: 'str' was not declared in this scope; did you mean 'std'?
   39 |     int Answer = atoi(Answer-str.c_str());
      |                              ^~~
      |                              std
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <math.h>

using namespace std;

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

	int* s = new int[m];
	int* c = new int[m];

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


	int answer = -1;
	bool flag;
	for (int i = 0; i < 1000; i++) {
		flag = true;
		for (int j = 0; j < m; j++) {
			int a;
			switch (s[j])
			{
			case 1:
				if (c[j] != (int)(i / 100)) {
					flag = false;
				}
				break;
			case 2:
				if (c[j] != ((int)(i / 10) % 10)) {
					flag = false;
				}
				break;
			case 3:
				if (c[j] != i % 10) {
					flag = false;
				}
				break;
			default:
				break;
			}
		}
		if (flag) {
			answer = i;
			break;
		}
	}

	if ((answer * 10 / o) <= 0) {
		answer = -1;
	}

	cout << answer;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:28: error: 'o' was not declared in this scope
   55 |         if ((answer * 10 / o) <= 0) {
      |                            ^
Language: Java

import java.util.*;
	class Main{
		public static void main(String args[]){
			Scanner sc = new Scanner(System.in);
     		int n = sc.nextInt(), m = sc.nextInt();
          	int[] s = new int[m];
          int[] t= new int[m];
          for (int i = 0; i< m; i++){
          	s[i] = sc.nextInt(); t[i] = sc.nextInt();
          }
          StringBuilder sb = new StringBuilder();
          for (int i = 1; i<= m; i++)
            sb.append("0");
          for (int i = 0; i < m; i++){
          	sb.replace(s[i], s[i] + 1, String.valueOf(t[i]));
                      //~ System.out.println(sb.toString());

          }
          String ss = sb.toString();
          if (m == 0)
						System.out.println(-1);

          else if ss.charAt(1) == '0')
            System.out.println(-1);
          else{
						for (int i= 1 ; i< ss.length(); i++)
            System.out.print(ss.charAt(i));
            }
          
        }
    }


Compiler output:
Main.java:23: error: '(' expected
          else if ss.charAt(1) == '0')
                 ^
1 error
Language: C

int main()
{
  int flag[3] = {0};
  int n;
  int m;
  int num;
  int min_num;
  int a[2] = {0};
  
  int num = 0;
  int min_num = 0;
  while (scanf("%d %d", &n, &m) != EOF)
  {
    if (n == 3)
	  num += m;
    else if (n == 2)
	  num += m * 10;
    else
	  num += m * 100;
  }  
  printf(num);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:7: error: redeclaration of 'num' with no linkage
   10 |   int num = 0;
      |       ^~~
main.c:6:7: note: previous declaration of 'num' with type 'int'
    6 |   int num;
      |       ^~~
main.c:11:7: error: redeclaration of 'min_num' with no linkage
   11 |   int min_num = 0;
      |       ^~~~~~~
main.c:7:7: note: previous declaration of 'min_num' with type 'int'
    7 |   int min_num;
      |       ^~~~~~~
main.c:12:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   12 |   while (scanf("%d %d", &n, &m) != EOF)
      |          ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main()
main.c:12:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   12 |   while (scanf("%d %d", &n, &m) != EOF)
      |          ^~~~~
main.c:12:10: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:12:36: error: 'EOF' undeclared (first use in this function)
   12 |   while (scanf("%d %d", &n, &m) != EOF)
      |                                    ^~~
main.c:12:36: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:12:36: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   21 |   printf(num);
      |   ^~~~~~
main.c:21:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:21:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:10: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   21 |   printf(num);
      |          ^~~
      |          |
      |          int
main.c:21:10: note: expected 'const char *' but argument is of type 'int'
Language: Java

import java.util.*;

class Main{
public static void main(String[] args ){
Scanner sc=new Scanner(System.in);
int N=sc.nextInt();
int M=sc.nextInt();
int[] num=new int[3];

for(int i=0;i<3;i++){
num[i]=-1;
}

for(int j=0;j<M;j++){
 int k=sc.nextInt();
 int l=sc.nextInt();
  if(l==0&&k==1){
System.out.print(-1);
return;
  }
if(num[k-1]!=-1&&num[k-1]!=l){
System.out.print(-1);
return;
}
num[k-1]=l;
}

  for(int j=0;j<3;j++
for(int j=2;j>=0;j--){
if(num[j]==-1) num[j]=0;
}

int Ans=num[0]*100+num[1]*10+num[2];
System.out.print(Ans);
}
}


Compiler output:
Main.java:28: error: ')' expected
  for(int j=0;j<3;j++
                     ^
1 error