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

n = int(input())
a = list(map(int, input().split()))
M = 10**9 + 7

def calc_index(a):
    t = sorted(a)
    for i, x in enumerate(t[1:]):
        if t[i] == x:
            break
    result = []
    for i, v in enumerate(a):
        if v == x:
            result.append(i)
    return result

f, e = calc_index(a)
out = n - e + f

facts = [0 for x in range(10**5 + 1)]
fresult = 1
for i in range(1, 10**5 + 1):
    fresult *= i
    if fresult > M:
        fresult %= M
    facts[i] = fresult

def fact(a):
    return facts[a]

def powmod(a, b):
    if b == 0:
        return 1
    elif b & 1:
        return (powmod(a, b - 1) * a) % M
    else:
        return powmod(a, b // 2)**2 % M

def c(a, b):
    if b > a: return 0
    return fact(a) * powmod(fact(b) * fact(a - b) % M, M - 2) % M

for i in range(1, n + 1):
    c1, c2 = c(n + 1, i), c(out, i - 1)
    r = c1 - c2
    if r < 0:
        r += M
    print(r)
print(1)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define NUM 100010
#define TEISUU 1000000007

unsigned long long expo(unsigned long long x, unsigned long long n){
    unsigned long long res = 1;
 
    while (n){
        if (n & 1ULL){
          res = (res * x) % TEISUU;
        } 
        x = (x * x) % TEISUU;
        n >>= 1ULL;
    }
 
    return (res % TEISUU);
}

unsigned long long calc_combi(int n, int r) {
  int i;
  unsigned long long int bunshi = 1;
  unsigned long long int bunbo = 1;

  if (r > n) {
    return 0;
  }
  
  if (n-r > r){
    r = n - r;
  }
  if (r == 0) {
    return 1;
  } else {
    for (i = 1; i <= r; i++) {
      bunbo = bunbo * i;
      bunshi = (bunshi * (n - r + i));
      if(bunbo >> 10){
        bunbo = bunbo % TEISUU;
      } 
      if (bunshi >> 10) {
        bunshi = bunshi % TEISUU;
      }
        }
    bunbo = expo(bunbo, TEISUU - 2);
    return (bunbo * bunshi) % TEISUU;
  }

}

int main() {
  int i, j;
  int *x = (int *)malloc(sizeof(int) * NUM);
  int n;
  int temp;
  int between;
  unsigned long long int answer;

  for (i = 0; i < NUM; i++) {
    x[i] = -1;
  }

  scanf("%d", &n);
  for (i = 1; i <= n + 1; i++) {
    scanf(" %d", &temp);
    if (x[temp] == -1) {
      x[temp] = i;
    } else {
      between = i - x[temp] - 1;
      break;
    }
  }

  if (n == 1) {
    printf("1\n");
    printf("1\n");
  } else {
    printf("%d\n", n);
    for (i = 2; i <= n + 1; i++) {
      //answer = calc_combi(n - 1, i) + 2 * calc_combi(n - 1, i - 1) -
      //         calc_combi(n - 1 - between, i - 1) + calc_combi(n - 1, i - 2);
      answer = calc_combi(n + 1, i) - calc_combi(n + 1 - between);
      printf("%llu\n", answer % TEISUU);
      fflush(stdout);
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:84:39: error: too few arguments to function 'calc_combi'
   84 |       answer = calc_combi(n + 1, i) - calc_combi(n + 1 - between);
      |                                       ^~~~~~~~~~
main.c:22:20: note: declared here
   22 | unsigned long long calc_combi(int n, int r) {
      |                    ^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>>

using namespace std;

typedef long long ll;

const int N = 1e5 + 2, MOD = 1e9 + 7;

ll fpm(ll x, ll n)
{
	ll y = 1;
	for (; n; (x *= x) %= MOD, n >>= 1)
		if (n & 1)
			(y *= x) %= MOD;
	return y;
}

ll fac[N], ifac[N];
int pos[N];

inline ll C(int n, int k)
{
	if (k > n) return 0;
	return fac[n] * ifac[k] % MOD * ifac[n-k] % MOD;
}

int main()
{
	int n;
	scanf("%d", &n);
	++n;
	fac[0] = 1;
	for(int i = 1;i < n+1;i++) fac[i] = fac[i-1] * i % MOD;
	ifac[n] = fpm(fac[n], MOD-2);
	per (i, n, 1) ifac[i-1] = ifac[i] * i % MOD;
	int m, x;
	rep (i, 1, n+1)
	{
		scanf("%d", &x);
		if (pos[x])
		{
			m = n - (i - pos[x] + 1);
			break;
		}
		pos[x] = i;
	}
	rep (i, 1, n+1)
		printf("%lld\n", (C(n, i) - C(m, i-1)) % MOD);
	return 0;
}


Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>>
      |                         ^
a.cc: In function 'int main()':
a.cc:35:14: error: 'i' was not declared in this scope
   35 |         per (i, n, 1) ifac[i-1] = ifac[i] * i % MOD;
      |              ^
a.cc:35:9: error: 'per' was not declared in this scope
   35 |         per (i, n, 1) ifac[i-1] = ifac[i] * i % MOD;
      |         ^~~
a.cc:37:9: error: 'rep' was not declared in this scope
   37 |         rep (i, 1, n+1)
      |         ^~~
Language: Java

import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] a = new int[n + 1];
		boolean[] hasOne = new boolean[n + 1];
		boolean[] hasTwo = new boolean[n + 1];

		for(int i = 0; i < n + 1; i++){
			a[i] = sc.nextInt();
			hasOne[i + 1] = false;
			hasTwo[i + 1] = false;
		}

		int[] position = new int[n + 1];
		int firstPosition = 0;
		int secondPosition = 0;
		for(int i = 0; i < n + 1; i++){
			if(hasOne[a[i]]){
				hasTwo[a[i]] = true;
				firstPosition = position[a[i]];
				secondPosition = i;
				break;
			}else{
				position[a[i]] = i;
				hasOne[a[i]] = true;
			}
		}

		int x = firstPosition + (n + 1 - secondPosition - 1);

		long[] ans = new long[n + 2];
		long[] combX = new long[x + 1];
		combX[0] = 1;
		long[] comb[] = new long[n + 2];
		comb[0] = 1;
		for(int i = 1; i <= n + 1; i++){
			if(i <= x){
				combX[i] = 1;
				if(i >= x / 2 + 1){
					combX[i] = combX[x - i];
				}else{
					for(int j = 1; j <= i; j++){
						combX[i] *= (long)(x - j + 1);
						combX[i] /= (long)j;
						combX[i] = combX[i] % 1000000007;
					}
				}
			}

			comb[i] = 1;
			if(i >= (n + 1) / 2 + 1){
				comb[i] = comb[(n + 1) - i];
			}else{
				for(int j = 1; j <= i; j++){
					comb[i] *= (long)(n + 1 - j + 1);
					comb[i] /= (long)j;
					comb[i] = comb[i] % 1000000007;
				}
			}

			if(i - 1 <= x){
				ans[i] = comb[i] - combX[i - 1];
				if(ans[i] < 0){
					ans[i] += 1000000007;
				}
			}else{
				ans[i] = comb[i];
			}

			System.out.println(ans[i]);		
		}	
	}
}


Compiler output:
Main.java:39: error: incompatible types: long[] cannot be converted to long[][]
		long[] comb[] = new long[n + 2];
		                ^
Main.java:40: error: incompatible types: int cannot be converted to long[]
		comb[0] = 1;
		          ^
Main.java:55: error: incompatible types: int cannot be converted to long[]
			comb[i] = 1;
			          ^
Main.java:60: error: bad operand types for binary operator '*'
					comb[i] *= (long)(n + 1 - j + 1);
					        ^
  first type:  long[]
  second type: long
Main.java:61: error: bad operand types for binary operator '/'
					comb[i] /= (long)j;
					        ^
  first type:  long[]
  second type: long
Main.java:62: error: bad operand types for binary operator '%'
					comb[i] = comb[i] % 1000000007;
					                  ^
  first type:  long[]
  second type: int
Main.java:67: error: bad operand types for binary operator '-'
				ans[i] = comb[i] - combX[i - 1];
				                 ^
  first type:  long[]
  second type: long
Main.java:72: error: incompatible types: long[] cannot be converted to long
				ans[i] = comb[i];
				             ^
8 errors
Language: C

#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MOD 1000000007
#define ll long long

long long expo(long long x, long long n){
    long long res = 1;

    while (n){
        if (n & 1LL) res = (res * x) % MOD;
        x = (x * x) % MOD;
        n >>= 1LL;
    }

    return (res % MOD);
}

long long lol(int n, int k){
    long long x = fact[n];
    long long y = (fact[k] * fact[n - k]) % MOD;
    long long res = (x * expo(y, MOD - 2)) % MOD;
    return res;
}

int main(int argc, char **argv){
    ll fact[100006];
    ll n;
    scanf("%lld",&n);
    ll a[n+2],i,j;
    for (i = 1, fact[0] = 1; i < 100006; i++) fact[i] = (fact[i - 1] * i) % MOD;
    for(i=1;i<=n+1;i++) scanf("%lld",&a[i]);
    n++;
    //a[1] to a[n]

    int hash[100006]={0};
    for(i=1;i<=n;i++) hash[a[i]]++;
    for(i=1;i<=n;i++) if(hash[i]==2) break;
    //i repeated twice
    ll occur[3],uwu=0;
    for(j=1;j<=n;j++){
        if(a[j]==i){
            occur[uwu]=j;
            uwu++;
        }
    }
    ll left=occur[0]-1;
    ll right=n-occur[1];
    ll k,diff;
    printf("%lld ",n-1);
    for(k=2;k<=n;k++){
        diff=lol(n,k);
        if(k<=left+right+1) {
            ll z=0;
            if(k-1-right>z) z=k-1-right;
            for(;z<=left;z++) {
                diff=(diff-(lol(left,z)*lol(right,k-1-z)))%MOD;
            }
            while(diff<0) diff+=MOD;
        } else {
            diff=lol(n,k);
        }
        printf("%lld ",diff);
    }
    printf("\n");
    return 0;
}


Compiler output:
main.c: In function 'lol':
main.c:22:19: error: 'fact' undeclared (first use in this function)
   22 |     long long x = fact[n];
      |                   ^~~~
main.c:22:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

//#pragma GCC optimize "O3"

#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

using namespace std;
#define LL 1000000007

void calc(vector<vector<long long int> > &v) {
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int k = 1; k < v.size(); k++) {
    for (int j = 1; j < k; j++) {
      v[k][j] = (v[k - 1][j - 1] + v[k - 1][j]);
    }
  }
}

long long comb(int n, int k) {
  vector<vector<long long int> > v(n + 1, vector<long long int>(n + 1, 0));
  calc(v);
  return v[n][k];
}

int main() {
  int n;
  cin >> n;
  set<int> st;

  int a[n + 1];
  int dupl = -1;

  for (int i = 0; i < n + 1; i++) {
    int tmp = st.size();
    cin >> a[i];
    st.insert(a[i]);
    if (tmp == st.size()) {
      dupl = a[i];
    }
  }

  int a1, a2;
  a1 = a2 = 0;
  int cnt = 0;
  for (int i = 0; i < n + 1; i++) {
    if (a[i] == dupl) {
      cnt++;
      cnt == 1 ? a1 = i : a2 = i;
    }
  }

  int diff = a2 - a1;
  // cerr << a1 << "\n" << a2 << "\n" << diff << endl;

  for (int i = 0; i < n + 1; i++) {
    //cerr << n + 1 << "C" << i + 1 << " : ";
    cout << (comb(n + 1, i + 1)  % LL << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:39: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   63 |     cout << (comb(n + 1, i + 1)  % LL << endl;
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:63:46: error: expected ')' before ';' token
   63 |     cout << (comb(n + 1, i + 1)  % LL << endl;
      |             ~                                ^
      |                                              )
Language: Java

import com.sun.xml.internal.fastinfoset.util.CharArray;

import java.util.*;

/**
 * Created by DELL on 2017/7/1.
 */

public class Main {
    static long fac(int x,int num){
        long a=1;
        for (int i = 0; i <num ; i++) {
            a*=x-i;
            a/=(i+1);
            if(a>1e9+7)
                a-=1e9+7;
        }
        return a;
    }
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int dup=0;
        List<Integer>list=new ArrayList<>();
        List<Integer>list1=new ArrayList<>();
        for (int i = 0; i <n+1 ; i++) {
            int x=in.nextInt();
            list.add(x);
            if(list.contains(x))dup=list.indexOf(x);
        }
        for (int i = 1; i <n+2; i++) {
            System.out.println(fac(n+1,i)-fac(n-dup,i-2)<0?fac(n+1,i)-fac(n-dup,i-2)+1e9+7:fac(n+1,i)-fac(n-dup,i-2));
        }
    }
}


Compiler output:
Main.java:1: error: package com.sun.xml.internal.fastinfoset.util does not exist
import com.sun.xml.internal.fastinfoset.util.CharArray;
                                            ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int count1[100001]={0};
 
// Utility function to split the string using a delim. Refer -
// http://stackoverflow.com/questions/236129/split-a-string-in-c
vector<string> split(const string &s, char delim)
{
    vector<string> elems;
    stringstream ss(s);
    string item;
    while (getline(ss, item, delim))
        elems.push_back(item);
 
    return elems;
}

// Function to find all subsets of given set. Any repeated
// subset is considered only once in the output
int printPowerSet(int arr[], int n)
{
    vector<string> list;
 
    /* Run counter i from 000..0 to 111..1*/
    for (int i = 0; i < (int) pow(2, n); i++)
    {
        string subset = "";
 
        // consider each element in the set
        for (int j = 0; j < n; j++)
        {
            // Check if jth bit in the i is set. If the bit
            // is set, we consider jth element from set
            if ((i & (1 << j)) != 0)
                subset += to_string(arr[j]) + "|";
        }
 
        // if subset is encountered for the first time
        // If we use set<string>, we can directly insert
        if (find(list.begin(), list.end(), subset) == list.end())
            list.push_back(subset);
    }
 
    // consider every subset
    for (string subset : list)
    {
        // split the subset and print its elements
        vector<string> arr = split(subset, '|');
		count1[arr.size()]++;
		//cout<<arr.size()<<endl;
		//cout << endl;
    }
}
 
// Driver code
int main()
{
    int n;
    cin>>n;
    int arr[n];
    int i;
	for(i=0;i<n;i++)
    	cin>>arr[i];
    printPowerSet(arr, n);
 	for(i=1;i<=n;i++)
 		cout<<count1[i]%mod<<endl;
 	
   // return 0;
}

Compiler output:
a.cc: In function 'int printPowerSet(int*, int)':
a.cc:53:1: warning: no return statement in function returning non-void [-Wreturn-type]
   53 | }
      | ^
a.cc: In function 'int main()':
a.cc:66:33: error: 'mod' was not declared in this scope; did you mean 'modf'?
   66 |                 cout<<count1[i]%mod<<endl;
      |                                 ^~~
      |                                 modf
Language: C++

#include <bits/stdc++.h>
using namespace std;
int count1[100001]={0};
 
// Utility function to split the string using a delim. Refer -
// http://stackoverflow.com/questions/236129/split-a-string-in-c
vector<string> split(const string &s, char delim)
{
    vector<string> elems;
    stringstream ss(s);
    string item;
    while (getline(ss, item, delim))
        elems.push_back(item);
 
    return elems;
}

// Function to find all subsets of given set. Any repeated
// subset is considered only once in the output
int printPowerSet(int arr[], int n)
{
    vector<string> list;
 
    /* Run counter i from 000..0 to 111..1*/
    for (int i = 0; i < (int) pow(2, n); i++)
    {
        string subset = "";
 
        // consider each element in the set
        for (int j = 0; j < n; j++)
        {
            // Check if jth bit in the i is set. If the bit
            // is set, we consider jth element from set
            if ((i & (1 << j)) != 0)
                subset += to_string(arr[j]) + "|";
        }
 
        // if subset is encountered for the first time
        // If we use set<string>, we can directly insert
        if (find(list.begin(), list.end(), subset) == list.end())
            list.push_back(subset);
    }
 
    // consider every subset
    for (string subset : list)
    {
        // split the subset and print its elements
        vector<string> arr = split(subset, '|');
		count1[arr.size()]++;
		//cout<<arr.size()<<endl;
		//cout << endl;
    }
}
 
// Driver code
int main()
{
    int n;
    cin>>n;
    int arr[n];
    for(i=0;i<n;i++)
    	cin>>arr[i];
    printPowerSet(arr, n);
 	for(i=1;i<=n;i++)
 		cout<<count1[i]<<endl;
 	
   // return 0;
}

Compiler output:
a.cc: In function 'int printPowerSet(int*, int)':
a.cc:53:1: warning: no return statement in function returning non-void [-Wreturn-type]
   53 | }
      | ^
a.cc: In function 'int main()':
a.cc:61:9: error: 'i' was not declared in this scope
   61 |     for(i=0;i<n;i++)
      |         ^
a.cc:64:13: error: 'i' was not declared in this scope
   64 |         for(i=1;i<=n;i++)
      |             ^
Language: C++

N = int(input())
A = list(map(int, input().split()))
A.reverse()
B = []
C = []
for i, a in enumerate(A):
    if i%2==0:
        B.append(a)
    else:
        C.append(a)
print(*(B+list(reversed(C))))


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.Collections;

import org.graalvm.compiler.nodes.calc.IntegerDivRemNode;

public class Main{


    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


        ArrayList<Integer> temp =  new ArrayList<Integer>();

        int n = Integer.parseInt(br.readLine());

        String[] s = br.readLine().split(" ");

        for(int i = 0; i < s.length; ++i)
        {
            if(i%2 == 0)
            {
                temp.add(Integer.parseInt(s[i]));
            }
            else
            {
                temp.add(0, Integer.parseInt(s[i]));
            }
        }
        
        if(n%2 == 1)
        {
            Collections.reverse(temp);
        }
        
        String res = "";

        for(int i = 0; i < temp.size() - 1; ++i)
        {
            res += temp.get(i) + " ";
        }
        res += temp.get(temp.size()-1);
        System.out.println(res);
    }
}

Compiler output:
Main.java:5: error: package org.graalvm.compiler.nodes.calc does not exist
import org.graalvm.compiler.nodes.calc.IntegerDivRemNode;
                                      ^
1 error
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define pi 3.14159265358979323846264338327950L
using namespace std;

int main() {
  int64_t n;
  cin >> n;
  vector<int64_t> a(n);
  for (int64_t i=0; i<n; i++) {
    cin >> a[i];
  }
  

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

#inlcude<bits/stdc++.h>
using namespace std;
int main(){
long long int n;
  cin>>n;
  long long int a[n+1];
  for(long long int i=1;i<=n;i++)cin>>a[i];
    if(n%2){
      for(long long int j=n;j>=1;j=j-2)cout<<a[j]<<" ";
      for(long long int j=2;j<=n-1;j=j+2)cout<<a[j]<<" ";
    }
  else{
    for(long long int j=n;j>=2;j=j-2)cout<<a[j]<<" ";
    for(long long int j=1;j<=n-1;j=j+2)cout<<a[j]<<" ";
  }
  cout<<"\n";
}
      

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlcude<bits/stdc++.h>
a.cc:9:40: error: 'cout' was not declared in this scope
    9 |       for(long long int j=n;j>=1;j=j-2)cout<<a[j]<<" ";
      |                                        ^~~~
a.cc:9:40: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:42: error: 'cout' was not declared in this scope
   10 |       for(long long int j=2;j<=n-1;j=j+2)cout<<a[j]<<" ";
      |                                          ^~~~
a.cc:10:42: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:38: error: 'cout' was not declared in this scope
   13 |     for(long long int j=n;j>=2;j=j-2)cout<<a[j]<<" ";
      |                                      ^~~~
a.cc:13:38: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:40: error: 'cout' was not declared in this scope
   14 |     for(long long int j=1;j<=n-1;j=j+2)cout<<a[j]<<" ";
      |                                        ^~~~
a.cc:14:40: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout<<"\n";
      |   ^~~~
a.cc:16:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main() {
ll n;
cin>>n;
ll a[n]={};
ll b[n]={};
deque<ll> d;
ll aa;
for(ll i=0; i<n; i++){
cin>>a[i];}
ll counter=1000000;
for(ll i=0; i<n; i++){
if(i%2==0){
d.push_back(a[i]);}
else
d.push_front(a[i]);}
while(!=d.empty()){
aa=d.front();
d.pop_front();
cout<<aa<<" ";}}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: expected primary-expression before '!=' token
   21 | while(!=d.empty()){
      |       ^~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll n;
  cin>>n;
  vll a(n);
  ll X=0;
  rep(i,n) cin>>a[i];
  vll b(0);
  if(n%2==0){
    ll k=n-2;
    while(k>=0){
      b.pb(a[k]);
      k-=2;
    }
    for(int i=1;i<n;i+=2){
      b.pb(a[i]);
    }
  }
  else{
    ll k=n-2;
    while(k>=1){
      b.pb(a[k]);
      k-=2;
    }
    for(int i=0;i<n;i+=2){
      b.pb(a[i]);
    }
  }
  rep(i,n) COUT(a[i]<<" ");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:21: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'const char [2]' to binary 'operator<<'
   60 |   rep(i,n) COUT(a[i]<<" ");
a.cc:16:24: note: in definition of macro 'COUT'
   16 | #define COUT(x) cout<<(x)<<endl
      |                        ^
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt();
    int a[]=new int[n];
    StringBuilder ans = new StringBuilder();
    String
    
    for(int i=0;i<n;i++){
      a[i] = sc.nextInt();
    }
    for(int j = n-1;j<0;j--){
      ans.append(a[j]);
      j--;
    }
    for(int k = n-2;k<0;k++){
      ans.append(a[k]);
      k++;
    }
    System.out.println(new String(ans));
  }
}

Compiler output:
Main.java:9: error: not a statement
    String
    ^
Main.java:9: error: ';' expected
    String
          ^
2 errors
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt();
    int a[]=new int[n];
    StringBuilder ans = new StringBuilder();
    String
    
    for(int i=0;i<n;i++){
      a[i] = sc.nextInt();
    }
    for(int j = n-1;j<0;j--){
      ans.append(a[j]);
      j--;
    }
    for(int k = n-2;k<0;k--){
      ans.append(a[k]);
      k--;
    }
    System.out.println(new String(ans));
  }
}

Compiler output:
Main.java:9: error: not a statement
    String
    ^
Main.java:9: error: ';' expected
    String
          ^
2 errors
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt();
    int a[]=new int[n];
    
    for(int i=0;i<n;i++){
      a[i] = sc.nextInt();
    }
    for(int j = n-1;j<0;2*j--){
      System.out.print(a[j]);
    }
    for(int k = n-2;k<0;2*k--){
      System.out.print(a[k]);
    }
  }
}

Compiler output:
Main.java:12: error: not a statement
    for(int j = n-1;j<0;2*j--){
                         ^
Main.java:15: error: not a statement
    for(int k = n-2;k<0;2*k--){
                         ^
2 errors
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt();
    List<Integer> a = new ArrayList<Integer>();
    
    for(int i=0;i<n;i++){
      if(n % 2 == 0){
        if(i % 2 == 0){
         a.add(0,sc.nextInt()); 
        }else{
          a.add(sc.nextInt()); 
        }
      }else{
        if(i % 2 != 0){
          a.add(0,sc.nextInt()); 
        }else{
          a.add(sc.nextInt()); 
        }
      }

    }
    System.out.println(String.join("",a));
  }
}

Compiler output:
Main.java:25: error: no suitable method found for join(String,List<Integer>)
    System.out.println(String.join("",a));
                             ^
    method String.join(CharSequence,CharSequence...) is not applicable
      (varargs mismatch; List<Integer> cannot be converted to CharSequence)
    method String.join(CharSequence,Iterable<? extends CharSequence>) is not applicable
      (argument mismatch; List<Integer> cannot be converted to Iterable<? extends CharSequence>)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt();
    List<String> a = new ArrayList<String>();
    
    for(int i=0;i<n;i++){
      if(n % 2 == 0){
        if(i % 2 == 0){
         a.add(0,sc.next()); 
        }else{
          a.add(sc.next()); 
        }
      }else{
        if(i % 2 != 0){
          a.add(0,sc.next()); 
        }else{
          a.add(sc.next()); 
        }
      }

    }
    System.out.println(String.join('',a));
  }
}

Compiler output:
Main.java:25: error: empty character literal
    System.out.println(String.join('',a));
                                   ^
Main.java:25: error: not a statement
    System.out.println(String.join('',a));
                                      ^
Main.java:25: error: ';' expected
    System.out.println(String.join('',a));
                                       ^
3 errors
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt();
    List<Integer> a = new ArrayList<Integer>();
    
    for(int i=0;i<n;i++){
      if(n % 2 == 0){
        if(i % 2 == 0){
         a.add(0,sc.nextInt()); 
        }else{
          a.add(sc.nextInt()); 
        }
      }else{
        if(i % 2 != 0){
          a.add(0,sc.nextInt()); 
        }else{
          a.add(sc.nextInt()); 
        }
      }

    }
    System.out.println(String.join('',a));
  }
}

Compiler output:
Main.java:25: error: empty character literal
    System.out.println(String.join('',a));
                                   ^
Main.java:25: error: not a statement
    System.out.println(String.join('',a));
                                      ^
Main.java:25: error: ';' expected
    System.out.println(String.join('',a));
                                       ^
3 errors
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt();
    List<Integer> a = new ArrayList<Integer>();
    
    for(int i=0;i<n;i++){
      if(n % 2 == 0){
        if(i % 2 == 0){
         a.add(0,sc.nextInt()); 
        }else{
          a.add(sc.nextInt()); 
        }
      }else{
        if(i % 2 != 0){
          a.add(0,sc.nextInt()); 
        }else{
          a.add(sc.nextInt()); 
        }
      }

    }
    System.out.println(String.join(a));
  }
}

Compiler output:
Main.java:25: error: incompatible types: List<Integer> cannot be converted to CharSequence
    System.out.println(String.join(a));
                                   ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt();
    int a[]=new a[n];
    int b[]=new b[n];
    
    for(int i=0;i<n;i++){
      a[i] = sc.nextInt();
      for(int j=0;j<=i;j++){
        b[i-j] = a[j];
      }
    }
    String ans = Arrays.toString(b);
    System.out.println(ans);
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    int a[]=new a[n];
                ^
  symbol:   class a
  location: class Main
Main.java:8: error: cannot find symbol
    int b[]=new b[n];
                ^
  symbol:   class b
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <bits/stdc++.h>

using namespace std;


long long int a,b,c[200010],d[100010],ans =1,ant=1;

int main(){
  cin >> a ;
  
  for(int i=0;i<a;i++)
    cin >> c[i];
  
    
  for(int i=1;i<=a;i++){
    
    reverse(c,c+i);
  }
  for(int i=0;i<a;i++)
  cout << c[i] << " " <<;
  
  cout << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: expected primary-expression before ';' token
   23 |   cout << c[i] << " " <<;
      |                         ^
Language: Java

import java.util.*;
import java.lang.*;
public class Main{
	public static void main(String[] args){
		FastScanner sc = new FastScanner(System.in);

		int N = sc.nextInt();
		long[] ans = new long[N+1];
		int b = N/2+1;
		int c = N/2+2;
		int d = N/2;
		if( N%2!=0 ){
			for( int i=1; i<=N; i++ ){
				if( i%2!=0 ){
					ans[b] = sc.nextLong();
					b--;
				}else{
					ans[c] = sc.nextLong();
					c++;
				}
			}
		}
		if( N%2==0 ){
			for( int i=1; i<=N; i++ ){          
				if( i%2!=0 ){
					ans[b] = sc.nextLong();
					b++;
				}else{
					ans[d] = sc.nextLong();
					d--;
				}	
            }              
		}
		String ss = "A";
		for( int i=1; i<=N; i++ ){
			ss = ss + " " + String.valueOf(ans[i]);
		}
		System.out.println(ss.substring(2));
	}
}


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

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
//桁
int kt(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  int a;
  cin>>a;
  vector<int> b(a);
  rep(i,a)
    cin>>b[i];
  queue<int> c;
  stack<int> d;
  rep(i,a){
  if(i%2==0){
  c.push(b[i]);
  }
    else{
    d.push(b[i]);
    }
  }
  while(d.empty()){
  cout<<d.front();
    d.pop();
  }
    while(c.empty()){
  cout<<c.top();
      c.pop();
    }
  
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:11: error: 'class std::stack<long long int>' has no member named 'front'
   69 |   cout<<d.front();
      |           ^~~~~
a.cc:73:11: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'?
   73 |   cout<<c.top();
      |           ^~~
      |           pop
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
//桁
int kt(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  int a;
  cin>>a;
  vector<int> b(a);
  rep(i,a)
    cin>>b[i];
  queue<int> c;
  stack<int> d;
  rep(i,a){
  if(i%2==0){
  c.push(b[i]);
  }
    else{
    d.push(b[i]);
    }
  }
  while(d.empty()){
  cout<<d.top();
    d.pop();
  }
    while(c.empty()){
  cout<<c.top();
      c.pop();
    }
  
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:11: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'?
   73 |   cout<<c.top();
      |           ^~~
      |           pop
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
//桁
int kt(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  int a;
  cin>>a;
  vector<int> b(a);
  rep(i,a)
    cin>>b[i];
  queue<int> c;
  stack<int> d;
  rep(i,a){
  if(i%2==0){
  c.push(b[i]);
  }
    else{
    d.push(b[i]);
    }
  }
  while(d.empty()){
  cout<<d.top();
    d.pop();
  }
    while(c.empty()){
  cout<<c.top();
      c.pop();
    }
  }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:11: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'?
   73 |   cout<<c.top();
      |           ^~~
      |           pop
a.cc: At global scope:
a.cc:78:1: error: expected declaration before '}' token
   78 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=200005;
const int MOD=1e9+7;
int n;
int a[N];
int b[N];
int main()
{

    cin>>n;
   for(int i=1;i<=n;i++)
   {
   	scanf("%d",&a[i]);
   }
   int m=n;
   int j=1;
   for(int i=n;i>=2;i-=2)
   {
   	b[j]=a[i];
   	b[n-j+1]=a[i-1];
   	j++;
   }
   if(i&1)
   {
   	b[j]=a[1];
   }
   
   for(int i=1;i<=n;i++)
   	printf("%d ",b[i]);
   
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:7: error: 'i' was not declared in this scope
   25 |    if(i&1)
      |       ^
Language: C++

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

const int S=(1<<20)+5;
char buf[S],*H,*T;

inline char Get()
{
	if(H==T) T=(H=buf)+fread(buf,1,S,stdin);
	if(H==T) return -1;
	return *H++;
}

inline int read()
{
	int x=0;
	char c=Get();
	while(!isdigit(c)) c=Get();
	while(isdigit(c)) x=x*10+c-'0',c=Get();
	return x;
}

typedef long long LL;

struct Seg
{
	int l,r,extra;
}seg[1000000<<1];

vector<Seg> R[1000000];
int n,m,a[1000000],tot=0;

int main()
{
	int cross=0,p=1;
	LL ans=0x7fffffff,cur=0;
	n=read();
	m=read();
	for(int i=1; i<=n; i++) a[i]=read();
	for(int i=1; i<n; i++)
		if(a[i]<a[i+1])
		{
			seg[++tot]= {a[i],a[i+1],0};
			R[a[i+1]].push_back(seg[tot]);
			cur+=a[i+1]-a[i];
		}
		else
		{
			seg[++tot]= {a[i],m,0};
			R[m].push_back(seg[tot]);
			seg[++tot]= {0,a[i+1],m-a[i]};
			R[a[i+1]].push_back(seg[tot]);
			cur+=a[i+1]+m-a[i];
		}
	sort(seg+1,seg+1+tot,[](Seg a,Seg b)
	{
		return a.l<b.l;
	});
	for(int i=0; i<=m; i++)
	{
		cur-=cross;
		ans=min(ans,cur);
		for(Seg s : R[i])
		{
			cur+=s.extra+i-s.l-1;
			cross--;
		}
		while(p<=tot&&seg[p].l<=i)
		{
			Seg s=seg[p];
			cur-=s.extra+i-s.l-1;
			cross++;
			p++;
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
a.cc:31:1: error: 'vector' does not name a type
   31 | vector<Seg> R[1000000];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:45:25: error: 'R' was not declared in this scope
   45 |                         R[a[i+1]].push_back(seg[tot]);
      |                         ^
a.cc:51:25: error: 'R' was not declared in this scope
   51 |                         R[m].push_back(seg[tot]);
      |                         ^
a.cc:64:29: error: 'R' was not declared in this scope
   64 |                 for(Seg s : R[i])
      |                             ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
  int n;
  int a[200005];
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  vector<int> b;
  for(int i=0;i<n;i++){
    b.push_back(a[i]);
    reverse(b.begin(),b.end());
  }
  for(int i=0;i<n-1;i++){
    cout<<b[i]<<" ";
  }
  cout<<b[n-1]<<"\n";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'reverse' was not declared in this scope
   15 |     reverse(b.begin(),b.end());
      |     ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,a[200000],ans[200000];
    cin>>n;
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=n-1;i>=0;i--){
        if((n-i)%2)ans[(n-i)/2)]=a[i];
        else ans[n-((n-i)/2)]=a[i];
    }
    for(int i=0;i<n;i++){
        if(i!=n-1)cout<<ans[i]<<" ";
        else cout<<ans[i]<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: expected ']' before ')' token
    8 |         if((n-i)%2)ans[(n-i)/2)]=a[i];
      |                               ^
      |                               ]
a.cc:8:31: error: expected ';' before ')' token
    8 |         if((n-i)%2)ans[(n-i)/2)]=a[i];
      |                               ^
      |                               ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,a[200000],ans[200000];
    cin>>n;
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=n-1;i>=0;i++){
        if((n-i)%2)ans[(n-i)/2)]=a[i];
        else ans[n-((n-i)/2)]=a[i];
    }
    for(int i=0;i<n;i++){
        if(i!=n-1)cout<<ans[i]<<" ";
        else cout<<ans[i]<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: expected ']' before ')' token
    8 |         if((n-i)%2)ans[(n-i)/2)]=a[i];
      |                               ^
      |                               ]
a.cc:8:31: error: expected ';' before ')' token
    8 |         if((n-i)%2)ans[(n-i)/2)]=a[i];
      |                               ^
      |                               ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int maxn=1e5+7;
int a[maxn];
int b[maxn<<1];
int c[maxn<<1];
int main() {
//    freopen("in.txt","r",stdin);
    int n,m;
    long long sum=0;
    scanf("%d%d",&n,&m);
    for(int i=1; i<=n; ++i)
        scanf("%d",&a[i]);
    for(int i=2; i<=n; ++i) {
        if(a[i]>a[i-1]) {
            sum+=a[i]-a[i-1];
            b[a[i-1]+1]+=a[i-1]+1;
            b[a[i]+1]-=a[i-1]+1;
            c[a[i-1]+1]++;
            c[a[i]+1]--;
        } else {
            sum += m-a[i-1]+a[i];
            b[a[i-1]+1] += a[i-1]+1;
            b[a[i]+1] += m-a[i-1]-1;
            b[1] -= m-a[i-1]-1;
            c[1]++;
            c[a[i-1]+1]++;
            c[a[i]+1]--;
        }
    }
    for(int i=1; i<=m; ++i) {
        c[i]+=c[i-1];
        b[i]+=b[i-1];
    }
    long long  ma=0;
    for(int x=1; x<=m; ++x) {
        if(c[x]) {
            ma=max(ma,1LL(x*c[x]-b[x]));
        }
    }
    printf("%lld\n",sum-ma);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:26: error: expression cannot be used as a function
   38 |             ma=max(ma,1LL(x*c[x]-b[x]));
      |                       ~~~^~~~~~~~~~~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
const int maxn = 2e5+7;
int a[maxn],ans[maxn];
int n;
int main()
{
   scanf("%d",&n);
   for(int i=1;i<=n;i++){
    scanf("%d",&a[i]);
   }
   int l=1,r=n,k=n,cnt=1;
   for(int i=n;i>=1;i--){
        if(cnt&1)
            ans[l++]=a[k--];
        else
            ans[r--]=a[k--];
        cnt++;
   }
   for(int i=1;i<=n-1;i++)
    printf("%d ",ans[i]);
   printf("%d\n",ans[n]);
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

using namespace std;

int b[1000000001];

int main() {
    int i, a, n;
    cin >> n;
    int mid = (n - 1) / 2;
    for(i=0; i<n; i++) {
        cin >> a;
        //if(i % 2 == 0) b[mid-(i+1)/2] = a;
        else           b[mid+(i+1)/2] = a;
    }

    if(n % 2 == 0) for(i=n-1; i>=0; i--) {
        printf("%d ", b[i]);
    }
    else for(i=0; i<n; i++) {
        printf("%d ", b[i]);
    }

    puts("");

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'else' without a previous 'if'
   14 |         else           b[mid+(i+1)/2] = a;
      |         ^~~~
Language: Java

import java.util.*;

class Main{       
   public static void main(String[] args){
 
      Scanner sc = new Scanner(System.in);                                            
  
      Deque<Integer> q = new ArrayDeque<Integer>();
      
      int n = sc.nextInt();
      
      int a[] = new int[n];
      for(int i = 0;i < n;i++){
          a[i] = sc.nextInt();
      }
      
      if(n%2 == 0){
          for(int i = 0;i < n;i++){
             if(a[i]%2 == 1){
                 q.addLast(a[i]);
             }else{
                 q.addFirst(a[i]);
             }
          }          
      }else{
          for(int i = 0;i < n;i++){
              if(a[i]%2 == 1){
                  q.addFirst(a[i]);
              }else{
                  q.addLast(a[i]);
              }
          }
      }
      
      while(!q.isEmpty()){
          System.out.print(q.poll());
          System.out.print(" ");
      }
     
      System.out.println();
      
   }
}

Compiler output:
Main.java:5: error: illegal character: '\u00a0'
?
^
1 error
Language: Java

improt java.util.*;

class Main{       
   public static void main(String[] args){
 
      Scanner sc = new Scanner(System.in);                                            
  
      Deque<Integer> q = new ArrayDeque<Integer>();
      
      int n = sc.nextInt();
      
      int a[] = new int[n];
      for(int i = 0;i < n;i++){
          a[i] = sc.nextInt();
      }
      
      if(n%2 == 0){
          for(int i = 0;i < n;i++){
             if(a[i]%2 == 1){
                 q.addLast(a[i]);
             }else{
                 q.addFirst(a[i]);
             }
          }          
      }else{
          for(int i = 0;i < n;i++){
              if(a[i]%2 == 1){
                  q.addFirst(a[i]);
              }else{
                  q.addLast(a[i]);
              }
          }
      }
      
      while(!q.isEmpty()){
          System.out.print(q.poll());
          System.out.print(" ");
      }
     
      System.out.println();
      
   }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
improt java.util.*;
^
Main.java:5: error: illegal character: '\u00a0'
?
^
2 errors
Language: Java

class Main{       
   public static void main(String[] args){
 
      Scanner sc = new Scanner(System.in);                                            
  
      Deque<Integer> q = new ArrayDeque<Integer>();
      
      int n = sc.nextInt();
      
      int a[] = new int[n];
      for(int i = 0;i < n;i++){
          a[i] = sc.nextInt();
      }
      
      if(n%2 == 0){
          for(int i = 0;i < n;i++){
             if(a[i]%2 == 1){
                 q.addLast(a[i]);
             }else{
                 q.addFirst(a[i]);
             }
          }          
      }else{
          for(int i = 0;i < n;i++){
              if(a[i]%2 == 1){
                  q.addFirst(a[i]);
              }else{
                  q.addLast(a[i]);
              }
          }
      }
      
      while(!q.isEmpty()){
          System.out.print(q.poll());
          System.out.print(" ");
      }
     
      System.out.println();
      
   }
}

Compiler output:
Main.java:3: error: illegal character: '\u00a0'
?
^
1 error
Language: C++

//#include "IntMod.h"
//typedef IntMod<1000000007> MInt;

//#include "Union_Find.h"

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <array>
#include <bitset>

using namespace std;
#define REP(i,a,n) for(int i = (a); i < (int)(n); ++i)
#define REPM(i,n,a) for(int i = ((n) - 1); i >= (a); --i)
#define EPS 0.0001
#define INF 0x3FFFFFFF
#define INFLL 0x3FFFFFFF3FFFFFFF
#define INFD 1.0e+308
#define FLOAT setprecision(16)
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<LL, LL> PP;

template <class T, class U>
istream& operator>>(istream& ist, pair<T, U>& right) { return ist >> right.first >> right.second; }
template <class T, class U>
ostream& operator<<(ostream& ost, pair<T, U>& right) { return ost << right.first << ' ' << right.second; }
template <class T, class TCompatible, size_t N>
void Fill(T(&dest)[N], const TCompatible& val) { fill(begin(dest), end(dest), val); }
template <class T, class TCompatible, size_t M, size_t N>
void Fill(T(&dest)[M][N], const TCompatible& val) { for (int i = 0; i < M; ++i) Fill(dest[i], val); }

#if 1
#include <unordered_set>
#include <unordered_map>
template<class T>
using PriorityQ = priority_queue<T, vector<T>, greater<T> >;	// コスト小を優先
#endif


int N;
list<int> L;
int main() {
	cin >> N;
	REP(i, 0, N) {
		int a;
		cin >> a;
		if ((N - i) % 2 == 0) {
			L.push_back(a);
		} else {
			L.push_front(a);
		}
	}
	for (auto it = L.begin(); it != L.end(); ++it) {
		cout << *it << (it != prev(L.end()) ? ' ' : '\n');
	}
	return 0;
}

Compiler output:
a.cc:56:1: error: 'list' does not name a type
   56 | list<int> L;
      | ^~~~
a.cc: In function 'int main()':
a.cc:63:25: error: 'L' was not declared in this scope
   63 |                         L.push_back(a);
      |                         ^
a.cc:65:25: error: 'L' was not declared in this scope
   65 |                         L.push_front(a);
      |                         ^
a.cc:68:24: error: 'L' was not declared in this scope
   68 |         for (auto it = L.begin(); it != L.end(); ++it) {
      |                        ^