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


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

#define INF 999999999
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
#define pub push_back
#define pob pop_back
#ifdef LOCAL
  #define de(e) cout << "L" << __LINE__ << ": " << e << "\n" // debug echo
  #define dr(e) cout << "L" << __LINE__ << ": " << #e << " -> " << e << "\n" // debug repr
#else
  #define de(e)
  #define dr(e)
#endif
#define out(fmt, ...) printf(fmt, __VA_ARGS__); printf("\n")
int gcd(int m, int n) { if((0 == m) || (0 == n)){return 0;} while(m != n){ if(m > n){m -= n;}else{n -= m;} } return m; }
int lcm(int m, int n) { if((0 == m) || (0 == n)){return 0;} return (m / gcd(m, n)) * n; }

//
// Implementation
//

typedef struct {
  int si;
  int x;
  int y;
  int xdir;
  int ydir;
} S;

bool dfs(vector<int> memo, int finalx, int finaly, S s) {

  queue<S> que;
  que.push(S{0, 0, 0, 1, 0});

  while (que.size()) {
    S s = que.front(); que.pop();
    if (s.si >= memo.size()) {
      if (s.x == finalx && s.y == finaly) {
        return true;
      }
      continue;
    }

    int m = memo[s.si];

    int xdir1, ydir1;
    int xdir2, ydir2;
    if (s.xdir != 0) {
      xdir1 = 0;
      xdir2 = 0;
      ydir1 = 1;
      ydir2 = -1;
    } else {
      xdir1 = 1;
      xdir2 = -1;
      ydir1 = 0;
      ydir2 = 0;
    }
    S newsLeft = S{s.si+1, s.x+s.xdir*m, s.y+s.ydir*m, xdir1, ydir1};
    S newsRight = S{s.si+1, s.x+s.xdir*m, s.y+s.ydir*m, xdir2, ydir2};
    que.push(newsLeft);
    que.push(newsRight);
  }

  return false;
}

int main() {
  string ops; cin >> ops;
  int x, y; cin >> x >> y;

  vector<int> memo;
  int cur = 0;
  rep(i, ops.size()-1) {
    if (ops[i] == 'F') {
      cur++;
    } else if (ops[i] == 'T') {
      memo.pub(cur);
      cur = 0;
    }
  }

  if (bfs(memo, x, y)) {
    out("%s", "Yes");
  } else {
    out("%s", "No");
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:87:7: error: 'bfs' was not declared in this scope; did you mean 'ffs'?
   87 |   if (bfs(memo, x, y)) {
      |       ^~~
      |       ffs
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<sstream>
#include<math.h>

using namespace std;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	string s;
	int x,y;
	bool T=true;
	int c=0;
	int c2=0;
	vector<int> Fx,Fy;
	
	
	
	cin>>s;
	cin>>x>>y;
	

	
	for(int i=0,n=s.size();i<n;i++){
		if(s[i]=='F'){
			c++;
		}
		else{
			if(c2%2==0)
				Fx.push_back(c);
			else if(c2%2==1)
				Fy.push_back(c);
			c=0;
			c2++;
		}	
	}
	
	if(c2%2==0)
		Fx.push_back(c);
	else if(c2%2==1)
		Fy.push_back(c);

	int temp=0;
	int ttt=0;
	vector<int>Fxi(Fx.size(),1),Fyi(Fy.size(),1);
	
	Fxi[0]=1;
	int xm=pow(2,Fx.size()),ym=pow(2,Fy.size());
	for(int i=1;i<Fx.size();i++){
		temp=i;
		ttt=0
		for(int j=1;j<Fx.size();j++){

			
		if(temp==1){
			Fxi[j]=-1;
		}
		else if(temp==2){
			Fxi[j]=0;	
		}
		else if(temp%2==1)
			Fxi[j]=-1;
		else
			Fxi[j]=1;
		temp=i/2;
		}
		
		for(int j=0;j<Fx.size();j++){
			ttt+=Fx[j]*Fxi[j];
		}
		if(ttt==x){
			T=true;
			break;
		}
		else
			T=false;
	
	}
	
	if(T==true){
		for(int i=0;i<Fx.size();i++){
		temp=i;
			ttt=0;
		for(int j=0;j<Fx.size();j++){

			
		if(temp==1){
			Fyi[j]=-1;
		}
		else if(temp==2){
			Fyi[j]=0;	
		}
		else if(temp%2==1)
			Fyi[j]=-1;
		else
			Fyi[j]=1;
		temp=i/2;
		}
		
		for(int j=0;j<Fx.size();j++){
			ttt+=Fx[j]*Fxi[j];
		}
		if(ttt==x){
			T=true;
			break;
		}
		else
			T=false;
	
	}
	}
	else
		cout<<"No";
	
	cout<<"Yes";
	
	for(int i=0;i<Fx.size();i++){
		cout<<Fx[i]<<endl;
	}
	for(int i=0;i<Fy.size();i++){
		cout<<Fy[i]<<endl;
	}
	
	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:22: error: expected ';' before 'for'
   54 |                 ttt=0
      |                      ^
      |                      ;
   55 |                 for(int j=1;j<Fx.size();j++){
      |                 ~~~   
a.cc:55:29: error: 'j' was not declared in this scope
   55 |                 for(int j=1;j<Fx.size();j++){
      |                             ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
const int MaxN = 8000;

int main()
{
	char s[MaxN + 5];
	int c,d,x,y,vis = 0;
	int a = 0,b = 0;
	int e = 0,f = 0;
	scanf("%s",s);
	c = strlen(s);
	scanf("%d %d",&x,&y);
	for(int i = 0;i < c;i++)
	{
		if(s[i]=='T') 
		{
			vis++;
			e = 0;
			f = 0;
		}
		d = vis%2;
		if(d == 0&&s[i]=='F') 
		{
			if(x >= 0&&e != -1 || e = 1) 
			{
				x--;
				e = 1;
			}
			if(x < 0&&e != 1 || e = -1) 
			{
				x++;
				e = -1;
			}
		}
		if(d == 1&&s[i]=='F') 
		{
			if(y >= 0&& f != -1 ||f = 1)
			{
				y--;
				f = 1;
			}
			if(y < 0 && f != 1||f = -1)
			{
				y++;
				f = -1;
			}
		}
	}
	if(x==0&&y==0) printf("Yes\n");
	else printf("No\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:44: error: lvalue required as left operand of assignment
   30 |                         if(x >= 0&&e != -1 || e = 1)
      |                            ~~~~~~~~~~~~~~~~^~~~
a.cc:35:42: error: lvalue required as left operand of assignment
   35 |                         if(x < 0&&e != 1 || e = -1)
      |                            ~~~~~~~~~~~~~~^~~~
a.cc:43:45: error: lvalue required as left operand of assignment
   43 |                         if(y >= 0&& f != -1 ||f = 1)
      |                            ~~~~~~~~~~~~~~~~~^~~
a.cc:48:43: error: lvalue required as left operand of assignment
   48 |                         if(y < 0 && f != 1||f = -1)
      |                            ~~~~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
	char s[8000];
	int x, y, i, k=0;
	int n[2] = {0, 0};
	cin >> s;
	cin >> x;
	cin >> y;
	for(i = 0; i < strlen(s); i++)
	{
		if(s[i] == 'F')
		{
			n[k]++;
		}
		else if(s[i] == 'T')
		{
			if(k == 0)
			{
				k = 1;
			}
			else
			{
				k = 0;
			}
		}
	}
	if((n[0] >= abs(x)) && (n[1] >= abs(y)))
	{
		if(((n[0]-x)%2 == 0) && ((n[1]-y)%2 == 0))
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}
	else
	{
		cout << "No" << endl;
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: 'strlen' was not declared in this scope
   12 |         for(i = 0; i < strlen(s); i++)
      |                        ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <random>
#include <climits>
#include <unordered_map>

#define mod 1000000007

using namespace std;
using ll = long long;

void solve(){
    string s;
    int x, y;
    cin >> s;
    cin >> x >> y;

    bool a[4];  //x, -x, y, -y
    for(int i = 0; i < 4; i++){
        a[i] = false;
    }
    a[0] = true;

    for(int i = 0; i < s.length(); i++){
        if(s[i] == 'F'){
            for(int j = 0; j < 4; j++){
                if(a[j] && j == 0){
                    x--;
                }else if(a[j] && j == 1){
                    x++;
                }else if(a[j] && j == 2){
                    y--;
                }else if(a[j] && j == 3){
                    y++;
                }
            }
        }else{
            int current = 5;
            for(int j = 0; j < 4; j++){
                if(a[j]){
                    current = j;    //現在向いている方向を記録
                    break;
                }
            }
            if((current == 0 || current == 1) && y >= 0){
                a[2] = true;    //yの方向を向く
            }else if((current == 0 || current == 1) && y =< 0){
                a[3] = true;    //-yの方向を向く
            }else if((current == 2 || current == 3) && x >= 0){
                a[0] = true;    //xの方向を向く
            }else if((current == 2 || current == 3) && x =< 0){
                a[1] = true;    //-xの方向を向く
            }
            a[current] = false;
        }
    }

    if(x == 0 && y == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

int main(){
    solve();
    return 0;
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:51:59: error: expected primary-expression before '<' token
   51 |             }else if((current == 0 || current == 1) && y =< 0){
      |                                                           ^
a.cc:55:59: error: expected primary-expression before '<' token
   55 |             }else if((current == 2 || current == 3) && x =< 0){
      |                                                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define il inline
#define outy printf("Yes\n")
#define outn printf("No\n")
#define outf printf("First\n")
#define outs printf("Second\n")
#define FOR(a,b,c) for(int a=b;a<=c;a++)
#define FORD(a,b,c) for(int a=b;a>=c;a--)
#define FORL(a,b) for(int a=head[b];a;a=nxt[a])
#define in(a)  a=read()
#define in2(a,b)  a=read(),b=read()
#define in3(a,b,c)  a=read(),b=read(),c=read()
#define in4(a,b,c,d)  a=read(),b=read(),c=read(),d=read()
#define inl(a)  a=readl()
#define inl2(a,b)  a=readl(),b=readl()
#define inl3(a,b,c)  a=readl(),b=readl(),c=readl()
#define inl4(a,b,c,d)  a=readl(),b=readl(),c=readl(),d=readl()
#define out(a) printf("%d\n",a)
#define out2(a,b) printf("%d %d\n",a,b)
#define out3(a,b,c) printf("%d %d %d\n",a,b,c)
#define out4(a,b,c,d) printf("%d %d %d %d\n",a,b,c,d)
#define outl(a) printf("%lld\n",a)
#define outl2(a,b) printf("%lld %lld\n",a,b)
#define outl3(a,b,c) printf("%lld %lld %lld\n",a,b,c)
#define outl4(a,b,c,d) printf("%lld %lld %lld %lld\n",a,b,c,d)
#define clr(x,y) memset(x,y,sizeof(x))
inline int read(){
    char c;int s=0,t=1;
    while(!isdigit(c=getchar()))if(c=='-')t=-1;
    do{s=s*10+c-'0';}while(isdigit(c=getchar()));
    return s*t;
}
inline ll readl(){
    char c;ll s=0;int t=1;
    while(!isdigit(c=getchar()))if(c=='-')t=-1;
    do{s=s*10+c-'0';}while(isdigit(c=getchar()));
    return s*t;
}
/*------------------------------------------------------------*/
#define mod 1000000007
#define maxn 100010
#define inf 0x7fffffff
/*------------------------------------------------------------*/

int main(){
	srand(time(1));
	int a=rand()%2;
	if(a)outy;
	 else outn;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:48:20: error: invalid conversion from 'int' to 'time_t*' {aka 'long int*'} [-fpermissive]
   48 |         srand(time(1));
      |                    ^
      |                    |
      |                    int
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:1:
/usr/include/time.h:76:29: note:   initializing argument 1 of 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |                     ~~~~~~~~^~~~~~~
Language: C++

#include<cstdio>
#include<string.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<windows.h>
using namespace std;
int visx[40005],visy[40005];
int x,y;
int f=0,t=0;
char a[20005];
int len;
int main(){
    scanf("%s",a);
    visx[20000]=visy[20000]=1;
    scanf("%d%d",&x,&y);
    len=strlen(a);
    for(int i=0;i<len;i++){
    	if(a[i]=='T'){
    	   if(t%2==1){
    	      for(int j=0;j<=40000;j++){
    	      	 if(j>=f&&j<=40000-f){
    	      	    visy[j]=max(visy[j-f],visy[j+f]);	
				 }
				 else if(j<f){
				 	visy[j]=visy[j+f];
				 }
				 else visy[j]=visy[j-f];
			  }
		   }
		   else{
    	      for(int j=0;j<=40000;j++){
    	      	 if(j>=f&&j<=40000-f){
    	      	    visx[j]=max(visx[j-f],visx[j+f]);	
				 }
				 else if(j<f){
				 	visx[j]=visx[j+f];
				 }
				 else visx[j]=visx[j-f];
			  }
		   }
		   f=0;
		   t++;
	    }
	    else f++;
	}
    if(a[len-1]!='T'){
    	if(t%2==1){
    	    for(int j=0;j<=40000;j++){
    	      	if(j>=f&&j<=40000-f){
    	      	   visy[j]=max(visy[j-f],visy[j+f]);	
				}
				else if(j<f){
				 	visy[j]=visy[j+f];
				}
				else visy[j]=visy[j-f];
			}
		}
		else{
    	    for(int j=0;j<=40000;j++){
    	      	if(j>=f&&j<=40000-f){
    	      	   visx[j]=max(visx[j-f],visx[j+f]);	
				}
				else if(j<f){
				    visx[j]=visx[j+f];
				}
				else visx[j]=visx[j-f];
			}
		}
	}
	if(len>8000)Sleep(2000); 
	if(visx[x+10000]==1&&visy[y+10000]==1)printf("Yes");
	else printf("No");
	
}

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

#include <bits/stdc++.h>
using namespace std;
#define y1 cgbngfgn
#define pb push_back
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define fir first
#define m_p make_pair
#define sec second
#define files(name) freopen(name".dat","r",stdin); freopen (name".sol","w",stdout);
#pragma GCC optimize ("O3")
#pragma GCC optimize ("O2")
#define time pdojegoritg
typedef long long ll;
typedef long double ld;
const int arr=500000;

bool dp[9001][9001*4];

signed main()
{
    string st;
    cin>>st;
    int x,y;
    cin>>x>>y;
    vector<int> vec1,vec2;
    int now=1;
    int sum=0;

    for (auto i:st)
    {
        if (i=='T')
        {
            if (now)
                vec1.pb(sum); else
                vec2.pb(sum);
            now=!now;
            sum=0;
        } else
        {
            sum++;
        }
    }
    if (now)
        vec1.pb(sum); else
        vec2.pb(sum);


    int pl=st.size()+100;
    dp[1][vec[0]+pl]=1;
    for (int i=2;i<=vec1.size();i++)
        for (int j=-pl;j<=pl;j++)
        if (dp[i-1][j+pl])
        {
            dp[i][j+pl+vec1[i-1]]=1;
            dp[i][j+pl-vec1[i-1]]=1;
        }

    bool ch=dp[vec1.size()][x+pl];

    for (int i=1;i<=vec1.size();i++)
        for (int j=-pl;j<=pl;j++)
            dp[i][j+pl]=0;

    for (int i=1;i<=vec2.size();i++)
        for (int j=-pl;j<=pl;j++)
        if (dp[i-1][j+pl])
        {
            dp[i][j+pl+vec2[i-1]]=1;
            dp[i][j+pl-vec2[i-1]]=1;
        }


    ch&=dp[vec2.size()][y+pl];

    if (ch)
        cout<<"Yes"<<'\n' ;else
        cout<<"No"<<'\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:11: error: 'vec' was not declared in this scope; did you mean 'vec2'?
   49 |     dp[1][vec[0]+pl]=1;
      |           ^~~
      |           vec2
Language: C++

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

int main() 
{
	
	
	
	
    	int n; 

	    
	   cin>>n;
	   //cin>>c;
	    
	   
	    map<int,int> mp;
	    
	    for(int i=0;i<n;i++)
	    cin>>n,mp[x]++;
	    
	    
	    
	    
	    int sum=0;
	    
	 
	       for( auto x: mp)
	    {
	      
	      if( x.second>=x.first)  sum= s.second-x.first; 
	      else sum= sum+ x.second ;
        }
        
        cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:23: error: 'x' was not declared in this scope
   20 |             cin>>n,mp[x]++;
      |                       ^
a.cc:31:44: error: 's' was not declared in this scope
   31 |               if( x.second>=x.first)  sum= s.second-x.first;
      |                                            ^
Language: C++

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

typedef long long int ll;
typedef vector<long long int> vi;
typedef vector<vi> vii;
typedef pair<int, int> ii;
typedef vector<ii> vpii;

#define sz(a) int((a).size())
#define pb push_back
#define all(C) C.begin(),C.end()
#define fai(i,n) for(int i=0; i<n; i++)
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repl(i,a,b) for(ll i=a; i<=b; i++)
#define fal(i,n) for(ll i=0; i<n; i++)
#define tr(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++) 
// *it or it->second.first

ll getSum(ll n) 
 { 
    ll sum; 
  
    for (sum = 0; n > 0; sum += n % 10, n /= 10); 
  
    return sum; 
 } 


int main()
{	
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);

    int t;
    cin>>t;
    map<int,int> mp;
    while(t--){
        int k;
        cin>>k;
        mp[k]++;
    }
    int ans=0;
    for(auto it: mp){
        
            ans+= it.second-it.first;
        }
        else if(it.second< it.first){
            ans+= it.second;
        }
        
    }
    cout<<ans;
   
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:9: error: 'else' without a previous 'if'
   50 |         else if(it.second< it.first){
      |         ^~~~
a.cc:50:17: error: 'it' was not declared in this scope; did you mean 't'?
   50 |         else if(it.second< it.first){
      |                 ^~
      |                 t
a.cc: At global scope:
a.cc:55:5: error: 'cout' does not name a type
   55 |     cout<<ans;
      |     ^~~~
a.cc:57:5: error: expected unqualified-id before 'return'
   57 |     return 0;
      |     ^~~~~~
a.cc:58:1: error: expected declaration before '}' token
   58 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
 long long n,i,a;
  map<long long,long long>mp;
  cin>>n;
  for(i=0;i<n;i++)
  {
    cin>>a;
    mp[a]++;
  }
  for(auto u:mp)
  {
    if(u.first<u.second)
      c+=u.second-u.first;
    else if(u.first>u.second)
      c+=u.second;
  }
  cout<<c;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: 'c' was not declared in this scope
   16 |       c+=u.second-u.first;
      |       ^
a.cc:18:7: error: 'c' was not declared in this scope
   18 |       c+=u.second;
      |       ^
a.cc:20:9: error: 'c' was not declared in this scope
   20 |   cout<<c;
      |         ^
Language: C++

/*   -----------------------------
    | If you see my code,         |
    | You are BC (best coder -_- )|
    |                             |
     -----------------------------
*/
#include<bits/stdc++.h>
#include<iomanip>
typedef long long ll;
typedef unsigned long long ul;
#define to_lower(x)  transform(x.begin(), x.end(), x.begin(), ::tolower)
#define to_upper(x)  transform(x.begin(), x.end(), x.begin(), ::toupper)
#define pi acos(-1)
#define ll long long
#define ull unsigned long long
#define vec vector<ll>
#define f1(i,n) for(i=1;i<n;i++)
#define input  ll nn;cin>>nn;ll arr[nn];for(i=0;i<nn;i++)cin>>arr[i];
#define test   ll ttt;cin>>ttt;while(ttt--)
#define faster  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define faster2 ios_base::sync_with_stdio(0);
#define en '\n'
#define eps 10e9
#define pb push_back
ll i,j;
using namespace std;

void Main();
int main()
{
  
    Main();

}
void Main()
{
    int x,n,c=0;cin>>n; map<int,int>m;
    while(n--)
    {
        cin>>x;
        m[x]++;
    }
    for(i:m)
    {

        if(i.second>=i.first)c+=i.second-i.first;
        else c+=i.second;
    }
    cout<<c<<endl;

}


Compiler output:
a.cc: In function 'void Main()':
a.cc:43:10: error: found ':' in nested-name-specifier, expected '::'
   43 |     for(i:m)
      |          ^
      |          ::
a.cc:43:9: error: 'i' is not a class, namespace, or enumeration
   43 |     for(i:m)
      |         ^
a.cc:51:1: error: expected primary-expression before '}' token
   51 | }
      | ^
a.cc:49:19: error: expected ')' before '}' token
   49 |     cout<<c<<endl;
      |                   ^
      |                   )
   50 | 
   51 | }
      | ~                  
a.cc:43:8: note: to match this '('
   43 |     for(i:m)
      |        ^
a.cc:51:1: error: expected primary-expression before '}' token
   51 | }
      | ^
Language: C++

/*   -----------------------------
    | If you see my code,         |
    | You are BC (best coder -_- )|
    |                             |
     -----------------------------
*/
#include<bits/stdc++.h>
#include<iomanip>
typedef long long ll;
typedef unsigned long long ul;
#define to_lower(x)  transform(x.begin(), x.end(), x.begin(), ::tolower)
#define to_upper(x)  transform(x.begin(), x.end(), x.begin(), ::toupper)
#define pi acos(-1)
#define ll long long
#define ull unsigned long long
#define vec vector<ll>
#define f1(i,n) for(i=1;i<n;i++)
#define input  ll nn;cin>>nn;ll arr[nn];for(i=0;i<nn;i++)cin>>arr[i];
#define test   ll ttt;cin>>ttt;while(ttt--)
#define faster  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define faster2 ios_base::sync_with_stdio(0);
#define en '\n'
#define eps 10e9
#define pb push_back
ll i,j;
using namespace std;

void Main();
int main()
{
    clock_t tStart = clock();
    Main();
#ifndef ONLINE_JUDGE
    cout << "\n\n**Time -> " << fixed << setprecision(10) << (double)(clock()-tStart) / CLOCKS_PER_SEC << " fs" << endl;
#endif
    return 0;
}
void Main()
{
    int x,n,c=0;cin>>n; map<int,int>m;
    while(n--)
    {
        cin>>x;
        m[x]++;
    }
    for(i:m)
    {

        if(i.second>=i.first)c+=i.second-i.first;
        else c+=i.second;
    }
    cout<<c<<endl;

}


Compiler output:
a.cc: In function 'void Main()':
a.cc:46:10: error: found ':' in nested-name-specifier, expected '::'
   46 |     for(i:m)
      |          ^
      |          ::
a.cc:46:9: error: 'i' is not a class, namespace, or enumeration
   46 |     for(i:m)
      |         ^
a.cc:54:1: error: expected primary-expression before '}' token
   54 | }
      | ^
a.cc:52:19: error: expected ')' before '}' token
   52 |     cout<<c<<endl;
      |                   ^
      |                   )
   53 | 
   54 | }
      | ~                  
a.cc:46:8: note: to match this '('
   46 |     for(i:m)
      |        ^
a.cc:54:1: error: expected primary-expression before '}' token
   54 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define Vi vector<int>
#define Vll vector<long long>
#define Pii pair<int,int>
#define Pll pair<long long, long long>
#define VVi vector<vector<int>>
#define fori(i,a,b) for(int i=a;i<b; i++)
#define MOD 1000000007
#define pb push_back
#define mp make_pair
typedef long long int ll;
typedef double dl;
using namespace std;


void soln(){
    ll n;cin>>n;
  	Vll v;
  	unordered_map<ll,ll> freq;
  	fori(i,0,n){
    	cin>>v[i];
      	freq[v[i]]++;
    }
  	ll count = 0;
  	for(auto i:ump){
     	if(i.first>i.second){
        	count+=i.first;
        }else if(i.first<i.second){
        	count+=(i.second-i.first);
        }
    }
    cout<<count<<"\n";
    
	return;
}

int main() {
	// your code goes here
	fastio;
	int t=1 ;//cin>>t;
	while(t--){
		soln();
	}
	return 0;
}


Compiler output:
a.cc: In function 'void soln()':
a.cc:26:20: error: 'ump' was not declared in this scope; did you mean 'mp'?
   26 |         for(auto i:ump){
      |                    ^~~
      |                    mp
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
 
int main() {
ll n,k;
cin>>n;
ll ca=10000000000;
ll counter=0;
ll a[n+1]={};
ll cb=10000000000;
for(ll i=0;i<n;i++){
cin>>ca;
if(ca=<n){
a[ca]++;}}
for(ll i=0;i<n+1;i++){
if(a[i]<i){
counter+=a[i];}
else {
counter+=a[i]-i;}}
cout<<counter<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: expected primary-expression before '<' token
   15 | if(ca=<n){
      |       ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); i++)
#define REP1(i,a,b) for(int i=a; i<=(int)(b); i++)
#define ALL(x) begin(x),end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>>void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    map<int,int> mp;
    int n;
    cin >> n;
    int ans=n;
    REP(i,n) {
    	int a;
    	cin >> a;
    	mp[a]++;
    }
    for ( auto p:mp ) {
    	if ( p.second < p.first ) {
    		continue;
    	}
    	ans=min(ans,n-mp.first);
    }
    cout << ans << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:26: error: 'class std::map<int, int>' has no member named 'first'
   36 |         ans=min(ans,n-mp.first);
      |                          ^~~~~
Language: Java

import java.util.*;
public class MyClass
{
    public static void main(String args[]) 
    {
      Scanner sc=new Scanner(System.in);
      long n=sc.nextInt();
      HashMap<Long,Long> map=new HashMap<>();
      while(n-->0)
      {
          long a=sc.nextInt();
          if(map.containsKey(a))
          {
              long c=map.get(a);
              map.put(a,c+1);
          }
          else
          {
              map.put(a,1);
          }
      }
      long sum=0;
      for(Map.Entry<Long,Long> entry:map.entrySet())
      {
          if(entry.getKey()!=entry.getValue())
          {
             if(entry.getValue()>entry.getKey())
             {
                 sum+=entry.getValue()-entry.getKey();
             }
             else
             {
                 sum+=entry.getValue();
             }
          }
      }
      System.out.print(sum);
    }
}

Compiler output:
Main.java:2: error: class MyClass is public, should be declared in a file named MyClass.java
public class MyClass
       ^
Main.java:19: error: incompatible types: int cannot be converted to Long
              map.put(a,1);
                        ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.util.*;
public class Main
{
    public static void main(String args[]) 
    {
      Scanner sc=new Scanner(System.in);
      long n=sc.nextInt();
      HashMap<Long,Long> map=new HashMap<>();
      while(n-->0)
      {
          long a=sc.nextInt();
          if(map.containsKey(a))
          {
              int c=map.get(a);
              map.put(a,c+1);
          }
          else
          {
              map.put(a,1);
          }
      }
      long sum=0;
      for(Map.Entry<Long,Long> entry:map.entrySet())
      {
          if(entry.getKey()!=entry.getValue())
          {
             if(entry.getValue()>entry.getKey())
             {
                 sum+=entry.getValue()-entry.getKey();
             }
             else
             {
                 sum+=entry.getValue();
             }
          }
      }
      System.out.print(sum);
    }
}

Compiler output:
Main.java:14: error: incompatible types: Long cannot be converted to int
              int c=map.get(a);
                           ^
Main.java:15: error: incompatible types: int cannot be converted to Long
              map.put(a,c+1);
                         ^
Main.java:19: error: incompatible types: int cannot be converted to Long
              map.put(a,1);
                        ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Language: Java

import java.util.*;
public class MyClass
{
    public static void main(String args[]) 
    {
      Scanner sc=new Scanner(System.in);
      int n=sc.nextInt();
      HashMap<Integer,Integer> map=new HashMap<>();
      while(n-->0)
      {
          int a=sc.nextInt();
          if(map.containsKey(a))
          {
              int c=map.get(a);
              map.put(a,c+1);
          }
          else
          {
              map.put(a,1);
          }
      }
      int sum=0;
      for(Map.Entry<Integer,Integer> entry:map.entrySet())
      {
          if(entry.getKey()!=entry.getValue())
          {
             if(entry.getValue()>entry.getKey())
             {
                 sum+=entry.getValue()-entry.getKey();
             }
             else
             {
                 sum+=entry.getValue();
             }
          }
      }
      System.out.print(sum);
    }
}

Compiler output:
Main.java:2: error: class MyClass is public, should be declared in a file named MyClass.java
public class MyClass
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class GoodSubsequence {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] input = br.readLine().split(" ");
        Map<Integer,Integer> map = new HashMap<>();
        for(int i=0;i<input.length;i++){
            int elem = Integer.parseInt(input[i]);
            if(map.containsKey(elem)){
                map.put(elem, map.get(elem) + 1);
            }else{
                map.put(elem, 1);
            }
        }

        int count = 0;
        Set<Integer> keys = map.keySet();
        for(int key : keys){
            int value = map.get(key);
            if(value > key){
                count += (value - key);
            }else if(value < key){
                count += value;
            }
        }

        System.out.println(count);
    }
}


Compiler output:
Main.java:8: error: class GoodSubsequence is public, should be declared in a file named GoodSubsequence.java
public class GoodSubsequence {
       ^
1 error
Language: Java

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

public class Good_Sequence {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		int num=in.nextInt();
		int[] arr=new int[num];
		
		for(int i=0;i<num;i++)
		{
			arr[i]=in.nextInt();
		}
		
		Map<Integer,Integer> map=new HashMap<>();
		
		for(int i=0;i<num;i++)
		{
			if(map.containsKey(arr[i])==true)
			{
				map.put(arr[i], map.get(arr[i])+1);
			}
			else
			{
				map.put(arr[i], 1);
			}
		}
		
		int count=0;
		
		for(Map.Entry<Integer, Integer> el:map.entrySet())
		{
			int key=el.getKey();
			int value=el.getValue();
			
			if(value>key)
			{
				count=count+(value-key);
			}
			else if(value<key)
			{
				count=count+value;
			}
		}
		
		System.out.println(count);

	}

}


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

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

signed main() {
	ios::sync_with_stdio(0), cin.tie(0);
    
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i=0; i<n; ++i) cin >> arr[i];

    map<int, int> occ;
    for (int i=0; i<n; ++i) ++occ[a[i]];

    int res = 0;
    for (auto pr : occ) {
        int x = pr.first;
        if (occ[x] < x) res += occ[x];
        else res += occ[x] - x;
    }
    cout << res;
}

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

int n;
cin >> n;
vector<int> arr(n);
for (int i=0; i<n; ++i) cin >> arr[i];

map<int, int> occ;
for (int i=0; i<n; ++i) ++occ[a[i]];

int res = 0;
for (auto pr : occ) {
    int x = pr.first;
    if (occ[x] < x) res += occ[x];
    else res += occ[x] - x;
}
cout << res;

Compiler output:
a.cc:2:1: error: 'cin' does not name a type
    2 | cin >> n;
      | ^~~
a.cc:3:1: error: 'vector' does not name a type
    3 | vector<int> arr(n);
      | ^~~~~~
a.cc:4:1: error: expected unqualified-id before 'for'
    4 | for (int i=0; i<n; ++i) cin >> arr[i];
      | ^~~
a.cc:4:15: error: 'i' does not name a type
    4 | for (int i=0; i<n; ++i) cin >> arr[i];
      |               ^
a.cc:4:20: error: expected unqualified-id before '++' token
    4 | for (int i=0; i<n; ++i) cin >> arr[i];
      |                    ^~
a.cc:6:1: error: 'map' does not name a type
    6 | map<int, int> occ;
      | ^~~
a.cc:7:1: error: expected unqualified-id before 'for'
    7 | for (int i=0; i<n; ++i) ++occ[a[i]];
      | ^~~
a.cc:7:15: error: 'i' does not name a type
    7 | for (int i=0; i<n; ++i) ++occ[a[i]];
      |               ^
a.cc:7:20: error: expected unqualified-id before '++' token
    7 | for (int i=0; i<n; ++i) ++occ[a[i]];
      |                    ^~
a.cc:10:1: error: expected unqualified-id before 'for'
   10 | for (auto pr : occ) {
      | ^~~
a.cc:15:1: error: 'cout' does not name a type
   15 | cout << res;
      | ^~~~
Language: C

int n;
cin >> n;
vector<int> arr(n);
for (int i=0; i<n; ++i) cin >> arr[i];

map<int, int> occ;
for (int i=0; i<n; ++i) ++occ[a[i]];

int res = 0;
for (auto pr : occ) {
    int x = pr.first;
    if (occ[x] < x) res += occ[x];
    else res += occ[x] - x;
}
cout << res;

Compiler output:
main.c:2:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>>' token
    2 | cin >> n;
      |     ^~
main.c:3:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 | vector<int> arr(n);
      |       ^
main.c:4:1: error: expected identifier or '(' before 'for'
    4 | for (int i=0; i<n; ++i) cin >> arr[i];
      | ^~~
main.c:4:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    4 | for (int i=0; i<n; ++i) cin >> arr[i];
      |                ^
main.c:4:20: error: expected identifier or '(' before '++' token
    4 | for (int i=0; i<n; ++i) cin >> arr[i];
      |                    ^~
main.c:6:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    6 | map<int, int> occ;
      |    ^
main.c:7:1: error: expected identifier or '(' before 'for'
    7 | for (int i=0; i<n; ++i) ++occ[a[i]];
      | ^~~
main.c:7:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    7 | for (int i=0; i<n; ++i) ++occ[a[i]];
      |                ^
main.c:7:20: error: expected identifier or '(' before '++' token
    7 | for (int i=0; i<n; ++i) ++occ[a[i]];
      |                    ^~
main.c:10:1: error: expected identifier or '(' before 'for'
   10 | for (auto pr : occ) {
      | ^~~
main.c:15:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<<' token
   15 | cout << res;
      |      ^~
Language: Java

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class goodSeq
{
    public static void main(String[] args)
    {
        int cnt=0;
        HashMap<Integer,Integer> hm=new HashMap<>();
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int ar[]=new int[n];
        for (int i = 0; i <n ; i++) {
            ar[i]=sc.nextInt();
        }
        for (int i = 0; i <n ; i++) {
            hm.put(ar[i],0);
        }
        for (int i = 0; i <n ; i++) {
            hm.put(ar[i],hm.get(ar[i])+1);
        }
        for (Map.Entry<Integer,Integer> m:hm.entrySet()) {
            int v=m.getValue();
            int k=m.getKey();
            if(v<k)
                cnt=cnt+v;
            else
                cnt=cnt+v-k;
        }
        System.out.println(cnt);
    }
}


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

#include<bits/stdc++.h>

using namespace std;

#define int long long

int32_t main(){
  int n;
  cin>>n;
  
  map<int,int>m;
  int temp;
  for(int i=0;i<n;i++){
    cin>>temp;
    m[temp]++;
  }
  int ans = 0;
  
  for(auto it : m){
    if(it.first > it.second) ans += it.second;
    else if(it.second > it.first) ans += (it.second - it.first);
  }
  cout<<ans;

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:23:13: error: expected '}' at end of input
   23 |   cout<<ans;
      |             ^
a.cc:7:15: note: to match this '{'
    7 | int32_t main(){
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(0)
#define pb push_back
#define digit(x) floor(log10(x))+1
#define mod 1000000007
#define endl "\n"
typedef long long ll;
typedef long double ld;
typedef vector<vector<ll> > matrix;
typedef vector<ll> arr;
typedef vector<string> vs;
typedef vector<pair<ll,ll> > pv;
#define FOR(i,a,b) for(int i=a;i<=b;--i)
#define ROF(i,a,b) for(int i=a;i>=b;--i)
#define all(x) x.begin(),x.end()
#define debug(x) cerr << #x << " is " << x << endl;
int bx[]={0,0,1,-1,1,-1,-1,1};
int by[]={1,-1,0,0,1,-1,1,-1};

//=================================================================//

int main(){
    fast;
    ll n;
    cin>>n;
    unordered_map<ll>mp;
    for(int i=0;i<n;i++) {
        int t;
        cin>>t;
        mp[t]++;
    }
    ll ans = 0;
    for(auto it:mp) {
        if(it.first!=it.second) {
            if(it.second>it.first) {
                ans += it.second-it.first;
            } else {
                ans += it.second;
            }
        }
    }
    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:21: error: wrong number of template arguments (1, should be at least 2)
   27 |     unordered_map<ll>mp;
      |                     ^
In file included from /usr/include/c++/14/unordered_map:41,
                 from /usr/include/c++/14/functional:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/unordered_map.h:109:11: note: provided for 'template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> class std::unordered_map'
  109 |     class unordered_map
      |           ^~~~~~~~~~~~~
a.cc:31:11: error: invalid types 'int[int]' for array subscript
   31 |         mp[t]++;
      |           ^
a.cc:34:17: error: 'begin' was not declared in this scope
   34 |     for(auto it:mp) {
      |                 ^~
a.cc:34:17: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:34:17: error: 'end' was not declared in this scope
   34 |     for(auto it:mp) {
      |                 ^~
a.cc:34:17: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:42:10: error: 'i' was not declared in this scope
   42 |   ll j=a[i];
      |          ^
Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC087A
{
    class Program
    {
        static void Main(string[] args)
        {
            
            int x, a, b, c;

            x = int.Parse(Console.ReadLine());
            a = int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());

            c = (x - a) % b;

            Console.WriteLine(c);

            Console.ReadKey();
         }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:11:26: error: 'string' has not been declared
   11 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
   11 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:26:6: error: expected ';' after class definition
   26 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void ABC087A::Program::Main(int*)':
a.cc:16:17: error: expected primary-expression before 'int'
   16 |             x = int.Parse(Console.ReadLine());
      |                 ^~~
a.cc:17:17: error: expected primary-expression before 'int'
   17 |             a = int.Parse(Console.ReadLine());
      |                 ^~~
a.cc:18:17: error: expected primary-expression before 'int'
   18 |             b = int.Parse(Console.ReadLine());
      |                 ^~~
a.cc:22:13: error: 'Console' was not declared in this scope
   22 |             Console.WriteLine(c);
      |             ^~~~~~~
Language: C++

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

using namespace std;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(long long i=(a),i##Len_=(b);i<i##Len_;i++)
typedef long long ll;
static const ll MOD = 1000000007;



int main()
{
    ll N;

    cin >> N;

    vector <ll> a(N);

    REP(i,N)
    {
        cin >> a[i];
    }

    ll cnt = 0;

    ll tori = N;

    sort(a.begin(),a.end());

    ll mae = a[0];

    if(a[0] > 100000)
    {
        cout << N << endl;
        return 0;
    }

        
    cnt = 1;

    for(ll i = 1; i < N; ++i)
    {

        if(mae == a[i])
        {
            cnt++;
        }
        else
        {
            if(cnt >= mae)
            {
                tori -= cnt - mae;
            }
            else
            {
                tori -= cnt;
            }
            cnt = 1;
            mae = a[i];
        }

        if(a[i] > 100000)
        {
            tori -= N - i; 
            break;
        }
    }

    //末尾処理
    if(i == N-1)
    {
        if(cnt >= mae)
        {
            tori -= cnt - mae;
        }
        else
        {
            tori -= cnt;
        }
    }
    
    cout << N - tori << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:73:8: error: 'i' was not declared in this scope
   73 |     if(i == N-1)
      |        ^
Language: C++

#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main() {
  int n,a,ans=0;
  cin >> n;
  map<int int> mp;
  for(int i=0; i<n; i++) {
    cin >> a;
    mp[a]++;
  }
  for(auto au:mp) {
    if(au.first<au.second) {
      ans+=au.second-au.first;
    }
    else if(au.first>au.second) {
      ans+=au.second;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: two or more data types in declaration of 'type name'
    8 |   map<int int> mp;
      |       ^~~
a.cc:8:14: error: wrong number of template arguments (1, should be at least 2)
    8 |   map<int int> mp;
      |              ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:11:7: error: invalid types 'int[int]' for array subscript
   11 |     mp[a]++;
      |       ^
a.cc:13:15: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   13 |   for(auto au:mp) {
      |               ^~
      |               std::begin
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:13:15: error: 'end' was not declared in this scope; did you mean 'std::end'?
   13 |   for(auto au:mp) {
      |               ^~
      |               std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
Language: Java

n = int(input())
li = list(map(int,input().split()))
set = []
for l in li:
  if set.count(l) == 0 :
    set.append(l)
result = 0
for l in set:
  if li.count(l) == l:
    continue
  elif li.count(l) < l:
    limit = li.count(l)
    result += limit
  elif li.count(l) > l:
    limit = li.count(l) - l
    result += limit

print(result)



Compiler output:
Main.java:1: error: class, interface, enum, or record expected
n = int(input())
^
1 error