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

#include<bits/stdc++.h>
using namespace std;
int main()
{
int N,K;
  cin>>N>>K,sum=0,sum1=0;
  int arr[N],n;
  
  for(int i=0;i<N;i++)
  {
   cin>>arr[i];
    sum=sum+arr[i];
    if(i<N-K)
    {sum1=sum1+arr[i];}
  }
  n=sizeof(arr)/sizeof(arr[0]);
  sort(arr,arr+n);
  
  if(K==0){
    cout<<sum;}
  
  
  
  if(K>N){
    cout<<"0";
  }
  else{
    cout<<sum1;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'sum' was not declared in this scope
    6 |   cin>>N>>K,sum=0,sum1=0;
      |             ^~~
a.cc:6:19: error: 'sum1' was not declared in this scope
    6 |   cin>>N>>K,sum=0,sum1=0;
      |                   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int N,K;
  cin>>N>>K,sum=0;
  int arr[N],n;
  n=sizeof(arr)/sizeof(arr[0]);
  for(int i=0;i<N;i++)
  {
   cin>>arr[i];
    sum=sum+arr[i];
  }
  sort(arr,arr+n);
  
  if(K==0){
    cout<<sum;}
  
  int sum1=0;
  for(int j=0;j<N-K;j++)
  {
   sum1=sum1+arr[j];
  }
  if(K>N){
    cout<<"0";
  }
  else{cout<<sum1;}
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'sum' was not declared in this scope
    6 |   cin>>N>>K,sum=0;
      |             ^~~
Language: C++

using namespace std;
long int n,k_max,a,sum,total;
long int arr[] =  {};
vector <long int> Array;
int main(){
    cin>>n>>k_max;
      
    for (int i=0;i<n;i++){
        cin>>a;
          Array.push_back(a);
          sum+=a;
        
    }
    sort(Array.begin(), Array.end(), greater<long int>());
    for (int i=0;i<k_max;i++){
        total += Array[i];
    }
      if (k_max>=n){
            cout<<0;
            return 0;
        }
        sum -= total;
        cout<<sum;
}


Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector <long int> Array;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>n>>k_max;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:10:11: error: 'Array' was not declared in this scope
   10 |           Array.push_back(a);
      |           ^~~~~
a.cc:14:10: error: 'Array' was not declared in this scope
   14 |     sort(Array.begin(), Array.end(), greater<long int>());
      |          ^~~~~
a.cc:14:38: error: 'greater' was not declared in this scope
   14 |     sort(Array.begin(), Array.end(), greater<long int>());
      |                                      ^~~~~~~
a.cc:14:46: error: expected primary-expression before 'long'
   14 |     sort(Array.begin(), Array.end(), greater<long int>());
      |                                              ^~~~
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |     sort(Array.begin(), Array.end(), greater<long int>());
      |     ^~~~
      |     short
a.cc:19:13: error: 'cout' was not declared in this scope
   19 |             cout<<0;
      |             ^~~~
a.cc:19:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout<<sum;
      |         ^~~~
a.cc:23:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
#include <vector>
using namespace std;
long int n,k_max,a,sum,total;
long int arr[] =  {};
vector <int> Array;
int main(){
    cin>>n>>k_max;
      
    for (int i=0;i<n;i++){
        cin>>a;
          Array.push_back(a);
          sum+=a;
    }
    sort(Array.begin(), Array.end(), greater<int>());
   
    
          
    for (int i=0;i<k_max;i++){
        total += Array[i];
    }
   
        
      if (k_max>n){
               cout<<0;
            return 0;
        }
    else if (k_max==0){
            cout<<sum;
            return 0;
        }
    else{
        sum -= total;
        cout<<sum;
    }
    return 0;
}

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

#include <iostream>
#include <vector>
using namespace std;
long int n,k_max,a,sum,total;
long int arr[] =  {};
vector <int> Array;
int main(){
    cin>>n>>k_max;
      
    for (int i=0;i<n;i++){
        cin>>a;
          Array.push_back(a);
          sum+=a;
    }
    sort(Array.begin(), Array.end(), greater<int>());
   
    
          
    for (int i=0;i<k_max;i++){
        total += Array[i];
    }
   
        
      if (k_max>n){
               cout<<0;
            return 0;
        }
    else if (k_max==0){
            cout<<sum;
            return 0;
        }
    else{
        sum -= total;
        cout<<sum;
    }
  
}


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

#include<bits/stdc++.h>

using namespace std;
#define ll long long

int main(){
  ll n,k;
  vector<ll> h;
  std::cin>>n>>k;
  ll i,j;
  for(i=0;i<n;i++)
  {
    std::cin>>j;
    h.push_back(j);
  }
  sort(h.begin(),h.end());
  ll count=0;
  for(i=0;i<n-k;i++)
  {
    count+=v[i];
  }
  std::cout<<count;
  return 0;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'v' was not declared in this scope
   20 |     count+=v[i];
      |            ^
Language: C

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

int main(){
  int n,k;
  long *h;
  int i,j,tmp;
  long long count=0;
  
  scanf("%d %d",&n,&k);
  h=(long*)calloc(sizeof(long)*n,0);
  for(i=0;i<n;i++){
    scanf("%d",&h[i]);
  }
  
  for(i=n-1;i>0;i--){
    for(j=0;j<i;j++){
      if(h[j]>h[j+1]){
        tmp=h[j];
        h[j]=h[j+1];
        h[j+1]=tmp;
      }
    }
  }
  
  for(i=0;i<n-k;i++){
    count+=(long long)h[i];
  }
  printf("%lld",count);
  free(h)
}


Compiler output:
main.c: In function 'main':
main.c:30:10: error: expected ';' before '}' token
   30 |   free(h)
      |          ^
      |          ;
   31 | }
      | ~
Language: C

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

int main(){
  int n,k;
  int *h;
  int i,j,tmp;
  long long count=0;
  
  scanf("%d %d",&n,&k);
  h=(int*)calloc(sizeof(int)*n);
  for(i=0;i<n;i++){
    scanf("%d",&h[i]);
  }
  
  for(i=n-1;i>0;i--){
    for(j=0;j<i;j++){
      if(h[j]>h[j+1]){
        tmp=h[j];
        h[j]=h[j+1];
        h[j+1]=tmp;
      }
    }
  }
  
  for(i=0;i<n-k;i++){
    count+=h[i];
  }
  printf("%lld",count);
}

Compiler output:
main.c: In function 'main':
main.c:11:11: error: too few arguments to function 'calloc'
   11 |   h=(int*)calloc(sizeof(int)*n);
      |           ^~~~~~
In file included from main.c:2:
/usr/include/stdlib.h:675:14: note: declared here
  675 | extern void *calloc (size_t __nmemb, size_t __size)
      |              ^~~~~~
Language: C++

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

int main(){
  ll n,k;cin >> n >> k;
  vector<ll> vec(n);
  for(ll i=0; i<n; i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end(),greater<ll>);
  ll ans=0;
  for(ll i=k; i<n; i++){
    ans += vec.at(i);
  }
  cout << ans << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:41: error: expected primary-expression before ')' token
   11 |   sort(vec.begin(),vec.end(),greater<ll>);
      |                                         ^
Language: C++

        #include<iostream>
        using namespace std;
        int main(){
        	int n,k;
        	cin>>n>>k;
         	int a[n];
          	for(int i=0;i<n;i++){
            	cin>>a[i];
            }
          	long long sum=0;
        	sort(a,a+n);
          	for(int i=0;i<(n-k);i++)sum+=a[i];
          	cout<<sum<<endl;
          return 0;
        }

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

    #include<iostream>
    using namespace std;
    int main(){
    	int n,k;
    	cin>>n>>k;
     	int a[n];
      	for(int i=0;i<n;i++){
        	cin>>a[i];
        }
      	long long sum=0;
    	sort(a,a+n);
      	rep(i,0,n-k)sum+=a[i];
      	cout<<sum<<endl;
      return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |         sort(a,a+n);
      |         ^~~~
      |         short
a.cc:12:13: error: 'i' was not declared in this scope
   12 |         rep(i,0,n-k)sum+=a[i];
      |             ^
a.cc:12:9: error: 'rep' was not declared in this scope
   12 |         rep(i,0,n-k)sum+=a[i];
      |         ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n,k;
	cin>>n>>k;
 	int a[n];
  	for(int i=0;i<n;i++){
    	cin>>a[i];
    }
  	ll sum=0;
	sort(a,a+n);
  	rep(i,0,n-k)sum+=a[i];
  	cout<<sum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'll' was not declared in this scope
   10 |         ll sum=0;
      |         ^~
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |         sort(a,a+n);
      |         ^~~~
      |         short
a.cc:12:13: error: 'i' was not declared in this scope
   12 |         rep(i,0,n-k)sum+=a[i];
      |             ^
a.cc:12:9: error: 'rep' was not declared in this scope
   12 |         rep(i,0,n-k)sum+=a[i];
      |         ^~~
a.cc:13:15: error: 'sum' was not declared in this scope
   13 |         cout<<sum<<endl;
      |               ^~~
Language: C++

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
 ll n,m,sum=0;
  cin>>n>>m;
  ll a[n];
  for(ll i=0;i<n;i++)
  {
    ll k;
    cin>>k;
    a[i]=-k;
  }
  sort(a,a+n); 
  if(m>n)
  {
    cout<<"0";
  }
  else
  {
   for(ll i=max(0,m);i<n;i++)
   {
     sum=sum+a[i];
   }
    cout<<sum;
  }
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: no matching function for call to 'max(int, long long int&)'
   22 |    for(ll i=max(0,m);i<n;i++)
      |             ~~~^~~~~
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:22:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   22 |    for(ll i=max(0,m);i<n;i++)
      |             ~~~^~~~~
/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:22:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   22 |    for(ll i=max(0,m);i<n;i++)
      |             ~~~^~~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
 ll n,m,sum=0;
  cin>>n>>m;
  ll a[n];
  for(ll i=0;i<n;i++)
  {
    ll k;
    cin>>k;
    a[i]=-k;
  }
  sort(a,a+n); 
  if(m>n)
  {
    cout<<"0";
  }
  else
  {
   for(int i=max(0,m);i<n;i++)
   {
     sum=sum+a[i];
   }
    cout<<sum;
  }
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: no matching function for call to 'max(int, long long int&)'
   22 |    for(int i=max(0,m);i<n;i++)
      |              ~~~^~~~~
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:22:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   22 |    for(int i=max(0,m);i<n;i++)
      |              ~~~^~~~~
/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:22:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   22 |    for(int i=max(0,m);i<n;i++)
      |              ~~~^~~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n,h[200005],k,s;
int main(){
	cin>>n>>k;
	for(int i=0;i<n;i++)cin>>h[i];
	sort(h,h+n);
	for(int i=0;i<n-k;i++)s+=h[i];
	cout<<s<<endl;
	return 0;
}


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

#include <vector>
#include <algorithm>
#include <stdio.h>

typedef long long int llint;

using namespace std;]

int n,k;
vector<int> h(200000);

int main()
{
    scanf("%d %d",&n,&k);
    for(int i=0;i<n;i++) scanf("%d",h[i]);

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

    llint sum=0;
    for(int i=0;i<n-k;i++) sum+=h[i];
    printf("%lld\n",sum);
}

Compiler output:
a.cc:7:21: error: expected unqualified-id before ']' token
    7 | using namespace std;]
      |                     ^
a.cc: In function 'int main()':
a.cc:14:20: error: 'n' was not declared in this scope
   14 |     scanf("%d %d",&n,&k);
      |                    ^
a.cc:14:23: error: 'k' was not declared in this scope
   14 |     scanf("%d %d",&n,&k);
      |                       ^
Language: C++

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


/* Driver program to test above functions */
int32_t main()
{

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


Compiler output:
a.cc:2:17: error: 'std3' is not a namespace-name
    2 | using namespace std3
      |                 ^~~~
a.cc: In function 'int32_t main()':
a.cc:13:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   13 |     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:18:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   18 |     sort(arr, arr + n);
      |     ^~~~
      |     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:23:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |     cout<<count<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |     cout<<count<<endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include <stdio.h>
int compare(const void *a,const void *b){
    if(*(int *)a>*(int *)b)return -1;
    return 1;
}
int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    int h[n];
    for(i = 0;i<N;i++){
        scanf("%d",h[i]);
    }
    
    qsort(h,n,sizeof(int),compare);
    for(int i=k;i<n;i++){
        count+=h[i];
    }
    printf("%d",count);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'i' undeclared (first use in this function)
   10 |     for(i = 0;i<N;i++){
      |         ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:17: error: 'N' undeclared (first use in this function)
   10 |     for(i = 0;i<N;i++){
      |                 ^
main.c:14:5: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   14 |     qsort(h,n,sizeof(int),compare);
      |     ^~~~~
main.c:16:9: error: 'count' undeclared (first use in this function)
   16 |         count+=h[i];
      |         ^~~~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int n,k;
  cin>>n>>k;
  
  int arr[n];
  for(int i=0;i<n;i++) cin>>arr[i];
  
  sort(arr,arr+n);
  long long ans=0;
  for(int i=0;i<n;i++)
  {
    if(k==0) break;
    ans+=arr[i]*1LL;
  }
  
  cout<<ans<<endl;
  
  return 0;
}

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

n,k = [int(x) for x in input().split()]
h = [int(x) for x in input().split()]
h.sort(reverse=True)
  
if(h.length <= k):
	print("0")
else:
	print(sum(h,k))

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,k = [int(x) for x in input().split()]
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'k' [-Wimplicit-int]
    1 | n,k = [int(x) for x in input().split()]
      |   ^
main.c:1:7: error: expected expression before '[' token
    1 | n,k = [int(x) for x in input().split()]
      |       ^
main.c:2:1: error: expected ',' or ';' before 'h'
    2 | h = [int(x) for x in input().split()]
      | ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int h,a,n,s=0;
  cin>>h>>n;
  while(n--)
  {
    cin>>a;
    s+=a;
  }
  if(s>=a)
    cout<<"Yes";
  else cout<<"No";
  return ;
}
  

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

#include <iostream>
#include <vector>
 
using namespace std;
 
int main() {
    int n, k;
    cin >> n >> k;
 
    vector<int> h(n);
    for (int i=0; i<n; i++) cin >> h[i];
 
    sort(h.begin(), h.end());
    long long ans = 0;
    for (int i=0; i<n-k; i++) ans += h[i];
 
    cout << ans << endl;
}

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

#include <iostream>
#include <vector>
 
using namespace std;
 
int main() {
    int n, k;
    cin >> n >> k;
 
    vector<int> h(n);
    for (int i=0; i<n; i++) cin >> h[i];
 
    sort(h.begin(), h.end());
    long long ans = 0;
    for (int i=0; i<n-k; i++) ans += h[i];
 
    cout << ans << endl;
}

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

#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main()
{
    int n,k;
    cin>>n>>k;

  int i,  sum = 0;
    if(k>=n)
        cout<<"0"<<endl;
    else
    {
        lnt cnt = 0;
        lnt a[n];
        for(i = 0;i < n;i++)
        {
            cin>>a[i];
            sum+=a[i];
        }
        for(i = n-1;cnt<k;i--,cnt++)
        {
            sum-=a[i];

        }
        cout<<sum<<endl;
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'lnt' was not declared in this scope; did you mean 'int'?
   15 |         lnt cnt = 0;
      |         ^~~
      |         int
a.cc:16:12: error: expected ';' before 'a'
   16 |         lnt a[n];
      |            ^~
      |            ;
a.cc:19:18: error: 'a' was not declared in this scope
   19 |             cin>>a[i];
      |                  ^
a.cc:22:21: error: 'cnt' was not declared in this scope; did you mean 'int'?
   22 |         for(i = n-1;cnt<k;i--,cnt++)
      |                     ^~~
      |                     int
a.cc:24:18: error: 'a' was not declared in this scope
   24 |             sum-=a[i];
      |                  ^
Language: C++

include <bits/stdc++.h>
using namespace std;
int main(void){
   long long n,k;cin>>n>>k;
   priority_queue<long long> que;
   for(int i=0;i<n;i++){
       long long h;cin>>h;
       que.push(h);
   }
   long long cou=0;
   for(int i=0;i<k;i++){
       if(que.size()==0){
           cout<<cou<<endl;
           return 0;
       }
       que.pop();
       //cou++;
   }
   while(que.size()>0){
       long long x=que.top();que.pop();
       cou+=x;
   }
   cout<<cou<<endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:4:18: error: 'cin' was not declared in this scope
    4 |    long long n,k;cin>>n>>k;
      |                  ^~~
a.cc:5:4: error: 'priority_queue' was not declared in this scope
    5 |    priority_queue<long long> que;
      |    ^~~~~~~~~~~~~~
a.cc:5:19: error: expected primary-expression before 'long'
    5 |    priority_queue<long long> que;
      |                   ^~~~
a.cc:8:8: error: 'que' was not declared in this scope
    8 |        que.push(h);
      |        ^~~
a.cc:12:11: error: 'que' was not declared in this scope
   12 |        if(que.size()==0){
      |           ^~~
a.cc:13:12: error: 'cout' was not declared in this scope; did you mean 'cou'?
   13 |            cout<<cou<<endl;
      |            ^~~~
      |            cou
a.cc:13:23: error: 'endl' was not declared in this scope
   13 |            cout<<cou<<endl;
      |                       ^~~~
a.cc:16:8: error: 'que' was not declared in this scope
   16 |        que.pop();
      |        ^~~
a.cc:19:10: error: 'que' was not declared in this scope
   19 |    while(que.size()>0){
      |          ^~~
a.cc:23:4: error: 'cout' was not declared in this scope; did you mean 'cou'?
   23 |    cout<<cou<<endl;
      |    ^~~~
      |    cou
a.cc:23:15: error: 'endl' was not declared in this scope
   23 |    cout<<cou<<endl;
      |               ^~~~
Language: C++

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

int main(){
	long int n,k,a,ans=0;
  vector<int> h;
  cin >> n >> k;
  for(int i=0; i<n; i++){
  	cin >> a;
    h.push_back(a);
  }
  sort(h.begin(),h.end);
  for(int i=0+k; i<n; i++){
  	ans += h.at(i);
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: no matching function for call to 'sort(std::vector<int>::iterator, <unresolved overloaded function type>)'
   14 |   sort(h.begin(),h.end);
      |   ~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:63: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

int main(){
	long int n,k,a,ans=0;
  victor<int> h;
  cin >> n >> k;
  for(int i=0; i<n; i++){
  	cin >> a;
    h.push_back(a);
  }
  sort(h.begin(),h.end);
  for(int i=0+k; i<n; i++){
  	ans += h.at(i);
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'victor' was not declared in this scope
    8 |   victor<int> h;
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   victor<int> h;
      |          ^~~
a.cc:12:5: error: 'h' was not declared in this scope
   12 |     h.push_back(a);
      |     ^
a.cc:14:8: error: 'h' was not declared in this scope
   14 |   sort(h.begin(),h.end);
      |        ^
Language: Java

import java.util.*;

public class FennecVsMonster {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        if (n <= k) {
            System.out.println(0);
            return;
        }

        List<Integer> hpList = new ArrayList<>();
        for (int i = 0; i < n; i++) hpList.add(sc.nextInt());
        Collections.sort(hpList, Comparator.reverseOrder());
        
        long result = 0;
        for (int i = k; i < n; i++) result += hpList.get(i);

        System.out.println(result);
    }
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k;
  cin>>n>>k;
  vector<long> h(n);
  for(int i=0;i<n;i++) cin>>h[i];
  sort(h.begin(),h.end());
  long count=0
  if(n>k){
    for(int i=0;i<n-k;i++)
    count+=h[i];
  }
  cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'if'
   10 |   if(n>k){
      |   ^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'i' was not declared in this scope
    8 |         int h[i];
      |               ^
a.cc:10:24: error: 'h' was not declared in this scope
   10 |                 cin >> h[i];
      |                        ^
a.cc:12:14: error: 'h' was not declared in this scope
   12 |         sort(h,h+n);
      |              ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  vector<int> list;
  int N, K;
  cin >> N >> K;
  if (N < K) {
    cout << "0";
    return 0;
  }
  for (int index = 0; index < N; index++) {
    int H = 0;
    cin >> H;
    list.push_back(H);
  }
  sort(list.begin(), list.end(), greater<int>());
  int all;
  for (int index = K; index < N; index++) {
    all += list[index];
  }
  cout << all;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> list;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> list;
      |          ^~~
a.cc:15:5: error: 'list' was not declared in this scope
   15 |     list.push_back(H);
      |     ^~~~
a.cc:2:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
    1 | #include <iostream>
  +++ |+#include <list>
    2 | using namespace std;
a.cc:17:8: error: 'list' was not declared in this scope
   17 |   sort(list.begin(), list.end(), greater<int>());
      |        ^~~~
a.cc:17:8: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |   sort(list.begin(), list.end(), greater<int>());
      |   ^~~~
      |   short
Language: C++

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

int main(){
  int n,k;
  cin >> n >> k;
  vector<ll> h(n);
  for(ll i=0;i<n;i++){
    cin >> h.at(i);
  }
  sort(h.begin(),h.end());
  ll cnt = 0;
  for(ll i=0;i<n-k;i++){
    cnt += h.at(i);
  }
  cout << cnt << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'll' was not declared in this scope
    8 |   vector<ll> h(n);
      |          ^~
a.cc:8:12: error: template argument 1 is invalid
    8 |   vector<ll> h(n);
      |            ^
a.cc:8:12: error: template argument 2 is invalid
a.cc:9:9: error: expected ';' before 'i'
    9 |   for(ll i=0;i<n;i++){
      |         ^~
      |         ;
a.cc:9:14: error: 'i' was not declared in this scope
    9 |   for(ll i=0;i<n;i++){
      |              ^
a.cc:10:14: error: request for member 'at' in 'h', which is of non-class type 'int'
   10 |     cin >> h.at(i);
      |              ^~
a.cc:12:10: error: request for member 'begin' in 'h', which is of non-class type 'int'
   12 |   sort(h.begin(),h.end());
      |          ^~~~~
a.cc:12:20: error: request for member 'end' in 'h', which is of non-class type 'int'
   12 |   sort(h.begin(),h.end());
      |                    ^~~
a.cc:13:5: error: expected ';' before 'cnt'
   13 |   ll cnt = 0;
      |     ^~~~
      |     ;
a.cc:14:9: error: expected ';' before 'i'
   14 |   for(ll i=0;i<n-k;i++){
      |         ^~
      |         ;
a.cc:14:14: error: 'i' was not declared in this scope
   14 |   for(ll i=0;i<n-k;i++){
      |              ^
a.cc:15:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   15 |     cnt += h.at(i);
      |     ^~~
      |     int
a.cc:15:14: error: request for member 'at' in 'h', which is of non-class type 'int'
   15 |     cnt += h.at(i);
      |              ^~
a.cc:17:11: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |   cout << cnt << endl;
      |           ^~~
      |           int
Language: C++

    #include<iostream>
    #include<algorithm>
    #define int long long
    using namespace std;
     
    int32_t main()
    {
    int n,k; cin>>n>>k;
      int arr[n];
    for(int i=0;i<n;i++) cin>>arr[i];
    sort(arr,arr+n);
      for(int i=0;i<n-k;i++) sum+=arr[i];
      cout<<sum<<endl;
     
     
    return 0;
    }

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:12:30: error: 'sum' was not declared in this scope
   12 |       for(int i=0;i<n-k;i++) sum+=arr[i];
      |                              ^~~
a.cc:13:13: error: 'sum' was not declared in this scope
   13 |       cout<<sum<<endl;
      |             ^~~
Language: C++

#include<iostream>
#include<algorithm>
#define int long long
using namespace std;

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


return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:9:11: error: 'i' was not declared in this scope
    9 |   int arr[i];
      |           ^
a.cc:10:27: error: 'arr' was not declared in this scope
   10 | for(int i=0;i<n;i++) cin>>arr[i];
      |                           ^~~
a.cc:11:6: error: 'arr' was not declared in this scope
   11 | sort(arr,arr+n);
      |      ^~~
a.cc:12:26: error: 'sum' was not declared in this scope
   12 |   for(int i=0;i<n-k;i++) sum+=arr[i];
      |                          ^~~
a.cc:13:9: error: 'sum' was not declared in this scope
   13 |   cout<<sum<<endl;
      |         ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int n, k, a[1000001];

int main() {

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

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

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

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> h(n);
  rep(i,n) cin >> h(i);
  sort(h.begin(), h.end());
  k = min(n,k);
  ll ans = 0;
  rep(i,k){
    h.pop_back(); 
  }
  rep(i,h.size()) ans += h[i];
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: no match for call to '(std::vector<int>) (int&)'
   11 |   rep(i,n) cin >> h(i);
      |                   ~^~~
Language: C

#include <stdio.h>

int main(int argc, char const *argv[]) {

  int N, K;
  if (N < K) {
    printf("%d\n", K);
    return 0;
  }

  int H[200000];
  scanf("%d %d", &N, &K);
  for (int i = 0; i < N; i++) {
    scanf("%d", (A + i));
  }

  long long int sum;
  for (int i = 0; i < N - K; i++) {
    sum += (long long int)A[K + i];
  }

  printf("%lld\n", sum);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:18: error: 'A' undeclared (first use in this function)
   14 |     scanf("%d", (A + i));
      |                  ^
main.c:14:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(int argc, char const *argv[]) {

  int N, K;
  if (N < K) {
    printf("%d\n", K);
    return 0;
  }

  int H[200000];
  scanf("%d %d", &N, &K);
  for (int i = 0; i < count; i++) {
    scanf("%d", (A + i));
  }

  long long int sum;
  for (int i = 0; i < N - K; i++) {
    sum += (long long int)A[K + i]; 
  }

  printf("%lld\n", sum);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:23: error: 'count' undeclared (first use in this function)
   13 |   for (int i = 0; i < count; i++) {
      |                       ^~~~~
main.c:13:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:18: error: 'A' undeclared (first use in this function)
   14 |     scanf("%d", (A + i));
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#include <cstdlib> 
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (int I = (A); I <= (B); I++)
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > ii;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(int i=0;i<n;i++)
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
int main(){
 IOS
    int h,n;
    cin>>h>>n;
    vector<int> power(n);
    fo(i,n) cin>>power[i];
    sort(all(power));
    reverse(all(power));
    ll ans=0;
    if(k>=n) {cout<<0<<endl; return 0;}
    FOR(i,k,n-1) ans=ans+power[i];

    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: 'k' was not declared in this scope
   29 |     if(k>=n) {cout<<0<<endl; return 0;}
      |        ^
a.cc:30:11: error: 'k' was not declared in this scope
   30 |     FOR(i,k,n-1) ans=ans+power[i];
      |           ^
a.cc:8:36: note: in definition of macro 'FOR'
    8 | #define FOR(I, A, B) for (int I = (A); I <= (B); I++)
      |                                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#include <cstdlib> 
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (int I = (A); I <= (B); I++)
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > ii;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(int i=0;i<n;i++)
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
int main(){
 IOS
    int h,n;
    cin>>h>>k;
    vector<int> power(n);
    fo(i,n) cin>>power[i];
    sort(all(power));
    reverse(all(power));
    ll ans=0;
    if(k>=n) {cout<<0<<endl; return 0;}
    FOR(i,k,n-1) ans=ans+power[i];

    cout<<ans<<endl;
}

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

# -*- coding: utf-8 -*-

# Input
s = [input() for i in range(2)]
NK = list(s[0].split())
HI = sorted(list(s[1].split()))

# Proccess
nk = int(NK[0])-int(NK[1])
del HI[nk:]

x = 0
for i in range(nk):
  x = x + int(HI[i])

# Output                            
print(x)


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:3:3: error: invalid preprocessing directive #Input
    3 | # Input
      |   ^~~~~
a.cc:8:3: error: invalid preprocessing directive #Proccess
    8 | # Proccess
      |   ^~~~~~~~
a.cc:16:3: error: extended character   is not valid in an identifier
   16 | # Output                            
      |   ^
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: extended character   is not valid in an identifier
a.cc:16:3: error: invalid preprocessing directive #Output\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0\U000000a0
   16 | # Output                            
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:4:1: error: 's' does not name a type
    4 | s = [input() for i in range(2)]
      | ^
Language: C

#include <stdio.h>
double amount=0;

int findmax(int n,int ceil,int hp[],int sp[],int k){
    int i,j,max=0;
    for(i=0;i<n;i++){
    if(ceil>=hp[i]&&max<hp[i]){
        max=hp[i];
    }
    }
    for(i=0;i<n;i++){
        if(hp[i]==max){
            for(j=0;j<k;j++){
                if(sp[j]==0){
                    sp[j]=hp[i];
                    amount=amount-hp[i];
                    break;
                }
                if(j==k-1)
                    return -1;
            }
        }
    }
    return max-1;
}
void koushin(int k,int n,int hp[],int sp[]){
    int max=2000000000;
    int i;
    for(i=0;i<k;i++){
        max=findmax(n,max,hp,sp,k);
        if(max<1)
            break;
    }
}

int main(){
    int N,K,i;
    scanf("%d%d",&N,&K);
    int HP[N],SP[K]={0};
    for(i=0;i<N;i++){
      scanf("%d",&HP[i]); 
      amount+=HP[i];
    }
    koushin(K,N,HP,SP);
    printf("%.0f\n",amount);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:39:21: error: variable-sized object may not be initialized except with an empty initializer
   39 |     int HP[N],SP[K]={0};
      |                     ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int a,b,h[200001],tot;
	cin >> a >> b;
	for(int i = 0;i < a;i++){
		cin >> h[i];
	}
	sort(h,h+a);
	for(int i = 0;i < a-b;i++){
		tot+=h[i];
	}
	cout << tot << '\n';
}

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

#define rep(i,n) for (int i=0; i<(n);++i)
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
int N,K,sum=0;
  cin>>N>>K;
vector<int>H(N);
rep(i,N) cin >> H[i];
sort(H.begin(),H.end(), greater<int>());
rep(i,N){
		sum+=H[K+i];
       }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:1: error: 'vector' was not declared in this scope
    9 | vector<int>H(N);
      | ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <algorithm>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:9:8: error: expected primary-expression before 'int'
    9 | vector<int>H(N);
      |        ^~~
a.cc:10:17: error: 'H' was not declared in this scope
   10 | rep(i,N) cin >> H[i];
      |                 ^
a.cc:11:6: error: 'H' was not declared in this scope
   11 | sort(H.begin(),H.end(), greater<int>());
      |      ^
Language: C++

#define rep(i,n) for (int i=0; i<(n);++i)
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
int N,K,sum=0;
  cin>>N>>K;
vector<int>H(N);
rep(i,n) cin >> H[i];
sort(H.begin(),H.end(), greater<int>());
  rep(i,N){
		sum+=H[K+i];
       }
 
cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:1: error: 'vector' was not declared in this scope
    9 | vector<int>H(N);
      | ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <algorithm>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:9:8: error: expected primary-expression before 'int'
    9 | vector<int>H(N);
      |        ^~~
a.cc:10:7: error: 'n' was not declared in this scope
   10 | rep(i,n) cin >> H[i];
      |       ^
a.cc:1:35: note: in definition of macro 'rep'
    1 | #define rep(i,n) for (int i=0; i<(n);++i)
      |                                   ^
a.cc:10:17: error: 'H' was not declared in this scope
   10 | rep(i,n) cin >> H[i];
      |                 ^
a.cc:11:6: error: 'H' was not declared in this scope
   11 | sort(H.begin(),H.end(), greater<int>());
      |      ^
Language: C++

#include <iostream>

int main() {
long long h , s;
std :: cin >> h >> s;

if(s >= h) {
std :: cout << "0\n";
return 0;
}

long long  arr[h] , prefix = 0;
for(auto i = 0 ; i < h ; i++) {
std :: cin >> arr[i];
prefix += arr[i];
}

std :: sort(arr , arr + h);

for(int i = 0 ; i < s ; i++) prefix -= arr[h - 1 - i];
std :: cout << prefix << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   18 | std :: sort(arr , arr + h);
      |        ^~~~
      |        qsort