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

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

using namespace std;

unsigned char d[10000000100];

int main()
{
	int n;
	cin >> n;
	int result = 0;
	vector<int> v;
	for (int i = 0; i < n; i++)
	{
		int buf;
		cin >> buf;
		vector<int>::iterator itr = find(v.begin(), v.end(), buf);
		if (itr == v.end())
		{
			v.push_back(buf);
		}
		else
		{
			v.erase(itr);
		}
	}
	cout << v.size() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:49: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   20 |                 vector<int>::iterator itr = find(v.begin(), v.end(), buf);
      |                                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:20:49: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   20 |                 vector<int>::iterator itr = find(v.begin(), v.end(), buf);
      |                                             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<iostream>
#define K 100000
#include<cstring>
#include<vector>
using namespace std;
 long long n,tot = 0; 
 vector<long long> a[K];
 char f[12] = {'0'};
 
void div()
{
  int k1 = 0, k2 = 0;
  for(int i = 0; i < 5; i ++)
 {
  k1 += f[i]*10*(5-i);
}
k1 /= 10 ;
  for(int i = strlen(f)-1; i >= 5 ; i++)
 {
  k2 += f[i]*10*(i-4);
}
k2 /= 10;
 if(a[k1].size() == a[k2].size())
{
 for(int j = 0; j < a[k1].size(); j++)
{ if(a[k1][j] && a[k2][j])
   {
      a[k1][j] = 0;
      a[k2][j] = 0;
tot --;
   }  
 }
}
else {
 a[k1].push_back(1);
 a[k2].push_back(1);
tot ++;
}

 }

int main(){
	scanf("%lld",&n);
for(long long i = 0; i <= 100000; i ++)
{ a[i].push_back(0);
}
        
	while(scanf("%s",&f))
	{
                if(strlen(f) > 5) div();
                else if(strlen(f) <= 5){
                if(a[f][0]) tot -- ;
                else tot ++;
a[f][0] = 1-a[f][0] ; }
 
         
	}
	printf("%lld",tot);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:21: error: invalid types 'std::vector<long long int> [100000][char [12]]' for array subscript
   54 |                 if(a[f][0]) tot -- ;
      |                     ^
a.cc:56:2: error: invalid types 'std::vector<long long int> [100000][char [12]]' for array subscript
   56 | a[f][0] = 1-a[f][0] ; }
      |  ^
a.cc:56:14: error: invalid types 'std::vector<long long int> [100000][char [12]]' for array subscript
   56 | a[f][0] = 1-a[f][0] ; }
      |              ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  long a[100001];
  long count=0;
  for(int i=0;i<N;i++){
    cin >> a[i] ;
	for(int k=0;k<i;k++){
		if(a[i]==a[k]){
          a[i]=0;
          a[k]=0;
          count +=2;
        }
    }
    cout << N-count << endl;
    return 0;
  }
  

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

#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;
int main(){
	
	int N;
	int cnt=0,flag;a
	cin>>N;
	vector<int> A(N);
	
	for(int i=0;i<N;i++){
		cin>>A[i];
	}
	
	sort(A.begin(),A.end());
	
	for(int i=1;i<N;i++){
		if(A[i]==A[i-1])flag++;
	}	
	cout<<N-(flag/2)*2<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: 'a' was not declared in this scope
    9 |         int cnt=0,flag;a
      |                        ^
Language: C++

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

using namespace std;

unsigned char d[10000000100];

int main()
{
	int n;
	cin >> n;
	int result = 0;
	vector<int> v;
	for (int i = 0; i < n; i++)
	{
		int buf;
		cin >> buf;
		auto itr = find(v.begin(), v.end(), buf);
		if (itr == v.end())
		{
			v.push_back(buf);
		}
		else
		{
			v.erase(itr);
		}
	}
	cout << v.size() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:32: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   20 |                 auto itr = find(v.begin(), v.end(), buf);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:20:32: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   20 |                 auto itr = find(v.begin(), v.end(), buf);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<iostream>
#define K 100000
#include<cstring>
#include<vector>
using namespace std;
 long long n,tot = 0; 
 vector<long long> a[K];
 char f[12] = {'0'};
 
void div()
{
  int k1 = 0, k2 = 0;
  for(int i = 0; i < 5; i ++)
 {
  k1 += f[i]*10*(5-i);
}
k1 /= 10 ;
  for(int i = strlen(f)-1; i >= 5 ; i++)
 {
  k2 += f[i]*10*(i-4);
 if(a[k1].size() == a[k2].size())
{
 for(int j = 0; j < a[k1].size(); j++)
{ if(a[k1][j] && a[k2][j])
   {
      a[k1][j] = 0;
      a[k2][j] = 0;
tot --;
   }  
 }
}
else {
 a[k1].push_back(1);
 a[k2].push_back(1);
tot ++;
}
}
k2 /= 10;
 }
int main(){
	scanf("%lld",n);
for(long long i = 0; i <= 100000; i ++)
{ a[i].push_back(0);
}
        
	while(scanf("%s",&f))
	{
                if(strlen(f) > 5) div();
                else if(strlen(f) <= 5){
                if(a[f][0]) tot -- ;
                else tot ++;
a[f][0] = 1-a[f][0] ; }
 
         
	}
	printf("%lld",tot);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:21: error: invalid types 'std::vector<long long int> [100000][char [12]]' for array subscript
   52 |                 if(a[f][0]) tot -- ;
      |                     ^
a.cc:54:2: error: invalid types 'std::vector<long long int> [100000][char [12]]' for array subscript
   54 | a[f][0] = 1-a[f][0] ; }
      |  ^
a.cc:54:14: error: invalid types 'std::vector<long long int> [100000][char [12]]' for array subscript
   54 | a[f][0] = 1-a[f][0] ; }
      |              ^
Language: C++

n = int(input())
a = {}
for i in range(n):
    b = int(input())
    if b in a.keys():
        a[b] += 1
    else:
        a[b] = 0
ans = 0
for i in a.keys():
  if a[i]%2 == 1:
    ans += 1
print(ans)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
a.cc:3:1: error: expected unqualified-id before 'for'
    3 | for i in range(n):
      | ^~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<iostream>
#define K 100000
#include<cstring>
#include<vector>
using namespace std;
 long long n,tot = 0; 
 vector<long long> a[K];
 char f[12] = {'0'};

void div()
{
  int k1 = 0, k2 = 0;
  for(int i = 0; i < 5; i ++)
 {
  k1 += f[i]*10*(5-i);
}
k1 /= 10 ;
  for(int i = strlen(f)-1; i >= 5 ; i++)
 {
  k2 += f[i]*10*(i-4);
 if(a[k1].size() == a[k2].size())
{
 for(int j = 0; j < a[k1].size(); j++)
{ if(a[k1][j] && a[k2][j])
   {
      a[k1][j] = 0;
      a[k2][j] = 0;
tot --;
   }  
 }
}
else {
 a[k1].push(1);
 a[k2].push(1);
tot ++;
}
}
k2 /= 10;
 }
int main(){
	scanf("%lld",n);
for(long long i = 0; i <= 100000; i ++)
{ a[i].push_back(0);
}
        
	while(scanf("%s",&f))
	{
                if(strlen(f) > 5) div();
                else if(strlen(f) <= 5){
                if(a[f][0]) tot -- ;
                else tot ++;
a[f][0] = 1-a[f][0] ; }
 
         
	}
	printf("%lld",tot);
	return 0;
}

Compiler output:
a.cc: In function 'void div()':
a.cc:35:8: error: 'class std::vector<long long int>' has no member named 'push'
   35 |  a[k1].push(1);
      |        ^~~~
a.cc:36:8: error: 'class std::vector<long long int>' has no member named 'push'
   36 |  a[k2].push(1);
      |        ^~~~
a.cc: In function 'int main()':
a.cc:52:21: error: invalid types 'std::vector<long long int> [100000][char [12]]' for array subscript
   52 |                 if(a[f][0]) tot -- ;
      |                     ^
a.cc:54:2: error: invalid types 'std::vector<long long int> [100000][char [12]]' for array subscript
   54 | a[f][0] = 1-a[f][0] ; }
      |  ^
a.cc:54:14: error: invalid types 'std::vector<long long int> [100000][char [12]]' for array subscript
   54 | a[f][0] = 1-a[f][0] ; }
      |              ^
Language: C

#include<stdio.h>
int main(void)
{
 int N;
 int i,j;
 int A[100000];
 int kek=0;
 int mke[100000];
 scanf("%d",&N);
 kek+=N;
 for(i=0;i<N;i++)
 scanf("%d",&A[i]);
 for(i=0;i<N;i++){
   mkek[i]=0;
 for(j=0;j<N;j++){
  if(A[i]==A[j])
   mke[i]+=1;
   }
   if(mke[i]%2==0)
   kek-=1;
   }
  printf("%d\n",kek);
  return 0;
 }

Compiler output:
main.c: In function 'main':
main.c:14:4: error: 'mkek' undeclared (first use in this function); did you mean 'mke'?
   14 |    mkek[i]=0;
      |    ^~~~
      |    mke
main.c:14:4: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long int N;
    cin >> N;
    int a, k;
    k = 0;
    int S[1000000001] = {};
    for(int i = 0; i < N; i++)
    {
        cin >> a;
        S[a] = S[a] + 1;
    }
    
    for(long long int j = 0; j < 1000000000; j++)
    {
        if(S[j + 1] % 2 == 1)
        {
            k = k + 1;
        }
        else
        {
            
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:25:10: error: expected '}' at end of input
   25 |         }
      |          ^
a.cc:17:5: note: to match this '{'
   17 |     {
      |     ^
a.cc:25:10: error: expected '}' at end of input
   25 |         }
      |          ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int count=0;
typedef struct node{
  int x;
  struct node *next;
}node;
void add(int x,node *nodex){
  if(nodex->next==NULL){
    struct node *new=malloc(sizeof(node));
    new->next=nodex->next;
    new->x=x;
    nodex->next=new;
    return;
  }else if(x<nodex->next->x){
    struct node *new=malloc(sizeof(node));
    new->next=nodex->next;
    new->x=x;
    nodex->next=new;
    return;
  }else if(x>nodex->next->x){
    add(x,nodex->next);
    return;
  }else if(x==nodex->next->x){
    struct node *temp=nodex->next;
    nodex->next=nodex->next->next;
    free(temp);
    return;
  }
}
int main(){
  int i,n,x;
  struct node root;
  root.next=NULL;
  root.x=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&x);
    add(x,&root);
  }
  struct node *temp=&root;
  while(temp->next!=NULL){
    count++;
    temp=temp->next;
  }
  printf("%d\n",count );
}

Compiler output:
a.cc: In function 'void add(int, node*)':
a.cc:11:18: error: expected unqualified-id before 'new'
   11 |     struct node *new=malloc(sizeof(node));
      |                  ^~~
a.cc:12:8: error: expected type-specifier before '->' token
   12 |     new->next=nodex->next;
      |        ^~
a.cc:13:8: error: expected type-specifier before '->' token
   13 |     new->x=x;
      |        ^~
a.cc:14:20: error: expected type-specifier before ';' token
   14 |     nodex->next=new;
      |                    ^
a.cc:17:18: error: expected unqualified-id before 'new'
   17 |     struct node *new=malloc(sizeof(node));
      |                  ^~~
a.cc:18:8: error: expected type-specifier before '->' token
   18 |     new->next=nodex->next;
      |        ^~
a.cc:19:8: error: expected type-specifier before '->' token
   19 |     new->x=x;
      |        ^~
a.cc:20:20: error: expected type-specifier before ';' token
   20 |     nodex->next=new;
      |                    ^
Language: C++

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int count=0;
typedef struct node{
  int x;
  struct node *next;
}node;
void add(int x,node *nodex){
  if(nodex->next==NULL){
    node *new=malloc(sizeof(node));
    new->next=nodex->next;
    new->x=x;
    nodex->next=new;
    return;
  }else if(x<nodex->next->x){
    node *new=malloc(sizeof(node));
    new->next=nodex->next;
    new->x=x;
    nodex->next=new;
    return;
  }else if(x>nodex->next->x){
    add(x,nodex->next);
    return;
  }else if(x==nodex->next->x){
    node *temp=nodex->next;
    nodex->next=nodex->next->next;
    free(temp);
    return;
  }
}
int main(){
  int i,n,x;
  node root;
  root.next=NULL;
  root.x=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&x);
    add(x,&root);
  }
  node *temp=&root;
  while(temp->next!=NULL){
    count++;
    temp=temp->next;
  }
  printf("%d\n",count );
}

Compiler output:
a.cc: In function 'void add(int, node*)':
a.cc:11:11: error: expected unqualified-id before 'new'
   11 |     node *new=malloc(sizeof(node));
      |           ^~~
a.cc:12:8: error: expected type-specifier before '->' token
   12 |     new->next=nodex->next;
      |        ^~
a.cc:13:8: error: expected type-specifier before '->' token
   13 |     new->x=x;
      |        ^~
a.cc:14:20: error: expected type-specifier before ';' token
   14 |     nodex->next=new;
      |                    ^
a.cc:17:11: error: expected unqualified-id before 'new'
   17 |     node *new=malloc(sizeof(node));
      |           ^~~
a.cc:18:8: error: expected type-specifier before '->' token
   18 |     new->next=nodex->next;
      |        ^~
a.cc:19:8: error: expected type-specifier before '->' token
   19 |     new->x=x;
      |        ^~
a.cc:20:20: error: expected type-specifier before ';' token
   20 |     nodex->next=new;
      |                    ^
Language: C++

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

int main(void){
	int n;
	int t=1;
	long long int a=0;
	bool p[100010]={0};
	cin >> n;

	for(int i=0; i<n; i++){
		cin >> a[i];
	}
	sort(a.begin(),a.end());
	for(int i=0; i<n; i++){
		if(a[i]!=a[i+1])t++;
	}

	cout << t << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: invalid types 'long long int[int]' for array subscript
   13 |                 cin >> a[i];
      |                         ^
a.cc:15:16: error: request for member 'begin' in 'a', which is of non-class type 'long long int'
   15 |         sort(a.begin(),a.end());
      |                ^~~~~
a.cc:15:26: error: request for member 'end' in 'a', which is of non-class type 'long long int'
   15 |         sort(a.begin(),a.end());
      |                          ^~~
a.cc:17:21: error: invalid types 'long long int[int]' for array subscript
   17 |                 if(a[i]!=a[i+1])t++;
      |                     ^
a.cc:17:27: error: invalid types 'long long int[int]' for array subscript
   17 |                 if(a[i]!=a[i+1])t++;
      |                           ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
 
int main(){
    int N;
    int A;
    vector<int> all;
    bool if_ok;
    cin >> N;
    cin >> A;
    all.push_back(A);
    for(int i = 0; i < N - 1; i++{
    	if_ok = true;
    	cin >> A;
    	for(int i2 = 0; i2 < all.size(); i2++){
    		if(all[i2] == A){
    			if_ok = false;
    			all.erase(all.begin() + i2);
    			break;
    		}
    	}
    	if(if_ok){
	    	all.push_back(A);
    	}
    }
    cout << all.size() << endl;
	return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:13:34: error: expected ')' before '{' token
   13 |     for(int i = 0; i < N - 1; i++{
      |        ~                         ^
      |                                  )
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] a;
        a = new int[10001];
		b = new int[10001];
		for(int s = 0; s < 10000; s++){
			a[s] = 0;
			b[s] = 0;
		}
        int tmp;
        int count = 0;
        for(int i = 0; i < num; i++){
            tmp = sc.nextInt();
			if(tmp < 10000){
				a[tmp] = (a[tmp] + 1) % 2; 
			}else{
				tmp = tmp /10000;
				b[tmp] = (b[tmp] + 1) % 2; 
			}
        }
		for(int j = 0; j < 10000; j++){
			if(a[j] == 1) count++;
			if(b[j] == 1) count++;
		}
        System.out.print(count);
	}
}

Compiler output:
Main.java:8: error: cannot find symbol
		b = new int[10001];
		^
  symbol:   variable b
  location: class Main
Main.java:11: error: cannot find symbol
			b[s] = 0;
			^
  symbol:   variable b
  location: class Main
Main.java:21: error: cannot find symbol
				b[tmp] = (b[tmp] + 1) % 2; 
				^
  symbol:   variable b
  location: class Main
Main.java:21: error: cannot find symbol
				b[tmp] = (b[tmp] + 1) % 2; 
				          ^
  symbol:   variable b
  location: class Main
Main.java:26: error: cannot find symbol
			if(b[j] == 1) count++;
			   ^
  symbol:   variable b
  location: class Main
5 errors
Language: Java

3import java.util.Scanner;
import java.util.HashMap;

public class Main {
	public static void main(String args[]){
		Scanner in=new Scanner(System.in);
    HashMap<Integer,Integer> map =new HashMap<Integer,Integer>();
		int counter = 0;
		int n=in.nextInt();
    int tmp=0;
    int ans=0;
    for (int i=0;i<n;i++) {
      tmp=in.nextInt();
      if (!map.containsKey(tmp)) {
        map.put(tmp,i);
        ans++;
      }
    }

		System.out.printf("%d%n",ans);
	}
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
3import java.util.Scanner;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.HashMap;
^
2 errors
Language: C++

#include <cstdio>
#include <vector>

using namespace std;

int main() {
  int N;
  scanf("%d", &N);
  vector<int> log;
  int counter[10000] = {0};
  int pivot = 0;
  for (int i = 0; i < N; i++) {
    int ai;
    scanf("%d", &ai);
    if (count(log.begin(), log.end(), ai) != 0) {
      int j = 0;
      for (; j < log.size(); j++) {
        if (log[j] == ai) break;
      }
      counter[j]++;
    } else {
      log.push_back(ai);
      counter[pivot]++;
      pivot++;
    }
  }
  int answer = 0;
  for (int i = 0; i < N; i++) {
    printf("%d ", counter[i]);
    if (counter[i] % 2 == 1) answer++;
  }
  printf("%d", answer);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'count' was not declared in this scope; did you mean 'counter'?
   15 |     if (count(log.begin(), log.end(), ai) != 0) {
      |         ^~~~~
      |         counter
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] a;
        a = new int[10001];
		for(int s = 0; s < 10000; s++) a[s] = 0;
        int tmp;
        int count = 0;
        for(int i = 0; i < num; i++){
            tmp = sc.nextInt();
			if(tmp > 10000) tmp / 10000;
			a[tmp] = (a[tmp] + 1) % 2; 
        }
		for(int j = 0; j < 10000; j++){
			if(a[j] == 1) count++;
		}
        System.out.print(count);
	}
}

Compiler output:
Main.java:13: error: not a statement
			if(tmp > 10000) tmp / 10000;
			                    ^
1 error
Language: C++

#include<cstdio>
#include<cstdlib>
#include<iostream>
#define K 10000000
#include<cstring>
using namespace std;
 long long n,f,tot = 0; 
 long long a[K] = {0};
int main(){
	
	scanf("%lld",&n);
	while(scanf("%lld",&f);)
	{
                a[f] = 1-a[f] ; 
		if(a[f]) tot -- ;
                else tot ++;
	}
	printf("%lld",tot);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:31: error: expected ')' before ';' token
   12 |         while(scanf("%lld",&f);)
      |              ~                ^
      |                               )
a.cc:12:32: error: expected primary-expression before ')' token
   12 |         while(scanf("%lld",&f);)
      |                                ^
Language: C++

#include<iostream>
#include<algorithm>
#include<functional>
#include <string>
#include<iomanip>
#include<cstdio>
#include<math.h>
#include<stack>
#include<queue>
#include<cstring>
#include<vector>
typedef long long int ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define EREP(i,n) for(int i=(n-1);i>=0;--i)
#define D(n,retu) REP(i,n){cin>>retu[i];}
#define mod 1000000007
#define MIN -93193111451418101
#define INF 931931114518101
using namespace std;
typedef pair<ll, ll>P;
template<typename T>
void fill_all(T& arr, const T& v) {
	arr = v;
}
template<typename T, typename ARR>
void fill_all(ARR& arr, const T& v) {
	for (auto& i : arr) { fill_all(i, v); }
}
#define MAX_NUM 50
long long comb[MAX_NUM + 1][MAX_NUM + 1];
 
ll par[100000], depth[100000];
static void calc_comb()
{
	for (uint32_t i = 0; i <= MAX_NUM; i++) {
		for (uint32_t j = 0; j <= i; j++) {
			if ((j == 0) || (i == j)) {
				comb[i][j] = 1;
			}
			else {
				comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
			}
		}
	}
}
#define yo 100001
//------------------変数-----------------------//
//-------------------関数----------------------//
 
ll ketawa(ll b, ll nn) {
	if (nn < b) {
		return nn;
	}
	return ketawa(b, nn / b) + nn%b;
}
int main() {
vector<ll> vec;
vec.push_back(INF);
ll n;cin>>n;
vector<ll>::iterator itr;
REP(i,n){
ll hoge;cin>>hoge;
itr=vec.lower_bound(vec.begin(),vec.end(),hoge);
if(*itr==hoge){vec.erase(itr);}
else{vec.push_back(hoge);vec.insert(itr-1,hoge);}
}
cout<<vec[0]<<endl;
cout<<vec.size()-1<<endl;
}

Compiler output:
a.cc: In function 'void calc_comb()':
a.cc:36:14: error: 'uint32_t' was not declared in this scope
   36 |         for (uint32_t i = 0; i <= MAX_NUM; i++) {
      |              ^~~~~~~~
a.cc:11:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   10 | #include<cstring>
  +++ |+#include <cstdint>
   11 | #include<vector>
a.cc:36:30: error: 'i' was not declared in this scope
   36 |         for (uint32_t i = 0; i <= MAX_NUM; i++) {
      |                              ^
a.cc:37:30: error: expected ';' before 'j'
   37 |                 for (uint32_t j = 0; j <= i; j++) {
      |                              ^~
      |                              ;
a.cc:37:38: error: 'j' was not declared in this scope; did you mean 'jn'?
   37 |                 for (uint32_t j = 0; j <= i; j++) {
      |                                      ^
      |                                      jn
a.cc: In function 'int main()':
a.cc:64:9: error: 'class std::vector<long long int>' has no member named 'lower_bound'
   64 | itr=vec.lower_bound(vec.begin(),vec.end(),hoge);
      |         ^~~~~~~~~~~
Language: C++


#include<string>
#include<vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<cstring>
#include<sstream>
#include<cassert>
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()


using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;


const int MAX_N = 100000;

int main(int argc, char const* argv[])
{
    int N;
    int ans = 0;
    cin >> N;
    

    int nums[MAX_N];


    for (int i = 0; i < N; i++) {
        nums[i] = 0;
    }

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

    sort(nums, nums+N);


    for (int i = 0; i < N; i++) {
        int k = muns[i];
        for (int n = i; n < N; n++) {
            if (k != muns[n+1]) {
                if (n-i+1 % 2 == 1) {
                    ++ans;
                }
                i = n;
                break;
            } 
        }
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:55:17: error: 'muns' was not declared in this scope
   55 |         int k = muns[i];
      |                 ^~~~
Language: C++

#include<iostream>
using namespace std;
void swap(long &a,long &b){
  long c=a;
  a=b;
  b=c;
}
int main(){
  long n,a[123456],b[123456];
  cin>>n>>a[0];
  int dem=0;
  int ki=0;
  int kj=1;
  b[0]=a[0];
  for(int i=1;i<n;i++){
    cin>>a[i];
    for(int bi=ki;bi<kj;bi++)
      if(a[i]==b[bi])
        break;
    if(bi==kj){
      dem++;
      b[kj]=a[i];
      kj++;
    }
    else{
      dem--;
      b[ki]=0;
      swap(b[ki],b[ki-1]);
      ki++;
    }
  }
  cout<<dem;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: 'bi' was not declared in this scope; did you mean 'i'?
   20 |     if(bi==kj){
      |        ^~
      |        i
Language: C++

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

using namespace std;

unsigned char d[10000000100];

int main()
{
	int n;
	cin >> n;
	int result = 0;
	vector<int> v;
	for (int i = 0; i < n; i++)
	{
		int buf;
		cin >> buf;
		//auto itr = std::find(v.begin(), v.end(), buf);
		std::_Vector_iterator < std::_Vector_val<std::_Simple_types<int>>> itr = std::find(v.begin(), v.end(), buf);
		if (itr == v.end())
		{
			v.push_back(buf);
		}
		else
		{
			v.erase(itr);
		}
	}
	cout << v.size() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: '_Vector_iterator' is not a member of 'std'; did you mean '_List_iterator'?
   21 |                 std::_Vector_iterator < std::_Vector_val<std::_Simple_types<int>>> itr = std::find(v.begin(), v.end(), buf);
      |                      ^~~~~~~~~~~~~~~~
      |                      _List_iterator
a.cc:21:46: error: '_Vector_val' is not a member of 'std'; did you mean '_Vector_base'?
   21 |                 std::_Vector_iterator < std::_Vector_val<std::_Simple_types<int>>> itr = std::find(v.begin(), v.end(), buf);
      |                                              ^~~~~~~~~~~
      |                                              _Vector_base
a.cc:21:63: error: '_Simple_types' is not a member of 'std'
   21 |                 std::_Vector_iterator < std::_Vector_val<std::_Simple_types<int>>> itr = std::find(v.begin(), v.end(), buf);
      |                                                               ^~~~~~~~~~~~~
a.cc:21:77: error: expected primary-expression before 'int'
   21 |                 std::_Vector_iterator < std::_Vector_val<std::_Simple_types<int>>> itr = std::find(v.begin(), v.end(), buf);
      |                                                                             ^~~
a.cc:22:21: error: 'itr' was not declared in this scope
   22 |                 if (itr == v.end())
      |                     ^~~
Language: Java

#include<cstdio>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<iostream>

using namespace std;

const int MAXN=1e5+10;
int a[MAXN];

int main()
{
	int n;
	scanf("%d",&n);
	int sum=n;
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
/*	for(int i=1;i<n;i++){
		for(int j=i+1;j<=n;j++){
			if (a[i]==a[j])
				sum-=2;
		}
	}*/
	sort(a+1,a+1+n);
	for(int i=n;i>=2;i--){
		if (a[i]==a[i-1]){
			sum-=2;
			i--;
		}
	}
	printf("%d\n",sum);
	return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<cstdio>
^
Main.java:2: error: illegal character: '#'
#include<iomanip>
^
Main.java:3: error: illegal character: '#'
#include<cmath>
^
Main.java:4: error: illegal character: '#'
#include<cstring>
^
Main.java:5: error: illegal character: '#'
#include<algorithm>
^
Main.java:6: error: illegal character: '#'
#include<iostream>
^
Main.java:10: error: class, interface, enum, or record expected
const int MAXN=1e5+10;
^
Main.java:11: error: class, interface, enum, or record expected
int a[MAXN];
^
Main.java:13: error: unnamed classes are a preview feature and are disabled by default.
int main()
^
  (use --enable-preview to enable unnamed classes)
Main.java:16: error: illegal start of expression
	scanf("%d",&n);
	           ^
Main.java:18: error: illegal start of expression
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	                                 ^
11 errors
Language: Java

import java.util.Map;
import java.util.Scanner;

import org.apache.commons.collections.map.HashedMap;

/**
 * 遊び
 *
 * @author s-sugimoto
 */
public class WriteAndErase {

	/**
	 * コンストラクタ
	 */
	private WriteAndErase() {
	}

	/**
	 * main
	 *
	 * @param args 起動引数
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int count = scanner.nextInt();

		Map<Integer, Boolean> resultMap = new HashedMap();
		for (int i = 0; i < count; i++) {
			int input = scanner.nextInt();
			Boolean tmp = resultMap.get(input);
			if (tmp == null) {
				resultMap.put(input, true);
			} else {
				if (tmp) {
					resultMap.put(input, false);
				} else {
					resultMap.put(input, true);
				}
			}
		}

		System.out.println(resultMap.entrySet().stream().map(e -> e.getValue()).filter(e -> e == true).count());
	}
}


Compiler output:
Main.java:11: error: class WriteAndErase is public, should be declared in a file named WriteAndErase.java
public class WriteAndErase {
       ^
Main.java:4: error: package org.apache.commons.collections.map does not exist
import org.apache.commons.collections.map.HashedMap;
                                         ^
Main.java:28: error: cannot find symbol
		Map<Integer, Boolean> resultMap = new HashedMap();
		                                      ^
  symbol:   class HashedMap
  location: class WriteAndErase
3 errors
Language: C++

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

int main()
{
  int N;
  cin N;
  vector<int> a(N);
  for(int i = 0;i<N;i++)cin>>a[i];
  auto b = a;
  sort(b.begin(),b.end());
  b.erase(unique(b.begin(),b.end()),b.end());
  for(int i=0;i<N;i++) a[i]=lower_bound(b.begin(),b.end(),a[i]) - b.begin();
  vector<int> cnt(b.size());
  for(int i=0;i<N;i++) cnt[a[i]] ^= 1;
  int res = 0;
  for(auto x : cnt) res += x;
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'N'
    7 |   cin N;
      |      ^~
      |      ;
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

import org.apache.commons.collections.map.HashedMap;

/**
 * お遊び
 *
 * @author s-sugimoto
 */
public class Main {

	/**
	 * 隠蔽
	 */
	private Main() {
	}

	/**
	 * main
	 *
	 * @param args 起動引数
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int count = scanner.nextInt();

		Map<Integer, Boolean> resultMap = new HashedMap();
		for (int i = 0; i < count; i++) {
			int input = scanner.nextInt();
			Boolean tmp = resultMap.get(input);
			if (tmp == null) {
				resultMap.put(input, true);
			} else {
				if (tmp) {
					resultMap.put(input, false);
				} else {
					resultMap.put(input, true);
				}
			}
		}

		System.out.println(resultMap.entrySet().stream().map(e -> e.getValue()).filter(e -> e == true).count());
	}

}

Compiler output:
Main.java:6: error: package org.apache.commons.collections.map does not exist
import org.apache.commons.collections.map.HashedMap;
                                         ^
Main.java:30: error: cannot find symbol
		Map<Integer, Boolean> resultMap = new HashedMap();
		                                      ^
  symbol:   class HashedMap
  location: class Main
2 errors
Language: C++

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

using namespace std;

unsigned char d[10000000100];

int main()
{
	int n;
	cin >> n;
	int result = 0;
	vector<int> v;
	for (int i = 0; i < n; i++)
	{
		int buf;
		cin >> buf;
		auto itr = std::find(v.begin(), v.end(), buf);
		if (itr == v.end())
		{
			v.push_back(buf);
		}else
		{
			v.erase(itr);
		}
	}
	cout << v.size() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:37: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   20 |                 auto itr = std::find(v.begin(), v.end(), buf);
      |                            ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:20:37: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   20 |                 auto itr = std::find(v.begin(), v.end(), buf);
      |                            ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

include<stdio.h>
int main(){
  int N,i,j,tmp,s=0;
  scanf("%d",&N);
  int l[N];
  for(i=0;i<N;i++){
    scanf("%d",&l[i]);
  }
  for (i=0; i<N; i++) {
    for (j=i+1; j<N; j++) {
      if (l[i] < l[j]) {
	tmp = l[i];
	l[i] = l[j];
	l[j] = tmp;
	}
    }
  }
  i=0;
  while(i<N){
    j=1;
    while(l[i]==l[i+j]){
      j++;
    }
    if(j%2==1){
      s++;
    }
    i+=j;
  }
  printf("%d",s);
  return 0;
}


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

#include <iostream>
#include <vector>
using namespace std;
 
int main(){
    int N;
    int A;
    vector<int> all;
    int if_ok;
    cin >> N;
    for(int i = 0; i < N; i += 1){
    	if_ok = 1;
    	cin >> A;
    	for(int i2 = 0; i2 < int(all.size()); i2 += 1){
    		if(all[i2] == A){
    			if_ok = 0;
    			v.erase(v.begin() + i2);
    		}
    	}
    	if(if_ok == 1){
	    	all.push_back(A);
    	}
    }
    cout << int(all.size()) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: 'v' was not declared in this scope
   17 |                         v.erase(v.begin() + i2);
      |                         ^
Language: C++

#include<iostream>
///#include<boost/format.hpp>
#include<vector>

using namespace std;
using uint = unsigned int;

int main(){
  int N;
  uint  num;

  std::vector<uint> list;
  
  cin >> N;

  for(int i=0; i<N; i++){
    cin >> num;
    auto result = find( list.begin(),list.end());

    if( result == list.end() ) list.push_back(num);
    else                       list.erase(result);
  }

  cout << list.size(); 
    
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: no matching function for call to 'find(std::vector<unsigned int>::iterator, std::vector<unsigned int>::iterator)'
   18 |     auto result = find( list.begin(),list.end());
      |                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

from collections import Counter
def main():
    N=int(input())
    l=[]
    for i in range(N):
        l.append(int(input()))
    c=Counter(l)
    ans=0
    for i in c:
        if c[i]%2==1:
            ans+=1
    print(ans)

if __name__=='__main__':
    main()


Compiler output:
a.cc:14:14: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   14 | if __name__=='__main__':
      |              ^~~~~~~~~~
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import Counter
      | ^~~~
Language: C++

#include<iostream>
///#include<boost/format.hpp>
#include<vector>

using namespace std;
using uint = unsigned int;

int main(){
  int N;
  uint  num;

  std::vector<uint> list;
  
  cin >> N;

  for(int i=0; i<N; i++){
    cin >> num;
    auto result = find( list.begin(),list.end() , num);

    if( result == list.end() ) list.push_back(num);
    else                       list.erase(result);
  }

  cout << list.size(); 
    
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: no matching function for call to 'find(std::vector<unsigned int>::iterator, std::vector<unsigned int>::iterator, uint&)'
   18 |     auto result = find( list.begin(),list.end() , num);
      |                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:18:23: note:   '__gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   18 |     auto result = find( list.begin(),list.end() , num);
      |                   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++


#include<string>
#include<vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<cstring>
#include<sstream>
#include<cassert>
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()


using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;


const int MAX_N = 100000;

int main(int argc, char const* argv[])
{
    int N;
    int ans = 0;
    cin >> N;
    

    pii nums[MAX_N];


    for (int i = 0; i < N; i++) {
        pii p(0,0);
        nums[i] = p;
    }

    for (int i = 0; i < N; i++) {
        int k;
        cin >> k;
        for (int l = 0; l <= i; l++) {
            if (nums[l].first == 0) {
                nums[l].first = k;
                ++nums[l].second;
                break;
            } else if (nums[l].first == k) {
                ++nums[l].second;
                break;
            }
        }
    }

    int ans = 0;

    for (int i = 0; i < N; i++) {
        if (nums[i].first == 0) {
            break;
        } else if (nums[i].second % 2 == 1) {
            ++ans;
        }
    }

    cout << ans << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:63:9: error: redeclaration of 'int ans'
   63 |     int ans = 0;
      |         ^~~
a.cc:36:9: note: 'int ans' previously declared here
   36 |     int ans = 0;
      |         ^~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
 
int main(){
    int N;
    int A;
    vector<int> all;
    int if_ok;
    cin >> N;
    for(int i = 0; i < N; i += 1){
    	if_ok = 1;
    	cin >> A;
    	for(int i2 = 0; i2 < int(all.size()); i2 += 1){
    		if(all[i2] == A){
    			if_ok = 0;
    		}
    		if(if_ok == 1){
		    	N.push_back(to_string(A));
    		}
    	}
    }
    cout << int(all.size()) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: request for member 'push_back' in 'N', which is of non-class type 'int'
   19 |                         N.push_back(to_string(A));
      |                           ^~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
 
int main(){
    int N;
    int A;
    vector<int> all;
    int if_ok;
    cin >> N;
    for(int i = 0; i < N; i += 1){
    	if_ok = 1;
    	cin >> A;
    	for(int i2 = 0; i2 < int(all.size()); i2 += 1){
    		if(all[i2] == A){
    			if_ok = 0;
    		}
    		if(if_ok == 1){
		    	N.push_back(int(A));
    		}
    	}
    }
    cout << int(all.size()) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: request for member 'push_back' in 'N', which is of non-class type 'int'
   19 |                         N.push_back(int(A));
      |                           ^~~~~~~~~
Language: C++



n=int(input())

A=[]
count=0
for i in range(n):
    number=int(input())
    if not number in A:
        A.append(number)
        count+=1
        
    else:
        j=0
        while not A[j]==number:
            j+=1
        del A[j]
        count-=1
print(count,end='')

Compiler output:
a.cc:19:17: error: empty character constant
   19 | print(count,end='')
      |                 ^~
a.cc:3:1: error: 'n' does not name a type
    3 | n=int(input())
      | ^
Language: C++

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


using namespace std;

vector<long long> a(100001, 0);

int main(){
	long long N;
	long long ansCounter = 0;

	cin >> N;
	long long input;
	for (int i = 0; i < N; i++)
	{
		cin >> input;
		a[input]++;
		if (a[input % 2 == 1) {
			ansCounter++;
		}
		else {
			ansCounter++;
		}
	}


	cout << ansCounter  << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:37: error: expected ']' before ')' token
   20 |                 if (a[input % 2 == 1) {
      |                                     ^
      |                                     ]
Language: C

#include<stdio.h>

#define MAX_N 100000

int n;
int w;
int a[MAX_N];

int main(void)
{
	int num;
	int i, flag;
	
	scanf( "%d", &n );
	
	num = 0;
	while( n-- ) {
		scanf( "%d", &w );
		
		flag = 0;
		for( i=0; i<=num; i++ ) {
			if ( flag == 1 ) {
				a[i-1] = a[i];
			else if ( a[i] == w ) {
				flag = 1;
			}
		}
		
		if ( flag == 0 ) {
			a[i+1] = w;
			num++;
		}
		else {
			num--;
		}
	}
	
	printf( "%d\n", num );
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:25: error: expected '}' before 'else'
   24 |                         else if ( a[i] == w ) {
      |                         ^~~~
Language: C

#include<stdio.h>

#define MAX_N 100000

int n;
int w;
int a[MAX_N];

int main(void)
{
	int num;
	int i, flag;
	
	scanf( "%d", &n );
	
	num = 0;
	while( n-- ) {
		scanf( "%d", &w );
		
		flag = 0;
		for( i=0; i<=num; i++ ) {
			if ( flag == 1 ) {
				a[i-1] = a[i]}
			else if ( a[i] == w ) {
				flag = 1;
			}
		}
		
		if ( flag == 0 ) {
			a[i+1] = w;
			num++;
		}
		else {
			num--;
		}
	}
	
	printf( "%d\n", num );
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:46: error: expected ';' before '}' token
   23 |                                 a[i-1] = a[i]}
      |                                              ^
      |                                              ;
Language: C++

#include <iostream>
using namespace std;
 
int main(){
    int N;
    int A;
    vector<int> all;
    int if_ok;
    cin >> N;
    for(int i = 0; i < N; i += 1){
    	if_ok = 1;
    	cin >> A;
    	for(int i2 = 0; i2 < int(all.size()); i2 += 1){
    		if(all[i2] == A){
    			if_ok = 0;
    		}
    		if(if_ok == 1){
		    	N.push_back(A);
    		}
    	}
    }
    cout << int(all.size()) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> all;
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> all;
      |            ^~~
a.cc:13:34: error: 'all' was not declared in this scope; did you mean 'atoll'?
   13 |         for(int i2 = 0; i2 < int(all.size()); i2 += 1){
      |                                  ^~~
      |                                  atoll
a.cc:18:27: error: request for member 'push_back' in 'N', which is of non-class type 'int'
   18 |                         N.push_back(A);
      |                           ^~~~~~~~~
a.cc:22:17: error: 'all' was not declared in this scope; did you mean 'atoll'?
   22 |     cout << int(all.size()) << endl;
      |                 ^~~
      |                 atoll
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
const int maxn = 100000 + 5;
int A[maxn];
int main()
{
	int n, a, b,sum;
	while (cin>>n)
	{
		memset(A, 0, sizeof(A));
		sum = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> A[i];
		}
		sort(A, A + n);
		a = A[0];
		b = 1;
		A[n] = 0;
		for(int i = 1; i <= n; i++)
		{
			if (a == A[i])
			{
				b++;
			}
			else
			{
				a = A[i];
				sum += b % 2;
				b = 1;
			}
		}
		cout << sum << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'memset' was not declared in this scope
   11 |                 memset(A, 0, sizeof(A));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;