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

#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <complex>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
#if __cplusplus >= 201103
#include <numeric>
#endif
using namespace std;

int main(){
    int n;
    vector<int> times(n);
    for(int i=0;i<n;i++){
        cin >> times.at(i);
    }
    int m;
    cin >> m;
    vector<int> ps(m), xs(m);
    for(int j=0;j<m;j++){
        int sum =0;
        for(int k=0;k<n;k++){
            if(k==ps.at(j)){
                sum += xs(j);
            }
            else sum += times.at(k);
        }
        cout << sum << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:26: error: no match for call to '(std::vector<int>) (int&)'
   34 |                 sum += xs(j);
      |                        ~~^~~
Language: C

int n;
	int a[100];
	scanf("%d", &n);
	for (int i = 0;i<n;i++) {
		scanf("%d", &a[i]);
	}
	int m;
	int p[100];
	int x[100];
	scanf("%d", &m);
	for (int i = 0;i<m;i++) {
		scanf("%d %d", &p[i], &x[i]);
	}
	int sum;
	for (int k = 0;k < m;k++) {
		sum = 0;
		for (int j = 0;j < n;j++) {
			sum += a[j];
		}
		
		sum -= a[p[k] - 1];
		sum += x[k];
		
		printf("%d\n", sum);
	}

Compiler output:
main.c:3:15: error: expected declaration specifiers or '...' before string constant
    3 |         scanf("%d", &n);
      |               ^~~~
main.c:3:21: error: expected declaration specifiers or '...' before '&' token
    3 |         scanf("%d", &n);
      |                     ^
main.c:4:9: error: expected identifier or '(' before 'for'
    4 |         for (int i = 0;i<n;i++) {
      |         ^~~
main.c:4:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    4 |         for (int i = 0;i<n;i++) {
      |                         ^
main.c:4:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    4 |         for (int i = 0;i<n;i++) {
      |                             ^~
main.c:10:15: error: expected declaration specifiers or '...' before string constant
   10 |         scanf("%d", &m);
      |               ^~~~
main.c:10:21: error: expected declaration specifiers or '...' before '&' token
   10 |         scanf("%d", &m);
      |                     ^
main.c:11:9: error: expected identifier or '(' before 'for'
   11 |         for (int i = 0;i<m;i++) {
      |         ^~~
main.c:11:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   11 |         for (int i = 0;i<m;i++) {
      |                         ^
main.c:11:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   11 |         for (int i = 0;i<m;i++) {
      |                             ^~
main.c:15:9: error: expected identifier or '(' before 'for'
   15 |         for (int k = 0;k < m;k++) {
      |         ^~~
main.c:15:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   15 |         for (int k = 0;k < m;k++) {
      |                          ^
main.c:15:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   15 |         for (int k = 0;k < m;k++) {
      |                               ^~
Language: C

#include <stdio.h>
#include<string.h>
#define ll long long


int main() {
    ll a[100010];
    ll n , m ,p,q,i;
    scanf("%lld",&n);
    for ( i = 1; i <=n; i++) {
        scanf("%lld",&a[i]);
    }

    scanf("%lld",&m);
    for ( i = 1; i <=m; i++) {
        scanf("%lld%lld",&p,&q);
        ll temp=a[p];
        a[p] = q;
        ll t  = 0;
        for (int j = 1; j<=n; ++j) {

            t = t + a[j];
        }
        printf("%lld",t);
        a[p]=temp;
    }


Compiler output:
main.c: In function 'main':
main.c:26:5: error: expected declaration or statement at end of input
   26 |     }
      |     ^
Language: C++

#include<iostream>
using namespace std;

int main(){

int N;

cin>>N;
int data[N];


for (int i=0;i<N;++i){
    cin>>data[i];

}
int M=0;
cin>>M;
int P[M];
int sum[M];
int P_time[M];


for (int i=0;i<M;++i){
cin>>P[i];
sum[i]=0;
cin>>P_time[i];
}


int a=sizeof(P_time)/sizeof(*P_time);

for (int i=0;i<M;i++){
    for (int j=0;j<N;j++){
        if (i==j){

            sum[i]+=P_time[i];

        }
        else {
        sum[i]+=data[j];
        }
    }
}



for (int i=0;i<M;i++){

    cout<<sum[i]<<endl;
}



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

int main() {
	int N, M, i, a,b,c;
	int ans = 0;
	int *T;
	cin >> N;
	T = new int[N];
	for (i = 0; i < N; i++) cin >> T[i];
	cin >> M;
	for (i = 0; i < M; i++) {
		cin >> a >> b;
		c = T[a - 1];
		T[a - 1] = b;
		for (int n = 0; n < N; n++) ans += T[n];
		cout << ans << endl;
		ans = 0;
		T[a - 1] = c;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> N;
      |         ^~~
a.cc:14:17: error: 'cout' was not declared in this scope
   14 |                 cout << ans << endl;
      |                 ^~~~
a.cc:14:32: error: 'endl' was not declared in this scope
   14 |                 cout << ans << endl;
      |                                ^~~~
Language: C++

#include <iostream>
#include <array>

using namespace std;

int main() {
    int N;
    int M;

    cin >> N;

    std::array<int, 100> arrayT;
    for_each(arrayT.begin(), arrayT.end(), [](int x) {
        std::cin >> x;
    });

    cin >> M;

    std::array<int, 100> arrayP;
    std::array<int, 100> arrayX;

    for (int i = 0; i < M; ++i) {
        cin >> arrayP[i] >> arrayX[i];
    }

    std::array<int, 100> array_ans;

    for (int j = 0; j < M; ++j) {
        int arrayT_total = 0;

        for (int i = 2; i < arrayT.size(); ++i) {
            arrayT_total += arrayT[i];
        }

        array_ans[j] = arrayP[j] + arrayX[j] + arrayT_total;
        cout << array_ans[j] << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'for_each' was not declared in this scope
   13 |     for_each(arrayT.begin(), arrayT.end(), [](int x) {
      |     ^~~~~~~~
Language: C++

#include <iostream>
#include <array>

using namespace std;

int main() {
    int N;
    int M;

    cin >> N;

    std::array<int, 100> arrayT;
    std::for_each(arrayT.begin(), arrayT.end(), [](int x) {
        std::cin >> x;
    });

    cin >> M;

    std::array<int, 100> arrayP;
    std::array<int, 100> arrayX;

    for (int i = 0; i < M; ++i) {
        cin >> arrayP[i] >> arrayX[i];
    }

    std::array<int, 100> array_ans;

    for (int j = 0; j < M; ++j) {
        int arrayT_total = 0;

        for (int i = 2; i < arrayT.size(); ++i) {
            arrayT_total += arrayT[i];
        }

        array_ans[j] = arrayP[j] + arrayX[j] + arrayT_total;
        cout << array_ans[j] << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'for_each' is not a member of 'std'
   13 |     std::for_each(arrayT.begin(), arrayT.end(), [](int x) {
      |          ^~~~~~~~
Language: C

#include <iostream>

using namespace std;

int main()
{
int n, tn[10^5], sumt=0, m, pm, xm ,result[10^5];
cin>>n; for (int i=0 ; i<n; i++){cin >>tn[i];sumt+=tn[i];}
cin >>m; 
for (int i=0 ; i<m; i++){
cin>>pm >>xm;
result [i]= sumt -tn[pm-1]+xm;
}
for (int i=0 ; i<m; i++)cout <<result[i]<<endl;
    return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
  int N = sc.nectInt();
  int[] t = new int[N];
  int sum = 0;
  for(int i = 0;i , n;i++){
    t[i] = sc.nextInt();
    sum += t[i];
  }
  int[] p = new int[2*M];
  for(int i = 0;i < 2*M;i += 2){
    p[i] = sc.nextInt();
    p[i+1] = sc.nextInt();
    System.out.println(sum - t[p[i]] + p[i+1]);
  }
}}

Compiler output:
Main.java:8: error: ';' expected
  for(int i = 0;i , n;i++){
                 ^
Main.java:8: error: illegal start of expression
  for(int i = 0;i , n;i++){
                  ^
Main.java:8: error: not a statement
  for(int i = 0;i , n;i++){
                    ^
Main.java:8: error: ')' expected
  for(int i = 0;i , n;i++){
                     ^
Main.java:8: error: ';' expected
  for(int i = 0;i , n;i++){
                         ^
5 errors
Language: Java


public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int [] t = new int[n];
		for(int i = 0;i < n;i++)t[i] = sc.nextInt();
		int m = sc.nextInt();
		int[] sum = new int[m];
		int[] p = new int[m];
		int[] x = new int[m];
		for(int i = 0;i < m;i++) {
			p[i] = sc.nextInt();
			x[i] = sc.nextInt();
		}
		for(int i = 0;i < m;i++) {
			for(int k = 0;k < n;k++) {
				if(k == p[i]-1)sum[i] += x[i];
				else sum[i] += t[k];
			}
			System.out.println(sum[i]);
		}
	}

}


Compiler output:
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int [] t = new int[n];
		for(int i = 0;i < n;i++)t[i] = sc.nextInt();
		int m = sc.nextInt();
		int[] sum = new int[m];
		int[] p = new int[m];
		int[] x = new int[m];
		for(int i = 0;i < m;i++) {
			p[i] = sc.nextInt();
			x[i] = sc.nextInt();
		}
		for(int i = 0;i < m;i++) {
			for(int k = 0;k < n;k++) {
				if(k == p[k])sum[k] += x[k];
				else sum[k] += t[k];
			}
			System.out.println(sum[i]);
		}
	}

}


Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <cstdio>
int a[110];
int b[110];
int main()
{
	  int n , m;
	 scanf("%d",&n);
	for(int i = 1; i <= n; i++)
	   {
	     scanf("%d",&a[i]);
	       b[i] = a[i];
	 }
	   scanf("%d",&m);
	   while(m--)
	   {
	   	   int k , b;
	   	   scanf("%d %d",&k,&b);
	   	       a[k] = b;
			 int sum = 0;
			for(int i = 1; i <= n; i++)
			     sum += a[i];
			   printf("%d\n",sum); 
			   	a[k] = b[k];
	   }
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:41: error: invalid types 'int[int]' for array subscript
   23 |                                 a[k] = b[k];
      |                                         ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int N, i , j, ans=0;
	cin >> N;
	int T[N];
	for(i=0; i<N; i++){
		cin >> T[i];
	}
	cin >> M;
	int P[M], X[M];
	for(i=0; i<M; i++){
		cin >> P[i] >> X[i];
	}
	for(i=0; i<M; i++){
		int temp = T[P[i]-1];
		T[P[i]-1] = X[i];
		for(j=0; j<N; j++){
			ans += T[j];
		}
		cout << ans << endl;
		T[P[i]-1] = temp;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'M' was not declared in this scope
   11 |         cin >> M;
      |                ^
a.cc:14:24: error: 'P' was not declared in this scope
   14 |                 cin >> P[i] >> X[i];
      |                        ^
a.cc:14:32: error: 'X' was not declared in this scope
   14 |                 cin >> P[i] >> X[i];
      |                                ^
a.cc:17:30: error: 'P' was not declared in this scope
   17 |                 int temp = T[P[i]-1];
      |                              ^
a.cc:18:29: error: 'X' was not declared in this scope
   18 |                 T[P[i]-1] = X[i];
      |                             ^
Language: C++

#include <iostream>
using namespace std;

int ans(int i, int N, int T[], int P[], int X[]){
	int ans=0;
	T[P[i]-1]=X[i];
	for(int j=0;j<N;i++) ans += T[j]
	return ans;
}
	
int main(){
	int N, T[N], M, P[M], X[M], i;

	cin >> N;
	for(i=0;i<N;i++) cin >> T[i];
	cin >> M;
	for(i=0;i<M;i++) cin >> P[i] >> X[i];

	for(i=0;i<M;i++) cout << ans(i,N,T,P,X)
		
}


Compiler output:
a.cc: In function 'int ans(int, int, int*, int*, int*)':
a.cc:7:41: error: expected ';' before 'return'
    7 |         for(int j=0;j<N;i++) ans += T[j]
      |                                         ^
      |                                         ;
    8 |         return ans;
      |         ~~~~~~                           
a.cc:9:1: warning: no return statement in function returning non-void [-Wreturn-type]
    9 | }
      | ^
a.cc: In function 'int main()':
a.cc:19:48: error: expected ';' before '}' token
   19 |         for(i=0;i<M;i++) cout << ans(i,N,T,P,X)
      |                                                ^
      |                                                ;
   20 | 
   21 | }
      | ~
Language: C++

#include <iostream>
using namespace std;

int N, T[N], M, P[M], X[M], i;

int ans(i,N,T[],P[],X[]){
	int ans=0;
	T[P[i]-1]=X[i];
	for(int j=0;j<N;i++) ans += T[j]
	return ans;
}
	
int main(){
	cin >> N;
	for(i=0;i<N;i++) cin >> T[i];
	cin >> M;
	for(i=0;i<M;i++) cin >> P[i] >> X[i];

	for(i=0;i<M;i++) cout << ans(i,N,T,P,X)
}


Compiler output:
a.cc:4:10: error: size of array 'T' is not an integral constant-expression
    4 | int N, T[N], M, P[M], X[M], i;
      |          ^
a.cc:4:19: error: size of array 'P' is not an integral constant-expression
    4 | int N, T[N], M, P[M], X[M], i;
      |                   ^
a.cc:4:25: error: size of array 'X' is not an integral constant-expression
    4 | int N, T[N], M, P[M], X[M], i;
      |                         ^
a.cc:6:15: error: expected primary-expression before ']' token
    6 | int ans(i,N,T[],P[],X[]){
      |               ^
a.cc:6:19: error: expected primary-expression before ']' token
    6 | int ans(i,N,T[],P[],X[]){
      |                   ^
a.cc:6:23: error: expected primary-expression before ']' token
    6 | int ans(i,N,T[],P[],X[]){
      |                       ^
a.cc:6:24: error: expression list treated as compound expression in initializer [-fpermissive]
    6 | int ans(i,N,T[],P[],X[]){
      |                        ^
a.cc: In function 'int main()':
a.cc:19:37: error: 'ans' cannot be used as a function
   19 |         for(i=0;i<M;i++) cout << ans(i,N,T,P,X)
      |                                  ~~~^~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int ans(i,N,T[],P[],X[]){
	int ans=0;
	T[P[i]-1]=X[i];
	for(int j=0;j<N;i++) ans += T[j]
	return ans;
}
	
int main(){
	int N, T[N], M, P[M], X[M], i;

	cin >> N;
	for(i=0;i<N;i++) cin >> T[i];
	cin >> M;
	for(i=0;i<M;i++) cin >> P[i] >> X[i];

	for(i=0;i<M;i++) cout << ans(i,N,T,P,X)
		
}


Compiler output:
a.cc:4:9: error: 'i' was not declared in this scope
    4 | int ans(i,N,T[],P[],X[]){
      |         ^
a.cc:4:11: error: 'N' was not declared in this scope
    4 | int ans(i,N,T[],P[],X[]){
      |           ^
a.cc:4:13: error: 'T' was not declared in this scope
    4 | int ans(i,N,T[],P[],X[]){
      |             ^
a.cc:4:15: error: expected primary-expression before ']' token
    4 | int ans(i,N,T[],P[],X[]){
      |               ^
a.cc:4:17: error: 'P' was not declared in this scope
    4 | int ans(i,N,T[],P[],X[]){
      |                 ^
a.cc:4:19: error: expected primary-expression before ']' token
    4 | int ans(i,N,T[],P[],X[]){
      |                   ^
a.cc:4:21: error: 'X' was not declared in this scope
    4 | int ans(i,N,T[],P[],X[]){
      |                     ^
a.cc:4:23: error: expected primary-expression before ']' token
    4 | int ans(i,N,T[],P[],X[]){
      |                       ^
a.cc:4:24: error: expression list treated as compound expression in initializer [-fpermissive]
    4 | int ans(i,N,T[],P[],X[]){
      |                        ^
a.cc: In function 'int main()':
a.cc:19:37: error: 'ans' cannot be used as a function
   19 |         for(i=0;i<M;i++) cout << ans(i,N,T,P,X)
      |                                  ~~~^~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
int M,N,i;
long long int P,X,sum[110],total;
cin>>N;
vector<int> T(N);
for(i=0;i<N;i++){
 cin>>T[i];
 }
total = accumulate(T.begin(),T.end(),0);
cin>>M;
for(i=0;i<M;i++){
cin>>P>>X;
sum[i] = total -T[P-1] + X;
 }
for(i=0;i<M;i++){
cout<<sum[i]<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'accumulate' was not declared in this scope
   12 | total = accumulate(T.begin(),T.end(),0);
      |         ^~~~~~~~~~
Language: C++

#include<iostream>
#include<numeric>
using namespace std;
int main(){
int M,N,i;
long long int T[110],P,X,sum[110],total;
cin>>N;
for(i=0;i<N;i++){
 cin>>T[i];
 }
 total = accumulate(T.begin(),T.end(),0);
cin>>M;
for(i=0;i<M;i++){
cin>>P>>X;
sum[i] = total -T[P-1] + X;
 }
for(i=0;i<M;i++){
cout<<sum[i]<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: request for member 'begin' in 'T', which is of non-class type 'long long int [110]'
   11 |  total = accumulate(T.begin(),T.end(),0);
      |                       ^~~~~
a.cc:11:33: error: request for member 'end' in 'T', which is of non-class type 'long long int [110]'
   11 |  total = accumulate(T.begin(),T.end(),0);
      |                                 ^~~
Language: C++

        #include<iostream>
        using namespace std;
        int main(){
         int M,N,i;
         long long int T[N],P,X,sum[M],total=0;
         cin>>N;
         for(i=0;i<N;i++){
          cin>>T[i];
          total += T[i];
         }
         cin>>M;
         for(i=0;i<M;i++){
          cin>>P>>X;
          P--;
          sum[i] = total -T[P] + X;
         }
         for(i=0;i<M;i++){
          cout<<sum[i];
        }
         return 0;

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

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<iomanip>
#include<utility>
#include<cmath>
#include<set>
#include<list>
#include<queue>
#include<stack>
#include<deque>
#include<map>
#include<set>
#include<cstring>
#include<iterator>
#include<bitset>
#include<assert.h>
//#include<chrono>
//#include<time.h>
//#include<windows.h>
using namespace std;
 
//#define int ll
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,pair<int,int> > PP;
typedef vector<int> VI;
typedef vector<long long int> VL;
//static const int MOD = 1000000007;
//static const int INF = 2147483647;
//static const long long INF = 9223372000000000000;
//static const long long INF = 9223372000000000000/2;
//static const int INF = 1000010000;
//int dx4[4] = {0,1,0,-1}, dy4[4] = {-1,0,1,0};
//int dx5[5] = {-1,0,0,0,1}, dy5[5] = {0,-1,0,1,0};
//int dx8[8] = {-1,0,1,1,1,0,-1,-1}, dy8[8] = {1,1,1,0,-1,-1,-1,0};
//int dx9[9] = {-1,0,1,1,1,0,-1,-1,0}, dy9[9] = {1,1,1,0,-1,-1,-1,0,0};
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define FI first
#define SE second
#define NP next_permutation
#define PQ priority_queue
#define UB upper_bound
#define LB lower_bound
#define SZ(a) int((a).size())
#define LEN(a) int((a).length())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REP1(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREP1(i,x) for(int i=((int)(x));i>0;i--)
#define ALL(x) (x).begin(),(x).end()
struct edge {int /*from,*/to,cost;};

signed main(){
    int n;
    int t[114];
    int m;
    int p[114],x[114];

    cin >> n;
    int sum = 0;
    REP(i,n) {scanf("%d",&t[i]);sum+=s[i];}
    cin >> m;
    REP(i,m){
        int p,tmp;
        scanf("%d%d",&p,&tmp);
        printf("%d\n",sm+tmp-t[p]);
    }


    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:70:38: error: 's' was not declared in this scope
   70 |     REP(i,n) {scanf("%d",&t[i]);sum+=s[i];}
      |                                      ^
a.cc:75:23: error: 'sm' was not declared in this scope; did you mean 'sum'?
   75 |         printf("%d\n",sm+tmp-t[p]);
      |                       ^~
      |                       sum
Language: C++

#include <iostream>
using namespace std;
int main() {
    int n,m;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    int s=0;
    for(int h=0;h<n;h++)
        s+=a[h];
    int m;
    cin>>m;
    while(m--){
        int f,g;
        cin>>f>>g;
        cout<<s-a[f-1]+g<<endl;
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: redeclaration of 'int m'
   12 |     int m;
      |         ^
a.cc:4:11: note: 'int m' previously declared here
    4 |     int n,m;
      |           ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(){
    int N, M, tmp=0,sum;
    cin >>N;
    vector<int> T(N);

    for(int i=0;i<N;i++){
        cin >>T[i];
    }
    
    cin >>M;
    vector<int> P(M), X(M);

    for(int i=0;i<M;i++){
        cin >>P[i];
        cin >>X[i];
    }

    for(int i=0;i<M;i++){
        for(int j=0;i<N;j++){
            if(P[i]==j){
                tmp=T[j];
                T[j]==X[i];

                for(int k=0;k<N;k++){
                    sum+=T[k];
                }

                cout<<sum<<endl;
                T[j]=temp;
            }
        }
    }

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:22: error: 'temp' was not declared in this scope; did you mean 'tmp'?
   34 |                 T[j]=temp;
      |                      ^~~~
      |                      tmp
Language: C++

#include <iostream>
using namespace std;

#define PrintLn(X) cout << X << endl
#define Rep(i, n) for(int i = 0; i < (int)(n); ++i)

int T[100];
int P[100];
int X[100];
int main(void)
{
	int N, M;
	cin >> N >> M;
	int ans = 0;
	Rep(i, N){
		cin >> T[i];
		ans += T[i];
	}
	Rep(i, M){
		int p, x;
		cin >> p >> x;
		p--;
		PrintLn(ans + x[p] - T[p]);
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:32: error: invalid types 'int[int]' for array subscript
   23 |                 PrintLn(ans + x[p] - T[p]);
      |                                ^
a.cc:4:28: note: in definition of macro 'PrintLn'
    4 | #define PrintLn(X) cout << X << endl
      |                            ^
Language: C++

int main(){
	int N, M,sumT=0;
	int T[1000], P[1000], X[1000],ans[1000];
	cin >> N;
	for (int i = 0; i < N; i++){
		cin >> T[i];
		sumT = sumT + T[i];
	}
	cin >> M;
	for (int j = 0; j < M; j++){
		cin >> P[j]>> X[j];
		ans[j] = sumT - T[P[j] - 1] + X[j];
	}
	for (int j = 0; j < M; j++){
		cout << ans[j] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> N;
      |         ^~~
a.cc:15:17: error: 'cout' was not declared in this scope
   15 |                 cout << ans[j] << endl;
      |                 ^~~~
a.cc:15:35: error: 'endl' was not declared in this scope
   15 |                 cout << ans[j] << endl;
      |                                   ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
		
		int N,T[100],M,P[100],X[100];
		int r;
		
		cin>>N;
		for(int i=0;i<N;i++){
			cin>>T[i];
		}
		cin>>M;
		for(int i=0;i<M;i++){
			cin>>P[i]>>X[i];
		}
		for(int i=0;i<M;i++){
			r=r+T[i]
		}
		for(int i=0;i<M;i++){
			cout<<r-T[ P[i]-1 ]+X[i]<<endl;
	    }
	    
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:33: error: expected ';' before '}' token
   18 |                         r=r+T[i]
      |                                 ^
      |                                 ;
   19 |                 }
      |                 ~
Language: C++

#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define NMAX 103
#define MMAX 103
 
//コメントアウトするとdebug()を実行しない
#define DEBUG
 
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
 
int N,T[NMAX],M,P[MMAX],X[MMAX],sum = 0;
char C;
string S;
static const int dx[8] = {0,1,1,1,0,-1,-1,-1},
					dy[8] = {1,1,0,-1,-1,-1,0,1};
 
void solve(){
 
}
 
void debug(){
 
}
 
void answer(){
	cout << ans << "\n";
}
 
int main(){
	cin >> N;
	for (int i = 0; i < N; ++i)
	{
		cin >> T[i];
		sum += T[i];
	}
	cin >> M;
	for (int i = 0; i < M; ++i)
	{
		cin >> P[i] >> X[i];
		cout << sum-T[P[i]-1]+ X[i] << "\n";
 
	}
 
	return 0;
}

Compiler output:
a.cc: In function 'void answer()':
a.cc:40:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   40 |         cout << ans << "\n";
      |                 ^~~
      |                 abs
Language: C++

#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define NMAX 103
#define MMAX 103

//コメントアウトするとdebug()を実行しない
#define DEBUG

using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef pair<int ,int > P;
typedef long long ll;

int N,T[NMAX],M,P[MMAX],X[MMAX],sum = 0;
char C;
string S;
static const int dx[8] = {0,1,1,1,0,-1,-1,-1},
					dy[8] = {1,1,0,-1,-1,-1,0,1};

void solve(){

}

void debug(){

}

void answer(){
	cout << ans << "\n";
}

int main(){
	cin >> N;
	for (int i = 0; i < N; ++i)
	{
		cin >> T[i];
		sum += T[i];
	}
	cin >> M;
	for (int i = 0; i < M; ++i)
	{
		cin >> P[i] >> X[i];
		cout << sum-T[P[i]-1]+ X[i] << "\n";

	}

	return 0;
}

Compiler output:
a.cc:28:23: error: 'int P [103]' redeclared as different kind of entity
   28 | int N,T[NMAX],M,P[MMAX],X[MMAX],sum = 0;
      |                       ^
a.cc:25:25: note: previous declaration 'typedef struct std::pair<int, int> P'
   25 | typedef pair<int ,int > P;
      |                         ^
a.cc: In function 'void answer()':
a.cc:43:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   43 |         cout << ans << "\n";
      |                 ^~~
      |                 abs
a.cc: In function 'int main()':
a.cc:56:25: error: expected primary-expression before '[' token
   56 |                 cin >> P[i] >> X[i];
      |                         ^
a.cc:57:32: error: expected primary-expression before '[' token
   57 |                 cout << sum-T[P[i]-1]+ X[i] << "\n";
      |                                ^
Language: Java

public static void main(String[] args) {
		int N = 6;
		int P = 3;
		int [] time = {1,4,10,2,6,3};
		int [] drinktime = {4,2,5,4,3,9};
		int sum = 0;
		for(int i = 0; i < N; i++){
			sum = sum + time[i];
		}
		for(P = 0; P < drinktime.length; P++){
		sum = sum + drinktime[P] - time[P];
		System.out.println(sum);
	}
	}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.*;
public Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] t=new int[n];
		for(int i=1;i<n;i++){
			t[i]=sc.nextInt();
		}
		int m=sc.nextInt();
		int[] p=new int[m],x=new int[m];
		for(int i=1;i<m;i++){
			p[i]=sc.nextInt();
			x[i]=sc.nextInt();
		}
		int sum=0;
		for(int i=0;i<m;i++){
			for(int j=0;j<n;i++){
				sum+=t[j];
			}
			sum=sum-t[p[i]]+x[i];
			System.out.println(sum);
		}
	}
}

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
public Main {
       ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args){
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:25: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int [] t = new int [n];
		int sumTime = 0;
		for (int i = 0 ; i < n ; i++) {
			t [i] = scanner.nextInt();
			sumTime += t[i];
		}
		int m = scanner.nextInt();
		for (int i = 0 ; i < m ; i++) {
			int p = scanner.Int() - 1;
			int sum = sumTime - t[p] + scanner.nextInt();
			System.out.println(sum);
		}
	}
} 

Compiler output:
Main.java:15: error: cannot find symbol
			int p = scanner.Int() - 1;
			               ^
  symbol:   method Int()
  location: variable scanner of type Scanner
1 error
Language: C++

package main

import (
	"fmt"
)

func main() {
	var M, N int
	fmt.Scan(&N)
	var sum int
	t := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&t[i])
		sum += t[i]
	}
	fmt.Scan(&M)
	for i := 0; i < M; i++ {
		var p, x int
		fmt.Scan(&p, &x)
		fmt.Println(sum + x - t[p-1])
	}
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
int N;
int T[101];
int sum=0;
cin>>N;
for(int i=1;i<=N;i++){
cin>>T[i]
sum+=T[i];
}
int M;
cin>>M;
for(int i=0;i<M;i++){
int p,x;
cin>>p>>x;
cout<<sum-T[p]+x<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: expected ';' before 'sum'
   10 | cin>>T[i]
      |          ^
      |          ;
   11 | sum+=T[i];
      | ~~~
Language: C

#include<stdio.h>
int main(void)
{
	int temp,goukei[110] = { 0 },mondai, time[110], drink, siyou[110], siyoutime[110], i, n, t;
	scanf("%d", &mondai);
	for (i = 0; i < mondai; i++)
	{
		scanf("%d", &time[i]);
	}
	scanf("%d", &drink);
	for (i = 0; i < drink; i++)
	{
		scanf("%d%d", &siyou[i], &siyoutime[i]);
		siyou[i]--;
	}
	for (i = 0; i < drink; i++)
	{
		temp = time[siyou[i]];
		time[siyou[i]] = siyoutime[i];
		for (n = 0; n < mondai; n++)
		{
			goukei[i] += time[n];
		}
		time[siyou[i]] = temp;
	}
	for (i = 0; i < drink; i++)
		printf("%d\n",goukei[i] );
	return0;
}

Compiler output:
main.c: In function 'main':
main.c:28:9: error: 'return0' undeclared (first use in this function)
   28 |         return0;
      |         ^~~~~~~
main.c:28:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(){
	int N,M;
	int T[N],P[M],X[M];
	int sum;
	scanf("%d",&N);
	for(int i=0;i++;i<<N){
		scanf("%d",*T[i]);
		sum=sum+T[i];
	}
	scanf("%d",&M);
	for(int j=0;j++;j<<M){
		scanf("%d%d",*P[j],*X[j]);

		printf("%d",sum+X[j]-T[P[j]]);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:28: error: invalid type argument of unary '*' (have 'int')
    9 |                 scanf("%d",*T[i]);
      |                            ^~~~~
main.c:14:30: error: invalid type argument of unary '*' (have 'int')
   14 |                 scanf("%d%d",*P[j],*X[j]);
      |                              ^~~~~
main.c:14:36: error: invalid type argument of unary '*' (have 'int')
   14 |                 scanf("%d%d",*P[j],*X[j]);
      |                                    ^~~~~
Language: C++

#include <iostream>

using namespace std;

int main(){
  int N = 0, temp = 0, result = 0, M = 0, P = 0, X = 0;
  cin >> N;
  int *T = new int[N];
  for(int i = 0; i < N; i++){
    cin >> T[i];  
  }
  cin >> M;

  for(int i = 0; i < M; i++){
    cin >> P;
    cin >> X;

    temp = T[i];
    T[P] = X;
    for(int i = 0; i < N; i++){
      result += T[i];
    }
    cout << result;
    resutl = 0;

    T[i] = temp;
  }

  return 0;
}

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

#include <iostream>

using namespace std;

int main(){
  int N = 0, temp = 0, result = 0;
  cin >> N;
  int *T = new int[N];
  for(int i = 0; i < N; i++){
    cin >> T[i];  
  }
  cin >> M;
  for(int i = 0; i < M; i++){
    cin >> P;
    cin >> X;

    temp = T[i];
    T[P] = X;
    for(int i = 0; i < N; i++){
      result += T[i];
    }
    cout << result;
    resutl = 0;

    T[i] = temp;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'M' was not declared in this scope
   12 |   cin >> M;
      |          ^
a.cc:14:12: error: 'P' was not declared in this scope
   14 |     cin >> P;
      |            ^
a.cc:15:12: error: 'X' was not declared in this scope
   15 |     cin >> X;
      |            ^
a.cc:23:5: error: 'resutl' was not declared in this scope; did you mean 'result'?
   23 |     resutl = 0;
      |     ^~~~~~
      |     result
Language: C++

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
static const int R = 10000;

int main(){
	int n[R],t,m;
	int sum = 0;
	int k = 0;
	int number = 0;
	int sec = 0;
	cin >> t;
	for( int i = 0; i < n; i++)
	 {
		cin >> n[i];
	}
	cin >> m;
	for( int i = 0; i < m; i++)
	 {
		cin >> number >> sec;
		n[number - 1] = sec;
			for( int i = 0; i < t; i++){
				sum += n[i];
				cout << sum << endl;
			}
	}
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         for( int i = 0; i < n; i++)
      |                         ~~^~~
Language: C++

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
static const int R = 10000;

int main(){
	int n[R],t,m;
	int sum = 0;
	int k = 0;
	int number = 0;
	int sec = 0;
	cin >> t;
	for( int i = 0; i < n; i++) {
		cin >> n[i];
	}
	cin >> m;
	for( int i = 0; i < m; i++)
	 {
		cin >> number >> sec;
		n[number - 1] = sec;
			for( int i = 0; i < t; i++){
				sum += n[i];
				cout << sum << endl;
			}
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         for( int i = 0; i < n; i++) {
      |                         ~~^~~
a.cc:27:10: error: expected '}' at end of input
   27 |         }
      |          ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: Java

import java.util.*;
public class bz {

 public static void main(String[] args) {
  Scanner no=new Scanner(System.in);
  int n=no.nextInt();
  int arr[]=new int[1000000];
  int max=0;
  boolean t=true;
  for(int i=0;i<n;i++){
    int r=no.nextInt();
    if(r>n||(n%2==0&&r%2==0)||(n%2==1&&r%2==1)){
      System.out.println("0");
      t=false;
    }
    if(r>max){
      max=r;
    }
    arr[r]++;
  }
  if(t){
   if(n%2==0){
     boolean t1=true;
     for(int i=0;i<max;i++){
       if(arr[i]>2){
         System.out.println("0");
         t1=false;
         break;  
       }
     }
     if(t1){
       int o=n/2;
       int fin=1;
       for(int i=0;i<o;i++){
         fin=(fin*2)%1000000007;
       }
       System.out.println(fin);
     }
   }
   else if(n%2==1){
     boolean t1=true;
     for(int i=0;i<max;i++){
       if(arr[i]>2||arr[0]>1){
         System.out.println("0");
         t1=false;
         break;  
       }
     }
     if(t1){
     int o=n/2;
     int fin=1;
     for(int i=0;i<o;i++){
         fin=(fin*2)%1000000007;
     }
     System.out.println(fin);
     }
   }
  }
 }

}


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

#include<iostream>
#include<algorithm>
using namespace std;
int N_MAX = 100000;
int p=1000000007;
typedef long long ll;
int main()
{
  int n,t,i;
  int c[N_MAX];
  ll res=1;
  cin >> n;
  fill(c,c+n-1,0)
  for(i=0;i<n;i++){
    cin >> t;
    if((n+t)%2!=1||(t==0&&c[t]>=1)||c[t]>=2){
      cout << "0" << endl;
      return 0;
    }
    c[t]++;
  }
  for(i=0;i<n;i++)
    if(c[i]>0){
      res*=c[i];
      res%=p;
    }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: expected ';' before 'for'
   13 |   fill(c,c+n-1,0)
      |                  ^
      |                  ;
   14 |   for(i=0;i<n;i++){
      |   ~~~             
a.cc:14:18: error: expected ';' before ')' token
   14 |   for(i=0;i<n;i++){
      |                  ^
      |                  ;
Language: C++

#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath> 
#define ll long long
 
ll MOD=1e9+7;
ll a[100005];
using namespace std;
 
int main(){
	ll n;
	cin>>n;
	
	ll flag=1;//flag 
	ll ans=1;
	
	if(n%2==0){ // even number 
	
		for(ll i=0;i<n;i++){
			ll x;
			cin>>x;
			a[x]++;//a[7]++
			
			// give data x error 
			if(x>=n || x%2==0 || a[x]>2){ 
				flag=0;
				cout<<"0"<<endl;
				break;
			}
			
			//The correct situation 
			if(a[x]==1)
				ans=ans*2%MOD; // a * b %c == a%c * b%c 
		}
	} 
	
	else{ //odd 
	
		for(ll i=0;i<n;i++){
			ll x;
			cin>>x;
			a[x]++;
			
			/ / give data x error 
			if(x>=n || x%2==1 || a[0]>1 ||a[x]>2){
				flag=0;
				cout<<"0"<<endl;
				break;
			}
			
			//The correct situation
			if(x!=0 && a[x]==1)
				ans=ans*2%MOD;
		}
	}
	
	if(flag)
		cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:25: error: expected primary-expression before '/' token
   46 |                         / / give data x error
      |                         ^
a.cc:46:27: error: expected primary-expression before '/' token
   46 |                         / / give data x error
      |                           ^
a.cc:46:29: error: 'give' was not declared in this scope
   46 |                         / / give data x error
      |                             ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
 
ll MOD=1e9+7;
ll a[100005];
using namespace std;
 
int main(){
	ll n;
	cin>>n;
	
	ll flag=1;//flag 
	ll ans=1;
	
	if(n%2==0){ // even number 
	
		for(ll i=0;i<n;i++){
			ll x;
			cin>>x;
			a[x]++;//a[7]++
			
			/ / give data x error 
			if(x>=n || x%2==0 || a[x]>2){ 
				flag=0;
				cout<<"0"<<endl;
				break;
			}
			
			//The correct situation 
			if(a[x]==1)
				ans=ans*2%MOD; // a * b %c == a%c * b%c 
		}
	} 
	
	else{ //odd 
	
		for(ll i=0;i<n;i++){
			ll x;
			cin>>x;
			a[x]++;
			
			/ / give data x error 
			if(x>=n || x%2==1 || a[0]>1 ||a[x]>2){
				flag=0;
				cout<<"0"<<endl;
				break;
			}
			
			//The correct situation
			if(x!=0 && a[x]==1)
				ans=ans*2%MOD;
		}
	}
	
	if(flag)
		cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: expected primary-expression before '/' token
   23 |                         / / give data x error
      |                         ^
a.cc:23:27: error: expected primary-expression before '/' token
   23 |                         / / give data x error
      |                           ^
a.cc:23:29: error: 'give' was not declared in this scope
   23 |                         / / give data x error
      |                             ^~~~
a.cc:43:25: error: expected primary-expression before '/' token
   43 |                         / / give data x error
      |                         ^
a.cc:43:27: error: expected primary-expression before '/' token
   43 |                         / / give data x error
      |                           ^
a.cc:43:29: error: 'give' was not declared in this scope
   43 |                         / / give data x error
      |                             ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath> 
#define ll long long

ll MOD=1e9+7;
ll a[100005];
using namespace std;

int main(){
	ll n;
	cin>>n;
	
	ll flag=1;//flag 
	ll ans=1;
	
	if(n%2==0){ // even number 
	
		for(ll i=0;i<n;i++){
			ll x;
			cin>>x;
			a[x]++;//a[7]++
			
			/ / give data x error 
			if(x>=n || x%2==0 || a[x]>2){ 
				flag=0;
				cout<<"0"<<endl;
				break;
			}
			
			//The correct situation 
			if(a[x]==1)
				ans=ans*2%MOD; // a * b %c == a%c * b%c 
		}
	} 
	
	else{ //odd 
	
		for(ll i=0;i<n;i++){
			ll x;
			cin>>x;
			a[x]++;
			
			/ / give data x error 
			if(x>=n || x%2==1 || a[0]>1 ||a[x]>2){
				flag=0;
				cout<<"0"<<endl;
				break;
			}
			
			//The correct situation
			if(x!=0 && a[x]==1)
				ans=ans*2%MOD;
		}
	}
	
	if(flag)
		cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: expected primary-expression before '/' token
   26 |                         / / give data x error
      |                         ^
a.cc:26:27: error: expected primary-expression before '/' token
   26 |                         / / give data x error
      |                           ^
a.cc:26:29: error: 'give' was not declared in this scope
   26 |                         / / give data x error
      |                             ^~~~
a.cc:46:25: error: expected primary-expression before '/' token
   46 |                         / / give data x error
      |                         ^
a.cc:46:27: error: expected primary-expression before '/' token
   46 |                         / / give data x error
      |                           ^
a.cc:46:29: error: 'give' was not declared in this scope
   46 |                         / / give data x error
      |                             ^~~~
Language: C

#include <stdio.h>
#include <math.h>
int main(){
   int n;
   scanf("%d", &n);
   int a[100000 + 5] = {0}, b, c; //aの要素を0。それとb、cを定義
   for(int i = 0; i < n; i++){
       scanf("%d", &b);
       a[b]++;
   }
   for(int i = n - 1; i >= 0; i -= 2){
       if(i == 0){
           if(a[i] != 1){
                printf("0\n");
                return 0;
            }
            else break;
       }        
       if(a[i] != 2){
           printf("0\n");
           return 0;
        }
    }
   c = (1<<(n/2));
   printf("%d\n", c%((1000000000+7));
   return 0;
}


Compiler output:
main.c: In function 'main':
main.c:25:37: error: expected ')' before ';' token
   25 |    printf("%d\n", c%((1000000000+7));
      |          ~                          ^
      |                                     )
main.c:26:13: error: expected ';' before '}' token
   26 |    return 0;
      |             ^
      |             ;
   27 | }
      | ~
Language: Java

import java.util.*;
import java.math.BigInteger;
import java.text.DecimalFormat;
// warm-up
public class LiningUp {

	static Set<Integer> a = new HashSet<Integer>();
	static Set<Integer> b = new HashSet<Integer>();

	static void solve() {
		Scanner sc = new Scanner(System.in);
		double mod = 1000000007;
		int n=sc.nextInt();
		while (n-->0) {
			int c = sc.nextInt();
			if (c==0) continue;
			if (a.contains(c)) b.add(c);
			else a.add(c);
		}
		if (a.size()==b.size()) System.out.println(new DecimalFormat("#").format(Math.pow(2,a.size())%mod));
		else System.out.println(0);
		sc.close();				
	}

	public static void main(String args[]) {
		solve();
	}

}

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

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

int main (){
  int N;
  cin >> N;
  int arr[N];
  for (int i = 0; i < N; i ++){
    cin >> arr[i];
  }
  
  
  
  void combine(int arr[], int len, int start, int end){
  int tempLen = end - start + 1;
  int arr3[tempLen];
  int mid = (start + end) / 2;
  int pos1 = start;
  int pos2 = mid + 1;
  int end1 = mid;
  int end2 = end;
  for (int i = 0; i < tempLen; i ++){
    if (pos1 <= end1 && pos2 <= end2){
      if (arr[pos1] <= arr[pos2]) {
        arr3[i] = arr[pos1];
        pos1 ++;
      } else {
        arr3[i] = arr[pos2];
        pos2 ++;
      }
    } else if (pos1 <= end1) {
      arr3[i] = arr[pos1];
      pos1 ++;
    } else {
      arr3[i] = arr[pos2];
      pos2 ++;
    }
  }
  for (int i = 0; i < tempLen; i ++){
  arr[start +  i] = arr3[i];
  }

  void mergeSort(int arr[], int len, int start, int end){
    int mid = (start + end) / 2;
    if (mid > start + 1){
      mergeSort(arr, len, start, mid);
    }
    if (end > mid + 1){
      mergeSort(arr, len, mid + 1, end);
    }
  combine(arr, len, start, end);
  }
  
  mergeSort(arr, N, 0, N - 1);
  
  
  /*
  
  for (int i = 0; i < N - 1; i ++){
    for (int j = i + 1; j < N; j ++){
      if (arr[j] < arr[i]){
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
      }
    }
  }
  
  */
  
  if (N % 2 == 0){
    int A[N];
    for (int i = 0; i < N; i += 2){
      A[i] = i + 1;
      A[i + 1] = i + 1;
    }
    for (int i = 0; i < N; i ++){
      if (A[i] != arr[i]){
        cout << 0 << '\n';
        break;
      }
    }
    cout << pow (2, N / 2) << '\n';
  } else {
    int A[N];
    A[0] = 0;
    for (int i = 2; i < N; i += 2){
      A[i - 1] = i;
      A[i] = i;
    }
    for (int i = 0; i < N; i ++){
      if (A[i] != arr[i]){
        cout << 0 << '\n';
        break;
      }
    }
    cout << pow (2, (N - 1) / 2) << '\n';
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:55: error: a function-definition is not allowed here before '{' token
   15 |   void combine(int arr[], int len, int start, int end){
      |                                                       ^
a.cc:100:2: error: expected '}' at end of input
  100 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main (){
      |            ^
Language: C++

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

int main (){
  cout << pow(2, N/2) << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: 'N' was not declared in this scope
    6 |   cout << pow(2, N/2) << '\n';
      |                  ^
Language: C++

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

#define Bye return 0

void solve(){
    int n, res = 1; cin>>n;
    
    int a[n+1];
    memset(a, 0, sizeof a);
    bool no_solution = false; 

    for (int i=1; i<=n; i++){ int e; cin>>e; a[e]++;}
    int counter = (n%2^0) ? (n-1)/2 :  n/2;
    for (int i=1; i<=counter; i++) res = (res*2)%MAX;
    bool isValid = false;

    for (int i=0; i<n; i+=2){
        isValid += (i+2<n && a[i+2]^2 && n%2^0) ? true : false;
        isValid += (i+1<=n-1 && a[i+1]^2 && !(n%2^0)) ? true : false;
    }
    
    cout<<((!isValid) ? res : 0)<<endl;
}

int main()
{
    solve();
    Bye;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:15:50: error: 'MAX' was not declared in this scope
   15 |     for (int i=1; i<=counter; i++) res = (res*2)%MAX;
      |                                                  ^~~
Language: C++

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

#define Bye return 0
#define ll long long
const int MAX = 1e9+7;
const int SIZE = 1e5+1;

void solve(){
    int n; cin>>n;
    
    int a[n+1];
    memset(a, 0, sizeof a);
    bool no_solution = false; 
    for (int i=1; i<=n; i++){
        int e; cin>>e;
        a[e]++;
    }

    int counter = (n%2 == 0) ? n/2 : (n-1)/2;

    int res = 1;
    for (int i=1; i<=counter; i++)
        res = (res*2)%MAX;
    
    cout<<(a[0]>=2 && a[n-1]<=1) ? 0: res)<<endl;
}

int main()
{
    solve();
    Bye;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:26:42: error: expected ';' before ')' token
   26 |     cout<<(a[0]>=2 && a[n-1]<=1) ? 0: res)<<endl;
      |                                          ^
      |                                          ;