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

#include<stdio.h>
int main()
{
	int i,j,n,f=1,p=0,t,b[201];
	long long a[201];
	scanf("%d",&n);
for(i=0;i<n;i++)
	{
	scanf("%I64d",&a[i]);
 if(a[i]%2!=0)
	{
			f=0;
	}
	
	}
if(f)
	{
	for(i=0;i<n;i++)
	{
		while(a[i]%2==0)
		{
			a[i]=a[i]/2;
		b[i]++;
		}
		}	
		min=b[0];
	for(i=0;i<n;i++)
	{
		if(b[i]<min)
		min=b[i];
	}
	printf("%d\n",min)
	}

	else
	printf("0\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'min' was not declared in this scope; did you mean 'main'?
   26 |                 min=b[0];
      |                 ^~~
      |                 main
Language: C++

#include<stdio.h>
int main()
{
	int i,j,n,f=1,p=0,t;
	long long a[201];
	scanf("%d",&n);
for(i=0;i<n;i++)
	{
	scanf("%I64d",&a[i]);
 if(a[i]%2!=0)
	{
			f=0;
	}
	
	}
if(f)
	{
	for(i=0;i<n;i++)
	{
		while(a[i]%2==0)
		{
			a[i]=a[i]/2;
		b[i]++;
		}
		}	
		min=b[0];
	for(i=0;i<n;i++)
	{
		if(b[i]<min)
		min=b[i];
	}
	printf("%d\n",min)
	}

	else
	printf("0\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'b' was not declared in this scope
   23 |                 b[i]++;
      |                 ^
a.cc:26:17: error: 'min' was not declared in this scope; did you mean 'main'?
   26 |                 min=b[0];
      |                 ^~~
      |                 main
a.cc:26:21: error: 'b' was not declared in this scope
   26 |                 min=b[0];
      |                     ^
Language: C++

#include <iostream>

using namespace std;
int N;
int A[201];


int main(void) {
	int flag = 0;
	int cnt = 0, k = 2;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	while (true) {
		for (int i = 0; i < N; i++) {
			if (A[i] % 2 == 0) {
				A[i] = A[i] / 2;
				cnt++;
			}
		}for (int i = 0; i < N; i++) {
			if (A[i] % 2 != 0) {
				cout << cnt / 3 << endl;
				return;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: return-statement with no value, in function returning 'int' [-fpermissive]
   24 |                                 return;
      |                                 ^~~~~~
Language: C

#include <stdio.h>
 
int main(void)
{	int n,i;
	int endcount = 0;
	int count = 0;
	scanf("%d",&n);
	int a[n];
	for(i = 0;i < n;i++){
	scanf("%d",&a[i]);
	if(a[i] % 2 == 1 ||a[i] == 0)
		endcount += 1;
	}
	if(endcount > 0){
	printf("0/n");
	}
	else{
	do{
		for(i = 0;i < n;i++){
			if(a[i] % 2 == 1){
				endcount += 1;
			}
			a[i] = a[i] / 2;
			}
	count += 1;		
	}while(endcount == 0);
	printf("%d\n",count - 1);
}
return 0;
}

Compiler output:
main.c:2:1: error: stray '\302' in program
    2 | <U+00A0>
      | ^~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main(){
  int N, cm = 2147483647;
  cin >> N;
  priority_queue<int, vector<int>, greater<int> >Q;
  for(int i = 0; i < N; i++){
    int a;
    cin >> a;
    Q.push(a);
  }
  for(int i = 0; i < N; i++){
    int x, c = 0;
    x = Q.top();
    Q.push();
    while(true){
      if((double)x/(double)2 == double(x/2)){
        x >> 1;
        c++;
      }else{
        break;
      }
    }
    if(cm > c)cm = c;
  }
  cout << cm;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: no matching function for call to 'std::priority_queue<int, std::vector<int>, std::greater<int> >::push()'
   17 |     Q.push();
      |     ~~~~~~^~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::greater<int>; value_type = int]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::greater<int>; value_type = int]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note:   candidate expects 1 argument, 0 provided
Language: C++

#include<iostream>
using namespace std;
typedef long long int ll;
main()
{
  int n;cin>>n;ll a[n];bool f=1;
  for(int i=0;i<n;i++){cin>>a[i];if(a[i]&1)f=0;}
  if(f)
  {
    while(true)
    {
      for(int i=0;i<n;i++)
      {
        a[i]/=2;if(a[i]&1){f=0;break;}
      }
      sum++;
      if(!f)break;
    }
    cout<<sum;
  }
  else cout<<0;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:16:7: error: 'sum' was not declared in this scope
   16 |       sum++;
      |       ^~~
a.cc:19:11: error: 'sum' was not declared in this scope
   19 |     cout<<sum;
      |           ^~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main(){
  int N, cm = 2147483647;
  cin >> N;
  priotiry_queue<int, vector<int>, greater<int> >Q;
  for(int i = 0; i < N; i++){
    int a;
    cin >> a;
    Q.push(a);
  }
  for(int i = 0; i < N; i++){
    int x, c = 0;
    x = Q.top();
    Q.push();
    while(true){
      if((double)x/(double)2 == double(x/2)){
        x >> 1;
        c++;
      }else{
        break;
      }
    }
    if(cm > c)cm = c;
  }
  cout << cm;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'priotiry_queue' was not declared in this scope
    8 |   priotiry_queue<int, vector<int>, greater<int> >Q;
      |   ^~~~~~~~~~~~~~
a.cc:8:18: error: expected primary-expression before 'int'
    8 |   priotiry_queue<int, vector<int>, greater<int> >Q;
      |                  ^~~
a.cc:12:5: error: 'Q' was not declared in this scope
   12 |     Q.push(a);
      |     ^
a.cc:16:9: error: 'Q' was not declared in this scope
   16 |     x = Q.top();
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{ long int i,n,j=0;
cin>>n;
long int a[n];
for(i=0;i<n;i++)
cin>>a[i];
int min=0;
for(i=0;i<n;i++)
{while(j>=0)
{ if(a[i]%math.pow(2,j)!=0)
  {a[i]=j-1;
   break;}
else
j++;
}
if(min>a[i])
min=a[i];
}
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'math' was not declared in this scope
   12 | { if(a[i]%math.pow(2,j)!=0)
      |           ^~~~
Language: C++

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

int main()
{
    int i,t=0,c=0,k;
    scanf("%d",&i);
    int n[i];
    for(;t<n;t++)
        scanf("%d",&n[t]);
     A:for(t=0;t<n;t++)
    {
         k=n[i]%2;
        if(k==0)
        break;
    }
    if(t==n){c++;
        goto A;}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     for(;t<n;t++)
      |          ~^~
a.cc:11:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |      A:for(t=0;t<n;t++)
      |                ~^~
a.cc:17:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     if(t==n){c++;
      |        ~^~~
Language: C++


#define _CRT_SECURE_NO_WARNINGS 1

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


int main(void) {
	
	int N;
	cin >> N;
	vector<long int>A(N);
	int i = 0,c=0;
	while (i<N) {
		cin >> A[i];
		i++;
	}
	i = 0;
	while (A[i] % 2 == 0) {
	
		A[i] /= 2;
		i++;
		if (i == N) {
			i = 0;
			c++;
		}
	}

	printf("%d\n", c);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'vector' was not declared in this scope
   13 |         vector<long int>A(N);
      |         ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    5 | #include <cstdio>
  +++ |+#include <vector>
    6 | using namespace std;
a.cc:13:16: error: expected primary-expression before 'long'
   13 |         vector<long int>A(N);
      |                ^~~~
a.cc:16:24: error: 'A' was not declared in this scope
   16 |                 cin >> A[i];
      |                        ^
a.cc:20:16: error: 'A' was not declared in this scope
   20 |         while (A[i] % 2 == 0) {
      |                ^
Language: C

#include <iostream>
#include <vector>

int get_two(int b) {
  auto out = 0;
  while(b % 2 == 0 && b > 0) {
    out++;
    b /= 2;
  }
  return out;
}

int main(void){
  int num;
  std::cin >> num;
  std::vector<int> a(num);
  for(int i = 0; i < num; i++){
    int tmp;
    std::cin >> tmp;
    a[i] = tmp;
  }
  int min = 114514;
  for(auto x : a) min = std::min(min, get_two(x));
  std::cout << min << std::endl;
  return 0;
}


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

#include <iostream>
using namespace std;
int main(){
int N;
cin>>N;
int A[N];
for(int i=0;i<N;i++){
cin>>A[i];
}
int j=0;
int m=100;
for(int k=0; k<N; k++){
j=0;
	for(int l=0; A[k]%2==0; l++){
	j++
	A[k]=A[k]/2;
	}
if (m>j){
m=j;}
}
cout<<m<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected ';' before 'A'
   15 |         j++
      |            ^
      |            ;
   16 |         A[k]=A[k]/2;
      |         ~
Language: C++

#include <iostream>
using namespace std;
int main(){
int N;
cin>>N;
int A[N];
for(int i=0;i<N;i++){
cin>>A[i];
}
int j=0;
int m=100;
for(int k=0; k<N; k++){
j=0;
	for(int l=0; A[k]%2==0; l++){
	j++
	A[k]=A[k]/2
	}
if (m>j){
m=j;}
}
cout<<m<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected ';' before 'A'
   15 |         j++
      |            ^
      |            ;
   16 |         A[k]=A[k]/2
      |         ~
Language: C

#include<stdio.h>
int main()
{
int n,i;
scanf("%d",&n);
int  a[n],r[n],c=0;
for(i=0;i<n;i++) {scanf("%d",&a[i]); r[i]=0;}
while(a[0]%2==0)
{
c++;
a[0]/=2;
}
for(i=0;i<n;i++) 
{
while(a[i]%2==0 && c>r[i])
{
r[i]+=1;
a[i]/=2;
}
if(c>r[i])  c=r[i];
}
printf("%d",c);


Compiler output:
main.c: In function 'main':
main.c:22:1: error: expected declaration or statement at end of input
   22 | printf("%d",c);
      | ^~~~~~
Language: C++

#include <cstdlib>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <ctime>

using namespace std;

int main(){
    int n;
    int num[200];
    int min = INT_MAX;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> num[i];
    }
    for(int i=0;i<n;i++){
        int count = 0;
        while(num[i]>0)
        {
            if(num[i]%2 == 0){
                count++;
                num[i] /= 2;
            }else{
                break;
            }

        }
        num[i] = count;
    }
    for(int i=0;i<n;i++){
        if(min>num[i]){
            min = num[i];
        }
    }
    cout << min << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: 'INT_MAX' was not declared in this scope
   15 |     int min = INT_MAX;
      |               ^~~~~~~
a.cc:9:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <ctime>
  +++ |+#include <climits>
    9 |
Language: C++

#include <iostream>
using namespace std;
int main(){
int N;
cin>>N;
int A[N];
for(int i=0;i<N;i++){
cin>>A[i];
}
int j=0;
int m=100;
for(int k=0; i<N; k++){
j=0;
	for(int l=0; A[k]%2==0; l++){
	j++
	A[k]=A[k]/2
	}
if (m>j){
m=j;}
}
cout<<m<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'i' was not declared in this scope
   12 | for(int k=0; i<N; k++){
      |              ^
a.cc:15:12: error: expected ';' before 'A'
   15 |         j++
      |            ^
      |            ;
   16 |         A[k]=A[k]/2
      |         ~
Language: C++

#include <iostream>
using namespace std;
int main(){
int N;
cin>>N;
int A[N];
for(int i=0;i<N;i++){
cin>>A[i];
}
int j=0;
int m=100;
for(int k=0; i<N; k++){
j=0;
	for(int l=0; A[k]%2==0; l++){
	j++
	}
if (m>j){
m=j;}
}
cout<<m<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'i' was not declared in this scope
   12 | for(int k=0; i<N; k++){
      |              ^
a.cc:15:12: error: expected ';' before '}' token
   15 |         j++
      |            ^
      |            ;
   16 |         }
      |         ~
Language: C

#include<stdio.h>
int main()
{
int n,i,f,c=0;long int a[200];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%ld",&a[i]);
}f=1;
while(1)
{
for(i=0;i<n;i++)
{
if((a[i]%2)!=0)
{
f=0;
break;
}a[i]=a[i]/2;}
if(f==0)
break;
else
c++;
}

Compiler output:
main.c: In function 'main':
main.c:23:1: error: expected declaration or statement at end of input
   23 | }
      | ^
Language: C

#include<stdio.h>
int main()
{
int n,i,f,c=0;long int a[200];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%ld",&a[i]);
}f=1;
while(1)
{
for(i=0;i<n;i++)
{
if(a[i]%2)!=0)
{
f=0;
break;
}a[i]=a[i]/2;}
if(f==0)
break;
else
c++;
}


Compiler output:
main.c: In function 'main':
main.c:14:11: error: expected expression before '!=' token
   14 | if(a[i]%2)!=0)
      |           ^~
main.c:14:14: error: expected statement before ')' token
   14 | if(a[i]%2)!=0)
      |              ^
main.c:23:1: error: expected declaration or statement at end of input
   23 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int n;
 a[200]={};
  int min=1000000000,idx,cnt=0;
 for(int i=0;i<n;i++){
  cin>>a[i];
  if(a[i]<min){min=a[i];idx=i;}
 }
 
 while(1){
   if(a[idx]%2!=0)break;
   a[idx]/=2;
   cnt++;
 }
  cout<<cnt<<endl; 
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: 'a' was not declared in this scope
    5 |  a[200]={};
      |  ^
Language: C++

#include <queue>
#include <algorithm>
#include <cmath>
using namespace std;

int main()
{
	long n,a[205],check=0,ans=0;
	scanf("%ld",&n);
	for(int i=1; i<=n; i++)
		scanf("%ld",&a[i]);
	while(check!=1){
		for(int i=1; i<=n; i++){
			if(a[i]%2==1) check=1;
			a[i]=a[i]/2;
		}
		ans++;
	}
	printf("%ld\n",ans-1);
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf' was not declared in this scope
    9 |         scanf("%ld",&n);
      |         ^~~~~
a.cc:19:9: error: 'printf' was not declared in this scope
   19 |         printf("%ld\n",ans-1);
      |         ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include <cmath>
  +++ |+#include <cstdio>
    4 | using namespace std;
Language: C

#include<stdio.h>
int main()
{
	__int64 t,i,a,z,min;
	scanf("%I64d",&t);
	for(i=1;i<=t;i++)
	{
		scanf("%I64d",&a);
		z=0;
		while(a)
		{
			if(a%2==0)z++;
			else break;
			a=a/2;
		}
		if(i==1)min=z;
		else if(min>z)min=z;
	}
	printf("%I64d\n",min);
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: unknown type name '__int64'; did you mean '__int64_t'?
    4 |         __int64 t,i,a,z,min;
      |         ^~~~~~~
      |         __int64_t
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N, cm = 2147483647;
  cin >> N;
  for(int i = 0; i < N; i++){
    int x, c = 0;
    cin >> x;
    while((double)x >> c == x >> c){
      c++;
    }
    if(cm > c)cm = c;
  }
  cout << cm;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: invalid operands of types 'double' and 'int' to binary 'operator>>'
    9 |     while((double)x >> c == x >> c){
      |           ~~~~~~~~~ ^~ ~
      |           |            |
      |           double       int
Language: C++

//2017.12.10
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)

const int max_v = 300;
const int INF = 1000000;



int main() {
	int n,ss, ans=0;
	cin >> n;
	vector <int> A(n);
	//string str;
	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}
    ss=n;
    while (ss == n){
        ss=0;
        REP(k,n){
            if(A[i] % 2 !=0) break;
            A[i]/=2;
            ss+=1;
        }
        if(ss==n) ans++;
        
    }
	//sort(A.begin(), A.end());

	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: 'i' was not declared in this scope
   29 |             if(A[i] % 2 !=0) break;
      |                  ^
a.cc:30:15: error: 'i' was not declared in this scope
   30 |             A[i]/=2;
      |               ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  int a[N];
  for(int i=0;i<N;i++)cin>>a[i];
  int c[N];
  for(int i=0;i<N;i++){
    int s=

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected primary-expression at end of input
   10 |     int s=
      |           ^
a.cc:10:11: error: expected '}' at end of input
a.cc:9:23: note: to match this '{'
    9 |   for(int i=0;i<N;i++){
      |                       ^
a.cc:10:11: error: expected '}' at end of input
   10 |     int s=
      |           ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<cstdio>
#include<algorithm>

using namespace std;

int main()
{
int N;
scanf("%d",&N);
int A,ret=9999999,tmp,w;
for(int i=0;i<N;i++)
{
scanf("%d",&A);
tmp=0;
w=1
while(w)
{
if(A%2==0)
{
A=A/2;
tmp++;
}else{w=0;}
}
ret=min(tmp,ret);
}
printf("%d",ret);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:4: error: expected ';' before 'while'
   15 | w=1
      |    ^
      |    ;
   16 | while(w)
      | ~~~~~
Language: C++

/* -------------------------------------------------

Author :- Vaibhav Pal
College :- Northern India Engineering College, New Delhi
Coding Handle :- underdog_eagle
Title :-

----------------------------------------------------*/
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef vector<ii> vii;
typedef vector<pll> vpll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;

#define FAST_IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define INF 1000000000000000000         
#define nl '\n'
#define sp ' '
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#define bg begin()
#define en end()
#define fo(i, a, b) for(int (i) = (a); (i) <= (b); (i)++)

inline ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
inline ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }

int main()
{
	FAST_IO
    /*#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
    #endif*/

	int n;
	cin >> n;
	ans = LLONG_MAX;
	fo(i, 1, n){
		ll num, x = 0;
		cin >> num;
		while(num % 2 == 0){
			num /= 2;
			x++;
		}
		ans = min(ans, x);
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   50 |         ans = LLONG_MAX;
      |         ^~~
      |         abs
Language: C++

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

#define llong long long
#define inf 999999999
#define mp make_pair
#define pb push_back
typedef pair<int, int> P;
typedef struct data{
	int now;
	int cost;
}data;
int nh[4] = {1, 0, -1, 0};
int nw[4] = {0, 1, 0, -1};

int role(int a){
	int ret = 0;
	int e =a;
	while(e % 2 == 0){
		ret++;
		e = e/2;
	}
	return ret;
}

int main(){
	int ans = inf;
	int N;
	cin >> N;
	int in;
	for(int i = 0; i < N; i++){
		cin >> in;
		if(in % 2 == 1){ans = 0;break}
		else{
			ans = min(ans, role(in));
		}
	}

	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:46: error: expected ';' before '}' token
   33 |                 if(in % 2 == 1){ans = 0;break}
      |                                              ^
      |                                              ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int data[200010]={0}; //最大の数が200000なので余裕をもって
  int N; //データの数
  int K; //limitの数
  
  cin >>N>>K; //データの入力
  
  for (int i=0; i<N; i++)cin>>data[i]; //データの挿入
  
  int num[200010]={0}; //バケット用意
  
  for (int i=0; i<N;i++) num [data[i]]++; //それぞれの種類が何種あるか数える
  
  sort(num,end(num),greater<int>());//大きい順に並び変える

  int ans=0; //答え
  
    int i=0;
    int kind=0; //初期化
    while(num[i] != 0){//何種類あるかを答える
      kind++;
      i++;
    }

  if (kind<=K)break;
  
  else
    for(int j=K ; j<kind; j++) ans += num[j];
  
  cout <<ans <<endl;
}

    
      
      
      
      
  
  
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:28:15: error: break statement not within loop or switch
   28 |   if (kind<=K)break;
      |               ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int data[200010]; //最大の数が200000なので余裕をもって
  int N; //データの数
  int K; //limitの数

  for (int i=0; i<N; i++)cin>>data[i]; //データの挿入
  
  num[200010]; //バケット用意
  
  for (int i=0; i<N;i++) num [data[i]]++; //それぞれの種類が何種あるか数える
  
  sort (num.begin(),num.end());//大きい順に並び変える
  
  int ans=0; //答え
  while(K<kind){//何回変えるかを答える
    int i=0;
    int kind=0;
    while(num[i] != 0){//何種類あるかを答える
      kind++;
      i++;
    }
    if (kind==K)break;
    
    num[kind -1]--;//最後のデータを一つ引く
    ans++; //答えを導く
  }
  
  cout << ans <<endl;//答えを出力
}
    
      
      
      
      
  
  
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'num' was not declared in this scope; did you mean 'enum'?
   11 |   num[200010]; //バケット用意
      |   ^~~
      |   enum
a.cc:18:11: error: 'kind' was not declared in this scope
   18 |   while(K<kind){//何回変えるかを答える
      |           ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,i,ans,s,cc;
  s=0;
  cc=0;
  ans=0;
  cin >> n >> k;
int a[n];
  vector<int> sw(n);
  
  for(i=0;i<n;++i)
  {
  sw[i]=0;
  }

  for(i=0;i<n;++i)
  {
  cin >> a[i];
  sw[a[i]]++;
  }
  
  for(i=0;i<n;++i)
  {
  if(sw[i]==0) cc++;
  else s++;
  }
  
  sort(a.begin(),a.end());
  
  if(s>k) {
  for(i=1;i<=s-k;++i)
  {
  ans=ans+sw[i];
  }
 }
  cout << ans;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: request for member 'begin' in 'a', which is of non-class type 'int [n]'
   30 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:30:20: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   30 |   sort(a.begin(),a.end());
      |                    ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    int n,k;
    cin >> n >> k;
    vector<int> a_cnt(n);
    set<int> a_type;

    rep(i, n) {
        int a;
        cin >> a;
        --a;
        ++a_cnt[a];
    }
    if(type_a <= k) {
        cout << 0 << endl;
        return 0;
    }

    sort(a_cnt.begin(), a_cnt.end());
    int ans = 0;
    rep(i, n-k) ans += a_cnt[i];

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:8: error: 'type_a' was not declared in this scope; did you mean 'typeof'?
   22 |     if(type_a <= k) {
      |        ^~~~~~
      |        typeof
Language: C++

#include "pch.h"
#include "bits/stdc++.h"
#include <set>

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
//#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}

template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	int n, k;
	cin >> n >> k;
	map<int, int>a;
	rep(i, n) {
		int tmp;
		cin >> tmp;
		a[tmp]++;
	}
	vector<int>b;
	for (auto itr = a.begin(); itr != a.end(); ++itr) {
		int value = itr->second;
	//	print(value);
		b.push_back(value);
	}
	sort(b.begin(), b.end());
	int ret = 0;
	if (b.size() - k <= 0) {
		print("0");
		return 0;
	}
	rep(i, b.size()-k) {
		ret += b[i];
	}
	print(ret);
}

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

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

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}

template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	int n, k;
	cin >> n >> k;
	map<int, int>a;
	rep(i, n) {
		int tmp;
		cin >> tmp;
		a[tmp]++;
	}
	vector<int>b;
	for (auto itr = a.begin(); itr != a.end(); ++itr) {
		int value = itr->second;
	//	print(value);
		b.push_back(value);
	}
	sort(b.begin(), b.end());
	int ret = 0;
	if (b.size() - k <= 0) {
		print("0");
		return 0;
	}
	rep(i, b.size()-k,0) {
		ret += b[i];
	}
	print(ret);
}

Compiler output:
a.cc:56:28: error: macro "rep" passed 3 arguments, but takes just 2
   56 |         rep(i, b.size()-k,0) {
      |                            ^
a.cc:7:9: note: macro "rep" defined here
    7 | #define rep(i, n) for (int i = 0; i < (n); i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:56:9: error: 'rep' was not declared in this scope
   56 |         rep(i, b.size()-k,0) {
      |         ^~~
Language: C++

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

using namespace std;

#define Nfor(N) for(int i=0;i<N;i++) 

int main(){
  	int N, K;
  	cin >> N >> K;
  	vector<int> bA(N, 0);
  	Nfor(N){
      	int A_tmp;
      	cin >> A_tmp;
      	bA[A_tmp]++;
    }
  	sort(bA.rbegin(), bA.rend());
  	int count = accumulate(bA.begin()+K, bA.end(), 0);
  	cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: 'accumulate' was not declared in this scope
   19 |         int count = accumulate(bA.begin()+K, bA.end(), 0);
      |                     ^~~~~~~~~~
Language: C++

/**
 *    author:  FromDihPout
 *    created: 2020-08-16
**/

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


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, k;
    cin >> n >> k;
    vector<int> cnt(n+1);
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        cnt[x]++;
    }
    sort(all(cnt), greater<int>());
    
    int sum = 0;
    for (int i = 0; i < k; i++) {
        sum += cnt[i];
    }
    cout << n - sum << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   22 |     sort(all(cnt), greater<int>());
      |          ^~~
      |          std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:6:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C++

int main () {
    int n, k, x=0;
    std::cin >> n >> k;
    int a, check[100] ={0};
    for(int i = 0; i < n; i++){
        std::cin >> a;
        check[a] += 1;
    }
    for(int i = 0; i < 100; ++i){
        if(check[i] != 0) ++x;
    }
    std::sort(check, check + 100);
    int ans = 0;
    for(int i = 0; i < x - k; ++i){
        if(check[i] == 0){
            ++x;
            continue;
        }
        ans += check[i];
    }
    std::cout << ans << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:10: error: 'cin' is not a member of 'std'
    3 |     std::cin >> n >> k;
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main () {
a.cc:6:14: error: 'cin' is not a member of 'std'
    6 |         std::cin >> a;
      |              ^~~
a.cc:6:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:10: error: 'sort' is not a member of 'std'
   12 |     std::sort(check, check + 100);
      |          ^~~~
a.cc:21:10: error: 'cout' is not a member of 'std'
   21 |     std::cout << ans << std::endl;
      |          ^~~~
a.cc:21:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:30: error: 'endl' is not a member of 'std'
   21 |     std::cout << ans << std::endl;
      |                              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main () {
Language: C++

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

using namespace std;
using ll = long long;

int main(int argc, const char *argv[]) {
  int n, k;
  cin >> n >> k;

  vector<ll> va(n), map<int, int> cnts;
  for (int i = 0; i < n; ++i) {
    cin >> va[i];
    cnts[va[i]]++;
  }
  
  vector<int> vc;
  for (auto &p : cnts) {
    vc.push_back(p.second);
  }
  
  sort(vc.begin(), vc.end());
  int kk = max(0, vc.size() - k);
  int ans = 0;
  for (int i = 0; i < kk; i++) {
    ans += vc[i];
  }

  cout << ans << '\n';
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:11:35: error: invalid declarator before 'cnts'
   11 |   vector<ll> va(n), map<int, int> cnts;
      |                                   ^~~~
a.cc:14:5: error: 'cnts' was not declared in this scope
   14 |     cnts[va[i]]++;
      |     ^~~~
a.cc:18:18: error: 'cnts' was not declared in this scope
   18 |   for (auto &p : cnts) {
      |                  ^~~~
a.cc:23:15: error: no matching function for call to 'max(int, std::vector<int>::size_type)'
   23 |   int kk = max(0, vc.size() - k);
      |            ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:23:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::vector<int>::size_type' {aka 'long unsigned int'})
   23 |   int kk = max(0, vc.size() - k);
      |            ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:23:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |   int kk = max(0, vc.size() - k);
      |            ~~~^~~~~~~~~~~~~~~~~~
Language: C++

N_K = input().split()
A = list(input().split())

list_map = {}
chg_num = 0

for index in A:
    if index in list_map:
        list_map[index] += 1
    else:
        list_map[index] = 1

while (len(list_map) > int(N_K[1])):
    chg_num += min(list_map.values())
    list_map.pop(min(list_map.items(), key = lambda x:x[1])[0])
print(chg_num)

Compiler output:
a.cc:1:1: error: 'N_K' does not name a type
    1 | N_K = input().split()
      | ^~~
a.cc:5:1: error: 'chg_num' does not name a type
    5 | chg_num = 0
      | ^~~~~~~
Language: C++

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

int main() {
  int N, K, A;
  cin >> N >> K;
  vector<int> cnt(N + 1);
  while (cin >> A) cnt.at(A)++;
  sort(cnt.rbegin(), cnt.rend());
  cout << N - accumulate(cnt.begin(), cnt.begin() + K, 0); << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:60: error: expected primary-expression before '<<' token
   10 |   cout << N - accumulate(cnt.begin(), cnt.begin() + K, 0); << "\n";
      |                                                            ^~
Language: C

int main(){
    int N,K,*ball,*num,*data,i,j,n,m,l,cnt,wk,res;
    cnt = 0;
    wk = 0;
    res = 0;
    l = 0;
    
    std::cin >> N >> K;

    ball = new int[N];
    num = new int[N];
    data = new int[N];

    for(i = 0; i < N; i++){
        std::cin >> ball[i];
    }

    for(j = 0; j < N; j++){
        num[ball[j]]++;
    }

    for(n = 0; n < N; n++){
        if(num[n] > 0){
            data[cnt] = n;
            cnt++;
        }
    }

    cnt -= K;
    if(cnt > 0){
        for(i = 0; i < N - 1; i++){
            for(j = i + 1; j < N; j++){
                if(num[ball[i]] > num[ball[j]] ){
                    wk = data[i];
                    data[i]  = data[j];
                    data[j] = wk;
                }
            }
        }

        do{
            res += num[data[l]];
            l++;
            cnt--;
        }while(cnt > 0);
    }

    std::cout << res << std::endl;

    delete[] ball;
    delete[] num;
    delete[] data;

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: 'std' undeclared (first use in this function)
    8 |     std::cin >> N >> K;
      |     ^~~
main.c:8:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:8: error: expected ';' before '::' token
    8 |     std::cin >> N >> K;
      |        ^~
      |        ;
main.c:10:12: error: 'new' undeclared (first use in this function)
   10 |     ball = new int[N];
      |            ^~~
main.c:10:15: error: expected ';' before 'int'
   10 |     ball = new int[N];
      |               ^~~~
      |               ;
main.c:11:14: error: expected ';' before 'int'
   11 |     num = new int[N];
      |              ^~~~
      |              ;
main.c:12:15: error: expected ';' before 'int'
   12 |     data = new int[N];
      |               ^~~~
      |               ;
main.c:15:12: error: expected ';' before '::' token
   15 |         std::cin >> ball[i];
      |            ^~
      |            ;
main.c:48:8: error: expected ';' before '::' token
   48 |     std::cout << res << std::endl;
      |        ^~
      |        ;
main.c:50:5: error: 'delete' undeclared (first use in this function)
   50 |     delete[] ball;
      |     ^~~~~~
main.c:50:12: error: expected expression before ']' token
   50 |     delete[] ball;
      |            ^
main.c:51:12: error: expected expression before ']' token
   51 |     delete[] num;
      |            ^
main.c:52:12: error: expected expression before ']' token
   52 |     delete[] data;
      |            ^
Language: C

#include<iostream>

int main(){
    int N,K,*ball,*num,*data,i,j,n,m,l,cnt,wk,res;
    cnt = 0;
    wk = 0;
    res = 0;
    l = 0;
    
    std::cin >> N >> K;

    ball = new int[N];
    num = new int[N];
    data = new int[N];

    for(i = 0; i < N; i++){
        std::cin >> ball[i];
    }

    for(j = 0; j < N; j++){
        num[ball[j]]++;
    }

    for(n = 0; n < N; n++){
        if(num[n] > 0){
            data[cnt] = n;
            cnt++;
        }
    }

    cnt -= K;
    if(cnt > 0){
        for(i = 0; i < N - 1; i++){
            for(j = i + 1; j < N; j++){
                if(num[ball[i]] > num[ball[j]] ){
                    wk = data[i];
                    data[i]  = data[j];
                    data[j] = wk;
                }
            }
        }

        do{
            res += num[data[l]];
            l++;
            cnt--;
        }while(cnt > 0);
    }

    std::cout << res << std::endl;

    delete[] ball;
    delete[] num;
    delete[] data;

    return 0;
}

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


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

int main(){
    int n, k;
    cin >> n >> k;
    map<int,int> mp;
    rep(i,n){
        int a;
        cin >> a;
        mp[a] ++;
    }
    int len=mp.size();

    if(len<=k){
        cout << 0 << endl;
        return 0;
    }


    vector<int> vec(len);
    for(auto i=mp.begin(); i!=mp.end();i++){
        vec[i] = i.second;
    }
    sort(all(vec));
  
    int ans=0;
    rep(i,len){
        ans += vec[i];
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: no match for 'operator[]' (operand types are 'std::vector<int>' and 'std::_Rb_tree_iterator<std::pair<const int, int> >')
   28 |         vec[i] = i.second;
      |            ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1128:28: note:   no known conversion for argument 1 from 'std::_Rb_tree_iterator<std::pair<const int, int> >' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1147:28: note:   no known conversion for argument 1 from 'std::_Rb_tree_iterator<std::pair<const int, int> >' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
a.cc:28:20: error: 'struct std::_Rb_tree_iterator<std::pair<const int, int> >' has no member named 'second'
   28 |         vec[i] = i.second;
      |                    ^~~~~~
Language: C++

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

int main() {
  int N, K;
  cin >> N >> K;
  map<int,int>data;
  vector<pair<int,int>>data2;
  for(int i=0;i<N;i++){
    int s;
    cin >> s;
    if(data.count(s)) data.at(s)++;
    else data[s]=1;
  }
  for(auto p:data){
    data2.push_back(make_pair(p.second,p.first));
  }
  int a = data2.size();
  data2.sort(data2.begin(),data2.end());
  int count=0;
  int i=0;
  while(a>K){
    count += data2.at(i).first;
    a--;
    i++;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'class std::vector<std::pair<int, int> >' has no member named 'sort'
   19 |   data2.sort(data2.begin(),data2.end());
      |         ^~~~
Language: C++

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

int main() {
  int N, K;
  cin >> N >> K;
  map<int,int>data;
  vector<pair<int,int>>data2;
  for(int i=0;i<N;i++){
    int s;
    cin >> s;
    if(data.count(s)) data.at(s)++;
    else data[s]=1;
  }
  for(auto p:data){
    data2.push_back((p.second,p.first));
  }
  int a = data2.size();
  data2.sort(data2.begin(),data2.end());
  int count=0;
  int i=0;
  while(a>K){
    count += data2.at(i).first;
    a--;
    i++;
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(const int&)'
   16 |     data2.push_back((p.second,p.first));
      |     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'const int' to 'const std::vector<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'const int' to 'std::vector<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:19:9: error: 'class std::vector<std::pair<int, int> >' has no member named 'sort'
   19 |   data2.sort(data2.begin(),data2.end());
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
//using Graph = vector<vector<edge>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define query int qq;std::cin >> qq;rep(qqq,qq)
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vout(a) erep(qxqxqx,a)std::cout << qxqxqx << ' ';std::cout  << std::endl;
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
//#define vvector(name,typ,m,n)vector<vector<typ> > name(m,vector<typ> (n))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define res resize
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout << a<<" "<<b <<" "<< c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define ssum(a) accumulate(a,0ll) 

typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
//typedef long long T;
ll ceil(ll a,ll b){
    return ((a+b-1)/b);
}
const int INF = 2000000000;
const ll INF64 = 9223372036854775807ll;
//const ll INF64 = 9223372036854775ll;
const ll MOD = 1000000007ll;
const dou pi=3.141592653589793;
//mapは、if関数などで覗いただけで構成されるので注意しよう！
//std::vector<vector<int>> g;
int main(){
    int n;
    std::cin >> n;
    int k;
    std::cin >> k;
    VEC(int,a,n);
    sort(all(a),greater<int>);
    std::cout << n-accumulate(a.begin(),a.begin()+k,0)<< std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:29: error: expected primary-expression before ')' token
   69 |     sort(all(a),greater<int>);
      |                             ^
Language: C++

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

int main(){
  int n,k;
  int a[200010];
  cin >> n >> k;
  for(int i=0; i<n; ++i) {cin >> a[i];}
  int num[n+1] = {0};
  for(int i=0; i<=n; ++i) {num[a[i]]++;}
  sort(num, num+n+1);
  int sum = 0;
  for(int i=0; i<n-k; ++i){ sum += num[i]; }
  cout << sum << emdl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: 'emdl' was not declared in this scope
   15 |   cout << sum << emdl;
      |                  ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

int main() {
    int n,k;
    cin >> n >> k;
    vector<int> a(n);
    map<int,int> m;
    rep(i,n) {
        int a;
        cin >> a;
        m[a]++;
    }
    int ans = 0;
    while (m.size() > k) {
        int Min = INT_MAX;
        map<int,int>::iterator mem;
        for (auto itr = m.begin(); itr != m.end(); itr++)
        {
            if (Min >= itr->first) {
                Min = itr->first;
                mem = itr;
            }
        }
        ans += Min;
        m.erase(mem);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:19: error: 'INT_MAX' was not declared in this scope
   26 |         int Min = INT_MAX;
      |                   ^~~~~~~
a.cc:10:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #include <map>
  +++ |+#include <climits>
   10 | using namespace std;
Language: C++

#include <memory.h>
using namespace std;


int	n,k, a[200000];
int	t[200000],tc=0;

int main()
{

	cin >>n >>k;

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

	memset(&t[0],0,sizeof(int)*(n+1));

	for(int i=0; i<n;i++)
	{
		if(!t[a[i]])
		{
			tc++;
		}
		t[a[i]]++;
	}

	int ans=0;

	int min=200001, min_i;
	for(;tc>k;tc--)
	{
		for(int i=1;i<=n;i++)
		{
			if(t[i] && min>t[i])
			{
				min=t[i],min_i=i;
			}
		}
		t[min_i]=0;
		ans+=min;
		min=200001;
	}

	cout << ans;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'cin' was not declared in this scope
   11 |         cin >>n >>k;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <memory.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:46:9: error: 'cout' was not declared in this scope
   46 |         cout << ans;
      |         ^~~~
a.cc:46:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'