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

#include<stdio.h>

int main(){
  int fenek, a, c, e;
  int HP[fenek];
  int e = 0;
    scanf("%d%d", &fenek, &a);
  for(int b=1; b<fenek+1; ++b){
    scanf("%d", &HP[b]);
  }
  
  for (int i=1; i<fenek; ++i) {
    for (int j=i+1; j<=fenek; ++j) {
      if (HP[i] > HP[j]) {
        c =  HP[j];
        HP[j] = HP[i];
        HP[i] = c;
      }
    }
  }

  if(a>=fenek) {
    e =fenek;
  } else {
    for (int d=1;d<=fenek-a;++d ){
    e += HP[d];
    }
  }
    printf ("%d", e);
    
     return 0;
  }


Compiler output:
main.c: In function 'main':
main.c:6:7: error: redeclaration of 'e' with no linkage
    6 |   int e = 0;
      |       ^
main.c:4:20: note: previous declaration of 'e' with type 'int'
    4 |   int fenek, a, c, e;
      |                    ^
Language: C

#include<stdio.h>

int main(){
  int fenek, a, c, e;
  int HP[fenek];
    scanf("%d%d\n", &fenek, &a);
  for(int b=1; b<fenek+1; ++b){
    scanf("%d", &HP[b]);
  }
  
  for (int i=0; i<fenek; ++i) {
    for (int j=i+1; j<fenek+1; ++j) {
      if (HP[i] > HP[j]) {
        c =  HP[j];
        HP[j] = HP[i];
        HP[i] = c;
      }
    }

  if(a>fenek) {
    e =fenek;
  } else {
    e = 0;
    for (int d =1;d<fenek-a;++d ){
    e += HP[d];
    }
  }
    printf ("%d", e);
    
     return 0;
  }


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

#include<stdio.h>

int main(){
  int fenek, a, c, e;
  int HP[fenek];
    scanf("%d%d\n", &fenek, &a);
  for(int b=1; b<fenek+1; ++b){
    scanf("%d", &HP[b]);
  }
  
  for (int i=0; i<fenek; ++i) {
    for (int j=i+1; j<fenek+1; ++j) {
      if (HP[i] > HP[j]) {
        c =  HP[j];
        HP[j] = HP[i];
        HP[i] = c;
      }
    }

  if(a>fenek) {
    e =fenek;
  } else {
    e = 0;
    for (int d =1;d<fenek-a;++d ){
    e += HP[d];
    }
  }
    printf (e);
    
     return 0;
  }


Compiler output:
main.c: In function 'main':
main.c:28:13: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   28 |     printf (e);
      |             ^
      |             |
      |             int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:31:3: error: expected declaration or statement at end of input
   31 |   }
      |   ^
Language: C

#include<stdio.h>

int main(){
  int fenek, a, c, e;
  int HP[fenek];
    scanf("%d%d\n", &fenek, &a);
  for(int b=1; b<fenek+1; ++b){
    scanf("%d", &HP[b]);
  }
  
  for (int i=0; i<fenek; ++i) {
    for (int j=i+1; j<fenek+1; ++j) {
      if (HP[i] > HP[j]) {
        b =  HP[j];
        HP[j] = HP[i];
        HP[i] = b;
      }
    }

  if(a>fenek) {
    e =fenek;
  } else {
    e = 0;
    for (int d =1;d<fenek-a;++d ){
    e += HP[d];
    }
  }
    printf (e)
    
     return 0;
  }


Compiler output:
main.c: In function 'main':
main.c:14:9: error: 'b' undeclared (first use in this function)
   14 |         b =  HP[j];
      |         ^
main.c:14:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:13: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   28 |     printf (e)
      |             ^
      |             |
      |             int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:28:15: error: expected ';' before 'return'
   28 |     printf (e)
      |               ^
      |               ;
   29 | 
   30 |      return 0;
      |      ~~~~~~    
main.c:31:3: error: expected declaration or statement at end of input
   31 |   }
      |   ^
Language: C

#include<stdio.h>

int main(){
  int fenek, a, c, e;
  int HP[fenek];
    scanf("%d%d\n", &fenek, &a);
  for(int b=1; b<fenek+1; ++b){
    scanf("%d", &HP[b]);
  }
  
  for (int i=0; i<fenek; ++i) {
    for (j=i+1; j<fenek+1; ++j) {
      if (HP[i] > HP[j]) {
        b =  HP[j];
        HP[j] = HP[i];
        HP[i] = b;
      }
    }

  if(a>fenek) {
    e =fenek;
  } else {
    e = 0;
    for (int d =1;d<fenek-a;++d ){
    e += HP[d];
    }
  }
    printf (e)
    
     return 0;
  }


Compiler output:
main.c: In function 'main':
main.c:12:10: error: 'j' undeclared (first use in this function)
   12 |     for (j=i+1; j<fenek+1; ++j) {
      |          ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:9: error: 'b' undeclared (first use in this function)
   14 |         b =  HP[j];
      |         ^
main.c:28:13: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   28 |     printf (e)
      |             ^
      |             |
      |             int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:28:15: error: expected ';' before 'return'
   28 |     printf (e)
      |               ^
      |               ;
   29 | 
   30 |      return 0;
      |      ~~~~~~    
main.c:31:3: error: expected declaration or statement at end of input
   31 |   }
      |   ^
Language: C

#include<stdio.h>

int main(){
  int fenek, a, c, e;
  int HP[fenek];
    scanf("%d%d\n", fenek, a);
  for(int b=1; b<fenek+1; ++b){
    scanf("%d", HP[b]);
  }
  
  for (int i=0; i<fenek; ++i) {
    for (j=i+1; j<fenek+1; ++j) {
      if (HP[i] > HP[j]) {
        b =  HP[j];
        HP[j] = HP[i];
        HP[i] = b;
      }
    }

  if(a>fenek) {
    e =fenek;
  } else {
    e = 0;
    for (int d =1;d<fenek-a;++d ){
    e += HP[d];
    }
  }
    printf (e)
    
     return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:12:10: error: 'j' undeclared (first use in this function)
   12 |     for (j=i+1; j<fenek+1; ++j) {
      |          ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:9: error: 'b' undeclared (first use in this function)
   14 |         b =  HP[j];
      |         ^
main.c:28:13: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   28 |     printf (e)
      |             ^
      |             |
      |             int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:28:15: error: expected ';' before 'return'
   28 |     printf (e)
      |               ^
      |               ;
   29 | 
   30 |      return 0;
      |      ~~~~~~    
main.c:31:3: error: expected declaration or statement at end of input
   31 |   }
      |   ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(void)
{
    long long int sum=0;
    int n,k,i;
    cin>>n>>k;
    vector<int> h;
    h.resize(n+1);
    for(i=0;i<n;i++)
    {
        cin>>h[i];
    }
    sort(h.begin(),h.end());
    if(n-k>0){
    for(i=0;i<n-k;i++)
    {
        sum+=h[i];
    }
    cout<<sum<<endl;
    }
    else
    {
        cout<<0<<endl;
    }
return 0;
}

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

#include<iostream>
#include<vector>

using namespace std;

int main(void)
{
    long long int sum=0;
    int n,k,i;
    cin>>n>>k;
    vector<int> h;
    h.resize(n+1);
    for(i=0;i<n;i++)
    {
        cin>>h[i];
    }
    sort(h.begin(),h.end());
    if(n-k>0){
    for(i=0;i<n-k;i++)
    {
        sum+=a[i];
    }
    cout<<sum<<endl;
    }
    else
    {
        cout<<0<<endl;
    }
return 0;
}

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

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define MAX_NUM 100000
typedef long long int ll;
using namespace std;

ll main(void) {
	ll n=0,k=0, tmp=0, ans=0;
	cin >> n >> k;
	vector<ll> enemy(n + 1);
	rep(i, n) cin >> enemy[i];

	sort(enemy.begin(), enemy.end());
	rep(i, k) enemy.pop_back();
	rep(i, enemy.size()) ans += enemy[i];
	cout << ans << endl;
	return 0;
}


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

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

int main() {
  int N,K,H;
  cin >> N >> K;
  vector<int> lineH(N);
    for(int i = 0; i < N; i++){
      cin >> lineH.at(i);
    }
  int count = accumulate(lineH.begin(),line_H.end(),0);
  sort(lineH.begin(),lineH.end());
  reverse(lineH.begin(),lineH.end());
  for(int i = 0; i < N-K; i++){
    count -= lineH.at(i);
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:40: error: 'line_H' was not declared in this scope; did you mean 'lineH'?
   11 |   int count = accumulate(lineH.begin(),line_H.end(),0);
      |                                        ^~~~~~
      |                                        lineH
Language: C++

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

int main() {
  int N,K,H;
  cin >> N >> K;
  vector<int> lineH(N);
    for(int i = 0; i < N; i++){
      cin >> lineH.at(i);
    }
  int count = accumulate(lineH.begin(),line.end(),0);
  sort(lineH.begin(),lineH.end());
  reverse(lineH.begin(),lineH.end());
  for(int i = 0; i < N-K; i++){
    count -= lineH.at(i);
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:40: error: 'line' was not declared in this scope; did you mean 'lineH'?
   11 |   int count = accumulate(lineH.begin(),line.end(),0);
      |                                        ^~~~
      |                                        lineH
Language: C++

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

int main() {
  int N,K,H;
  cin >> N >> K;
  vector<int> lineH(N);
    for(int i = 0; i < N; i++){
      cin >> lineH.at(i);
    }
  int count = accumulate(lineH.bigin(),line.end(),0);
  sort(lineH.begin(),lineH.end());
  reverse(lineH.begin(),lineH.end());
  for(int i = 0; i < N-K; i++){
    count -= lineH.at(i);
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
   11 |   int count = accumulate(lineH.bigin(),line.end(),0);
      |                                ^~~~~
      |                                begin
a.cc:11:40: error: 'line' was not declared in this scope; did you mean 'lineH'?
   11 |   int count = accumulate(lineH.bigin(),line.end(),0);
      |                                        ^~~~
      |                                        lineH
Language: C

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

#define maxn 2e5 + 6

int health[maxn];

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}

int main()
{
	int N, K;
	scanf("%d%d", &N, &K);

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

	qsort(health, N, sizeof(health[0]), cmp);

	long long int sum = 0;

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

	printf("%lld", sum);
	return 0; 
}

Compiler output:
main.c:6:5: error: size of array 'health' has non-integer type
    6 | int health[maxn];
      |     ^~~~~~
Language: C

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

const int maxn = 200000 + 6;

int health[maxn];

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}

int main()
{
	int N, K;
	scanf("%d%d", &N, &K);

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

	qsort(health, N, sizeof(health[0]), cmp);

	long long int sum = 0;

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

	printf("%lld", sum);
	return 0; 
}

Compiler output:
main.c:6:5: error: variably modified 'health' at file scope
    6 | int health[maxn];
      |     ^~~~~~
Language: C

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

const int maxn = 2e5 + 6;

int health[maxn];

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}

int main()
{
	int N, K;
	scanf("%d%d", &N, &K);

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

	qsort(health, N, sizeof(health[0]), cmp);

	long long int sum = 0;

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

	printf("%lld", sum);
	return 0; 
}

Compiler output:
main.c:6:5: error: variably modified 'health' at file scope
    6 | int health[maxn];
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int n,a;
    long long int s=0;
    cin >>n>>a;
    long long int b[n];
    for (int i=0;i<n;i++){
        cin >> b[i];
    }
    sort(b, b+n, greater<int>()); 
  for(i=a;i<n;i++){
    s=s+b[i];
  }
    cout << s<<"\n";
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int n,a;
    long long int s=0;
    cin >>n>>a;
    long long int b[n];
    for (int i=0;i<n;i++){
        cin >> b[i];
    }
    sort(b, b+n, greater<int>()); 
    for (int i=0;i<a;i++){
       s++;
    }
  for(i=k;i<n;i++){
    s=s+b[i];
  }
    cout << s<<"\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: 'i' was not declared in this scope
   16 |   for(i=k;i<n;i++){
      |       ^
a.cc:16:9: error: 'k' was not declared in this scope
   16 |   for(i=k;i<n;i++){
      |         ^
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++){ //xxxooo N=6 K=3
    ans += H[i];
  }
  
  cout << ans << endl;
  
  
  
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int K;
  cin >> N >> K;
  vector<int> H(N);
  for (int i=0; i<N; i++){
    cin >> H.at(i);
  }
  if (N <= K){
    cout << N << endl;
  }
  else{
    int count = 0;
    int at = 0;
    int sort = H.at(0);
    int large = 0;
    for (int j=0; j<(N-K); j++){
      if (sort > H.at(i)){
        sort = H.at(i);
        at = i;
      }
      if (large < H.at(i)){
        large = H.at(i);
      }
      count += sort;
      H.at(at) = large;
    }
    cout << count + K << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: 'i' was not declared in this scope
   21 |       if (sort > H.at(i)){
      |                       ^
a.cc:25:24: error: 'i' was not declared in this scope
   25 |       if (large < H.at(i)){
      |                        ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

#include "stdio.h"

void QuickSort(int *pa, int l , int r);
void swap(int *pa, int *pb);

int main(void) {
  /* code */
  int n,k;
  long cnt = 0;
  scanf("%d %d",n,m);
  int h[200001] = {0};
  for (int i = 0; i < n; i++) {
    scanf("%d\n",&h[i]);
  }
  //sort desc
  quickSort(h,0,n-1);
  if(n <= k){
    printf("%d\n", 0);
  }else{
    for (int j = 0; j < n; j++) {
      if(j < k) continue;
      cnt += h[j];
      /* code */
    }
    printf("%ld\n",cnt );
  }
  return 0;
}

void QuickSort(int *pa, int l, int r){
  int pivot_index = (l+r)/2;
  int pivot = pa[pivot_index];
  Swap(pa[pivot_index], pa[r-1]);
  int i = l;
    for (int j = i; j < r-1; j++) {
      if(pa[j] > pivot){
        Swap(pa[j], pa[i]);
        i++;
      }
    }
  Swap(pa[i],pa[r-1])
  QuickSort(pa,l,pivot_index);
  QuickSort(pa,pivot_index+1,l);
}

void Swap(int *pa, int *pb){
  int tmp = *pa;
  *pa = *pb;
  *pb = tmp;
}

Compiler output:
main.c: In function 'main':
main.c:10:19: error: 'm' undeclared (first use in this function)
   10 |   scanf("%d %d",n,m);
      |                   ^
main.c:10:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:3: error: implicit declaration of function 'quickSort'; did you mean 'QuickSort'? [-Wimplicit-function-declaration]
   16 |   quickSort(h,0,n-1);
      |   ^~~~~~~~~
      |   QuickSort
main.c: In function 'QuickSort':
main.c:33:3: error: implicit declaration of function 'Swap'; did you mean 'swap'? [-Wimplicit-function-declaration]
   33 |   Swap(pa[pivot_index], pa[r-1]);
      |   ^~~~
      |   swap
main.c:41:22: error: expected ';' before 'QuickSort'
   41 |   Swap(pa[i],pa[r-1])
      |                      ^
      |                      ;
   42 |   QuickSort(pa,l,pivot_index);
      |   ~~~~~~~~~           
main.c: At top level:
main.c:46:6: warning: conflicting types for 'Swap'; have 'void(int *, int *)'
   46 | void Swap(int *pa, int *pb){
      |      ^~~~
main.c:33:3: note: previous implicit declaration of 'Swap' with type 'void(int *, int *)'
   33 |   Swap(pa[pivot_index], pa[r-1]);
      |   ^~~~
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();
   long[] H = new long[N];
   for(int i=0;i<N;i++) H[i] = sc.nextLong();
   long ans = 0;
   Arrays.sort(H);
   for(int i=0;i<N-K;i++)
   {
     sum+=H[i];
   }
   System.out.println(ans);
 }
}

Compiler output:
Main.java:13: error: cannot find symbol
     sum+=H[i];
     ^
  symbol:   variable sum
  location: class Main
1 error
Language: C

#include<stdio.h>
#include<stdlib.h>
int H[200005];
int comp(const void *a,const void *b)
{
  return *(int *a)-*(int *b);
}
int main()
{
  int N,K;
  scanf("%d %d",&N,&K);
  long long i;
  for(i=0;i<N;i++)
  {
    scanf("%d",&H[i]);
  }
  qsort(H,N,sizeof(int),comp);
  long long sum;
   if(K>=N)
    {        printf("0");
    }
    else
    {
        sum=0;
        for(i=0;i<N-K;i++)
        {
            sum=sum+(long long)H[i];
        }
        printf("%lld",sum);
    }
    return 0;
}

Compiler output:
main.c: In function 'comp':
main.c:6:17: error: expected ')' before 'a'
    6 |   return *(int *a)-*(int *b);
      |           ~     ^
      |                 )
main.c:6:27: error: expected ')' before 'b'
    6 |   return *(int *a)-*(int *b);
      |                     ~     ^
      |                           )
main.c:6:29: error: expected expression before ';' token
    6 |   return *(int *a)-*(int *b);
      |                             ^
Language: Java

import java.util.*;
public class Main
{
    public static void main(String[] args) 
    {
      Scanner s = new Scanner(System.in);
      int h = s.nextInt();
      int k = s.nextInt();
      
      int a[] = new int[h];
      int sum=0;
      for(int i = 0; i <= h ;i++)
        {
            a[i] = s.nextInt();
        }
      Arrays.sort(a, Collections.reverseOrder()); 
      Arrays.toString(a);
      for(int j = k; j<(h-k); j++ )
      {
        sum = sum + a[j];
      }
      System.out.println("" + sum);
    }
      
   
}

Compiler output:
Main.java:16: error: no suitable method found for sort(int[],Comparator<Object>)
      Arrays.sort(a, Collections.reverseOrder()); 
            ^
    method Arrays.<T#1>sort(T#1[],Comparator<? super T#1>) is not applicable
      (inference variable T#1 has incompatible bounds
        equality constraints: int
        upper bounds: Object)
    method Arrays.<T#2>sort(T#2[],int,int,Comparator<? super T#2>) is not applicable
      (cannot infer type-variable(s) T#2
        (actual and formal argument lists differ in length))
  where T#1,T#2 are type-variables:
    T#1 extends Object declared in method <T#1>sort(T#1[],Comparator<? super T#1>)
    T#2 extends Object declared in method <T#2>sort(T#2[],int,int,Comparator<? super T#2>)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ull unsigned long long
#define pl pair<ll, ll>
#define vll vector<ll>
#define pll vector<pair<ll, ll>>
#define f(i,a, b) for (int i = a; i < b; i++)
#define mod 1000000007
#define mp make_pair
#define pb push_back
#define ld float
#define fd(i,a, b) for (ll i = a; i >= b; i--)
#define mx 1e17
/*  #include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
     typedef tree<ll ,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;*/


ll modpow(ll a,ll b){
 ll res=1;
 while(b>0)
{
    if(b&1)res=(res*a)%mod;
    b=b>>1;
    a=(a*a)%mod;

}
return res;
}
int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
ll n,k;
cin>>n>>k;
ll aa[n];
f(i,0,n)cin>>aa[i];
sort(a,a+n);
ll ans=0;
for(int i=n-1-k;i>=0;i--)ans+=aa[i];
cout<<ans;

}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, k, res = 0;
  scanf("%d %d", &n, &k);
  if(k >= n){
    printf("%d", res);
    return 0;
  } 
  int h[n];
  for(int i = 0; i < n; i++){
    cin >> h[i];
  }
  sort(h, h + n, greater<int>());
  for(int i = k; i < n; i++){
    res += h[i];
  }
  printf("%d", res);

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: expected '}' at end of input
   18 |   printf("%d", res);
      |                     ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
  int N;long long int hn[N]; int k;
  for (int i=0;i<N;i++) {
    cin>>hn[i];
  }
  
  sort(hn,hn[N]);
  long long int s;
  for(int t=0;t<N-k;t++){
    s = s + hn[t];
  }
  
  cout<<s;
    
  
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: no matching function for call to 'sort(long long int [N], long long int&)'
   11 |   sort(hn,hn[N]);
      |   ~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:11:7: note:   deduced conflicting types for parameter '_RAIter' ('long long int*' and 'long long int')
   11 |   sort(hn,hn[N]);
      |   ~~~~^~~~~~~~~~
/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 <bits/stdc++.h>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected ';' before '<' token
   15 |   for(int i=K, i<N; i++){
      |                 ^
      |                 ;
a.cc:15:17: error: expected primary-expression before '<' token
Language: C

#include<iostream>//c++的基本输入
#include<cstdio>//相当于stdio.h
#include<algorithm>//sort 的头文件
using namespace std;//命名空间
int main(){
  long long int m,n,k,l,sum=0,temp;
  scanf("%lld %lld",&m,&n);
  long long int a[m];
  if(n>=m){
    printf("0");
  }else{
        for(k=0;k<m;k++){
          scanf("%lld",&a[k]);
        }
        if(n==0){
            l=m-n;
            for(k=0;k<l;k++){
                sum+=a[k];
            }
            printf("%lld",sum);
        }else{
            
            l=m-n;
            sort(a,a+m);
            for(k=0;k<m-n;k++){
              sum+=a[k];
            }
            printf("%lld",sum);
              }
      }
}

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

#include<stdio.h>
int main(){
  int m,n,k,t,p,temp;
  int a[100000];
  scanf("%d %d",&m,&n);
  if(n>=m){
    printf("0");
  }else{
    for(t=0;t<m;t++){
      scanf("%d",&a[t]);
    )
    for(t=0;t<m;t++){
      for(p=0;p<m-1;p++{
        if(a[p]>a[p+1]){
          temp=a[p];
          a[p]=a[p+1];
          a[p+1]=temp;
        }
      }
    }
    for(k=0,p=0;k<m-n;k++){
      p+=a[k];
    }
    printf("%d",p);

Compiler output:
main.c: In function 'main':
main.c:11:5: error: expected statement before ')' token
   11 |     )
      |     ^
main.c:13:24: error: expected ')' before '{' token
   13 |       for(p=0;p<m-1;p++{
      |          ~             ^
      |                        )
main.c:20:5: error: expected expression before '}' token
   20 |     }
      |     ^
main.c:24:5: error: expected declaration or statement at end of input
   24 |     printf("%d",p);
      |     ^~~~~~
main.c:24:5: error: expected declaration or statement at end of input
main.c:24:5: error: expected declaration or statement at end of input
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#define int long long
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;
    int ans;
    vector<int> h;
    cin >> n >> k;
    for (int i = 0; i < n; i++)
    {
        int hp;
        cin >> hp;
        h.push_back(hp);
    }
    sort(h.begin(),h.end());
    
    for (int i = 0; i < n-k; i++)
    {
        ans += h[i];
    }
    cout << ans << "\n";
    
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;
    int ans;
    vector<int> h;
    cin >> n >> k;
    for (int i = 0; i < n; i++)
    {
        int hp;
        cin >> hp;
        h.push_back(hp);
    }
    sort(h.begin(),h.end());
    
    for (int i = 0; i < n-k; i++)
    {
        ans += h[i];
    }
    cout << ans << "\n";
    
    return 0;
}


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

#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

int main(){
    int n,k;
    cin >> n >> k;
    vector<long> h;
    for(int i=0;i<n;++i){
        long t;
        cin >> t;
        h.push_back(t);
    }
    sort(h.begin(),h.end(),greater<long>());
    for(int i=0;i<k;++i){
        h[i] = 0;
    }
    cout << accumulate(h.begin(), h.end(), 0L) << endl;
    return 0;
}

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

#include <iostream>
using namespace std;

int main() {


    int n,k;
    cin >> n >> k;
    int h[n];
    for(int i=0; i<n; i++){
    	cin >> h[i];
    }
    sort(h, h+n, greater<int>());
    for(int i=0; i<n; i++){
    	if(k>0){
    		h[i] = 0;
    		k -= 1;
    	}
    }
    long ans = 0;
    for(int i=0; i<n; 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, h+n, greater<int>());
      |     ^~~~
      |     short
Language: C

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int ar[200005] = {};
    long long ans =0;
    int n, k, x;
    cin >> n >> k;
    for (int i = 0; i < n; i++)
    {
        cin >> ar[i];
    }
    sort(ar, ar + n, greater<int>());
    for (int i = k; i < n; i++)
    {
        ans += ar[i];
    }
    cout << ans;
}


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

    #include<iostream>
    #include<iomanip>
    #include<string>
    #include<queue>
    #include<vector>
    #include<algorithm>
    #include<tuple>
    #include<numeric>
    #include<map>
    #include<cmath>
    #define ll long long
    #define mod 1000000000+7
    #define rep(i,n) for(ll i=0;i<(int) (n);i++)
    ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
    ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
    using namespace std;
    int main(){
      ll n,k;
      cin>>n>>k;
      vector<ll>h(n);
      ll cnt=0;
      rep(i,n){
        ll a;
        cin>>a;
        h.push_back(a);
      }
     
      rep(i,n)cnt+=h[i];
     
      ll m=0;
      sort(h.end()h.begin());
      rep(i,k)m+=h[i];
     
      if(n>k)cout<<cnt-m;
      else cout<<0;
     
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:31:19: error: expected ')' before 'h'
   31 |       sort(h.end()h.begin());
      |           ~       ^
      |                   )
a.cc:31:11: error: no matching function for call to 'sort(std::vector<long long int>::iterator)'
   31 |       sort(h.end()h.begin());
      |       ~~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/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, 1 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, 1 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, 1 provided
Language: C

int main(void){
  int n,k,i,j,t;
  int h[200000];
  long int sum = 0;
  scanf("%d %d",&n,&k);
  
  for (i = 0; i < n; i ++)
    scanf("%d",&h[i]);
  
  for (i = 0; i < n-1; i ++)
    for (j = i; l < n-1; j++) 
      if (h[j] < h[j+1]) {
        t = h[j];
        h[j] = h[j+1];
        j[j+1] = t;
      }
  
  for(i = k; i < n; i ++)
    sum += h[i];
  
  printf("%ld",sum);
}
     

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d %d",&n,&k);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d %d",&n,&k);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:17: error: 'l' undeclared (first use in this function)
   11 |     for (j = i; l < n-1; j++)
      |                 ^
main.c:11:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:10: error: subscripted value is neither array nor pointer nor vector
   15 |         j[j+1] = t;
      |          ^
main.c:21:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   21 |   printf("%ld",sum);
      |   ^~~~~~
main.c:21:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:21:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

int main(void){
  int n,k,i,j,t;
  int h[200000];
  long int sum = 0;
  scanf("%d %d",&n,&k);
  
  for (i = 0; i < n; i ++)
    scanf("%d",h&[i]);
  
  for (i = 0; i < n-1; i ++)
    for (j = i; l < n-1; j++) 
      if (h[j] < h[j+1]) {
        t = h[j];
        h[j] = h[j+1];
        j[j+1] = t;
      }
  
  for(i = k; i < n; i ++)
    sum += h[i];
  
  printf("%ld",sum);
}
      
        
      

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d %d",&n,&k);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d %d",&n,&k);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:18: error: expected expression before '[' token
    8 |     scanf("%d",h&[i]);
      |                  ^
main.c:11:17: error: 'l' undeclared (first use in this function)
   11 |     for (j = i; l < n-1; j++)
      |                 ^
main.c:11:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:10: error: subscripted value is neither array nor pointer nor vector
   15 |         j[j+1] = t;
      |          ^
main.c:21:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   21 |   printf("%ld",sum);
      |   ^~~~~~
main.c:21:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:21:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdlib.h>
int comp_int_r(const void *a, const void *b){return *(int*)b-*(int*)a;}
int main(){
  int n, k, i;
  scanf("%d%d", &n, &k);
  if(k>=n){
    puts("0");
    return 0;
  }
  int *a = calloc(n, sizeof(int));
  for(i=0; i<n; i++){
    scanf("%d", a+i);
  }
  qsort(a, n, sizeof(int), comp_int_r);
  long sum=0;
  for(i=k; i<n; i++){
    sum+=a[i]
  }
  printf("%ld\n", sum);
}


Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d%d", &n, &k);
      |   ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include <stdlib.h>
  +++ |+#include <stdio.h>
    2 | int comp_int_r(const void *a, const void *b){return *(int*)b-*(int*)a;}
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d%d", &n, &k);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:5: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    7 |     puts("0");
      |     ^~~~
main.c:7:5: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:17:14: error: expected ';' before '}' token
   17 |     sum+=a[i]
      |              ^
      |              ;
   18 |   }
      |   ~           
main.c:19:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   19 |   printf("%ld\n", sum);
      |   ^~~~~~
main.c:19:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:19:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

int main()
{
    long long n, k , fin , sum = 0 ;
    cin >> n >> k ;
    long long arr[200100];
    for ( int i = 0 ; i < n ; ++i){
        cin >> arr[i];
    }
    sort( arr , arr+n) ;
    for ( int x = 0 ; x < n-k ; x ++){
        sum += arr[x];
    }
    cout << sum ;
    return 0;
}


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

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

int main()
{
    long long n, k , fin , sum = 0 ;
    cin >> n >> k ;
    long long arr[200100];
    for ( int i = 0 ; i < n ; ++i){
        cin >> arr[i];
    }
    sort( arr , arr+n) ;
    for ( int x = 0 ; x < n-k ; x ++){
        sum += arr[x];
    }
    cout << sum ;
    return 0;
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: expected '}' at end of input
   26 |     return 0;
      |              ^
a.cc:6:1: note: to match this '{'
    6 | {int n,k,counter=0;
      | ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
   long long n,x,k,sum=0;
   cin>>n>>k;
   long long a[n];
   for(int i=0;i<n;i++)
   {
       cin>>a[i];
   }
   sort(a,a+n,greater<int>());
   for(int i=k;i<n;i++)
   {
       sum+=a[i];
   }
   cout<<sum;
    return 0;
}



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

#include<bits/stdc++.h>

using namespace std;

const int maxn=1e6+5;

typedef long long ll;

const ll mod=1e9+7;

ll a[maxn];

int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++){
		scanf("%d",a+i);
	} 
	sort(a,a+n);
	ll sum=0;
	for(int i=0;i<n-k;i++){
		sum+=a[i];
	}
	printf("%lld",sum;)
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:24:26: error: expected ')' before ';' token
   24 |         printf("%lld",sum;)
      |               ~          ^
      |                          )
a.cc:24:27: error: expected primary-expression before ')' token
   24 |         printf("%lld",sum;)
      |                           ^
Language: C++

#include <iostream>
#include <math.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;


int main() {
    int n, k;
    cin >> n >> k;
    vector<long long> v(n);
    for(int i=0; i<n; i++) {
        cin >> v[i];
    }
    sort(v.begin(), v.end());
    long long sum = 0;
    for(int i=n-1; i>=0; i--) {
        if(k > 0) {
            k--;
            continue;
        }
        sum = sum + v[i];
    }
    cout << sum << "\n";
    return 0;
}

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

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

int main()
{
  int N, K, sum=0;
  vector<long> H[N+1];
  cin >> N >> K;
  for(int i=0; i<N; ++i) cin >> H[i];
  
  if(K >= N) cout << 0 << endl;
  else
  {
    sort(begin(H), end(H));
    for(int j=0; j< N-K; ++j) sum += H[j];
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<long> H[N+1];
      |   ^~~~~~
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 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'long'
    8 |   vector<long> H[N+1];
      |          ^~~~
a.cc:10:33: error: 'H' was not declared in this scope
   10 |   for(int i=0; i<N; ++i) cin >> H[i];
      |                                 ^
a.cc:15:16: error: 'H' was not declared in this scope
   15 |     sort(begin(H), end(H));
      |                ^
Language: C++

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

int main()
{
  int N, K, sum=0;
  long H[220000];
  cin >> N >> K;
  for(int i=0; i<N; ++i) cin >> H[i];
  
  if(K >= N) cout << 0 << endl;
  else
  {
    sort(begin(H), end(H));
    for(int j=H.size()-K; j<=0; --j) sum += H[j];
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: request for member 'size' in 'H', which is of non-class type 'long int [220000]'
   16 |     for(int j=H.size()-K; j<=0; --j) sum += H[j];
      |                 ^~~~
Language: C++

include<stdio.h>
#include<stdlib.h>
#include<string.h>
void swap(int* h, int st, int gl) {
	int k = *(h + st);
	*(h + st) = *(h + gl);
	*(h + gl) = k;
	return;
}
int partition(int* h, int st, int gl) {
	int sta = st;
	int gol = gl;
	int pivot = *(h + st);

	st++;
	while (st < gl) {
		while ((st < gl) && (*(h + st) >= pivot)) {
			st++;
		}
		while ((st < gl) && (*(h + gl) < pivot)) {
			gl--;
		}
		if (st < gl)swap(h, st, gl);

	}
	swap(h, sta, gl-1);
	return gl;

}

void quicksort(int* h, int st, int gl) {
	int pivot;
	if (st < gl) {
		pivot = partition(h, st, gl);
		quicksort(h, st, pivot - 1);
		quicksort(h, pivot, gl);
	}

}

int main(void) {
	int n, k;
	scanf("%d %d", &n, &k);
	int* h = (int*)malloc(sizeof(int)*(n));
	//memset(h,0,sizeof(int)*(n+1));

	for (int m = 0; m < n; m++) {
		scanf("%d", (h + m));
		
	}
	printf("\n");
	quicksort(h, 0, n);
	long long int ans = 0;
	for (int x = k; x < n; x++) {
		ans += *(h + x);
	}
	free(h);
	printf("%lld", ans);
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:43:9: error: 'scanf' was not declared in this scope
   43 |         scanf("%d %d", &n, &k);
      |         ^~~~~
a.cc:51:9: error: 'printf' was not declared in this scope
   51 |         printf("\n");
      |         ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include<string.h>
  +++ |+#include <cstdio>
    4 | void swap(int* h, int st, int gl) {
Language: C++

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

int main()
{
  int N, K, sum=0;
  long H[220000];
  cin >> N >> K;
  for(int i=0; i<N; ++i) cin >> H[i];
  
  if(K >= N) cout << 0 << endl;
  else
  {
    sort(begin(H), end(H));
    if(int j=0; j< N-K; ++j) sum += H[j];
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: expected ')' before ';' token
   16 |     if(int j=0; j< N-K; ++j) sum += H[j];
      |       ~               ^
      |                       )
a.cc:16:27: error: 'j' was not declared in this scope
   16 |     if(int j=0; j< N-K; ++j) sum += H[j];
      |                           ^
Language: C++

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

int main()
{
  int N, K, sum=0;
  long H[220000];
  cin >> N >> K;
  for(int i=0; i<N; ++i) cin >> H[i];
  
  if(K >= N) cout << 0 << endl;
  else
  {
    sort(begin(H), end(H));
    if(int i=0; i< N-K; ++i) sum += H[i];
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: expected ')' before ';' token
   16 |     if(int i=0; i< N-K; ++i) sum += H[i];
      |       ~               ^
      |                       )
a.cc:16:27: error: 'i' was not declared in this scope
   16 |     if(int i=0; i< N-K; ++i) sum += H[i];
      |                           ^
Language: C++

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

int main()
{
  int N, K, sum=0;
  long H[220000];
  cin >> N >> K;
  for(int i=0; i<N; ++i) cin >> H[i];
  
  if(K >= N) cout << 0 << endl;
  else
  {
    sort(begin(H), end(H));
    if(int i=0; i<(N-K); ++i)
    {
      sum += H[i];
    }
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: expected ')' before ';' token
   16 |     if(int i=0; i<(N-K); ++i)
      |       ~                ^
      |                        )
a.cc:16:28: error: 'i' was not declared in this scope
   16 |     if(int i=0; i<(N-K); ++i)
      |                            ^
Language: C++

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

int main()
{
  int N, K, sum=0;
  long H[220000];
  cin >> N >> K;
  for(int i=0; i<N; ++i) cin >> H[i];
  
  if(K >= N) cout << 0 << endl;
  else
  {
    sort(begin(H), end(H));
    if(int i=0; i<N-K; ++i)
    {
      sum += H[i];
    }
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: expected ')' before ';' token
   16 |     if(int i=0; i<N-K; ++i)
      |       ~              ^
      |                      )
a.cc:16:26: error: 'i' was not declared in this scope
   16 |     if(int i=0; i<N-K; ++i)
      |                          ^
Language: C++

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

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