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

#include <bits/stdc++.h>
using namespace std;
int all[200005];
int main();
{
  	int n,m;
  	cin>>n>>m;
  	int a=0;
  	for (int i=0;i<n;i++)  cin>>all[i];
    int b=1000000001,c=0;
  	while (m)
    {
      	for (int i=0;i<n;i++)
        {
          	if (all[i]>=b)  break;
          	c=max(c,all[i]);
        }
      	b=c;
      	m--;
    }
  	int ans=0;
  	for (int i=0;i<n;i++)
    {
      	if (all[i]>=b)  break;
      	ans+=all[i];
    }
  	cout<<ans;
	return 0;
}

Compiler output:
a.cc:5:1: error: expected unqualified-id before '{' token
    5 | {
      | ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int k=sc.nextInt();
    int[] a=new int[n];
    for(int i=0;i<n;++i){
      a[i]=sc.nextInt();
    }
    if(k>=n){
      System.out.prinntln("0");
    }
    else{
      Arrays.sort(a);
      int temp=n-k-1;
      for(int i=0;i<=temp;++i){
      	ans+=a[i];
      }
      System.out.println(ans);
    }
  }
}


Compiler output:
Main.java:12: error: cannot find symbol
      System.out.prinntln("0");
                ^
  symbol:   method prinntln(String)
  location: variable out of type PrintStream
Main.java:18: error: cannot find symbol
      	ans+=a[i];
      	^
  symbol:   variable ans
  location: class Main
Main.java:20: error: cannot find symbol
      System.out.println(ans);
                         ^
  symbol:   variable ans
  location: class Main
3 errors
Language: Java

import java.io.*;
import java.math.*;
class Main
{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));			        
  int n,k,i=0;
  BigInteger s=new BigInteger("0");
  int a[]=new int[200000];
  String[] strs=br.readLine().trim().split("\\s+");
  String[] strsa=br.readLine().trim().split("\\s+");
  n=Integer.parseInt(strs[0]);
  k=Integer.parseInt(strs[1]);
  for(i=0;i<n;i++)                 
{                                              
a[i]=Integer.parseInt(strsa[i]);
}
  if(k-n>0)
    System.out.println("0");
  else
  {
    Arrays.sort(a);
    for(i=0;i<n-k;i++)
      s=s.add(BigInteger.valueOf(a[i]));
    System.out.println("s");
  }
}
}

Compiler output:
Main.java:22: error: cannot find symbol
    Arrays.sort(a);
    ^
  symbol:   variable Arrays
  location: class Main
1 error
Language: C++

// 大きいやつから順番に消す
#include <iostream>
#include <stdio.h>
using namespace std;
 
int main(){

    int n ,k;

	cin >> n >> k;

    int *h;

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

    h = new long int[n];

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

    int max = -1;
    int index;
    for(int j=0; j<k; j++){
        for(int i=0; i<n; i++){
            if (max < h[i]){
                max = h[i];
                index = i;
            }
        }

        h[index] = 0;
    }

    long int sum;

    for(int i=0; i<n; i++)
        sum += h[i];

    cout << sum << endl;

    delete[] h;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: cannot convert 'long int*' to 'int*' in assignment
   19 |     h = new long int[n];
      |         ^~~~~~~~~~~~~~~
      |         |
      |         long int*
Language: C++

// 大きいやつから順番に消す
#include <iostream>
#include <stdio.h>
using namespace std;
 
int main(){

    int n ,k;

	cin >> n >> k;

    int *h;

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

    h = new long int[n];

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

    int max = -1;
    int index;
    for(int j=0; j<k; j++){
        for(int i=0; i<n; i++){
            if (max < h[i]){
                max = h[i];
                index = i;
            }
        }

        h[index] = 0;
    }

    long int sum;

    for(int i=0; i<n; i++)
        sum += h[i];

    index = 0;
    ct = 0;
    max = -1;

    cout << sum << endl;

    delete[] h;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: cannot convert 'long int*' to 'int*' in assignment
   19 |     h = new long int[n];
      |         ^~~~~~~~~~~~~~~
      |         |
      |         long int*
a.cc:44:5: error: 'ct' was not declared in this scope
   44 |     ct = 0;
      |     ^~
Language: C++

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




int main()
{
  int N,K,i,j;
  long t,sum;
  vector<long> H;
  sum=0;
  cin >> N >> K;
  
  for(int i=0;i<N;i++)
  {
    cin >> t;
    H.push_back(t);
  }
  
  if(K=>N)
  {
   sum=0; 
  }
  else{
  	for(i=0;i<K;i++)
  	{
      for(j=i;j<N;j++)
      {
        if(H[i]>H[j])
        {
          t=H[i];
          H[i]=H[j];
          H[j]=t;
        }
      }
  	}
    for(i=K;i<N;i++)
    {
      sum=sum+H[i];
    }
  }
  
  cout << sum;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:21:8: error: expected primary-expression before '>' token
   21 |   if(K=>N)
      |        ^
Language: C++

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




int main()
{
  int N,K,i,j;
  long t,sum;
  vector<long> H;
  sum=0;
  cin >> N >> K;
  
  for(int i=0;i<N;i++)
  {
    cin >> t;
    H.push_back(t);
  }
  
  if(K=>N)
  {
   sum=0; 
  }
  else{
  	for(i=0;i<K;i++)
  	{
      for(j=i;j<N;j++)
      {
        if(N[i]>N[j])
        {
          t=N[i];
          N[i]=N[j];
          N[j]=t;
        }
      }
  	}
    for(i=K;i<N;i++)
    {
      sum=sum+N[i];
    }
  }
  
  cout << sum;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:21:8: error: expected primary-expression before '>' token
   21 |   if(K=>N)
      |        ^
a.cc:30:13: error: invalid types 'int[int]' for array subscript
   30 |         if(N[i]>N[j])
      |             ^
a.cc:30:18: error: invalid types 'int[int]' for array subscript
   30 |         if(N[i]>N[j])
      |                  ^
a.cc:32:14: error: invalid types 'int[int]' for array subscript
   32 |           t=N[i];
      |              ^
a.cc:33:12: error: invalid types 'int[int]' for array subscript
   33 |           N[i]=N[j];
      |            ^
a.cc:33:17: error: invalid types 'int[int]' for array subscript
   33 |           N[i]=N[j];
      |                 ^
a.cc:34:12: error: invalid types 'int[int]' for array subscript
   34 |           N[j]=t;
      |            ^
a.cc:40:16: error: invalid types 'int[int]' for array subscript
   40 |       sum=sum+N[i];
      |                ^
Language: C++

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

#define int long long int

int32_t main()
{
  int n, k;
  cin>>n>>k;
  
  vector<int> arr(n);
  for(int i=0;i<n;i++)
  {
    cin>>arr[i];
  }
  if(k>=n)
  {
    cout<<"0";
  }
  else
  {
  	sort(arr.begin(), arr.end(), greater<int> ());
   	cout<<accumulate(arr.begin()+k, arr.end(), int(0));
  }
  return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:4:13: error: expected primary-expression before 'long'
    4 | #define int long long int
      |             ^~~~
a.cc:23:52: note: in expansion of macro 'int'
   23 |         cout<<accumulate(arr.begin()+k, arr.end(), int(0));
      |                                                    ^~~
Language: C++

#include<iostream>
#include<algorithm>
#define rep(a,b) for(int i=a;i<b;i++)
typedef long long ll;
using namespace std;
int main()
{
    int n,k;
    cin>>n>>k;
    vector<int> temp(n,0);
    rep(0,n){
        cin>>temp[i];

    }
    sort(temp.begin(),temp.end());
    ll res=0;
    rep(k,n)
    {
        res+=temp[i];
    }
    cout<<res<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'vector' was not declared in this scope
   10 |     vector<int> temp(n,0);
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<algorithm>
  +++ |+#include <vector>
    3 | #define rep(a,b) for(int i=a;i<b;i++)
a.cc:10:12: error: expected primary-expression before 'int'
   10 |     vector<int> temp(n,0);
      |            ^~~
a.cc:12:14: error: 'temp' was not declared in this scope; did you mean 'tm'?
   12 |         cin>>temp[i];
      |              ^~~~
      |              tm
a.cc:15:10: error: 'temp' was not declared in this scope; did you mean 'tm'?
   15 |     sort(temp.begin(),temp.end());
      |          ^~~~
      |          tm
Language: C++

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

using namespace std;
#define ll long long

vector<ll> H;
int N, K;

void input() {
  cin >> N >> K;
  ll h;
  for (int i=0; i<N; i++) {
    cin >> h;
    H.push_back(h);
  }
}

void solve() {
  sort(H.begin(), H.end());
  reverse(H.begin(), H.end());
  ll total = 0;
  for (int i=K; i<N; i++) total += H.at(i);
  cout << total << endl;
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:21:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   21 |   sort(H.begin(), H.end());
      |   ^~~~
      |   sqrt
a.cc:22:3: error: 'reverse' was not declared in this scope
   22 |   reverse(H.begin(), H.end());
      |   ^~~~~~~
Language: C++

#include<iostream>  
#include <bits/stdc++.h> 
using namespace std;  
int main() 
{
  unsigned long int n,k;
  cin>>n;
  cin>>k;
  unsigned long int h[n],temp,i=0;
  for(i=0;i<n;i++){
    cin>>temp;
    h[i]=temp;
  }
  sort(h, h+n);
  unsigned long int t,count=0;
  for(t=0;t<n-k;t++){
     count=count+h[t]
  }
  cout<<count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: expected ';' before '}' token
   17 |      count=count+h[t]
      |                      ^
      |                      ;
   18 |   }
      |   ~
Language: C

#include<stdio.h>
int main()
{
  int s,n,i,j,t,sum=0;
   scanf("%d%d",&n,&s);
  int c[n];
  for(i=0;i<n;i++)
  {
  scanf("%d",&c[i]);
        }
  for(i=0;i<n-1;i++)
  {for(j=0;j<n-1;j++)
  {
    if(c[j]<c[j+1])
    {int t=c[j];
     c[j]=c[j+1];
     c[j+1]=t;
    }
  }
  if(s>=n)
    printf("%d",sum);
  else
  { for(i=s;i<n;i++)
  {sum=sum+c[i];
  } printf("%d",sum);}
    return 0;
}

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

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

int main()
{
  long long int num, k;
  cin >> num >> k;

  vector<long long int> vec(num);
  for(int i=0; i<num; ++i) cin >> vec.at(i);

  // 全ての要素の和
  long long int sum = 0;
  for(int i=0; i<num; ++i) sum += vec.at(i);

  sort(vec.begin(), vec.end());
  long long int sub_sum = 0;
  for(int i=0; i<num-1; ++i) sub_sum += vec.at(i);
                             
  if(num <= k) cout << 0 << endl;
  else if(k==0) cout << sum << endl;
  else{
    sort(vec.begin(), vec.end());
    long long int sub_sum = 0;
    for(int i=0; i<num-k; ++i) sub_sum += vec.at(i);

    cout << sub_sum << endl;
  }

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

#include<bits/stdc++.h> 
using namespace std;
int main(){
	long long n,k,s=0;
	cin>>n>>k;
	long long h[n];
	for(int i=0;i<n;i++){
		cin>>];
    }
    if(k==0) cout<<s;
    else if(k>=n) cout<<"0";
    else {
    	int t=h[0];
    	for(int m=0;m<k;m++){
    		for(int j=1;j<n;j++){
    			if(h[j]>t) t=h[j];
			}
			s-=t;
			t=0;
		}
		cout<<s;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected primary-expression before ']' token
    8 |                 cin>>];
      |                      ^
Language: C++

#include<iostream>  
#include <bits/stdc++.h> 
using namespace std;  
int main() 
{
  unsigned long int n,k;
  cin>>n;
  cin>>k;
  int h[n],temp,i=0;
  for(i=0;i<n;i++){
    cin>>temp;
    h[i]=temp;
  }
  sort(h, h+n);
  for(i=0;i<k;i++){
  }
  int t,count;
  for(t=0;t<n-i-1;t++){
     count=count+h[t]
  }
  cout<<count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: expected ';' before '}' token
   19 |      count=count+h[t]
      |                      ^
      |                      ;
   20 |   }
      |   ~
Language: C

include<stdio.h>
int main()
{
  int s,n,i,j,t,sum=0;
  
  scanf("%d%d",&n,&s);
  int c[n];
  for(i=0;i<n;i++)
  {
  scanf("%d",&c[i]);
        }
  for(i=0;i<=n-1;i++)
  {for(j=0;j<n-1;j++)
  {
    if(c[j]<c[j+1])
    {int t=c[j];
     c[j]=c[j+1];
     c[j+1]=t;
    }
  }
        if(sum>=n)
  printf("Yes");
  else
        printf("No");
        return 0;
        }
  if(s>=n)
    printf("%d",sum);
  else
  { for(i=s;i<n;i++)
  {sum=sum+c[i];
  } printf("%d",sum);}
    return 0;
}

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

#include<iostream>  
#include <bits/stdc++.h> 
using namespace std;  
int main() 
{
  unsigned long int n;
  cin>>n;
  cin>>k;
  int h[n],temp,i=0;
  for(i=0;i<n;i++){
    cin>>temp;
    h[i]=temp;
  }
  sort(h, h+n);
  for(i=0;i<k;i++){
  }
  int k,count;
  for(k=0;k<n-i-1;k++){
     count=count+h[k]
  }
  cout<<count;
  return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'k' was not declared in this scope
    8 |   cin>>k;
      |        ^
Language: C

#include<stdio.h>
int main()
{
  int n,k;
  scanf("%d%d",&n,&k);
  int array[n];
  for(int i=0;i<n;i++)
   scanf("%d",&array[i]);
  
  int temp,min,index,j,i;
  for( i=0;i<n;i++)
  {
     min=array[i];
    for(j=i;j<n;j++)
     {	if(array[j]<min)
         {
    	   min=array[j];
    	   index=j;
          }
     }
     temp=a[j];
     array[j]=array[i];
    array[i]=temp;
   }
   int sum=0;
   if(n-k<=0)
     {
      printf("0\n");
     break;
     }
   else
     {
     for(int i=0;i<n-k;i++)
     sum+=array[i];
      }
  printf("%d\n",sum);
}
        
      

Compiler output:
main.c: In function 'main':
main.c:21:11: error: 'a' undeclared (first use in this function)
   21 |      temp=a[j];
      |           ^
main.c:21:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:6: error: break statement not within loop or switch
   29 |      break;
      |      ^~~~~
Language: C++

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




int main()
{
  long H,A,t,i,j;
  
  cin >> A >> H;
  

  long sum=0;
  long min=0;
  vector<long> N;
   vector<long> v(H,0); 
  for(i=0;i<A;i++)
  {
    cin >> t;
    N.push_back(t);
    sum=sum+t;
    
    if(min<t)
    {
      int x=H-1;
     	for(int i=0;i<H;i++)
  		{
    		if(t<v[i])
    		{
      			x=i-1;
      			break;
    		}
  		}
  		for(int i=0;i<x;i++)
  		{
    	v[i+1]=v[i];
  		}
  			v[x]=t;
      		min=v[0];
    }
  
 
  for(i=H;i<A;i++)
  {
    sum=sum+N[i];
  }
  cout << sum;
}
  


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

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

int main(){
  int N, K;
  cin >> N >> K;
  
  std::vector<int> enemy(N);
  
  for(int i = 0; i < N; i++){
	cin >> enemy(i);
  }
  
  std::sort(enemy.begin(), enemy.end(), std::greater<int>());
  
  int x = 0;
  
  while(K > x){
    x++;
  }
  
  int cnt = x;
  
  for(int i = x; x < N; x++){
    while(enemy(x) == 0){
      enemy(x) = enemy(x) - 1;
      cnt++;
    }
  }
  
  cout << cnt << endl;
}
      
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: no match for call to '(std::vector<int>) (int&)'
   11 |         cin >> enemy(i);
      |                ~~~~~^~~
a.cc:25:16: error: no match for call to '(std::vector<int>) (int&)'
   25 |     while(enemy(x) == 0){
      |           ~~~~~^~~
a.cc:26:12: error: no match for call to '(std::vector<int>) (int&)'
   26 |       enemy(x) = enemy(x) - 1;
      |       ~~~~~^~~
a.cc:26:23: error: no match for call to '(std::vector<int>) (int&)'
   26 |       enemy(x) = enemy(x) - 1;
      |                  ~~~~~^~~
Language: C++

include<iostream>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
int ccc=0;
for(int s=1;s<=n;s++)
{
int w;
cin>>w;
if(w>=ccc)
{
ccc=w;
}
}
for(int j=1;j<=n-k;j++)
{
int sdf=w;
}
cout<<sdf;
return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin>>n>>k;
      | ^~~
a.cc:19:9: error: 'w' was not declared in this scope
   19 | int sdf=w;
      |         ^
a.cc:21:1: error: 'cout' was not declared in this scope
   21 | cout<<sdf;
      | ^~~~
a.cc:21:7: error: 'sdf' was not declared in this scope
   21 | cout<<sdf;
      |       ^~~
Language: C++

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

int main() {
  long int N, K, ans, imax;
  cin >> N >> K;
  vector<int> H(N);
  for(int i =0;i < N;i++){
    cin >> H.at(i);
  }
  
  if(N < K){
    cout << 0 << endl;
  }
  else{
    max = 0;
    for(int j = 0;j < K;j++){
		for(int i =0;i < N;i++){
        	if(max < H.at(i)){
          	max = H.at(i);
              imax = i;//最大値
        	}
          H.at(i) =0;
  		}
    }

  ans = 0;
  for(int i = 0;i < N;i++){
    ans += H.at(i);
  }
  
  cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: overloaded function with no contextual type information
   16 |     max = 0;
      |           ^
a.cc:19:30: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
   19 |                 if(max < H.at(i)){
      |                          ~~~~^~~
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:1180:7: note: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]' declared here
 1180 |       at(size_type __n)
      |       ^~
a.cc:19:20: error: parse error in template argument list
   19 |                 if(max < H.at(i)){
      |                    ^~~~~~~~~~~~~
a.cc:19:33: error: cannot resolve overloaded function 'max' based on conversion to type 'bool'
   19 |                 if(max < H.at(i)){
      |                                 ^
a.cc:20:29: error: overloaded function with no contextual type information
   20 |                 max = H.at(i);
      |                             ^
Language: C

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

int main()
{
    long long int N,K,i,j,count=0;
    long long int a[200000];
    scanf("%ld %ld",&N,&K);
    for(i=0;i<N;i++)
    {
        scanf("%ld",&a[i]);
    }
    for(i=0;i<N-1;i++)
    {
       for(j=i+1;j<N;j++)
       {
           if(a[i]<a[j])
           {
               int t=a[i];
               a[i]=a[j];
               a[j]=t;
           }
       }
    }
    if(K>=N)  printf("0");
    else
    {
        for(i=k-1;i<N;i++)
        {
            count=count+a[i];
        }
        printf("%d",count);
    }


    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:15: error: 'k' undeclared (first use in this function)
   28 |         for(i=k-1;i<N;i++)
      |               ^
main.c:28:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
{
  int n,k;
  scanf("%d%d",&n,&k);
  int array[n];
  for(int i=0;i<n;i++)
   scanf("%d",&array[i]);
  
  int temp,min,index,j,i;
  for( i=0;i<n;i++)
  {
     min=array[i];
    for(j=i;j<n;j++)
     {	if(array[j]<min)
    	{min=array[j];
    	 index=j;}
     }
     temp=a[j];
     array[j]=array[i];
    array[i]=temp;
   }
   int sum=0;
   if(n-k<=0)
   {
      printf("0\n");
     break;
   }
   else
   {
     for(int i=0;i<n-k;i++)
     sum+=array[i];
   }
  printf("%d\n",sum);
}
        
      

Compiler output:
main.c: In function 'main':
main.c:19:11: error: 'a' undeclared (first use in this function)
   19 |      temp=a[j];
      |           ^
main.c:19:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:6: error: break statement not within loop or switch
   27 |      break;
      |      ^~~~~
Language: C++

#include<iostream>  
#include <bits/stdc++.h> 
using namespace std;  
int main() 
{
  unsigned long int n,k;
  cin>>n;
  cin>>k;
  int h[n],tempi=0;
  for(i=0;i<n;i++){
    cin>>temp;
    h[i]=temp;
  }
  sort(h, h+n);
  for(i=0;i<k;i++){
  }
  int k,count;
  for(k=0;k<n-i-1;k++){
     count=count+h[k]
  }
  cout<<count;
  return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i=0;i<n;i++){
      |       ^
a.cc:11:10: error: 'temp' was not declared in this scope; did you mean 'tempi'?
   11 |     cin>>temp;
      |          ^~~~
      |          tempi
a.cc:15:7: error: 'i' was not declared in this scope
   15 |   for(i=0;i<k;i++){
      |       ^
a.cc:17:7: error: conflicting declaration 'int k'
   17 |   int k,count;
      |       ^
a.cc:6:23: note: previous declaration as 'long unsigned int k'
    6 |   unsigned long int n,k;
      |                       ^
a.cc:18:15: error: 'i' was not declared in this scope
   18 |   for(k=0;k<n-i-1;k++){
      |               ^
a.cc:19:22: error: expected ';' before '}' token
   19 |      count=count+h[k]
      |                      ^
      |                      ;
   20 |   }
      |   ~
Language: C++

#include <iostream>
#include <stdio.h>
using namespace std;
 
int main(){

    int n ,k;
    long int tempH;
    long int sum;

	cin >> n >> k;

    long int *h;

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

    h = new long int[n-k];

    int index;
    int ct;
    long int max;

    index = 0;
    ct = 0;
    max = -1;

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

        // 配列にまだ入るうちは配列に入れる
        if(ct < n-k){
            h[ct] = tempH;

            // tempHのほうが大きいならmaxとindexを更新
            if(max < tempH){
                max = tempH;
                index = ct;
            }
            ct += 1;
        }
        // 配列に入らなくなったら，maxと比較
        else{
            // maxより小さいなら，index要素と入れ替える
            if(max > tempH){
                h[index] = tempH;
                // maxを更新
                long int maxtemp = tempH;
                for(int j =0; j<n-k; j++){
                    if(maxtemp < h[j]){
                        maxtemp = h[j];
                        index = j;
                    }
                }
            }
        }

    }

    for(int i=0; i<n-k; i++)
        sum += h[i];

    cout << sum << endl;

    delete h[];
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:14: error: expected primary-expression before ']' token
   67 |     delete h[];
      |              ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int N, K;
  cin>>N>>K;
  long long int arr[N];
  int i;
  long long int sum = 0;
  for(i=0;i<N;i++)
    cin>>arr[i];
  sor(arr, arr+N);
  
    for(i=0;i<(N-K); i++)
    {
      sum = sum + arr[i];
    }
  cout<<sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'sor' was not declared in this scope
   13 |   sor(arr, arr+N);
      |   ^~~
Language: C

#include<stdio.h>
int main()
{
  int n,k;
  scanf("%d%d",&n,&k);
  int array[n];
  for(int i=0;i<n;i++)
   scanf("%d",&array[i]);
  
  int temp,min,index,j,i;
  for( i=0;i<n;i++)
  {
     min=array[i];
    for(j=i;j<n;j++)
     {	if(array[j]<min)
    	{min=array[j];
    	 index=j;}
     }
     temp=a[j];
     array[j]=array[i];
    array[i]=temp;
   }
   int sum=0;
   if(n-k<=0)
   {
      printf("0\n");
     break;
   }
   else
   {
     for(int i=0;i<n-k;i++)
   }   sum+=array[i];
  printf("%d\n",sum);
}
        
      

Compiler output:
main.c: In function 'main':
main.c:19:11: error: 'a' undeclared (first use in this function)
   19 |      temp=a[j];
      |           ^
main.c:19:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:6: error: break statement not within loop or switch
   27 |      break;
      |      ^~~~~
main.c:32:4: error: expected expression before '}' token
   32 |    }   sum+=array[i];
      |    ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>

#include <set>
using namespace std;
typedef long long unsigned int ll;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))
#define REP(i, n) for (ll i = 0; i < n; i++)
ll main()
{
	ll N, K;
	ll H[200000];
	cin >> N >> K;
	REP(i, N)
	{
		cin >> H[i];
	}
	ll cnt = 0;
	std::sort(H, H + 20000, std::greater<ll>());

	for (ll i = 0 + K; i < N; i++)
	{
		cnt += H[i];
	}
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc:24:1: error: '::main' must return 'int'
   24 | ll main()
      | ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
void fast()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);
}
int main(void)
{
	fast();
    ll int n,k;
    cin>>n>>k;
    // ll int p[n];
    vector<ll int> p(n,0)
    for(ll int i=0;i<p.size();i++)
    {
        cin>>p[i];
    }
    
     if(k>=n)
    {
           cout<<0<<endl;
    }
    
    else if(k==0)
    {
        int sum=0;
        for(ll int i=0;i<p.size();i++)
        {
            sum=sum+p[i];
        }
        cout<<(sum*p.size())<<endl;
    }
    
    else
    {
        sort(p.begin(),p.end());
        ll int sum2=0;
        ll int qw=n-k;
        for(ll int j=0;j<qw;j++)
        {
          sum2=sum2+p[j];   
        }
        cout<<sum2<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: expected ',' or ';' before 'for'
   17 |     for(ll int i=0;i<p.size();i++)
      |     ^~~
a.cc:17:20: error: 'i' was not declared in this scope
   17 |     for(ll int i=0;i<p.size();i++)
      |                    ^
Language: C

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

int main()
{
	int n, k, i, j;
	unsigned long long int sum = 0;
	int *h;
	scanf("%d %d", &n, &k);
	if(n <= k){
		printf("0\n");
		return 0;
	}
	h = (int *)malloc(sizeof(int) * n);
	for(i = 0; i < n; i++){
		scanf("%d", &h[i]);
	}
	for(i=0; i<n; ++i) {
    for(j=i+1; j<n; ++j) {
      if(h[i] > h[j]) {
        tmp =  h[i];
        h[i] = h[j];
        h[j] = tmp;
      }
    }
  }
	for(i = 0; i < n - k; i++){
		sum += h[i];
	}
	printf("%llu\n", sum);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:9: error: 'tmp' undeclared (first use in this function)
   21 |         tmp =  h[i];
      |         ^~~
main.c:21:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

void sort(int *numbern int n);

int main()
{
	int n, k, i, j;
	unsigned long long int sum = 0;
	int *h;
	scanf("%d %d", &n, &k);
	if(n <= k){
		printf("0\n");
		return 0;
	}
	h = (int *)malloc(sizeof(int) * n);
	for(i = 0; i < n; i++){
		scanf("%d", &h[i]);
	}
	for(i=0; i<n; ++i) {
    for(j=i+1; j<n; ++j) {
      if(number[i] > number[j]) {
        tmp =  number[i];
        number[i] = number[j];
        number[j] = tmp;
      }
    }
  }
	for(i = 0; i < n - k; i++){
		sum += h[i];
	}
	printf("%llu\n", sum);
	
	return 0;
}

Compiler output:
main.c:4:24: error: expected ';', ',' or ')' before 'int'
    4 | void sort(int *numbern int n);
      |                        ^~~
main.c: In function 'main':
main.c:22:10: error: 'number' undeclared (first use in this function)
   22 |       if(number[i] > number[j]) {
      |          ^~~~~~
main.c:22:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:9: error: 'tmp' undeclared (first use in this function)
   23 |         tmp =  number[i];
      |         ^~~
Language: C++

#include <stdio.h>
#include <set> 
#include <iterator> 

using namespace std; 

int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    multiset <long, greater <long> > health;
    multiset <long, greater <long> > :: iterator itr; 
    for(int i = 0; i<n; i++){
        long num;
        scanf("%ld", &num);
        health.insert(num);
    }
    int c = 0;
    int f1 = n-k;
    long sum = 0;
    multiset <long> health2(health.begin(), health.end());
    for(itr= health2.begin();itr!=health2.end();++itr){
        if(c<f1){
            c++;
            sum += *itr;
        }
        else{
            break;
        }
    }
   

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

#include<istream>
using namespace std;

int main()
{
	
  long long int n,k;
  cin>>n>>k;
  long long int arr[n];
  for(long long int i=0;i<n;i++)
  {
  	cin>>arr[i];
  }
  sort(arr,arr+n);
  long long int sum=0;
  if(k>=n)
  {
  	sum=0;
  }
  else
  {
	for(long long int i=0;i<n-k;i++)
	{
	  	sum+=arr[i];
	}
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   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<istream>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(arr,arr+n);
      |   ^~~~
      |   short
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout<<sum<<endl;
      |   ^~~~
a.cc:27:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int N, K;
  cin>>N>>K;
  int arr[N];
  int i,sum=0;
  for(i=0;i<N;i++)
    cin>>arr[i];
  sor(arr, arr+N);
  
    for(i=0;i<(N-K); i++)
    {
      sum = sum + arr[i];
    }
  cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'sor' was not declared in this scope
   12 |   sor(arr, arr+N);
      |   ^~~
Language: C

#include <stdio.h>
 
void quick_sort(long long int a[],long long int l,long long int u)
{
	long long int j;
	if(l<u)
	{
		j=partition(a,l,u);
		quick_sort(a,l,j-1);
		quick_sort(a,j+1,u);
	}
}
 
long long int partition(long long int a[],long long int l,long long int u)
{
	long long int v,i,j,temp;
	v=a[l];
	i=l;
	j=u+1;
	
	do
	{
		do
			i++;
			
		while(a[i]<v&&i<=u);
		
		do
			j--;
		while(v<a[j]);
		
		if(i<j)
		{
			temp=a[i];
			a[i]=a[j];
			a[j]=temp;
		}
	}while(i<j);
	
	a[l]=a[j];
	a[j]=v;
	
	return(j);
}
 
 
 
int main()
{
  long long int n,k,i,j;
   scanf("%lld %lld\n",&n,&k);
 long long int a[n],sum=0;
  for(i=0;i<n;i++)
    scanf("%lld ",&a[i]);
 quick_sort(a,0,n-1);
    for(i=0;i<n-k;i++)
    {
      sum=sum+a[i];
    }
    printf("%lld",sum);
  return 0;
}

Compiler output:
main.c: In function 'quick_sort':
main.c:8:19: error: implicit declaration of function 'partition' [-Wimplicit-function-declaration]
    8 |                 j=partition(a,l,u);
      |                   ^~~~~~~~~
main.c: At top level:
main.c:14:15: error: conflicting types for 'partition'; have 'long long int(long long int *, long long int,  long long int)'
   14 | long long int partition(long long int a[],long long int l,long long int u)
      |               ^~~~~~~~~
main.c:8:19: note: previous implicit declaration of 'partition' with type 'int()'
    8 |                 j=partition(a,l,u);
      |                   ^~~~~~~~~
Language: C++

//#include<iostream>
//using namespace std;
//int main()
//{
//	// 入力 n:人数 k:必殺技の回数
//	uint32_t n, k;
//
//	cin >> n >> k;
//
//	// 敵のHPの配列
//	long long h[2 * 10 ^ 5];
//
//	// 攻撃の回数を求めよ
//
//	for (uint32_t i = 0; i < n; ++i) {
//		cin >> h[i];
//	}
//
//	// ソート (大きい順番)
//	for (uint32_t i = 0; i < n; ++i) {
//		for (uint32_t j = 0; j < n - 1; ++j) {
//			if (h[j] < h[j + 1]) {
//				swap(h[j], h[j + 1]);
//			}
//		}
//	}
//
//	long long sum = 0;
//	for (uint32_t i = k; i < n; ++i) {
//		sum += h[i];
//	}
//
//	cout << sum << endl;
//	return 0;
//}

#include<iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
int main()
{
	// 入力 n:人数 k:必殺技の回数
	uint32_t n, k;

	cin >> n >> k;

	// 敵のHPの配列
	vector<long long> h;
	long long h[2 * 10 ^ 5];

	// 攻撃の回数を求めよ

	for (uint32_t i = 0; i < n; ++i) {
		h.push_back(0);
		cin >> h[i];
	}

	//// ソート (大きい順番)
	//for (uint32_t i = 0; i < n; ++i) {
	//	for (uint32_t j = 0; j < n - 1; ++j) {
	//		if (h[j] < h[j + 1]) {
	//			swap(h[j], h[j + 1]);
	//		}
	//	}
	//}

	std::sort(h.begin(), h.end(), std::greater<long long>());

	long long sum = 0;
	for (uint32_t i = k; i < n; ++i) {
		sum += h[i];
	}

	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: 'uint32_t' was not declared in this scope
   45 |         uint32_t n, k;
      |         ^~~~~~~~
a.cc:41:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   40 | #include <functional>
  +++ |+#include <cstdint>
   41 | using namespace std;
a.cc:47:16: error: 'n' was not declared in this scope
   47 |         cin >> n >> k;
      |                ^
a.cc:47:21: error: 'k' was not declared in this scope
   47 |         cin >> n >> k;
      |                     ^
a.cc:51:19: error: conflicting declaration 'long long int h [17]'
   51 |         long long h[2 * 10 ^ 5];
      |                   ^
a.cc:50:27: note: previous declaration as 'std::vector<long long int> h'
   50 |         vector<long long> h;
      |                           ^
a.cc:55:22: error: expected ';' before 'i'
   55 |         for (uint32_t i = 0; i < n; ++i) {
      |                      ^~
      |                      ;
a.cc:55:30: error: 'i' was not declared in this scope
   55 |         for (uint32_t i = 0; i < n; ++i) {
      |                              ^
a.cc:72:22: error: expected ';' before 'i'
   72 |         for (uint32_t i = k; i < n; ++i) {
      |                      ^~
      |                      ;
a.cc:72:30: error: 'i' was not declared in this scope
   72 |         for (uint32_t i = k; i < n; ++i) {
      |                              ^
Language: C++

#include<bits/stdc++.h>
#define ll long long int
int main()
{
  ll n,k;
  cin>>n>>k;
  vector<ll>v(n);
  for(auto &x:v) cin>>x;
  sort(v.begin(),v.end());
  ll sum=0;
  for(int i=0;i<n-k;i++) sum+=v[i];
  cout<<sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n>>k;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<ll>v(n);
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
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:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:2:12: error: expected primary-expression before 'long'
    2 | #define ll long long int
      |            ^~~~
a.cc:7:10: note: in expansion of macro 'll'
    7 |   vector<ll>v(n);
      |          ^~
a.cc:8:15: error: 'v' was not declared in this scope
    8 |   for(auto &x:v) cin>>x;
      |               ^
a.cc:9:8: error: 'v' was not declared in this scope
    9 |   sort(v.begin(),v.end());
      |        ^
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    9 |   sort(v.begin(),v.end());
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   cout<<sum;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  long long int n,k,h;
  vector<long long int> vec;
  for(long long int i=0;i<n;i++){
    cin>>h;
    vec.push_back(h);
  }  
 while(1){
   int count=0;
   long long int a;
   for( long long int i=0;i<n-1;i++){
     if(vec[i]<vec[i+1]){
       a=vec[i+1];
       vec[i+1]=vec[i];
       vec[i]=a;
       count++;
     }
     if(count==0)break;
   }
   for(long long int i=0;i<k;i++){
     vec[i]=0;
   }
   long long int sum=0;
   for(int i=0;i<n;i++){
     sum=sum+vec[i];
   }
   cout<<sum;
   return 0;
 }
   
   
    
    

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

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int n,k,h;
    cin>>n,k;
    for(int i=0; i<n; i++){
        cin>>h;
    }
    sort(h.begin(), h.end());
    cout<< h <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: request for member 'begin' in 'h', which is of non-class type 'int'
   10 |     sort(h.begin(), h.end());
      |            ^~~~~
a.cc:10:23: error: request for member 'end' in 'h', which is of non-class type 'int'
   10 |     sort(h.begin(), h.end());
      |                       ^~~
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |     sort(h.begin(), h.end());
      |     ^~~~
      |     short
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
ios::sync_with_stdio(false);

int main()
{
    ull N, K;
    vector<ull> H;

    cin >> N >> K;

    // 全員必殺技
    if(N <=K)
    {
        cout << 0;
        cout << "\n";
        return 0;
    }

    for(ull i=0; i<N; i++)
    {
        ull temp;
        cin >> temp;
        H.push_back(temp);
    }

    // 降順ソート
    sort(H.begin(), H.end(), greater<ull>());

    // 大きいのから削除
    for(ull i=0; i<K; i++)
    {
        H.erase(H.begin());
    }

    ull sum=0;

    for(auto hp : H)
    {
        sum = sum + hp;
    }

    cout << sum;
    cout << "\n";

    return 0;
}

Compiler output:
a.cc:5:1: error: specializing member 'std::basic_ios<char>::sync_with_stdio' requires 'template<>' syntax
    5 | ios::sync_with_stdio(false);
      | ^~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <math.h>
#include <stdio.h>
#define rep(i,n) for (int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main(){
  ll N,K;
  ll sum = 0;
  vector<int>::iterator itr;
  vector<int> v;
  cin >> N >> K;
  rep(i,N){
    ll H;
    cin >> H;
    v.push_back(H);
  }
  rep(i,K){
    if(v.size() == 0) break;
    itr = max_element(v.begin(),v.end());
    v.erase(itr);
  }

  for(int i=0;i<v.size();i++){
    sum += v[i];
  }

  cout << sum << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: 'max_element' was not declared in this scope
   23 |     itr = max_element(v.begin(),v.end());
      |           ^~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  long int N,K,sum=0;
  cin >> N >> K;
  vector<long int> H(N);
  for(int i=0;i<N;i++){
    cin >> H[i];
  }
  sort(H.begin(), H.end());
  if(N<=K){
    cout << 0 << endl;
  }else if(N>K){
    for(int j=0;j<N-K;j++){
      sum=sum+H[j];
    }
    cout << sum << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(H.begin(), H.end());
      |   ^~~~
      |   short
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
	int N, K, attack = 0, num_H = 0;
  	long int attack = 0;
  	cin >> N >> K;
  	vector<int> H(N);
  	if(K >= N){
      cout << "0" << endl;
      return 0;
    }
  	for(int i = 0; i < N; i++)
      cin >> H[i];
  	sort(H.begin(), H.end());
  	while(num_H < N){
    	if(K > 0){
        	K--;
          	num_H++;
          	continue;
        }
      	attack += H.at(num_H);
      	num_H++;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: conflicting declaration 'long int attack'
    7 |         long int attack = 0;
      |                  ^~~~~~
a.cc:6:19: note: previous declaration as 'int attack'
    6 |         int N, K, attack = 0, num_H = 0;
      |                   ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <math.h>
#include <stdio.h>
#define rep(i,n) for (int i=0;i<n;i++)
using namespace std;
typedef long long ll;


int main(){
  ll N,K;
  ll sum = 0;
  vector<ll>::iterator itr;
  size_t index;
  vector<ll> v;
  cin >> N >> K;
  rep(i,N){
    ll H;
    cin >> H;
    v.push_back(H);
  }
  rep(i,K){
    if(v.size() == 0) break;
    itr = max_element(v.begin(),v.end());
    index = distance(v.begin(),itr);
    v.erase(itr);
  }

  for(int i=0;i<v.size();i++){
    sum += v[i];
  }

  cout << sum << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: 'max_element' was not declared in this scope
   25 |     itr = max_element(v.begin(),v.end());
      |           ^~~~~~~~~~~
Language: C++

#include<stdio.h> 

int compareInt(const void* a, const void* b)
{
    int aNum = *(int*)a;
    int bNum = *(int*)b;

    return bNum - aNum;
}

int main(void)
{
  int n,k;
  unsigned int counter=0;
  scanf("%d %d",&n,&k);
  unsigned int e[n];
  for (int i=0; i < n; i++) {
    scanf("%u", &e[i]);
  }
  qsort(e, (sizeof(e)/sizeof(e[0])), sizeof(int), compareInt);
  for (int j = k; j < n; j++) {
    counter += e[j];
  }
  printf("%u",counter);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: 'qsort' was not declared in this scope
   20 |   qsort(e, (sizeof(e)/sizeof(e[0])), sizeof(int), compareInt);
      |   ^~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#define print(n) std::cout << n << std::endl
#define print_no_indention(n) std::cout << n
using namespace std;


int main() {
    long long int n,k;
    //n = 3;
    //k = 0;
    cin >> n >> k;
    vector<int> h(n);
    vector<long long int> h{n};
    for (long long int i = 0; i < n; ++i) {
        cin >> h.at(i);
    }
    sort(h.begin(),h.end(),greater<long long int>());
    /*for (long long int i = 0; i < n; ++i) {
        print(h.at(i));
    }*/

    long long int count = 0;
    if(k > n) {
    }else{
        for (long long int i = k; i < n; ++i) {
            count += h.at(i);
        }
    }
    print(count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: conflicting declaration 'std::vector<long long int> h'
   17 |     vector<long long int> h{n};
      |                           ^
a.cc:16:17: note: previous declaration as 'std::vector<int> h'
   16 |     vector<int> h(n);
      |                 ^
Language: C++

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

int main()
{
  long H,A,t,i,j;
  
  cin >> A >> H;
  long sum=0;
  
  vector<long> N;
    
  for(i=0;i<A;i++)
  {
    cin >> t;
    N.push_back(t);
  }
  for(i=0;i<K;i++)
  {
    for(j=i;j<A;j++)
    {
      if(N[i]<N[j])
      {
        t=N[i];
        N[i]=N[j];
        N[j]=t;
      }
    }
  }
  
  for(i=H;i<A;i++)
  {
    sum=sum+N[i];
  }
  cout << sum;
}
  


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

#include <stdio.h>

int main(void){
	int N,K,i,j,temp,sum;
  scanf("%d%d",&N,&K);
  int H[N];
  for(i=0;i<N;i++){
  	scanf("%d",&H[i]);
  }

  for(i=0;i<N-1;i++){
  	for(j=i+1;j<N;j++){
    	if(H[j]>H[i]){
        	temp=H[j];
          	H[j]=H[i];
          	H[i]=temp;
        }
    }
  
    if(K>=N) printf("0");
    else{
      	for(i=K;i<N;i++){
    		sum+=H[K]
        }
    }
  	printf("%d",sum);
  }

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:26: error: expected ';' before '}' token
   23 |                 sum+=H[K]
      |                          ^
      |                          ;
   24 |         }
      |         ~
Language: C++

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

int main() {
  ll n,k,sum=0;
  cin>>n>>k;
  vector<ll> h;
  for(ll i=0; i<n; i++) {
  	ll x;
    cin>>x;
    h.push_back(x);
    sum += x;
  }
  sort(h.begin(),h.end());
  reverse(h.begin(),h.end());
  ll i=0;
  while(k>0) {
  	sum -= h[i]
    i++;
    k--;
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: expected ';' before 'i'
   19 |         sum -= h[i]
      |                    ^
      |                    ;
   20 |     i++;
      |     ~
Language: C++

# include<stdio.h>
# include<stdlib.h>
long long int inc (const void * a,const void *b)
{
	return * (long long int * )a-* (long long int *)b;
}
int main()
{
	long long int n,k,i,sum=0;
	long long int arr[200000];
	scanf("%lld%lld",&n,&k);
	for(i=1;i<=n;i++)
	{
		scanf("%lld",&arr[i]);
	}
	qsort(arr,n,sizeof(long long int),inc);
	for(i=1;i<=n-k;i++)
	{
		sum=sum+arr[i];
	}
	printf("%lld",sum);
	return 0;
}

	


Compiler output:
a.cc: In function 'int main()':
a.cc:16:43: error: invalid conversion from 'long long int (*)(const void*, const void*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
   16 |         qsort(arr,n,sizeof(long long int),inc);
      |                                           ^~~
      |                                           |
      |                                           long long int (*)(const void*, const void*)
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/stdlib.h:36,
                 from a.cc:2:
/usr/include/stdlib.h:971:34: note:   initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: Java

import java.util.Scanner;
import java.util.*;

public class Main{
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
long n=scan.nextLong();
long k=scan.nextLong();  
long[] h=new long[n];

long i=0;  
for(i=0;i<n;i++){
    h[i]=scan.nextLong();
}
  
Arrays.sort(h);
  
long sum=0;

if(n>k){
    for(i=0;i<n-k;i++){
      sum=sum+h[i];
    }
System.out.println(sum); 
}else{
  System.out.println("0");
}


}
}


Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from long to int
long[] h=new long[n];
                  ^
Main.java:13: error: incompatible types: possible lossy conversion from long to int
    h[i]=scan.nextLong();
      ^
Main.java:22: error: incompatible types: possible lossy conversion from long to int
      sum=sum+h[i];
                ^
3 errors