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

include<bits/stdc++.h>

using namespace std;

int main(){
        vector <int> a;
        vector <int> b;
        int N;
        cin>>N;
        for(int i=0;i<N;i++){
                int aa;
                cin>>aa;
                a.push_back(aa);
        }
        for(int i=0;i<N;i++){
                b.push_back(a[i]);
                reverse(b.begin(), b.end());
        }
        for(int i=0;i<N;i++){
                cout<<b[i];
                if(i!=N-1)cout<<" ";
                else cout<<endl;
        }
        return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'vector' was not declared in this scope
    6 |         vector <int> a;
      |         ^~~~~~
a.cc:6:17: error: expected primary-expression before 'int'
    6 |         vector <int> a;
      |                 ^~~
a.cc:7:17: error: expected primary-expression before 'int'
    7 |         vector <int> b;
      |                 ^~~
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin>>N;
      |         ^~~
a.cc:13:17: error: 'a' was not declared in this scope; did you mean 'aa'?
   13 |                 a.push_back(aa);
      |                 ^
      |                 aa
a.cc:16:17: error: 'b' was not declared in this scope
   16 |                 b.push_back(a[i]);
      |                 ^
a.cc:16:29: error: 'a' was not declared in this scope
   16 |                 b.push_back(a[i]);
      |                             ^
a.cc:17:17: error: 'reverse' was not declared in this scope
   17 |                 reverse(b.begin(), b.end());
      |                 ^~~~~~~
a.cc:20:17: error: 'cout' was not declared in this scope
   20 |                 cout<<b[i];
      |                 ^~~~
a.cc:20:23: error: 'b' was not declared in this scope
   20 |                 cout<<b[i];
      |                       ^
a.cc:22:28: error: 'endl' was not declared in this scope
   22 |                 else cout<<endl;
      |                            ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> vec(n);
for(int i=0;i<n;i++)
{
cin>>vec[i];
reverse(vec.begin(),vec.end());
}
for(int i=0;i<n;i++)
cout<<vec[i]<<" ";
return 0;
}

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

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

using namespace std;
int main() {
	int n;
	cin >> n;
	vector<int> b;
	int btmp;
	for (int i = 0; i < n; i++) {
		cin >> btmp;
		b.push_back(btmp);
		reverse(b.begin(), b.end());
	}
	auto itr = b.begin();
	while (itr != b.end()) {
		string s = (itr + 1 == b.end()) ? "" : " ";
		cout << *itr << s;
		itr++;
	}
	return 0;
}

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

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class ContestMain {

    public static void main( String... args ) throws Exception {

        BufferedReader in = new BufferedReader( new InputStreamReader( System.in ) );
        String input = in.readLine();

        List<String> inputList = new ArrayList<>();
        List<String> outputList = new ArrayList<>();

        while ( input != null ) {
            inputList.add( input );
            input = in.readLine();
        }

        int number = Integer.parseInt( inputList.get( 0 ) );

        for ( String a : inputList.get( 1 ).split( " " ) ) {
            if ( outputList.size() < number ) {
                outputList.add( a );
                outputList = reverse( outputList );
            }
        }

        System.out.println( String.join( " ", outputList ) );

    }

    /**
     * @param inputList
     * @return
     */
    private static List<String> reverse( List<String> inputList ) {
        List<String> outputList = new ArrayList<>();

        for ( int i = inputList.size(); i > 0; i-- ) {
            outputList.add( inputList.get( i - 1 ) );
        }
        return outputList;

    }
}


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

#include <stdio.h>
#include <stdint.h>

uint32_t a[200000];
uint32_t e[200000];

int main(int argc, char **argv)
{
  int n;

  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d ", &a[i]);
  }

  const int c = 200000 / 2;
  int f;
  if (n % 2) { // odd
    for (int i = 0; i < n; i++) {
      int j = ((i + 1) % 2) ? -1 : 1;
      e[c + (i + 1) / 2 * j] = a[i];
    }
    f = c - n / 2;
  }
  else { // even
    for (int i = 0; i < n; i++) {
      int j = (i % 2) ? -1 : 1;
      e[c + (i + 1) / 2 * j] = a[i];
    }
    f = c - n / 2;
  }

  for (int i = 0; i < n - 1; i++) {
    printf("%d ", e[f + i]);
  }
  printf("%d\n", e[f + n - 1]);

  return 0;

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:38:12: error: expected '}' at end of input
   38 |   return 0;
      |            ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 回数
		int N = sc.nextInt();
		//元になる数列を格納
		ArrayList list = new ArrayList();
		ArrayList b = new ArrayList();
	
		while (sc.hasNextLine()) {
		  list.add(Integer.parseInt(sc.next()) + " ");
		    
		}
	
		//メイン処理
		for(int i = 0; i < N; i++){
		    //新しい配列に要素を格納
		    if(i % 2 == N % 2){
		        b.add(list.get(i));
		        
		    }else{
		        b.add(0,list.get(i));
		    }
		}

		//回答用出力
		for(int j = 0; j < b.size(); j++){
		    /*
		    if(j == (b.size()-1)){
		        System.out.print(b.get(j));
		    }else{
		        System.out.print(b.get(j)+" ");
		    }
		    */
		    System.out.print(b.get(j));
		}
	    return 0;
	}
}

Compiler output:
Main.java:38: error: incompatible types: unexpected return value
	    return 0;
	           ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include <iostream.h>
using namespace std;

void SortIn(int *b,int a,int i)
{
	int *tmp;
	tmp = (int *)malloc(sizeof(int)*(i+1));
	b[i]=a;
	for(int j=0; j<=i; j++)
	{
		tmp[j]=b[j];
	}
	for(int j=i; j>=0; j--)
	{
		b[i-j]=tmp[j];
	}
	free(tmp);
}

int main()
{
	int n;
	cin>>n;
	int a;
	int* b;
	
	b=(int *)malloc(sizeof(int)*n);

	for(int i=0; i<n; i++)
	{
		cin>>a;
		SortIn(b, a, i);
	}

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

	free(b);

	return 0;
}

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

#include <iostream>
#include <deque>

using namespace std;

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

    deque<int> d;
    bool isReversed = false;

    for (int i = 0; i < n; i++) {
        int value;
        cin >> value;

        if (isReversed) {
            d.push_front(value);
        } else {
            d.push_back(value);
        }

        isReversed = !isReversed;
    }

    if (isReversed) {
        reverse(d.begin(), d.end());
    }

    for (auto& i : d) {
        cout << i << " ";
    }

    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'reverse' was not declared in this scope; did you mean 'isReversed'?
   27 |         reverse(d.begin(), d.end());
      |         ^~~~~~~
      |         isReversed
Language: C++

#include <iostream>
#include <deque>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    bool flag = true;
    int n;
    cin >> n;
    vector<int> nums(n), res;
    deque<int> que;
    for (int i = 0; i < n; i++) cin >> nums[i];
    for (int i = 0; i < n; i++) {
	if (flag) que.push_back(nums[i]);
	else que.push_front(nums[i]);
	flag = !flag;
    }
    for (int x : que) res.push_back(x);
    if (n % 2 == 1) reserve(res.begin(), res.end());
    for (int x : res) cout << x << " ";
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: 'reserve' was not declared in this scope
   21 |     if (n % 2 == 1) reserve(res.begin(), res.end());
      |                     ^~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>

#define N 200000

int main(void){
	int a[N];
	int i, n;

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


	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:31: error: 'b' undeclared (first use in this function)
   16 |                 printf("%d ", b[i]);
      |                               ^
main.c:16:31: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;

class AtCoder {

    
    public static void main(String[] args) 
    {
        Scanner s = new Scanner(System.in);
        Queue<Long> queue = new LinkedList();
        Stack<Long> stack = new Stack();
        long n,in;
        n=s.nextLong();
        
        for (long i=0;i<n;i++)
        {
            if((n-(i+1))%2==0)
            {
                in = s.nextLong();
                stack.push(in);
            }
            else
            {
                in=s.nextLong();
                queue.add(in);
            }
        }
        System.out.println();
        while(!stack.empty())
        {
            long t = stack.pop();
            System.out.print(t);
        }
        while(!queue.isEmpty())
        {
            long t = queue.remove();
            System.out.print(t);
        }
        
        
        
    }
    
}


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

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;

public class AtCoder {

    
    public static void main(String[] args) 
    {
        Scanner s = new Scanner(System.in);
        Queue<Long> queue = new LinkedList();
        Stack<Long> stack = new Stack();
        long n,in;
        n=s.nextLong();
        
        for (long i=0;i<n;i++)
        {
            if((n-(i+1))%2==0)
            {
                in = s.nextLong();
                stack.push(in);
            }
            else
            {
                in=s.nextLong();
                queue.add(in);
            }
        }
        System.out.println();
        while(!stack.empty())
        {
            long t = stack.pop();
            System.out.print(t);
        }
        while(!queue.isEmpty())
        {
            long t = queue.remove();
            System.out.print(t);
        }
        
        
        
    }
    
}


Compiler output:
Main.java:6: error: class AtCoder is public, should be declared in a file named AtCoder.java
public class AtCoder {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

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

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve(args);
    }

    public void solve(String[] args) {
        MyScanner scanner = new MyScanner();
        int N = scanner.nextInt();
        StringBuilder sb = new StringBuilder();
        boolean end = true;
        for (int i = 0; i < N; i++) {
            int a = scanner.nextInt();
            if (end) {
                sb.append(a);
                sb.append(" ");
            } else {
                sb.insert(0, " ");
                sb.insert(0, a);
            }
            end = !end;
        }

        if (!end) {
            sb.reverse();
        }

        System.out.println(sb.toString().trim());
    }

    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";

        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {
            try {
                if (i < s.length) return s[i++];
                String line = br.readLine();
                while (line.equals("")) {
                    line = br.readLine();
                }
                s = line.split(reg, 0);
                i = 0;
                return s[i++];
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public int nextInt() {
            try {
                return Integer.parseInt(next());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return -1;
        }

        public double nextDouble() {
            try {
                return Double.parseDouble(next());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return -1;
        }

        public long nextLong()  {
            try {
                return Long.parseLong(next());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return -1;
        }
    }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import static java.lang.Math.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C++

n = int(input())
a = list(map(int, input().split()))
occur = [0 for i in range(n + 1)]
MOD = 1000000007
for i in range(n + 1):
    if occur[a[i]] > 0: val = n - 1 - i + occur[a[i]]
    else: occur[a[i]] = i + 1
inv = [0 if i > 2 else 1 for i in range(n + 2)]
pinv = [0 if i > 2 else 1 for i in range(n + 2)]
perm = [0 if i > 2 else 1 for i in range(n + 2)]
for i in range(2, n + 2):
    inv[i] = -int(MOD / i) * inv[MOD % i] + MOD
    pinv[i] = pinv[i - 1] * inv[i] % MOD
    perm[i] = perm[i - 1] * i % MOD
def C(n, m):
    return (perm[m] * pinv[n] % MOD) * pinv[m - n] % MOD if n <= m else 0
for i in range(1, n + 2):
    temp = C(i, n + 1) - C(i - 1, val)
    if temp < 0: temp += MOD
    print(temp)


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

import java.util.*;
import java.io.*;

public class Main{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Deque<Integer> dq = new LinkedList<>();
        boolean flag = false;
        for (int i = 0; i < n; i++){
            if (!flag){
                dq.addLast(in.nextInt());
            } else {
                dq.addFirst(in.nextInt());
            }
            flag = !flag;
        }
        int begin = flag ? n - 1 : 0;
        int end = flag ? 0 : n - 1;
        int inc = flag ? -1 : 1;
        for (int i = begin; i >= 0 && i <= n - 1; i += inc){
            System.out.print(dq.get(i) + " ");
        }
    }
}

Compiler output:
Main.java:23: error: cannot find symbol
            System.out.print(dq.get(i) + " ");
                               ^
  symbol:   method get(int)
  location: variable dq of type Deque<Integer>
1 error
Language: Java

import java.util.*;
import java.io.*;

public class Main{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Deque<Integer> dq = new Deque<Integer>();
        boolean flag = false;
        for (int i = 0; i < n; i++){
            if (!flag){
                dq.addLast(in.nextInt());
            } else {
                dq.addFirst(in.nextInt());
            }
            flag = !flag;
        }
        int begin = flag ? n - 1 : 0;
        int end = flag ? 0 : n - 1;
        int inc = flag ? -1 : 1;
        for (int i = begin; i >= 0 && i <= n - 1; i += inc){
            system.out.print(dq.get(i) + " ");
        }
    }
}

Compiler output:
Main.java:9: error: Deque is abstract; cannot be instantiated
        Deque<Integer> dq = new Deque<Integer>();
                            ^
Main.java:23: error: cannot find symbol
            system.out.print(dq.get(i) + " ");
                               ^
  symbol:   method get(int)
  location: variable dq of type Deque<Integer>
Main.java:23: error: package system does not exist
            system.out.print(dq.get(i) + " ");
                  ^
3 errors
Language: Java

import java.util.*;
import java.io.*;

public class Main{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Deque<Integer> dq = new Deque<Integer>();
        boolean flag = false;
        for (int i = 0; i < n; i++){
            if (!flag){
                dq.addLast(in.nextInt());
            } else {
                dq.addFirst(in.nextInt());
            }
            flag = !flag;
        }
        int begin = flag ? n - 1 : 0;
        int end = flag ? 0 : n - 1;
        int inc = flag ? -1 : 1;
        for (int i = begin; i += inc; i >= 0 && i <= n - 1){
            system.out.print(dq.get(i) + " ");
        }
    }
}

Compiler output:
Main.java:22: error: not a statement
        for (int i = begin; i += inc; i >= 0 && i <= n - 1){
                                             ^
1 error
Language: Java

import java.util.*;
import java.io.*;

public class void Main{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Deque<Integer> dq = new Deque<Integer>();
        boolean flag = false;
        for (int i = 0; i < n; i++){
            if (!flag){
                dq.addLast(in.nextInt());
            } else {
                dq.addFirst(in.nextInt());
            }
            flag = !flag;
        }
        int begin = flag ? n - 1 ; 0;
        int end = flag ? 0 : n - 1;
        int inc = flag ? -1 : 1;
        for (int i = begin; i += inc; i >= 0 && i <= n - 1){
            system.out.print(dq.get(i) + " ");
        }
    }
}

Compiler output:
Main.java:4: error: <identifier> expected
public class void Main{
            ^
Main.java:19: error: not a statement
        int begin = flag ? n - 1 ; 0;
                                   ^
Main.java:22: error: not a statement
        for (int i = begin; i += inc; i >= 0 && i <= n - 1){
                                             ^
Main.java:6: 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:19: error: : expected
        int begin = flag ? n - 1 ; 0;
                                ^
Main.java:19: error: illegal start of expression
        int begin = flag ? n - 1 ; 0;
                                 ^
Main.java:26: error: class, interface, enum, or record expected
}
^
7 errors
Language: C++

#include <stdio.h>
int main()
{
    int n, a[200001], i;
    scanf("%d", &n);
    for(i = 0; i < n; i++) scanf("%d", &a[i]);

    printf("%d", a[n-1]);

    for(i = n-3; i >= 0; i-=2) printf(" %d", a[i]);

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:56: error: expected ';' before '}' token
   13 |     else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i])
      |                                                        ^
      |                                                        ;
   14 | }
      | ~
Language: C++

#include <stdio.h>
#include<iostream>
int main()
{
    int n, a[200001], i;
    scanf("%d", &n);
    for(i = 0; i < n; i++) scanf("%d", &a[i]);

    printf("%d", a[n-1]);

    for(i = n-3; i >= 0; i-=2) printf(" %d", a[i]);

    if(n&1) for (i = 1; i <= n-2; i+=2) printf(" %d", a[i]);
    else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i])

Compiler output:
a.cc: In function 'int main()':
a.cc:14:56: error: expected ';' at end of input
   14 |     else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i])
      |                                                        ^
      |                                                        ;
a.cc:14:56: error: expected '}' at end of input
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include <stdio.h>
int main()
{
    int n, a[200001], i;
    scanf("%d", &n);
    for(i = 0; i < n; i++) scanf("%d", &a[i]);

    printf("%d", a[n-1]);

    for(i = n-3; i >= 0; i-=2) printf(" %d", a[i]);

    if(n&1) for (i = 1; i <= n-2; i+=2) printf(" %d", a[i]);
    else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i])

Compiler output:
a.cc: In function 'int main()':
a.cc:13:56: error: expected ';' at end of input
   13 |     else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i])
      |                                                        ^
      |                                                        ;
a.cc:13:56: error: expected '}' at end of input
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C

#include <stdio.h>
int main()
{
    int n, a[200001], i;
    scanf("%d", &n);
    for(i = 0; i < n; i++) scanf("%d", &a[i]);

    printf("%d", a[n-1]);

    for(i = n-3; i >= 0; i-=2) printf(" %d", a[i]);

    if(n&1) for (i = 1; i <= n-2; i+=2) printf(" %d", a[i]);
    else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i])

Compiler output:
main.c: In function 'main':
main.c:13:56: error: expected ';' at end of input
   13 |     else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i])
      |                                                        ^
      |                                                        ;
main.c:13:5: error: expected declaration or statement at end of input
   13 |     else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i])
      |     ^~~~
Language: Java

import java.io.*;
import java.util.*;

public class a_0701
{
	public static void main(String[] args)
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		List<Integer> b = new ArrayList<>();
		int n=0;
		try
		{
			n = Integer.parseInt(br.readLine());
			String str = br.readLine();
			String a[] = str.split("\\s+");
			for(int i=0;i<n;i++)
			{
				b.add(Integer.parseInt(a[i]));
				Collections.reverse(b);
			}
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}
		for(int i=0;i<n;i++)
		{
			if(i!=0)
			{
				System.out.print(" ");
			}
			System.out.print(b.get(i));
		}
	}
}

Compiler output:
Main.java:4: error: class a_0701 is public, should be declared in a file named a_0701.java
public class a_0701
       ^
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();
    Deque<Integer> dq = new Deque<Integer>();
    for(int i = 1; i <= n; i++) {
      int a = sc.nextInt();
      if((n - i) % 2 == 0) {
        dq.addFirst(a);
      } else {
        dq.addLast(a);
      }
    }
    for(int i = 0; i < n; i++) {
      System.out.println(dq.pollFirst());
    }
  }
}

Compiler output:
Main.java:7: error: Deque is abstract; cannot be instantiated
    Deque<Integer> dq = new Deque<Integer>();
                        ^
1 error
Language: C++

read = lambda: map(int, input().split())
n = int(input())
a = list(read())
from collections import deque
b = deque()
x = 1
for i in range(n):
    if x: b.append(a[i])
    else: b.appendleft(a[i])
    x ^= 1
ans = list(b)
if not x: ans = ans[::-1]
print(*ans)

Compiler output:
a.cc:1:1: error: 'read' does not name a type
    1 | read = lambda: map(int, input().split())
      | ^~~~
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(){

  vector <long long> d;
  int n;
  long long a;
  cin >> n;
  for(int i = 0;i < n;i++){
    cin >> a;
    d.push_back(a);
  }
  if(d.size()%2 == 0){
    

    for(int i = d.size() - 1;i >= 1; i = i - 2){
      cout << d[i] << " ";
    }
    for(int i = 0; i <= d.size() - 2;i = i + 2){
      cout << d[i] << " ";
    }
  }
  if(d.size()%2 == 1){
    if(d.size() == 1){
      cout << d[0];
    }
    else{
      for(int i = d.size() - 1;i >= 0; i = i - 2){
	cout << d[i] << " ";
      }
      for(int i = 1; i <= d.size() - 2;i = i + 2){
	cout << d[i] << " ";
      }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:37:6: error: expected '}' at end of input
   37 |     }
      |      ^
a.cc:26:22: note: to match this '{'
   26 |   if(d.size()%2 == 1){
      |                      ^
a.cc:37:6: error: expected '}' at end of input
   37 |     }
      |      ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

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

using namespace std;

int main(){
  int n;
  int num;
  vector<int> a;
  vector<int> b;

  cin >> n;

  for(int i = 0; i < n; i++){
    cin >> num;
    a.push_back(num);
  }

  for(int i = 0; i < n; i++){
    b.push_back(a[i]);
    reverse(b.begin(), b.end());
  }

  cout << b[0];
  
  for(int i = 1; i < n; i++)
    cout << " " << b[i];

  cout << endl;
  
  return 0;
}


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

import java.io.PrintWriter;
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		
		int N = sc.nextInt();
		LinkedList<Integer> q = new LinkedList<>();
		for(int i=0; i<N; i++)
			if((N-i)%2==1)
				q.addFirst(sc.nextInt());
			else
				q.addLast(sc.nextInt());
		
		for(int i=0; i<N; i++)
			pw.print(q.get(i) + (i==N-1 ? "\n" : " "));
		
		sc.close();
		pw.close();
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.PrintWriter;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

#ifdef __APPLE__
#include "bits:stdc++.h"
#else
#include <bits\stdc++.h>
#endif

#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (LL I = 0; I < (N); ++I)
#define REPP(I, A, B) for (LL I = (A); I < (B); ++I)
#define RI(X) scanf("%lld", &(X))
#define RII(X, Y) scanf("%lld%lld", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%lld%lld%lld", &(X), &(Y), &(Z))
#define DRI(X) LL (X); scanf("%lld", &X)
#define DRII(X, Y) LL X, Y; scanf("%lld%lld", &X, &Y)
#define DRIII(X, Y, Z) LL X, Y, Z; scanf("%lld%lld%lld", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
LL A[(int)2.5e5],ans[(int)2.5e5];
int main(){
    DRI(n);
    REP(i,n)RI(A[i]);
    reverse(A,A+n);
    LL l=0,r=n-1;
    REP(i,n){
        if(i%2==0){
            ans[l++]=A[i];
        }else{
            ans[r--]=A[i];
        }
    }REP(i,n)printf("%lld%c",ans[i]," \n"[i==n-1]);
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const int MOD = 1000000007;
const int INF = 1e9;

const int mod = 1000000007;
const int inf = 1e9;
#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};

const ll MAX = 200000;
ll inv[MAX], fac[MAX], finv[MAX];

void settable() {
   fac[0] = fac[1] = 1;
   finv[0] = finv[1] = 1;
   inv[1] = 1;
   for (int i = 2; i <=MAX ; i++){
       fac[i] = fac[i - 1] * i % MOD;
       inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
       finv[i] = finv[i - 1] * inv[i] % MOD;
   }
}
ll choose(ll n, ll k){
   if (n < k) return 0;
   if (n <= 0 || k < 0) return 0;
   return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll modpow(ll n, ll k){
   ll rtn = 1;
   while(k > 0){
       if(k&1) rtn = rtn * n % MOD;
       n = n * n % MOD;
       k = k >> 1;
   }
   return rtn;
}

int main(){
    settable();
    int n;
    cin >> n;
    vector<int> a(n+1);
    map<int, int> mp;
    for(int i = 0; i < n+1; i++) {
        cin >> a[i];
        mp[a[i]]++;
    }
    int p[2];
    for(auto w : mp) {
        if(w.second == 2) {
            int f = 0;
            for(int i = 0; i < n+1; i++) {
                if(w.first == a[i]) p[f] = i, f++;
                if(f == 2) break;
            }
        } 
    }
    cout << p[0] << " " << p[1] << endl;
    for(int i = 1; i <= n+1; i++) {
        ll ans = choose(n+1, i);
        if(p[0]+n-p[2] >= i-1) ans -= choose(p[0]+n-p[1], i-1);
        (ans + MOD) %= MOD;
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:78:14: error: lvalue required as left operand of assignment
   78 |         (ans + MOD) %= MOD;
      |         ~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ls( s) (s&(-s))
#define ll long long
#define inf 0x3f3f3f3f
#define fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll N = 103000;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =    1e9+7;
ll n;
ll fact[N];
ll arr[N];
ll ifact[N];
ll po(ll x,ll y)
{
	ll res=1;
	while(y)
	{
		if(y%2)
		res=res*x%mod;
		y/=2;
		x=x*x%mod;
	}
	return res;
}

int main()
{  fast
int z;
  fact[0]=1;
  for(int i=1;i<N;i++)
  fact[i]=fact[i-1]*i%mod;
  ifact[N-1]=po(fact[N-1],mod-2);
  for(int i=N-2;i>=0;i--)
  	ifact[i]=ifact[i+1]*(i+1)%mod;
  	   cin>>n;
  	vector<int> v(n+1);
   for(int i=1;i<=n+1;i++)
   {
	int x;
	cin>>x;
	v[i-1]=x;
   if(arr[x])
   {
arr[x]++;
   z=i;}
   arr[x]++;
   }
   int r;
   for(int i=0;i<=n;i++)
   {
   	if(v[i]==v[z-1])
   	{
		r=i;
		break;
	   }
   	
   }
   	z=n+1-(z-r);
	r=z;
  //01
1 1 cout<<r<<endl;
ll ans=0;
cout<<n<<endl;
if(n==1)
{cout<<1<<endl;
return 0;
}

for(int i=2;i<=n+1;i++)
{ans=0;
	ans+=(((fact[n+1]*ifact[i])%mod)*ifact[n+1-i])%mod;


	if(r>=i-1)
	ans-=(((fact[r]*ifact[i-1])%mod)*ifact[r-i+1])%mod;
	cout<<ans<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:2: error: expected ';' before numeric constant
   65 | 1 1 cout<<r<<endl;
      |  ^~
      |  ;
Language: C++

You are given an integer sequence of length n+1, a1,a2,…,an+1, which consists of the n integers 1,…,n. It is known that each of the n integers 1,…,n appears at least once in this sequence.
For each integer k=1,…,n+1, find the number of the different subsequences (not necessarily contiguous) of the given sequence with length k, modulo 109+7.
Notes

If the contents of two subsequences are the same, they are not separately counted even if they originate from different positions in the original sequence.
A subsequence of a sequence a with length k is a sequence obtained by selecting k of the elements of a and arranging them without changing their relative order. For example, the sequences 1,3,5 and 1,2,3 are subsequences of 1,2,3,4,5, while 3,1,2 and 1,10,100 are not.
Constraints

1≤n≤105
1≤ai≤n
Each of the integers 1,…,n appears in the sequence.
n and ai are integers.
Input

Input is given from Standard Input in the following format:
n
a1 a2 ... an+1

Compiler output:
a.cc:1:56: error: extended character … is not valid in an identifier
    1 | You are given an integer sequence of length n+1, a1,a2,…,an+1, which consists of the n integers 1,…,n. It is known that each of the n integers 1,…,n appears at least once in this sequence.
      |                                                        ^
a.cc:1:99: error: extended character … is not valid in an identifier
    1 | You are given an integer sequence of length n+1, a1,a2,…,an+1, which consists of the n integers 1,…,n. It is known that each of the n integers 1,…,n appears at least once in this sequence.
      |                                                                                                   ^
a.cc:1:146: error: extended character … is not valid in an identifier
    1 | You are given an integer sequence of length n+1, a1,a2,…,an+1, which consists of the n integers 1,…,n. It is known that each of the n integers 1,…,n appears at least once in this sequence.
      |                                                                                                                                                  ^
a.cc:2:22: error: extended character … is not valid in an identifier
    2 | For each integer k=1,…,n+1, find the number of the different subsequences (not necessarily contiguous) of the given sequence with length k, modulo 109+7.
      |                      ^
a.cc:9:1: error: extended character ≤ is not valid in an identifier
    9 | 1≤n≤105
      | ^
a.cc:9:1: error: extended character ≤ is not valid in an identifier
a.cc:10:1: error: extended character ≤ is not valid in an identifier
   10 | 1≤ai≤n
      | ^
a.cc:10:1: error: extended character ≤ is not valid in an identifier
a.cc:11:24: error: extended character … is not valid in an identifier
   11 | Each of the integers 1,…,n appears in the sequence.
      |                        ^
a.cc:1:1: error: 'You' does not name a type
    1 | You are given an integer sequence of length n+1, a1,a2,…,an+1, which consists of the n integers 1,…,n. It is known that each of the n integers 1,…,n appears at least once in this sequence.
      | ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue> 
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
using namespace std;
const int maxn=1e5+7;
const int mod=1e9+7;
int a[maxn];
int vis[maxn]={0};
long long f[maxn];
inline long long qpow(long long a,long long b){long long r=1,t=a; while(b){if(b&1)r=(r*t)%mod;b>>=1;t=(t*t)%mod;}return r;}
inline long long inv(long long b){return qpow(b,mod-2);}
void init(){f[0] = 1;for (int i=1;i<=maxn;i++)f[i] = (f[i-1]*i) % mod;}
long long c(int x,int y){return f[x]*inv(f[y])%mod*inv(f[x-y])%mod;}
int main()
{
	init();
	int n;
	cin>>n;
	int p1,p2;
	for (int i=1;i<=n+1;i++)
	{
		cin>>a[i];
		if (vis[a[i]])
		{
			p1=vis[a[i]]-1;
			p2=i;
		}
		vis[a[i]]=i;
	}
	for (int i=1;i<=n+1;i++)
	{
		long long ans=c(n+1,i)%mod;
		if (n+1-p2+p1>=i-1) ans=(ans-c(n+1-p2+p1,i-1)+mod)%mod;
		while (ans<0) ans=(ans+mod)%mod
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:48: error: expected ';' before 'cout'
   44 |                 while (ans<0) ans=(ans+mod)%mod
      |                                                ^
      |                                                ;
   45 |                 cout<<ans<<endl;
      |                 ~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

struct Combination{
    vector<long long> _fac,_finv,_inv;
    const int m = MOD;

    Combination(int sz) : _fac(sz),_finv(sz),_inv(sz){
        _fac[0] = _fac[1] = 1;
        _finv[0] = _finv[1] = 1;
        _inv[1] = 1;
        for(int i = 2; i <= sz; i++){
            _fac[i] = _fac[i-1]*i%m;
            _inv[i] = m-_inv[m%i]*(m/i)%m;
            _finv[i] = _finv[i-1]*_inv[i]%m;
        }
    }

    inline int fac(int n){return _fac[n];}
    inline int inv(int n){return _inv[n];}
    inline int finv(int n){return _finv[n];}

    int comb(int n,int k){
        if(n < k) return 0;
        if(n < 0 || k < 0) return 0;
        return _fac[n]*(_finv[k]*_finv[n-k]%m)%m;
    }
};

int main(){
    int n; cin >> n;
    vector<int> a(n+1);
    rep(i,n+1){
        cin >> a[i];
        a[i]--;
    }
    map<int,int> mp;
    int two;
    int l,r;
    rep(i,n+1){
        mp[a[i]]++;
        if(mp[a[i]] == 2){
            r = i;
            two = a[i];
            break;
        }
    }
    rep(i,n+1){
        if(a[i] == two){
            l = i;
            break;
        }
    }
    Combination C(200000);
    repr(i,1,n+2){
        int ans = (C.comb(n+1,i)-C.comb(n-r+l,i-1))+MOD)%MOD;
        cout << ans << endl;
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:86:56: error: expected ',' or ';' before ')' token
   86 |         int ans = (C.comb(n+1,i)-C.comb(n-r+l,i-1))+MOD)%MOD;
      |                                                        ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include <cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}

long long mod_inverse(long long x) {
	long  long ret = 1; long long n = mod - 2;
	while (n) {
		if (n & 1)ret = ret * x % mod;
		x = x * x % mod; n >>= 1;
	}
	return ret;
}

ll fact[100100], inv_fact[100100];

ll comb(ll n, ll r) {
    if(n < r || r < 0) return 0;
    ll ret = fact[n] * inv_fact[n - r] % mod * inv_fact[r] % mod;
    return rt;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    ll n; cin >> n;
    fact[0] = 1LL; inv_fact[0] = 1LL;
    rep1(i, n) {
        fact[i] = fact[i - 1] * i % mod;
        inv_fact[i] = mod_inverse(fact[i]);
    }
    rep1(k, n + 1) {
        ll ans = comb(n - 1, k) + comb(n - 1, k - 1) + comb(n - 1, k - 2);
        ans %= mod;
        cout << ans << endl;
    }
	return 0;
}

Compiler output:
a.cc: In function 'll comb(ll, ll)':
a.cc:68:12: error: 'rt' was not declared in this scope; did you mean 'ret'?
   68 |     return rt;
      |            ^~
      |            ret
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) FOR(i,0,b)
#define INF mugen
#define dump(x) cerr<<#x<<"="<<x<<endl
#define ALL(a) (a).begin(),(a).end()
#define EACH(e,v) for(auto& e:v)
#define SORT(v) sort(ALL(v))
#define PERM(v) SORT(v);for(bool c##p=1;c##p;c##p=next_permutation(ALL(v)))
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<vii> viii;
typedef pair<int,int> P;
template <class T> void chmin(T & a, T const & b) { if (b < a) a = b; }
template <class T> void chmax(T & a, T const & b) { if (b > a) a = b; }
template <typename T>
string to_string(const T &n){ostringstream stm;stm << n;return stm.str();}
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
using ll = long long;
const ll mod = 1000'000'007;
 

const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int se[112345];
signed main(){
    int n;
    cin>>n;
    vector<ll> avec;
    rep(i,n){
        ll a;cin>>a;avec.push_back(a);
    }
    COMinit();

    int idx=0;
    int idxb=0;
    rep(i,n){
        se[avec[i]]++;
        if(se[avec[i]]>1)idx=i;
    }

    rep(i,n){
        if(avec[idx]==avec[i]){
            idxb=i;
            break;
        }
    }
    dump(idx);dump(idxb);
    swap(idx,idxb);
    int b=idxb-idx-1;int c=n-idxb;
    ll ans=0LL;
    rep(i,n+1){
        int k=i+1;
        if(i==0)cout<<n<<endl;
        else cout<<(COM(n-1,k)+COM(idx+c,k-1)+2*(COM(idx+b+c,k-1)-COM(idx+c,k-1))%mod+COM(n-1,k-2)))%mod<<endl;
    }
    
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:100: error: expected ';' before ')' token
   75 |         else cout<<(COM(n-1,k)+COM(idx+c,k-1)+2*(COM(idx+b+c,k-1)-COM(idx+c,k-1))%mod+COM(n-1,k-2)))%mod<<endl;
      |                                                                                                    ^
      |                                                                                                    ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL N=1e5+100; 
const LL MOD=1e9+7;

int n;
LL a[N];
int v[N];
 
LL fac[N],finv[N],inv[N];
 
void make()
{
	fac[0]=fac[1]=1;
	finv[0]=finv[1]=1;
	inv[1]=1;
	for(int i=2;i<100010;i++)
	{
		inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
		fac[i]=fac[i-1]* i%MOD;
		finv[i]=finv[i-1]*inv[i]%MOD;
	}
}
LL C(int x,int y)
{
	if(x<y) return 0;
	return fac[x]*(finv[y]*finv[x-y]%MOD)%MOD;
}
 
int main ()
{
	cin>>n;
    for(int i = 1; i <= n + 1; ++i){
        cin >> a[i];
        v[a[i]]++;
    }
    LL pos1,pos2;
    for(int i = 1; i <= n + 1; ++i){
        if(v[a[i]] == 2 && !pos1){
            pos1 = i;
        }
        else if(v[a[i]] == 2) {
            pos2 = i;
        }
    }
	LL ans;
	make();
	for (i=0;i<=n;i++)
	{
		ans=C(n+1,i+1);
		ans-=C(n-pos2+pos1,i);
		if (ans<0) ans+=MOD;
		printf("%d\n",ans);	
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:14: error: 'i' was not declared in this scope
   49 |         for (i=0;i<=n;i++)
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL mod = 1e9+7;
int maxn;
int vis[100005];
LL fac[100005]={1,1};
LL opp[100005]={1,1};
LL fi[100005]={1,1}; 
void init()
{
    for(int i=2; i<=100000; ++i)
    {
        fac[i] = fac[i-1]*i%mod;
        opp[i] = (mod-mod/i)*opp[mod%i]%mod;
        fi[i] = fi[i-1]*opp[i]%mod;
    }
}
LL c(LL n, LL m)
{
    return fac[n]*op_fa[n-m]%mod*op_fa[m]%mod;
}
int main()
{
	init();
	int n,dist;
	scanf("%d",&n);
	for(int i=1;i<=n+1;i++)
	{
		int temp;
		scanf("%d",&temp);
		if(mak[temp]) 
			dist = mak[temp] + n - i;	
		mak[temp] = i;
	}	
	long long ans;
	for(int i=1;i<=n+1;i++)
	{
		ans = c((long long)(n+1), (long long)(i))%mod;
		if(dist>=i-1)
		{
			ans= (ans - c((long long)dist, (long long)(i-1)) + mod)%mod;
		}
		printf("%lld\n",ans);	
	}
	return 0;
}

Compiler output:
a.cc: In function 'LL c(LL, LL)':
a.cc:21:19: error: 'op_fa' was not declared in this scope
   21 |     return fac[n]*op_fa[n-m]%mod*op_fa[m]%mod;
      |                   ^~~~~
a.cc: In function 'int main()':
a.cc:32:20: error: 'mak' was not declared in this scope
   32 |                 if(mak[temp])
      |                    ^~~
a.cc:34:17: error: 'mak' was not declared in this scope
   34 |                 mak[temp] = i;
      |                 ^~~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=100010;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
const int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  invinit();
  int n;
  cin>>n;
  int a[n];
  map<int> mp;
  int fi=-1,si=-1;
  REP(i,n){
    cin>>a[i];
    mp[a[i]]++;
    if(mp[a[i]]==2){
      si=i;
    }
  }
  REP(i,n){
    if(a[i]==a[si]){
      fi=i;
      break;
    }
  }
  long long ans;
  long long sur=0;
  REPP(k,n+1){
    ans = comb(n+1,k);
    REP(i,k){
      if(i<=fi && k-1-i<=n-1-si){
        sur += mod(comb(fi,i)*comb(n-1-si,k-1-i));
      }
    }
    ans = mod(ans - sur);
    cout<<ans<<endl;
    sur = 0;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:10: error: wrong number of template arguments (1, should be at least 2)
   58 |   map<int> mp;
      |          ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:62:7: error: invalid types 'int[int]' for array subscript
   62 |     mp[a[i]]++;
      |       ^
a.cc:63:10: error: invalid types 'int[int]' for array subscript
   63 |     if(mp[a[i]]==2){
      |          ^