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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:25: error: expected ';' before '}' token
   25 |             sum=sum+p[i]
      |                         ^
      |                         ;
   26 |         }
      |         ~                
a.cc:39:13: error: 'j' was not declared in this scope
   39 |         for(j=0;j<qw;j++)
      |             ^
Language: C++

#include <cstdio>

void swap(int &a, int &b)
{
	int tmp = a;
	a = b;
	b = tmp;
}

int partition(int arr[], int l, int h)
{
	int pivot = arr[h];
	int i = l - 1;

	for (int j = l; j < h; ++j)
	{
		if (arr[j] < pivot)
		{
			++i;
			swap(arr[i], arr[j]);
		}
	}

	swap(arr[i + 1], arr[h]);
	return i + 1;
}

void quicksort(int arr[], int l, int h)
{
	if (l < h)
	{
		int p = partition(arr, l, h);
		quicksort(arr, l, p - 1);
		quicksort(arr, p + 1, h);
	}
}

int main()
{
	int N, K;
	long H[200000];
	unsigned long long sumH = 0;

	scanf("%d %d", &N, &K);

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

	quicksort(H, 0, N - 1);

	for (int i = 0; i < N - K; ++i)
		sumH += H[i];

	printf("%d\n", sumH);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:19: error: cannot convert 'long int*' to 'int*'
   49 |         quicksort(H, 0, N - 1);
      |                   ^
      |                   |
      |                   long int*
a.cc:28:20: note:   initializing argument 1 of 'void quicksort(int*, int, int)'
   28 | void quicksort(int arr[], int l, int h)
      |                ~~~~^~~~~
Language: C++

#include<iostream.h>
#include<conio.h>
void main()
{
  int H,A,K,h[200000],n,sum,sum1,t;
  cin>>n>>K;
  sum=0;
  for(i=0;i<n;i++)
  {
    cin>>h[i];
    sum=sum+h[i]
  }
  if(K>=n)
    cout<<"0";
  else if(K==0)
    cout<<sum;
  else 
    for(i=0;i<=n;i++)
 	{
 	for(j=0;j<=n-i;j++)
 		{
 			if(a[j]>a[j+1])
 				{
 					temp=a[j];
 					a[j]=a[j+1];
 					a[j+1]=temp;
 				}
 		}
	}
    t=n-K+1;
  	for(i=n;i>t;i--)
    {
      sum1=sum1+A[i];
    }
    cout<<sum1;
  return 0;
}  
    


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

#include <stdio.h>

int main(){
  int n, k, i, j, tmp, maxp, minp;
  long int result=0;
  int h[200001];
  
  scanf("%d %d", &n, &k);
  for(i=0;i<n;i++){
    scanf("%d", &h[i]);
    result += h[i];
  }
  
  //
  if(n/2 > k){
    for(i=0;i<k;i++){
      maxp = 0;
      for(j=1;j<n;j++){
        if(h[j] > h[maxp]) maxp = j;
      }
      result -= h[maxp];
      h[maxp] = 0;
    }
  }else{
    result = 0;
    for(i=0;i<n-k;i++){
      minp = 0;
      for(j=1;j<n;j++){
        if(h[j] < h[minp] && h[j] >= 1) minp = j;
      }
      result += h[minp];
      h[minp] = 0;
    }
  }

  }
  //
  
  printf("%lu", result);
  
  return 0;
}


Compiler output:
main.c:39:10: error: expected declaration specifiers or '...' before string constant
   39 |   printf("%lu", result);
      |          ^~~~~
main.c:39:17: error: unknown type name 'result'
   39 |   printf("%lu", result);
      |                 ^~~~~~
main.c:41:3: error: expected identifier or '(' before 'return'
   41 |   return 0;
      |   ^~~~~~
main.c:42:1: error: expected identifier or '(' before '}' token
   42 | }
      | ^
Language: C++

#include<iostream.h>
#include<conio.h>
void main()
{
  int H,A,K,h[200000],n,sum;
  cin>>n>>K;
  sum=0;
  for(i=0;i<n;i++)
  {
    cin>>h[i];
    sum=sum+h[i]
  }
  if(K>=n)
    cout<<"0";
  else if(K==0)
    cout<<sum;
  else 
    for(i=0;i<=n;i++)
 	{
 	for(j=0;j<=n-i;j++)
 		{
 			if(a[j]>a[j+1])
 				{
 					temp=a[j];
 					a[j]=a[j+1];
 					a[j+1]=temp;
 				}
 		}
	}
    t=n-K+1;
  	for(i=n;i>t;i--)
    {
      sum1=sum1+A[i];
    }
    cout<<sum1;
  return 0;
}  
    

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

#include <bits/stdc++.h>
 
using namespace std;
int main(void){
    long long N,K;
    vector<int> vec<N>;
    cin >> N >> K;
    for (auto& v : vec)
	{
		cin >> v;
	}
  
    if(K >= N) {
      cout << 0; 
      return 0;
    } 
   sort(vec.begin(), vec.end()); 
  
  long long sum = 0;
  for(int i = K;i<N;i++){
    sum += vec[i];
  }
  cout << sum;
   return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: expected initializer before '<' token
    6 |     vector<int> vec<N>;
      |                    ^
a.cc:8:20: error: 'vec' was not declared in this scope
    8 |     for (auto& v : vec)
      |                    ^~~
a.cc:17:9: error: 'vec' was not declared in this scope
   17 |    sort(vec.begin(), vec.end());
      |         ^~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
typedef long long ll;
using namespace std;

int main(){
    int N, K; cin >> N >> K;
    vector<int> H(N, 0);
    ll ans=0;
    for(int i=0; i<N; i++) cin >> H[i];
    sort(H.rbegin(), H.rend());
    for(int i=K; i<N; i++){
        ans += H[i];
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |     sort(H.rbegin(), H.rend());
      |     ^~~~
      |     short
Language: Java

#include <iostream>
#include <algorithm>
#include <vector>
#include <regex>
#define pb push_back
using namespace std;

int main() {
	int a, b;
	int summ=0;
	cin >> a >> b;
	long long c[1000000];
	for (int i = 0; i < a; i++)
	{
		cin >> c[i];
	}
	sort(c,c+10000000);
	if (b > a) {
		cout << 0;
	}
	else {
		for (int i = 0; i < a-b; i++)
		{
			summ = summ + c[i];
		}
		cout << summ;
	}
	return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <algorithm>
^
Main.java:3: error: illegal character: '#'
#include <vector>
^
Main.java:4: error: illegal character: '#'
#include <regex>
^
Main.java:5: error: illegal character: '#'
#define pb push_back
^
Main.java:11: error: not a statement
	cin >> a >> b;
	         ^
Main.java:12: error: not a statement
	long long c[1000000];
	^
Main.java:15: error: not a statement
		cin >> c[i];
		    ^
Main.java:19: error: not a statement
		cout << 0;
		     ^
Main.java:26: error: not a statement
		cout << summ;
		     ^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:12: error: ';' expected
	long long c[1000000];
	    ^
Main.java:12: error: ']' expected
	long long c[1000000];
	            ^
13 errors
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	long long t=0,k=0,h=0,sum=0,sum1=0;
	vector <long long> v;
	cin >>t >>k;
	for (int i=0;i<t;i++)
	{
		cin >>h;
		v.push_back(h);
		sum+=h;
	}
	sort (v.begin(),v.end());
	reverse (v.begin(),v.end());
	if (k>=t)
	{
		cout <<"0"<<endl;
		return 0;'
	}
	for (int i=0;i<k;i++)
		sum1+=v[i];
	cout <<sum-sum1<<endl;
	return 0;
}

Compiler output:
a.cc:22:26: warning: missing terminating ' character
   22 |                 return 0;'
      |                          ^
a.cc:22:26: error: missing terminating ' character
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
int main(void){
    long long N,K;
    cin >> N >> K;
    if(K >= N) {
      cout << 0; 
      return 0;
    } 
    vector<long long> vec<N>;
	for (auto& v : vec)
	{
		cin >> v;
	}
   sort(vec.begin(), vec.end()); 
  
  long long sum = 0;
  for(int i = K;i<N;i++){
    sum += vec[i];
  }
  cout << sum;
   return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: expected initializer before '<' token
   11 |     vector<long long> vec<N>;
      |                          ^
a.cc:12:24: error: 'vec' was not declared in this scope
   12 |         for (auto& v : vec)
      |                        ^~~
a.cc:16:9: error: 'vec' was not declared in this scope
   16 |    sort(vec.begin(), vec.end());
      |         ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main(void)
{
    ll n, k;
    cin >> n >> k;
    vector<ll> h(n);

    rep(i, n)
    {
        cin >> h[i];
    }

    sort(h.begin(), h.end(), greater<ll>());
    ll i=0;
    while(k > i)
    {
        h[i] = 0;
        i++;
    }
    unsigned ll sum=0;
    for(ll j=i; j < n; j++)
    {
        sum += h[j];
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: expected initializer before 'sum'
   26 |     unsigned ll sum=0;
      |                 ^~~
a.cc:29:9: error: 'sum' was not declared in this scope
   29 |         sum += h[j];
      |         ^~~
a.cc:32:13: error: 'sum' was not declared in this scope
   32 |     cout << sum << endl;
      |             ^~~
Language: C++

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

int main()
{
  ll N,K;
  ll ans=0;
  cin >> N >> K;
  vector <ll> H(300000);
  for(ll i=0; i<N; i++){
    cin >> H.at(i);
  }
  sort(H.begin(),H.end(),greater<ll>());
  for(ll i=0; i<K; i++){
    H.at(i)=0;
  }
  for(ll i=0; i<N; i++){
    ans+=H.at(i);
  }
  cout << ans << endl;
  return 0;
}


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


import java.util.Arrays;
import java.util.Scanner;

public class MyMain {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numMon = scanner.nextInt();
        int special = scanner.nextInt();
        int[] hps = new int[numMon];
        for(int i = 0; i < numMon; i++) {
            hps[i] = scanner.nextInt();
        }
        scanner.close();

        Arrays.sort(hps);
        int removeNum = Math.min(special, numMon);
        long remainSum = 0;
        for(int i = removeNum; i < numMon; i++) {
            remainSum += hps[i];
        }

        System.out.println(remainSum);
    }
}

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;

using ll = cpp_int;

int main() {
    ll n, k;
    cin >> n >> k;
    vector<ll> h;
    for (int i = 0; i < n; ++i) {
        ll e;
        cin >> e;
        h.push_back(e);
    }
    
    sort(h.begin(), h.end());

    for (int i = 0; i < k; ++i) {
        h.pop_back();
        if (h.empty()) {
            cout << 0 << endl;
            return 0;
        }
    }
    
    cout << accumulate(h.begin(), h.end(), 0) << endl;
    
    return 0;
}

Compiler output:
a.cc:5:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    5 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int main()
{
  long long int n,k,i,j;
   scanf("%lld %lld\n",&n,&k);
 long long int arr[n],sum=0;
  for(i=0;i<n;i++)
    scanf("%lld ",&arr[i]);
  for(i=0;i<n-1;i++)
  {
    for(j=0;j<n-i-1;j++)
    {
      if(arr[j]>=arr[j+1])
      {
        long long int tmp=arr[j];
        arr[j]=arr[j+1];
        arr[j+1]=tmp;
      }
    }
    for(i=0;i<n-k;i++)
    {
      sum=sum+arr[i];
    }
    printf("%lld",sum);
    
        
    return 0;
}

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

#define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <climits>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
//#include <tuple>

#define break break
#define continue continue
#define INF INT_MAX>>1 
#define SIZE 100010
#define MOD 1000000007
#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define rep2(i, from, to) for(int i=(from); i<(int)(to); i++)
#define all(obj) (obj).begin(), (obj).end()
#define lpair pair<ll, ll>
#define vint vector<ll>
#define vinput(name) for(int i=0; i<(int)(name.size()); i++) cin >> name[i];
#define voutput(name) for(int i=0; i<(int)(name.size()); i++) cout << name[i] << endl;
typedef long long ll;

using namespace std;

ll ans = 0;

int main(void){
	ll n, k; cin >> n >> k;
	vint h(n); vinput(h, n);
	sort(all(h), greater<ll>());
	ll useCount = 0;
	rep(i, n){
		if(useCount < k){
			useCount++;
			continue;
		}
		ans += h[i];
	}

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

Compiler output:
a.cc:38:31: error: macro "vinput" passed 2 arguments, but takes just 1
   38 |         vint h(n); vinput(h, n);
      |                               ^
a.cc:28:9: note: macro "vinput" defined here
   28 | #define vinput(name) for(int i=0; i<(int)(name.size()); i++) cin >> name[i];
      |         ^~~~~~
a.cc: In function 'int main()':
a.cc:38:20: error: 'vinput' was not declared in this scope
   38 |         vint h(n); vinput(h, n);
      |                    ^~~~~~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
int main(void){
    int N,K;
    cin >> N >> K;
    if(K >= N) { cout << 0; return 0;} 
    vector<long long> vec<N>;
	for (auto& v : vec)
	{
		cin >> v;
	}
   sort(vec.begin(), vec.end()); 
  
  long long sum = 0;
  for(int i = K;i<N;i++;){
    sum += vec[i];
  }
  cout << sum;
   return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: expected initializer before '<' token
    8 |     vector<long long> vec<N>;
      |                          ^
a.cc:9:24: error: 'vec' was not declared in this scope
    9 |         for (auto& v : vec)
      |                        ^~~
a.cc:13:9: error: 'vec' was not declared in this scope
   13 |    sort(vec.begin(), vec.end());
      |         ^~~
a.cc:16:24: error: expected ')' before ';' token
   16 |   for(int i = K;i<N;i++;){
      |      ~                 ^
      |                        )
a.cc:16:25: error: expected primary-expression before ')' token
   16 |   for(int i = K;i<N;i++;){
      |                         ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    int N, K;
    int *H;

    cin >> N >> K;
    H = new int[N];
    int i, sum=0;
    for (i=0;i<N;i++){
        cin >> H[i];
        sum += H[i];
    }

    // 大きい順にソート
    sort(H, H+N, greater<int>());

    int out; // 全てのモンスターを倒すのに必要な攻撃の回数(答え)
    // Kがモンスターの数より大きければ、全て必殺技で倒せる
    if (K >= N){
        out = 0;
    }
    else if (K == 0)
    {
        out = sum; 
    }
    else{
        for (i=0;i<K;i++){
            sum -= H[i];
        }
        out = sum;
    }

    cout << out << 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, H+N, greater<int>());
      |     ^~~~
      |     short
Language: C++

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

using namespace std;

int main(){

  int N,K;
  
  cin>>N>>K;
  int Hs[N];
  
  for(int  i=0;i<N;i++){
  	cin>>Hs[i];
  }
  
  sort(Hs,Hs+N);
  int A=0;
  
  for(int i=0;i<N-k;i++){
  	A += Hs[i];
  }
  
  cout<<A<<endl;
  
  
  
  return 0;
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:20:19: error: 'k' was not declared in this scope
   20 |   for(int i=0;i<N-k;i++){
      |                   ^
Language: C++

#include <iostream>
using namespace std;
  
  
int main()
{
    int a,b,bb[200009];
    cin>>a>>b;
    long long sum=0;
    for(int i=0;i<a;i++){
        cin>>bb[i];
    }
    if(b>=a){
        cout<<"0\n";
    }
    else{
        sort(bb,bb+a);
        for(int i=0;i<a-b;i++){
            sum+=bb[i];
        }
        cout<<sum<<"\n";
    }
    return 0;
}



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

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

void swap (int *x, int *y);
int partition (int array[], int left, int right);
void quick_sort (int array[], int left, int right);

int main(void){
  int n, k;
  int *h;
  scanf("%d %d", &n, &k);
  h = (int *)malloc(sizeof(int)*n);
  for(int i=0: i< n; i++){
    scanf("&d ", &h[i]);
  }
  quick_sort(h, 0, n-1);
  int sum = 0;
  for(int i=0; i<n-k; i++){
  sum = sum + h[i];
  }
  printf("%d", sum);
  return 0;
}

void swap (int *x, int *y) {
  int temp;  
  temp = *x;
  *x = *y;
  *y = temp;
}

int partition (int array[], int left, int right) {
  int i, j, pivot;
  i = left;
  j = right + 1;
  pivot = left;  
  do {
    do { i++; } while (array[i] < array[pivot]);
    do { j--; } while (array[pivot] < array[j]);
   
    if (i < j) { swap(&array[i], &array[j]); }
  } while (i < j);

  swap(&array[pivot], &array[j]);   

  return j;
}

void quick_sort (int array[], int left, int right) {
  int pivot;

  if (left < right) {
    pivot = partition(array, left, right);
    quick_sort(array, left, pivot-1);   
    quick_sort(array, pivot+1, right);
  }
}

Compiler output:
main.c: In function 'main':
main.c:13:14: error: expected ',' or ';' before ':' token
   13 |   for(int i=0: i< n; i++){
      |              ^
main.c:13:25: error: expected ';' before ')' token
   13 |   for(int i=0: i< n; i++){
      |                         ^
      |                         ;
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0;i < (int)(n);i++)
int main(){
    int n,k;
    priority_queue<ll> q;
    cin >> n >> k;
    rep(i,n){
      int t;
      cin >> t;
      q.push(t);
    }
    int ans=0;
    while (!q.size()){
      ll tem=q.top();q.pop;
      if (k >=1) {
        k--;
        continue;
      }
      else ans+=tem;
    }
    cout << ans << endl;
      
   
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: invalid use of non-static member function 'void std::priority_queue<_Tp, _Sequence, _Compare>::pop() [with _Tp = long long int; _Sequence = std::vector<long long int, std::allocator<long long int> >; _Compare = std::less<long long int>]'
   20 |       ll tem=q.top();q.pop;
      |                      ~~^~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_queue.h:771:7: note: declared here
  771 |       pop()
      |       ^~~
Language: C++

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

typedef long long ll;
#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define memset(v, h) memset((v), h, sizeof(v))
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

ll m[20][20];

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

struct node
{
    public: ll x;
    public: ll y;

    node(ll xx, ll yy)
    {
        x = xx;
        y = yy;
    }
};

int main(){
    ll a, b;
    cin >> a >> b;

    vector<ll> h;

    rep(i, a){
        ll p;
        cin >> p;
        h.push_back(p);
    }

    if(a <= b)
    {
        cout << 0 << endl;
        return 0;
    }

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

    ll k = 0;

    rep(i, a - b)k += h[i];

    cout << k << endl;
    return 0;
}

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

#include <iostream>
#include <iomanip>
#include <vector>
#define ll long long
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n

#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define FOR(i,m,n) for(int (i)=(m);(i)<(n); i++)
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define WREP(i,in,j,jn) REP(i,in)REP(j,jn)
using namespace std;
//-------------------------------------------

int main(void){
	ll N,K;cin>>N>>K;
	ll H[N];REP(i,N)cin>>H[i];
	sort(ALL(H,N),greater());
	ll count=0;
	REP(i,N){
		if(K>0){
			H[i]=0;
			K--;
		}
		else{
			count+=H[i];
		}
	}
	cout<<count;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   26 |         sort(ALL(H,N),greater());
      |         ^~~~
      |         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);
    long int term=0;
    for(int i=N-1;i>=0;i--){
        if(K>0){
            K--;
            H[i]=0;
            continue;
        }
        term+=H[i];
    }
    cout<<term<<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);
      |     ^~~~
      |     short
Language: C++

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

int main(){
   long long n,k;
   cin >> n >> k;   
   vector<long long> h(n);
    long long sum = 0;
   for (long long i = 0;i < n;i++){
       cin >> h[i];
       sum += h[i];
   }

   sort(h.begin(),h.end(),greater<long long>());
    long long cnt = 0;
    for (long long i = 0;i < k;i++){
        sum -= h[i];
    }

    cout << sum << endl;



Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: expected '}' at end of input
   20 |     cout << sum << endl;
      |                         ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: 'i' was not declared in this scope
   12 |   for(ll i=k;i<n;i++);ans+=b[i];
      |                              ^
Language: C

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

using namespace std;

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


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

#include <bits/stdc++.h>

using namespace std;

int q_sort(int d[],int left,int right){
	if(left >= right) return 0;
	int pipot = d[(left+right)/2], l = left, r = right, tmp;
	while(l<r){
		while(d[l] > pipot) l++;
		while(d[r] < pipot) r--;
		if( l <=  r){
			tmp = d[l];
			d[l] = d[r];
			d[r] = tmp;
			l++;
			r--;
		}
	}
	q_sort(d,left,r);
	q_sort(d,l,right);
}

int main(void)
{
	int n,k;
	cin>>n>>k;
	int i;
	long int h[n];
	for(i = 0; i < n; i++){
		cin>>h[i];
	}
	q_sort(h,0,n-1);
	for(i = 0; i < k; i++){
		h[i] = 0;
	}
	long long int sum = 0;
	for(i = 0; i < n; i++){
		sum += h[i];
	}
	printf("%lld\n",sum);
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: cannot convert 'long int*' to 'int*'
   32 |         q_sort(h,0,n-1);
      |                ^
      |                |
      |                long int*
a.cc:5:16: note:   initializing argument 1 of 'int q_sort(int*, int, int)'
    5 | int q_sort(int d[],int left,int right){
      |            ~~~~^~~
a.cc: In function 'int q_sort(int*, int, int)':
a.cc:20:15: warning: control reaches end of non-void function [-Wreturn-type]
   20 |         q_sort(d,l,right);
      |         ~~~~~~^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
    int n, k;
    cin >> n;
    cin >> k;
    priority_queue<int,greater<int>> H;
    for (int i = 0; i < n; i++)
    {
        int h;
        cin >> h;
        H.push(h);
    }
    for (int j = 0; j < k; j++)
    {
        H.pop();
    }
    int count = 0;
    while (!H.empty())
    {
        count = count + H.top();
        H.pop();
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: error: no type named 'value_type' in 'struct std::greater<int>'
   10 |     priority_queue<int,greater<int>> H;
      |                                   ^~
a.cc:10:35: error: template argument 3 is invalid
a.cc:15:11: error: request for member 'push' in 'H', which is of non-class type 'int'
   15 |         H.push(h);
      |           ^~~~
a.cc:19:11: error: request for member 'pop' in 'H', which is of non-class type 'int'
   19 |         H.pop();
      |           ^~~
a.cc:22:15: error: request for member 'empty' in 'H', which is of non-class type 'int'
   22 |     while (!H.empty())
      |               ^~~~~
a.cc:24:27: error: request for member 'top' in 'H', which is of non-class type 'int'
   24 |         count = count + H.top();
      |                           ^~~
a.cc:25:11: error: request for member 'pop' in 'H', which is of non-class type 'int'
   25 |         H.pop();
      |           ^~~
Language: C

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

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

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

int main(void){
    int N,K;
    int H[200010];
    long ans;

    scanf("%d",&N);
    scanf("%d",&K);

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

    qsort(H,N,sizeof(int),compare_int_big);

    ans=0;
    for(int i=0;i<N,i++){
        if(i<K){
            continue;
        }
        ans += H[i];
    }

    printf("%ld",ans);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:24: error: expected ';' before ')' token
   27 |     for(int i=0;i<N,i++){
      |                        ^
      |                        ;
Language: C++

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

int main() {

  long long int N, K;
  cin >> N >> K;
  vector<long long int> H(N);
  for (int i = 0; i < N; i++) {
    cin >> H.at(i);
  }
  sort(H.begin(), H.end());
  if (K >= N) {
    cout << 0 << endl;
  }
  else {
    long long int S = 0;
    for (int i = 0; i < N - K; i++) {
      S += H.at(i);
    }
    cout << S << endl;

}


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

#include<iostream>
#include <algorithm>
#include <functional>
using namespace std;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

int main(){
  long long N, K;
  cin>>N>>K;
  long long A[N];
  for(long long i=0;i<N;i++){
    cin>>A[i];
  }
  sort(A, A + SIZE_OF_ARRAY(A), std::greater<>());
  unsinged long long sum=0;
  for(long long i=K;i<N;i++){
    sum+=A[i];
  }
  cout<<sum;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'unsinged' was not declared in this scope; did you mean 'unsigned'?
   15 |   unsinged long long sum=0;
      |   ^~~~~~~~
      |   unsigned
a.cc:17:5: error: 'sum' was not declared in this scope
   17 |     sum+=A[i];
      |     ^~~
a.cc:19:9: error: 'sum' was not declared in this scope
   19 |   cout<<sum;
      |         ^~~
Language: C++

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

int main() {
 int n, k;
  cin >> n >> k;
  
  long long sum = 0;
  vector<int> arr(n);
  for(int i=0; i<a; i++)
    cin >> arr[i];
  
  sort(arr.rbegin(), arr.rend());
  
  for(int i=k; i<n; i++)
    sum += arr[i];
  
  	cout << sum << endl;
  
  return 0;
}

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

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

    




Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'lomg' was not declared in this scope; did you mean 'long'?
    6 |     vector <lomg lomg> h(n);
      |             ^~~~
      |             long
a.cc:6:22: error: template argument 1 is invalid
    6 |     vector <lomg lomg> h(n);
      |                      ^
a.cc:6:22: error: template argument 2 is invalid
a.cc:7:40: error: invalid types 'int[long long int]' for array subscript
    7 |     for(long long i=0;i<n;++i) cin >> h[i];
      |                                        ^
a.cc:8:12: error: request for member 'begin' in 'h', which is of non-class type 'int'
    8 |     sort(h.begin(),h.end(),greater<int>());
      |            ^~~~~
a.cc:8:22: error: request for member 'end' in 'h', which is of non-class type 'int'
    8 |     sort(h.begin(),h.end(),greater<int>());
      |                      ^~~
a.cc:10:10: error: invalid types 'int[long long int]' for array subscript
   10 |         h[i]=0;
      |          ^
a.cc:14:15: error: invalid types 'int[long long int]' for array subscript
   14 |         sum+=h[i];
      |               ^
Language: C++

#include <iostream>
#include <string>
#include <vector>

#define rep(i, n) for (int i=0; i< (n); ++i)
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using namespace std;

int main() {
    int n, k;

    cin >> n >> k;

    int h[n];
    rep(i, n) cin >> h[i];

    sort(h, h+n, greater<>());
    //rep(i, n) cout << h[i] << endl;

    if (n <= k) {
        // 必殺技は数えない
        cout << 0 << endl;
        return 0;
    }
    ll sum = 0;
    // 0 <= k
    for (int i=k; i<n; i++) {
        sum += h[i];
    }

    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   20 |     sort(h, h+n, greater<>());
      |     ^~~~
      |     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);

  long sum = 0;
  for (int i = n - k - 1; i >= 0; i--) {
  	sum += h[i];
  }

  cout << sum << endl;

  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using P =pair<int,int>;
int main(){
  ll n,k;
  cin>>n>>k;
  vector<ll> b(n);
  for(ll i=0;i<n;i++)cin>>b[i];
  sort(b.first(),b.end());
  ll ans=k;
  for(ll i=k;i<n;i++);ans+=b[i];
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'class std::vector<long long int>' has no member named 'first'
   10 |   sort(b.first(),b.end());
      |          ^~~~~
a.cc:12:30: error: 'i' was not declared in this scope
   12 |   for(ll i=k;i<n;i++);ans+=b[i];
      |                              ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <array>
#include <chrono>
#include <numeric>

using namespace std;

int main() {
	long long N, K;

	cin >> N >> K;
	std::vector<int> H(123);

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

	std::sort(H.begin(),H.end(),std::greater<int>());

	for(int i=0;i<K;i++){
		if( H.size() == 0 ){
			break;
		}
		H.erase( H.begin() );
	}

	cout << accumulate(H.begin(), H.end(), 0LL) << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   20 |         std::sort(H.begin(),H.end(),std::greater<int>());
      |              ^~~~
      |              qsort
Language: C++

#include<iostream>
#include <algorithm>
#include <functional>
using namespace std;
int main(){
  long long N, K;
  cin>>N>>K;
  long long A[N];
  for(long long i=0;i<N;i++){
    cin>>A[i];
  }
  sort(A, A + SIZE_OF_ARRAY(A), std::greater<>());
  unsinged long long sum=0;
  for(long long i=K;i<N;i++){
    sum+=A[i];
  }
  cout<<sum;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'SIZE_OF_ARRAY' was not declared in this scope
   12 |   sort(A, A + SIZE_OF_ARRAY(A), std::greater<>());
      |               ^~~~~~~~~~~~~
a.cc:13:3: error: 'unsinged' was not declared in this scope; did you mean 'unsigned'?
   13 |   unsinged long long sum=0;
      |   ^~~~~~~~
      |   unsigned
a.cc:15:5: error: 'sum' was not declared in this scope
   15 |     sum+=A[i];
      |     ^~~
a.cc:17:9: error: 'sum' was not declared in this scope
   17 |   cout<<sum;
      |         ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+7;
int a[maxn];
int main() {
    ll h;
    int s=0;
    scanf("%lld",&h);
    while(h>=1){
        h/=2;
        s*=2;
    }
    printf("%d\n")
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: expected ';' before 'return'
   14 |     printf("%d\n")
      |                   ^
      |                   ;
   15 |         return 0;
      |         ~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <cstdint>
#include <cmath>
#include <vector>
#include <map>
#include <climits>
#include <numeric>

using namespace std;

int main()
{
    int64_t N, K;
    cin >> N >> K;
    if(K >= N){
        cout << "0\n";
        return 0;
    }
    vector<int64_t> hs(N);
    for(auto& h : hs) cin >> h;
    sort(begin(hs), end(hs));
    cout << accumulate(begin(hs), end(hs) - K, 0L) << '\n';
}


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

#include <bits/stdc++.h>

using namespace std;


int main(){
    int n, k;
    cin >> n;
    cin >> k;
    priority_queue<int> H;
    for (int i = 0; i < n; i++)
    {
        int h;
        cin >> h;
        H.push(h);
    }
    for (int j = 0; j < k; j++){
        H.pop();
    }
    int count = 0;
    while(!H.empty){
        count = count + H.top();
        H.pop();
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: cannot convert 'std::priority_queue<int>::empty' from type 'bool (std::priority_queue<int>::)() const' to type 'bool'
   21 |     while(!H.empty){
      |              ^~~~~
a.cc:21:14: error: in argument to unary !
   21 |     while(!H.empty){
      |            ~~^~~~~
Language: C++

#inclue <bits/stdc++.h>
using namespace std;
using ll = long long;

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

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclue; did you mean #include?
    1 | #inclue <bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> h(n);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #inclue <bits/stdc++.h>
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> h(n);
      |          ^~~
a.cc:9:31: error: 'cin' was not declared in this scope
    9 |   for (int i = 0; i < n; ++i) cin >> h[i];
      |                               ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclue <bits/stdc++.h>
a.cc:9:38: error: 'h' was not declared in this scope
    9 |   for (int i = 0; i < n; ++i) cin >> h[i];
      |                                      ^
a.cc:10:8: error: 'h' was not declared in this scope
   10 |   sort(h.begin(), h.end());
      |        ^
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(h.begin(), h.end());
      |   ^~~~
      |   short
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout << sum << endl;
      |   ^~~~
a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:18: error: 'endl' was not declared in this scope
   15 |   cout << sum << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclue <bits/stdc++.h>
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define int long long

int main(){
  int n, k; cin >> n >> k;
  vector<int > v(n);
  for(auto &it : v) cin >> it;
  
  sort(v.begin(), v.end());
  
  int x = n-k;
  int sum = 0;
  for(int i = 0; i < x; i++) sum += v[i];
  
  cout << sum;
  
  return 0;
}

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <numeric> //lcm

#include "BIT.h"

#define ERROR() cout << "ERROR!!" << endl; return 0;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = n-1; i >= 0; --i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)

#define debug(vec) for(auto v : vec) cout << v << " "; cout << endl;

#define debug2D(vec2D) for(auto vec : vec2D) { for (auto v : vec) cout << v << " "; cout << endl; } 

using namespace std;

typedef long long ll;

const long long int INF = 1 << 29; //<10^10
//const ll MOD = 998244353;
const ll MOD = 1000000007;

inline bool maxch(int &a, int b) { if (a < b) {a = b; return true;} else return false;}


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

  int n, k;
	cin >> n >> k;

	vector<ll> m(n);
	rep(i,n) cin >> m[i];
	sort(m.begin(), m.end(), greater<ll>());

	ll ans =0;
	for(int i = k; i < n; ++i) ans += m[i];

	cout << ans << endl;
}




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

#include <algorithm>
#include <array>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;

constexpr double EPS = 1e-7;
constexpr int INF = 1e9;
#define PI (acos(-1))

constexpr int MOD = 1e9 + 7;

template <typename T>
ll slice_sum(const std::vector<T> &v, size_t from, size_t to) {
	assert(to <= v.size());
	return std::accumulate(std::next(v.cbegin(), from), std::next(v.cbegin(), to), T{});
}

int main(int argc, char const *argv[]) {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);

	int N, K;
	cin >> N >> K;
	vector<ll> H(N);
	for (int i = 0; i < N; i++) {
		cin >> H[i];
	}
	if (N <= K) {
		cout << 0 << endl;
		return 0;
	}
	sort(H.begin(), H.end());

	ll ans = slice_sum(H, 0, N - K);
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In instantiation of 'll slice_sum(const std::vector<_Tp>&, size_t, size_t) [with T = long long int; ll = long long int; size_t = long unsigned int]':
a.cc:58:20:   required from here
   58 |         ll ans = slice_sum(H, 0, N - K);
      |                  ~~~~~~~~~^~~~~~~~~~~~~
a.cc:37:15: error: 'assert' was not declared in this scope
   37 |         assert(to <= v.size());
      |         ~~~~~~^~~~~~~~~~~~~~~~
a.cc:22:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   21 | #include <unordered_set>
  +++ |+#include <cassert>
   22 | #include <vector>
Language: C++

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")

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

#define pb push_back
#define F first
#define S second
#define f(i,a,b)  for(int i = a; i < b; i++)
#define endl '\n'

using ll = long long;
using db = long double;
using ii = pair<int, int>;

const int N = 1e5 + 5, LG = 19, MOD = 1e9 + 7;
const int SQ =225;
const long double EPS = 1e-7;

int32_t main(){
#ifdef ONLINE_JUDGE
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif


    int h, n;
    int n, k;
    cin >> n >> k;
    vector<int>a(n);
    for(auto & x : a)cin >> x;
    sort(a.begin(),a.end());
    a.resize(n-k);
    cout << accumulate(a.begin(),a.end(),0ll) << '\n';


  return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:29:9: error: redeclaration of 'int n'
   29 |     int n, k;
      |         ^
a.cc:28:12: note: 'int n' previously declared here
   28 |     int h, n;
      |            ^
Language: C++

#pragma region template
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long MOD = 1e9+7, MAX = 1e18, larg = 1e5, INF = -1e9;
long long A,B,C,D,E,F,G,H,I,J,K,L,N,M,O,P,Q,R,S,T,U,V,W,x,y,z;
long long max_value = INF, max_index = -1;
long long min_value = MAX, min_index = -1;
typedef long long ll;
typedef pair<ll, ll> Pa;

template <std::int_fast64_t Modulus> class modint {
  using u64 = std::int_fast64_t;
public:
  u64 a;
  constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
  constexpr u64 &value() noexcept { return a; }
  constexpr const u64 &value() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  constexpr modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  constexpr modint &operator/=(modint rhs) noexcept {
    u64 exp = Modulus - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
};
typedef modint<MOD> m;
#pragma endregion

int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
}

int main() {
  cin >> N >> H;
  priority_queue<sum> que;
  ll sum = 0;
  rep(i, N){
    cin >> A;
    que.push(A);
    sum += A;
  }
  rep(i, H){
    sum -= que.top();
    que.pop();
  }
  cout << max(sum, 0ll);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:71:18: error: 'sum' was not declared in this scope
   71 |   priority_queue<sum> que;
      |                  ^~~
a.cc:71:21: error: template argument 1 is invalid
   71 |   priority_queue<sum> que;
      |                     ^
a.cc:71:21: error: template argument 2 is invalid
a.cc:71:21: error: template argument 3 is invalid
a.cc:75:9: error: request for member 'push' in 'que', which is of non-class type 'int'
   75 |     que.push(A);
      |         ^~~~
a.cc:79:16: error: request for member 'top' in 'que', which is of non-class type 'int'
   79 |     sum -= que.top();
      |                ^~~
a.cc:80:9: error: request for member 'pop' in 'que', which is of non-class type 'int'
   80 |     que.pop();
      |         ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  long long N, K;
  cin>>N>>K;
  long long A[N];
  for(long long i=0;i<N;i++){
    cin>>A[i];
  }
  sort(A, A + SIZE_OF_ARRAY(A), std::greater<>());
  unsinged long long sum=0;
  for(long long i=K;i<N;i++){
    sum+=A[i];
  }
  cout<<sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'SIZE_OF_ARRAY' was not declared in this scope
   10 |   sort(A, A + SIZE_OF_ARRAY(A), std::greater<>());
      |               ^~~~~~~~~~~~~
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(A, A + SIZE_OF_ARRAY(A), std::greater<>());
      |   ^~~~
      |   short
a.cc:11:3: error: 'unsinged' was not declared in this scope; did you mean 'unsigned'?
   11 |   unsinged long long sum=0;
      |   ^~~~~~~~
      |   unsigned
a.cc:13:5: error: 'sum' was not declared in this scope
   13 |     sum+=A[i];
      |     ^~~
a.cc:15:9: error: 'sum' was not declared in this scope
   15 |   cout<<sum;
      |         ^~~
Language: C++

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <regex>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
using ll = long long;
using VL=vector<ll>;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
const long long INF =  999999999;

ll h[100010];

int main(){
    ll n,k,ans=0;
    cin>>n>>k;
    REP(i,n)cin>>h[i];
    sort(h,h+n);
    REPR(i,n-k-1){
      ans+=h[i];
    }
    cout<<ans<<endl;a
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:21: error: 'a' was not declared in this scope
   45 |     cout<<ans<<endl;a
      |                     ^