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

#include <iostream>
#include <vector>
#include <deque>

using namespace std;

const int MAX = 8009 * 2, ORIGIN = 8009;
int b[MAX][MAX], x, y;
vector<int> sy, sx, d;

bool valid(int p);
deque<vector<int>> dp(const vector<int> &iv, const vector<int> &sv);

bool valid(int p) {
	return (0 <= p && p < MAX);
}

vector<int> dp(const vector<int> &iv, const vector<int> &sv) {
	deque<vector<int>> l;
	l.push_back(iv);
	for (int i = 0; i < sv.size(); i++) {
		vector<int> newv(MAX);
		for (int j = 0; j < MAX; j++) {
			 if (valid(j - sv[i]) && l.front()[j - sv[i]] == 1) {
			 	newv[j] = 1;
			 } else if (valid(j + sv[i]) && l.front()[j + sv[i]] == 1) {
			 	newv[j] = 1;
			 }
		}
		l.push_back(newv);
		l.pop_front();
	}
	return l.front();
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	
	string s;
	cin >> s >> x >> y;
	int dist = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'T') break;
		dist++;
	}
	int dir = -1, start = dist;
	dist = 0;
	for (int i = start + 1; i < s.size(); i++) {
		if (s[i] == 'F') dist++;
		else {
			if (dist != 0) d.push_back(dir * dist);
			dir *= -1;
			dist = 0;
		}
	}
	if (dist != 0) d.push_back(dir * dist);
	for (int i = 0; i < d.size(); i++) {
		if (d[i] < 0) sy.push_back(abs(d[i]));
		else sx.push_back(abs(d[i]));
	}
	vector<int> ix(MAX), iy(MAX);
	ix[ORIGIN + start] = iy[ORIGIN] = 1;
	vector<int> dy = dp(iy, sy), dx = dp(ix, sx);
	if (dy[ORIGIN + y] && dx[ORIGIN + x]) {
		cout << "Yes\n";
	} else {
		cout << "No\n";
	}
	
	return 0;
}


Compiler output:
a.cc:18:13: error: ambiguating new declaration of 'std::vector<int> dp(const std::vector<int>&, const std::vector<int>&)'
   18 | vector<int> dp(const vector<int> &iv, const vector<int> &sv) {
      |             ^~
a.cc:12:20: note: old declaration 'std::deque<std::vector<int> > dp(const std::vector<int>&, const std::vector<int>&)'
   12 | deque<vector<int>> dp(const vector<int> &iv, const vector<int> &sv);
      |                    ^~
a.cc: In function 'int main()':
a.cc:64:28: error: conversion from 'std::deque<std::vector<int> >' to non-scalar type 'std::vector<int>' requested
   64 |         vector<int> dy = dp(iy, sy), dx = dp(ix, sx);
      |                          ~~^~~~~~~~
a.cc:64:45: error: conversion from 'std::deque<std::vector<int> >' to non-scalar type 'std::vector<int>' requested
   64 |         vector<int> dy = dp(iy, sy), dx = dp(ix, sx);
      |                                           ~~^~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <deque>

using namespace std;

const int MAX = 8009 * 2, ORIGIN = 8009;
int b[MAX][MAX], x, y;
vector<int> sy, sx, d;

bool valid(int p);
list<vector<int>> dp(const vector<int> &iv, const vector<int> &sv);

bool valid(int p) {
	return (0 <= p && p < MAX);
}

void printv(const vector<int> &v) {
	for (int i = ORIGIN - 10; i < ORIGIN + 10; i++) {
		cerr << v[i] << ' ';
	}
	cout << '\n';
}

void debug(const vector<int> &v) {
	for (auto ch : v) {
		cout << ch << ' ';
	}
	cout << '\n';
}

deque<vector<int>> dp(const vector<int> &iv, const vector<int> &sv) {
	deque<vector<int>> l;
	l.push_back(iv);
	for (int i = 0; i < sv.size(); i++) {
		vector<int> newv(MAX);
		for (int j = 0; j < MAX; j++) {
			 if (valid(j - sv[i]) && l.front()[j - sv[i]] == 1) {
			 	newv[j] = 1;
			 } else if (valid(j + sv[i]) && l.front()[j + sv[i]] == 1) {
			 	newv[j] = 1;
			 }
		}
		l.push_back(newv);
//		printv(newv);
		l.pop_front();
	}
	return l;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	
	string s;
	cin >> s >> x >> y;
	int dist = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'T') break;
		dist++;
	}
	int dir = -1, start = dist;
	dist = 0;
	for (int i = start + 1; i < s.size(); i++) {
		if (s[i] == 'F') dist++;
		else {
			if (dist != 0) d.push_back(dir * dist);
			dir *= -1;
			dist = 0;
		}
	}
	if (dist != 0) d.push_back(dir * dist);
	for (int i = 0; i < d.size(); i++) {
		if (d[i] < 0) sy.push_back(abs(d[i]));
		else sx.push_back(abs(d[i]));
	}
//	debug(sx);
//	debug(sy);
	vector<int> ix(MAX), iy(MAX);
	ix[ORIGIN + start] = iy[ORIGIN] = 1;
	vector<int> dy = dp(iy, sy).front(), dx = dp(ix, sx).front();
	if (dy[ORIGIN + y] && dx[ORIGIN + x]) {
		cout << "Yes\n";
	} else {
		cout << "No\n";
	}
	
	return 0;
}


Compiler output:
a.cc:12:1: error: 'list' does not name a type
   12 | list<vector<int>> dp(const vector<int> &iv, const vector<int> &sv);
      | ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

const int MAX = 9009 * 2, ORIGIN = 9009;
int len, b[MAX][MAX], v[MAX][MAX], x, y;
vector<int> d;

void dfs(int y, int x, int i) {
	//cerr << y << ' ' << x << '\n';
	v[y][x] = 1;
	if (i == d.size()) return;
	if (d[i] < 0) {
		if (!v[y + d[i]][x]) dfs(y + d[i], x, i + 1);
		if (!v[y - d[i]][x]) dfs(y - d[i], x, i + 1);
	} else {
		if (!v[y][x + d[i]]) dfs(y, x + d[i], i + 1);
		if (!v[y][x - d[i]]) dfs(y, x - d[i], i + 1);
	}
}

void debug(const vector<int> &v) {
	for (auto ch : v) {
		cerr << ch << ' ';
	}
	cout << '\n';
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	
	string s;
	cin >> s >> x >> y;
	len = s.size();
	int dist = 0;
	for (int i = 0; i < len; i++) {
		if (s[i] == 'T') break;
		dist++;
	}
	int dir = -1, start = dist;
	dist = 0;
	for (int i = start + 1; i < len; i++) {
		if (s[i] == 'F') dist++;
		else {
			if (dist != 0) d.push_back(dir * dist);
			dir *= -1;
			dist = 0;
		}
	}
	if (dist != 0) d.push_back(dir * dist);
	//debug(d);
	dfs(ORIGIN, ORIGIN + start, 0);
	if (v[ORIGIN + y][ORIGIN + x]) {
		cout << "Yes\n";
	} else {
		cout << "No\n";
	}
		
	return 0;
}


Compiler output:
/tmp/cczDiHwi.o: in function `dfs(int, int, int)':
a.cc:(.text+0x46): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cczDiHwi.o
a.cc:(.text+0x6b): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cczDiHwi.o
a.cc:(.text+0x8f): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cczDiHwi.o
a.cc:(.text+0xe0): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cczDiHwi.o
a.cc:(.text+0x10d): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cczDiHwi.o
a.cc:(.text+0x162): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cczDiHwi.o
a.cc:(.text+0x195): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cczDiHwi.o
a.cc:(.text+0x1e6): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cczDiHwi.o
a.cc:(.text+0x213): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cczDiHwi.o
a.cc:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cczDiHwi.o
/tmp/cczDiHwi.o: in function `main':
a.cc:(.text+0x396): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

int main (){
  int N;
  cin >> N;
  int a[100000];
  for (int i=0;i<N;i++){
    cin >> a[i];
  }
  for (int i=0;i<N;i++){
    mpa[a[i]]++;
  }
  ll ans=0;
  int f=0;
  int s=0;
  for (int i=0;i<N;i++){
      f=mpa.first;
      s=mpa.second;
      if(s<f){
        ans+=s;
      }
      else{
        ans+=s-f;
      }
  }

  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: 'class std::map<int, int>' has no member named 'first'
   29 |       f=mpa.first;
      |             ^~~~~
a.cc:30:13: error: 'class std::map<int, int>' has no member named 'second'
   30 |       s=mpa.second;
      |             ^~~~~~
Language: Java

import java.util.Scanner;
import java.util.ArrayList;

class Good_Sequence {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    int array[] = new int[num];
    ArrayList<Integer> table = new ArrayList<Integer>();
    int n = 0;
    int sum = 1;
    int ans = 0;
    boolean flag = false;

    for ( int i = 0; i < num; i++ ) {
      array[i] = scan.nextInt();
    }

    for ( int k = 0; k < num; k++ ) {
      for ( int a = 0; a < n; a++ ) {
        if ( array[k] == table.get(a) ) {
           // System.out.println("out");
           flag = true;
        }
      }
      if ( flag == true ) { flag = false; break; }
      for ( int j = k + 1; j < num; j++ ) {
        if ( array[k] == array[j] ) {
          sum++;
        }
      }
      if ( array[k] <= sum ) {
        ans += sum - array[k];
      } else {
        ans += sum;
      }
      table.add(new Integer(array[k]));
      n++;
      sum = 1;
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:37: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      table.add(new Integer(array[k]));
                ^
1 warning
Language: Java

import java.util.*;

class Good_Sequence {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    int array[] = new int[num];
    ArrayList<Integer> table = new ArrayList<Integer>();
    int n = 0;
    int sum = 1;
    int ans = 0;
    boolean flag = false;

    for ( int i = 0; i < num; i++ ) {
      array[i] = scan.nextInt();
    }

    for ( int k = 0; k < num; k++ ) {
      for ( int a = 0; a < n; a++ ) {
        if ( array[k] == table.get(a) ) {
           // System.out.println("out");
           flag = true;
        }
      }
      if ( flag == true ) { flag = false; break; }
      for ( int j = k + 1; j < num; j++ ) {
        if ( array[k] == array[j] ) {
          sum++;
        }
      }
      if ( array[k] <= sum ) {
        ans += sum - array[k];
      } else {
        ans += sum;
      }
      table.add(new Integer(array[k]));
      n++;
      sum = 1;
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:36: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      table.add(new Integer(array[k]));
                ^
1 warning
Language: Java

class Good_Sequence {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    int array[] = new int[num];
    ArrayList<Integer> table = new ArrayList<Integer>();
    int n = 0;
    int sum = 1;
    int ans = 0;
    boolean flag = false;

    for ( int i = 0; i < num; i++ ) {
      array[i] = scan.nextInt();
    }

    for ( int k = 0; k < num; k++ ) {
      for ( int a = 0; a < n; a++ ) {
        if ( array[k] == table.get(a) ) {
           // System.out.println("out");
           flag = true;
        }
      }
      if ( flag == true ) { flag = false; break; }
      for ( int j = k + 1; j < num; j++ ) {
        if ( array[k] == array[j] ) {
          sum++;
        }
      }
      if ( array[k] <= sum ) {
        ans += sum - array[k];
      } else {
        ans += sum;
      }
      table.add(new Integer(array[k]));
      n++;
      sum = 1;
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:3: error: cannot find symbol
    Scanner scan = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Good_Sequence
Main.java:3: error: cannot find symbol
    Scanner scan = new Scanner(System.in);
                       ^
  symbol:   class Scanner
  location: class Good_Sequence
Main.java:6: error: cannot find symbol
    ArrayList<Integer> table = new ArrayList<Integer>();
    ^
  symbol:   class ArrayList
  location: class Good_Sequence
Main.java:6: error: cannot find symbol
    ArrayList<Integer> table = new ArrayList<Integer>();
                                   ^
  symbol:   class ArrayList
  location: class Good_Sequence
Main.java:34: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      table.add(new Integer(array[k]));
                ^
4 errors
1 warning
Language: Java

import java.util.*;

public class Good_Sequence {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    int array[] = new int[num];
    ArrayList<Integer> table = new ArrayList<Integer>();
    int n = 0;
    int sum = 1;
    int ans = 0;
    boolean flag = false;

    for ( int i = 0; i < num; i++ ) {
      array[i] = scan.nextInt();
    }

    for ( int k = 0; k < num; k++ ) {
      for ( int a = 0; a < n; a++ ) {
        if ( array[k] == table.get(a) ) {
           // System.out.println("out");
           flag = true;
        }
      }
      if ( flag == true ) { flag = false; break; }
      for ( int j = k + 1; j < num; j++ ) {
        if ( array[k] == array[j] ) {
          sum++;
        }
      }
      if ( array[k] <= sum ) {
        ans += sum - array[k];
      } else {
        ans += sum;
      }
      table.add(new Integer(array[k]));
      n++;
      sum = 1;
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:3: error: class Good_Sequence is public, should be declared in a file named Good_Sequence.java
public class Good_Sequence {
       ^
Main.java:36: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
      table.add(new Integer(array[k]));
                ^
1 error
1 warning
Language: C++

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;


int main(){
    int a = 10;

    int N;

    cin >> N;
    VI avec(N);

    REP(i,N){
        int a;
        cin >> a;
        avec.push_back(a);
    }
    sort(avec.begin(), avec.end())
    priority_queue<int> q(avec.begin(), avec.end());

    int olda = -1;
    int newa = -1;
    int count = 0;
    int ans = 0;

    if(q.empty()){
        cout << "0" << endl;
        return 0;
    }
    
    while(!q.empty()){        
        do{
            olda = q.top();
            count++;
            q.pop();
        }while(!q.empty() && olda == q.top() );
        if( count < olda) ans += count;
        else               ans += count - olda;
        count = 0;
    }

    cout << ans << endl;
   
}





Compiler output:
a.cc: In function 'int main()':
a.cc:88:35: error: expected ';' before 'priority_queue'
   88 |     sort(avec.begin(), avec.end())
      |                                   ^
      |                                   ;
   89 |     priority_queue<int> q(avec.begin(), avec.end());
      |     ~~~~~~~~~~~~~~                 
a.cc:96:8: error: 'q' was not declared in this scope
   96 |     if(q.empty()){
      |        ^
a.cc:101:12: error: 'q' was not declared in this scope
  101 |     while(!q.empty()){
      |            ^
Language: C++

# coding:utf-8

x=int(input())
member=list(map(int, input().split()))

table=(10**9)*[int(0)]
ans=0
for i in range(x):
    table[member[i]] += 1

    if (table[member[i]] != member[i]):
        ans += 1
    else:
        ans -= (member[i]-1);


print(ans)

'''
# {{{

# }}}
'''


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding:utf-8
      |   ^~~~~~
a.cc:19:1: error: empty character constant
   19 | '''
      | ^~
a.cc:19:3: warning: missing terminating ' character
   19 | '''
      |   ^
a.cc:19:3: error: missing terminating ' character
a.cc:20:3: error: invalid preprocessing directive #{
   20 | # {{{
      |   ^
a.cc:22:3: error: invalid preprocessing directive #}
   22 | # }}}
      |   ^
a.cc:23:1: error: empty character constant
   23 | '''
      | ^~
a.cc:23:3: warning: missing terminating ' character
   23 | '''
      |   ^
a.cc:23:3: error: missing terminating ' character
a.cc:3:1: error: 'x' does not name a type
    3 | x=int(input())
      | ^
a.cc:17:6: error: expected constructor, destructor, or type conversion before '(' token
   17 | print(ans)
      |      ^
Language: C++

using namespace std;
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int a[100000] = { 0 };
int main() {
	int N;
	int sum = 0;
	int temp;

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >>temp;
		temp <= N ? a[temp]++ : sum++;
	}
	for (int j = 1; j <= N; j++) sum+=a[j]>= j? a[j]-j:a[j];
	cout << sum;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
   12 |         cin >> N;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << sum;
      |         ^~~~
a.cc:18:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

int main()
{
	long long int N, i, ans, a[100001], b[100001]; 
	cin>> N;
	ans=0;
	for(i=1;i<=N;i++)
	{
		b[i]=0;
	}
	for(i=1;i<=N;i++)
	{
		cin >> a[i];
		if(a[i]>N) ans++;
		else b[a[i]]++;
		
	}
	for(i=1;i<=N;i++)
	{
		if(b[i]<i) ans+=b[i];
		else ans+=b[i]-i;	
	}
	cout<< ans;
}

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

int main()
{
	long long int N, ans, a[100001], b[100001]; 
	cin>> N;
	ans=0;
	for(i=1;i<=N;i++)
	{
		b[i]=0;
	}
	for(i=1;i<=N;i++)
	{
		cin >> a[i];
		if(a[i]>100000) ans++;
		else b[a[i]]++;
	}
	for(i=1;i<=N;i++)
	{
		if(b[i]<i) ans+=b[i];
		else ans+=b[i]-i;	
	}
	cout<< ans;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin>> N;
      |         ^~~
a.cc:6:13: error: 'i' was not declared in this scope
    6 |         for(i=1;i<=N;i++)
      |             ^
a.cc:10:13: error: 'i' was not declared in this scope
   10 |         for(i=1;i<=N;i++)
      |             ^
a.cc:16:13: error: 'i' was not declared in this scope
   16 |         for(i=1;i<=N;i++)
      |             ^
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout<< ans;
      |         ^~~~
Language: Java

public static void main(String[] args) throws IOException {
		Scanner reader = new Scanner(System.in);
		
		int x = reader.nextInt();
		int[] counter = new int[x];
		List<Integer> list = new LinkedList<Integer>();
		for(int i = 0; i < x ; i++){
			list.add(reader.nextInt());
		}
		int count = 0;		
		Set set = new TreeSet();
		int[] vis = new int[x];
		int[] countvis = new int[x];
		for(int i = 0; i<list.size(); i++){
			int temp = list.get(i);
			if(!set.contains(temp)){
				set.add(temp);
				vis[count] = temp; 
				countvis[count] = 1;
						
			}else{
				countvis[count]++;
				count++;
			}
		}
		System.out.println(Arrays.toString(vis));
		System.out.println(Arrays.toString(countvis));
		
		int number = 0;
		for(int i = 0; i<set.size(); i++){
			if(vis[i]!=countvis[i]){
				if(vis[i]<countvis[i]){
					number+=(vis[i]-countvis[i]);
				}
				else{					
					number+=vis[i];
				}
			}
		}
		System.out.println(number);
	}

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

import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

import javax.imageio.IIOException;

public class Atcoder_goodsequence {
	public static void main(String[] args) throws IOException {
		Scanner reader = new Scanner(System.in);
		
		int x = reader.nextInt();
		int[] counter = new int[x];
		List<Integer> list = new LinkedList<Integer>();
		for(int i = 0; i < x ; i++){
			list.add(reader.nextInt());
		}
		int count = 0;		
		Set set = new TreeSet();
		int[] vis = new int[x];
		int[] countvis = new int[x];
		for(int i = 0; i<list.size(); i++){
			int temp = list.get(i);
			if(!set.contains(temp)){
				set.add(temp);
				vis[count] = temp; 
				countvis[count] = 1;
						
			}else{
				countvis[count]++;
				count++;
			}
		}
		
		int number = 0;
		for(int i = 0; i<set.size(); i++){
			if(vis[i]!=countvis[i]){
				if(vis[i]<countvis[i]){
					number+=(vis[i]-countvis[i]);
				}
				else{					
					number+=vis[i];
				}
			}
		}
		System.out.println(number);
	}
}


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

#[allow(unused_imports)]
use std::io;
#[allow(unused_imports)]
use std::cmp;
use std::collections::LinkedList;

#[allow(dead_code)]
fn getline() -> LinkedList<String> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok().unwrap();
    s.split(' ')
        .map(|x| x.trim().to_string())
        .collect::<LinkedList<String>>()
}

#[allow(dead_code)]
fn get<T: std::str::FromStr>(l: &mut LinkedList<String>) -> T {
    l.pop_front().and_then(|s| s.parse().ok()).unwrap()
}

fn main() {
    let _ = getline();
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    let mut v: Vec<i32> = s.split(' ').map(|x| x.trim().parse().unwrap()).collect();
    v.sort();
    let mut prev: i32 = 0;
    let mut prev_count: i32 = 0;
    let mut ans: i32 = 0;
    for x in v {
        if x == prev {
            prev_count += 1;
        } else {
            if prev < prev_count {
                ans += prev_count - prev;
            } else if prev > prev_count {
                ans += prev_count;
            }
            prev = x;
            prev_count = 1;
        }
    }
    if prev < prev_count {
        ans += prev_count - prev;
    } else if prev > prev_count {
        ans += prev_count;
    }
    println!("{}", ans);
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #[
    1 | #[allow(unused_imports)]
      |  ^
a.cc:3:2: error: invalid preprocessing directive #[
    3 | #[allow(unused_imports)]
      |  ^
a.cc:7:2: error: invalid preprocessing directive #[
    7 | #[allow(dead_code)]
      |  ^
a.cc:16:2: error: invalid preprocessing directive #[
   16 | #[allow(dead_code)]
      |  ^
a.cc:2:1: error: 'use' does not name a type
    2 | use std::io;
      | ^~~
a.cc:4:1: error: 'use' does not name a type
    4 | use std::cmp;
      | ^~~
a.cc:5:1: error: 'use' does not name a type
    5 | use std::collections::LinkedList;
      | ^~~
a.cc:8:1: error: 'fn' does not name a type
    8 | fn getline() -> LinkedList<String> {
      | ^~
a.cc:17:1: error: 'fn' does not name a type
   17 | fn get<T: std::str::FromStr>(l: &mut LinkedList<String>) -> T {
      | ^~
a.cc:21:1: error: 'fn' does not name a type
   21 | fn main() {
      | ^~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
const int N=200000;
int n;
struct h{int num,cnt;}p[N];
int tmp[N];
int main()
{
ios::sync_with_stdio(false);
cin >>n;
for(int i=1;i<=n;i++)
	cin >>tmp[i];
sort(tmp+1,tmp+1+n);
int m=0;
for(int i=1;i<=n;i++)
	{
	if(p[m].num!=tmp[i])
		{
		p[++m].num=tmp[i];
		p[m].cnt=1;
		}
		else 
			{
			p[m].cnt++;
			}
	}
int ans=0;
for(int i=1;i<=m;i++)
	{
	if(p[i].num>p[i].cnt)
		ans+=p[i].cnt;
	else if(p[i].num<p[i].cnt) ans+=p[i].cnt-p[i].num;
	}
cout <<ans;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 | sort(tmp+1,tmp+1+n);
      | ^~~~
      | short
Language: C++

#include <iostream>
#include <map>
#include <vector>
#include <cstring>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <deque>
#include <math.h>
#include <stdio.h>
#include <time.h>
#define mp make_pair
typedef long long ll;
using namespace std;
const int INF=1000000000;
int num[INF];
int cnt[INF];
bool use[INF]={true};
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>num[i];
		cnt[num[i]]++;
		use[num[i]]=false;
	}
	int ans=0;
	for(int i=0;i<n;i++)
	{
		if(use[num[i]]==false)
		{
			use[num[i]]=true;
			if(num[i]>cnt[num[i]])
			{
				ans+=cnt[num[i]];
			}
			else
			{
				ans+=cnt[num[i]]-num[i];
			}
		}
	}
	cout<<ans;
	return 0;
}


Compiler output:
g++: internal compiler error: File size limit exceeded signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
Language: C++

#include <iostream>

using namespace std;

void forword_1(char vec, int& x, int& y);
char change_val(char vec, int x, int y);

int main()
{
	char vec = 0;
	int x = 0, y = 0;
	string code;
	
	cin >> code;
	cin >> x >> y;
	
	char* opc = new char[code.size() + 1];
	char* pc = opc;
	char_traits<char>::copy(opc, code.c_str(), code.size() + 1);
	
	while(*pc <= code.size)
	{
		switch(*pc)
		{
			case 'T':
				vec = change_val(vec, x, y);
				break;
			case 'F':
				forword_1(vec, x, y);
				break;
		}
		pc++;
	}
	
	if(x == 0 && y == 0)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
	
	delete[] opc;
	
	return 0;
}

void forword_1(char val, int& x, int& y)
{
	switch(val)
	{
		case 0:
			--x;
			break;
		case 1:
			--y;
			break;
		case 2:
			++x;
			break;
		case 3:
			++y;
			break;
	}
}

char change_val(char vec, int x, int y)
{
	char result;
	switch(vec)
	{
		case 0:
		case 2:
			if(y >= 0)
			{
				result = 1;
			}
			else
			{
				result = 3;
			}
			break;
		case 1:
		case 3:
			if(x >= 0)
			{
				result = 0;
			}
			else
			{
				result = 2;
			}
			break;
	}
	return result;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   21 |         while(*pc <= code.size)
      |                      ~~~~~^~~~
      |                               ()
Language: C++

#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
using namespace std;
const int maxn=8010;
int n, m;
int tot[2], a[2][500010];
bool f[233][500010];
char s[maxn];
int main()
{
//	freopen("1.in", "r", stdin);
	scanf("%s", s+1); scanf("%d%d", &n, &m);
	int len=strlen(s+1); int now=0; tot[0]=1;
	for(int i=1;i<=len;i++)
		if(s[i]=='T') now^=1, tot[now]++;
			else a[now][tot[now]]++;
//	printf("%d %d\n", tot[0], tot[1]);
	f[1][a[0][1]+maxn]=1;
//	printf("%d %d %d %d\n", a[0][1]+maxn, n+maxn, m+maxn, f[1][a[0][1]+maxn]);
	for(int i=2;i<=tot[0];i++)
	for(int j=0;j<=16000;j++)
	{
		f[i&1][j]=0;
		if(j>=a[0][i]) f[i&1][j]|=f[i&1^1][j-a[0][i]];
		if(j+a[0][i]<=16000) f[i&1][j]|=f[i&1^1][j+a[0][i]];
//		if(f[i&1^1][j]) printf("%d %d\n", i, j);
	}
//	for(int j=0;j<=16000;j++) if(f[tot[0]&1][j])printf("%d %d\n", j, f[tot[0]&1][j]);
	if(!f[tot[0]&1][n+maxn]) return puts("No");
	/*memset(f, 0, sizeof(f)); f[0][maxn]=1;
	for(int i=1;i<=tot[1];i++)
	for(int j=0;j<=16000;j++)
	{	
		f[i&1][j]=0;
		if(j>=a[1][i]) f[i&1][j]|=f[i&1^1][j-a[1][i]];
		if(j+a[1][i]<=16000) f[i&1][j]|=f[i&1^1][j+a[1][i]];
	}
	if(!f[tot[1]&1][m+maxn]) return puts("No");
	puts("Yes");
}

Compiler output:
a.cc:32:9: error: unterminated comment
   32 |         /*memset(f, 0, sizeof(f)); f[0][maxn]=1;
      |         ^
a.cc: In function 'int main()':
a.cc:31:52: error: expected '}' at end of input
   31 |         if(!f[tot[0]&1][n+maxn]) return puts("No");
      |                                                    ^
a.cc:12:1: note: to match this '{'
   12 | {
      | ^
Language: C++

using namespace std;
 string s;
int x,y,F=0,f=0;

void dfs(int now=0,int nx=0,int ny=0,int nt=1,int i=0){
  if(f)return;
  if(abs(nx-x)+abs(ny-y)>F-now)return;
  if(i==s.size()){
    if(nx==x&&ny==y){
      cout<<"Yes"<<endl;
      f=1;
    }
    return;
  }
  if(s[i]=='F'){
    if(nt==0)dfs(now+1,nx,ny+1,nt,i+1);
    if(nt==1)dfs(now+1,nx+1,ny,nt,i+1);
    if(nt==2)dfs(now+1,nx,ny-1,nt,i+1);
    if(nt==3)dfs(now+1,nx-1,ny,nt,i+1);
  }else if(s[i]=='T'){
    dfs(now,nx,ny,(nt+1)%4,i+1);
    dfs(now,nx,ny,(nt+3)%4,i+1);
  }else{
    dfs(now,nx,ny,(nt+2)%4,i+1);
    dfs(now,nx,ny,nt,i+1);
  }
}

int main(){
  cin>>s>>x>>y;
  for(int i=0;i<s.size();i++){
    if(s[i]=='F')F++;
    if(i<s.size()-1){
      if(s[i]=='T'){
	int cnt=0;
	while(s[i+1]=='T'&&s[i+1]!='¥0'){
	  cnt++;
	  s.erase(s.begin()+i+1);
	}
	if(cnt%2!=0)s[i]='t';
      }
    }
  }
  dfs();
  if(!f)cout<<"No"<<endl;
  return 0;
}


Compiler output:
a.cc:36:36: warning: multi-character character constant [-Wmultichar]
   36 |         while(s[i+1]=='T'&&s[i+1]!='¥0'){
      |                                    ^~~~
a.cc:2:2: error: 'string' does not name a type
    2 |  string s;
      |  ^~~~~~
a.cc: In function 'void dfs(int, int, int, int, int)':
a.cc:7:6: error: 'abs' was not declared in this scope
    7 |   if(abs(nx-x)+abs(ny-y)>F-now)return;
      |      ^~~
a.cc:8:9: error: 's' was not declared in this scope
    8 |   if(i==s.size()){
      |         ^
a.cc:10:7: error: 'cout' was not declared in this scope
   10 |       cout<<"Yes"<<endl;
      |       ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |       cout<<"Yes"<<endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:15:6: error: 's' was not declared in this scope
   15 |   if(s[i]=='F'){
      |      ^
a.cc: In function 'int main()':
a.cc:30:3: error: 'cin' was not declared in this scope
   30 |   cin>>s>>x>>y;
      |   ^~~
a.cc:30:3: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:8: error: 's' was not declared in this scope
   30 |   cin>>s>>x>>y;
      |        ^
a.cc:45:9: error: 'cout' was not declared in this scope
   45 |   if(!f)cout<<"No"<<endl;
      |         ^~~~
a.cc:45:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:45:21: error: 'endl' was not declared in this scope
   45 |   if(!f)cout<<"No"<<endl;
      |                     ^~~~
a.cc:45:21: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<iostream>
#include<string>
#include <cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define ll long long
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define SWAP(a,b) (a += b,b = a - b,a -= b)
#define all(c) (c).begin(), (c).end()
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N,tmp,cnt,ans=0
  cin >> N;
  vector<ll> a;
  vector<ll> b;
  rep(i,N)
  {
    cin >> tmp;
    a.push_back(tmp);
    b.push_back(tmp);
  }
  sort(all(a));
  sort(all(b));
  b.erase(unique(all(b)),b.end());
  tmp=b.size();
  rep(i,tmp)
  {
    cnt=count(all(a),b[i]);
    if(cnt>b[i]){
      ans= ans + (cnt-b[i]);
    }
    else if(cnt<b[i]){
      ans = ans + cnt;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: expected ',' or ';' before 'cin'
   20 |   cin >> N;
      |   ^~~
Language: C

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

static int compar(const void* pa, const void* pb)
{
	const int *a = pa;
	const int *b = pb;

	return *a - *b;
}
int main(void)
{
	int n;
	int a[100001];
	int i;
	int before = 0;
	int sum = 0, count = 0;

	scanf("%d", &n);

	for (i = 0; i < n; ++i){
		scanf("%d", a + i);
	}
	a[n] = INT_MAX;
	qsort(a, n, sizeof(int), compar);
	for (i = 0; i <= n; ++i){
		if (before < a[i]){
			sum += count < before ? count : (count - before);
			count = 0;
		}
		++count;
		before = a[i];
	}
	printf("%d\n", sum);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:25:16: error: 'INT_MAX' undeclared (first use in this function)
   25 |         a[n] = INT_MAX;
      |                ^~~~~~~
main.c:4:1: note: 'INT_MAX' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>'
    3 | #include <stdlib.h>
  +++ |+#include <limits.h>
    4 | 
main.c:25:16: note: each undeclared identifier is reported only once for each function it appears in
   25 |         a[n] = INT_MAX;
      |                ^~~~~~~
Language: C++

#include<stdio.h>
int main()
{
	int n,a[100010];
	while(~scanf("%d",&n))
	{
		long long b;
		if(n==1)
		{
			scanf("%lld",&b);
			if(b==1)
			{
				printf("0\n");
			}
			else
			{
				printf("1\n");
			}
			continue;
		}
		for(i=0;i<100010;i++)
		a[i]=0;
		int s=0;
		for(int i=0;i<n;i++)
		{
			scanf("%lld",&b);
			if(b>100000)
			{
				s++;
			}
			else
			{
				a[b]++;
			}
		}
		for(int i=0;i<=100000;i++)
		{
			if(a[i]>i)
			{
				s+=a[i]-i;
			}
			else if(a[i]<i)
			{
				s+=a[i];
			}
		}
		printf("%d\n",s);
	}
}


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

#include <cstdio>
#include <cstring>
using namespace std;
char s[8001];
int main(){
	register int n, i, x, y, prex, cntx, cnty, marken;
	scanf("%s", s);
	n = strlen(s);
	scanf("%d %d", &x, &y);
	if (y < 0) y = -y;
	prex = 0;
	for (i = 0; s[i] == 'F'; ++i) ++prex;
	for (marken = cntx = cnty = 0; i < n; ++i) {
		if (s[i] == 'T') marken ^= 1;
		else if (marken) ++cnty;
		else ++cntx;
	}
	if (x > 0) {
		cntx += prex;
		if (cntx >= x && (cntx & x & 1) == 0 && cnty >= y && (cnty & y & 1) == 0) puts("Yes");
		else puts("No"); 
	}
	else {
		cnt -= prex;
		x = -x;
		if (cntx >= x && (cntx & x & 1) == 0 && cnty >= y && (cnty & y & 1) == 0) puts("Yes");
		else puts("No");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                      ^
a.cc:6:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                         ^
a.cc:6:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                            ^
a.cc:6:31: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                               ^
a.cc:6:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                                  ^~~~
a.cc:6:40: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                                        ^~~~
a.cc:6:46: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                                              ^~~~
a.cc:6:52: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                                                    ^~~~~~
a.cc:24:17: error: 'cnt' was not declared in this scope; did you mean 'cnty'?
   24 |                 cnt -= prex;
      |                 ^~~
      |                 cnty
Language: C++

#include <cstdio>
#include <cstring>
using namespace std;
char s[8001];
int main(){
	register int n, i, x, y, prex, cntx, cnty, marken;
	scanf("%s", s);
	n = strlen(s);
	scanf("%d %d", &x, &y);
	if (y < 0) y = -y;
	prex = 0;
	for (i = 0; s[i] == 'F'; ++i) ++prex;
	for (marken = cntx = cnty = i = 0; i < n; ++i) {
		if (s[i] == 'T') marken ^= 1;
		else if (marken) ++cnty;
		else ++cntx;
	}
	if (x > 0) {
		cntx += prex;
		if (cntx >= x && (cntx & x & 1) == 0 && cnty >= y && (cnty & y & 1) == 0) puts("Yes");
		else puts("No"); 
	}
	else {
		cnt -= prex;
		x = -x;
		if (cntx >= x && (cntx & x & 1) == 0 && cnty >= y && (cnty & y & 1) == 0) puts("Yes");
		else puts("No");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                      ^
a.cc:6:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                         ^
a.cc:6:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                            ^
a.cc:6:31: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                               ^
a.cc:6:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                                  ^~~~
a.cc:6:40: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                                        ^~~~
a.cc:6:46: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                                              ^~~~
a.cc:6:52: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         register int n, i, x, y, prex, cntx, cnty, marken;
      |                                                    ^~~~~~
a.cc:24:17: error: 'cnt' was not declared in this scope; did you mean 'cnty'?
   24 |                 cnt -= prex;
      |                 ^~~
      |                 cnty
Language: C++

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

int a[200002];


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

	memset(&a[0], sizeof(a), 0);

	int ans = 0;
	for (int i = 0; i < N; i++) {
		int in;
		cin >> in;
		if (in >= 200002) ans++;
		else a[in]++;
	}


	for (int i = 1; i < 200002; i++) {
		if (a[i] < i) ans += a[i];
		else ans += a[i]-i;
	}

	if (ans > N) ans = N;
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'memset' was not declared in this scope
   13 |         memset(&a[0], sizeof(a), 0);
      |         ^~~~~~
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;
Language: C++

#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#include <cmath>
#define WMAX 10000
#define HMAX 10000
#define NMAX 100003

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

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

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

struct edge{
  int to,cost;
};

ll A[NMAX],B,C,N,W,H,ans = 0,dp[(int)1e9] = {};
string S;
static const int dx[8] = {0,1,1,1,0,-1,-1,-1},
					dy[8] = {1,1,0,-1,-1,-1,0,1};

void solve(){
	vector<int> v;
	for (int i = 0; i < N; ++i)
	{
		dp[A[i]]++;
		if(find(v.begin(), v.end(),A[i]) == v.end()){
			v.push_back(A[i]);
		}
	}
	for (int i = 0; i < v.size(); ++i)
	{
		if(v[i] < dp[v[i]]){
			ans += dp[v[i]] - v[i];
		}else if(v[i] > dp[v[i]]){
			ans += dp[v[i]];
		}
	}
}

void debug(){

}

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

int main(){
	cin >> N;
	for (int i = 0; i < N; ++i)
	{
		cin >> A[i];
	}
	solve();
	#ifdef DEBUG
	debug();
	#endif
	answer();

	return 0;
}

Compiler output:
/tmp/ccYzKfLr.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x37a): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccYzKfLr.o
a.cc:(.text+0x393): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccYzKfLr.o
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#define int long long
#define N 100010
using namespace std;
const int INF = 1LL<<55;
const int mod = (1e9)+7;
const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
template< class T > void prArray(T a,char ch = ' '){
  for(int i=0;i<(int)a.size();i++,cout<<ch){
    if(i) cout<<ch;
    cout<<a[i];
  }
  cout<<endl;
}



signed main(){
  int n;
  cin>>n;
  map<int,int> M;
  for(int i=0;i<n;i++){
    int a;
    cin>>a;
    M[a]++;
  }

  int ans = 0;
  for(auto p:M){
    if(p.first == p.second) continue;
    if(p.first <= p.second) ans += abs(p.first - p.second));
    else ans += p.second;
  }
    cout<<ans<<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:59: error: expected ';' before ')' token
   34 |     if(p.first <= p.second) ans += abs(p.first - p.second));
      |                                                           ^
      |                                                           ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
/*
分岐の処理をどうするか
x軸y軸それぞれにプラマイ自由にできるか
最初のTまでだけ固定
わけられた数字のパーツあわせてxyにできるかどうか

2 3 5 7
8をつくる
せいぜい8000まで
mapとか8000*8000
*/
int main(){
  string S; cin>>S;
  ll X,Y; cin>>X>>Y;
  ll ssz=S.size(), i=0, tmp=0;
  vector<ll> A(1,0), B(1,0);
  map<ll,bool> M1,M2,M3,M4;
  bool row=false;
  while(S[i]=='F' && i<ssz){
    X--;
    i++;
  }
  i++;
  while(i<ssz){
    if(S[i]=='T'){
      it(tmp>0) (row)?A.emplace_back(tmp):B.emplace_back(tmp);   
      row=(row)?false:true;
      tmp=0;
    }
    else tmp++;
    i++;
  }
  if(tmp>0) (row)?A.emplace_back(tmp):B.emplace_back(tmp);    
  M2[0]=true;
  ll asz=S.size(), bsz=B.size();
  for(i=0; i<asz; i++){
    M1=M2;
    M2.clear();
    for(auto v:M1){
      ll v1=v.first;
      M2[v1+A[i]]=true;
    }
  }
  M4[0]=true;
  for(i=0; i<bsz; i++){
    M3=M4;
    M4.clear();
    for(auto v:M3){
      ll v1=v.first;
      M4[v1+B[i]]=true;
    }
  }
  X=abs(X),Y=abs(Y);
  if(M2[X] && M4[Y]) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:7: error: 'it' was not declared in this scope; did you mean 'i'?
   29 |       it(tmp>0) (row)?A.emplace_back(tmp):B.emplace_back(tmp);
      |       ^~
      |       i
Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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 (a>b) { a=b; return 1; } return 0; }

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

bool dp[5000][16001];
bool dp2[5000][16001];

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s; cin>>s; s.pb('T');
    int x,y; cin>>x>>y;
    int n = s.size();
    int f=0;
    rep(i,n){
        if (s[i]=='T') break;
        f++;
    }
    x-=f;
    s=s.substr(f); n=s.size();
    // if (n==0){
    //     if (x==0 && y==0) cout<<"Yes\n";
    //     else cout<<"No\n";
    //     return 0;
    // }
    vi ax,ay;
    bool mode=false;
    int cnt=0;
    rep(i,n){
        if (s[i]=='F') cnt++;
        if (s[i]=='T'){
            if (cnt>0) (mode?ax:ay).pb(cnt);
            cnt=0;
            mode=!mode;
        }
    }
    if (cnt>0) (mode?ax:ay).pb(cnt);
    int m = ax.size();
    int l = ay.size();
    dp[0][8000]=true;
    rep(i,m)FOR(j,-8000,8000){
        if (j-ax[i]>=0 && dp[j+8000-ax[i]]) dp[j+8000]=true;
        if (j+ax[i]<=16000 && dp[j+8000+ax[i]]) dp[j+8000]=true;
    }
    dp2[0][8000]=true;
    rep(i,m)FOR(j,-8000,8000){
        if (j-ax[i]>=0 && dp2[j+8000-ax[i]]) dp2[j+8000]=true;
        if (j+ax[i]<=16000 && dp2[j+8000+ax[i]]) dp2[j+8000]=true;
    }
    if (dp[x+8000] && dp2[y+8000]){
        cout<<"Yes\n";
    }else{
        cout<<"No\n";
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:55: error: incompatible types in assignment of 'bool' to 'bool [16001]'
   69 |         if (j-ax[i]>=0 && dp[j+8000-ax[i]]) dp[j+8000]=true;
      |                                             ~~~~~~~~~~^~~~~
a.cc:70:59: error: incompatible types in assignment of 'bool' to 'bool [16001]'
   70 |         if (j+ax[i]<=16000 && dp[j+8000+ax[i]]) dp[j+8000]=true;
      |                                                 ~~~~~~~~~~^~~~~
a.cc:74:57: error: incompatible types in assignment of 'bool' to 'bool [16001]'
   74 |         if (j-ax[i]>=0 && dp2[j+8000-ax[i]]) dp2[j+8000]=true;
      |                                              ~~~~~~~~~~~^~~~~
a.cc:75:61: error: incompatible types in assignment of 'bool' to 'bool [16001]'
   75 |         if (j+ax[i]<=16000 && dp2[j+8000+ax[i]]) dp2[j+8000]=true;
      |                                                  ~~~~~~~~~~~^~~~~