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


import java.util.Scanner;

public class rightMost {
    static int binarySearchRightMost(int arr[],int key){
        int l=0,r=arr.length-1;
        while (l<r){
            int mid=Math.floorDiv(l+r,2);
            if(arr[mid]>key){
                r=mid;
            }
            else{
                l=mid+1;
            }
        }
        return r-1;

    }

    public static void main(String[] args) {
//        int arr[]={1,2,3,4,4,4,6,7};
//        System.out.println(binarySearchRightMost(arr,4));
        Scanner scanner=new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
//        int arr[]=new int[b];
        for(int j=0;j<b;j++){
            a-=scanner.nextInt();
            if(a<=0){
                System.out.println("Yes");
                break;
            }
        }
        if(a>0){
            System.out.println("No");
        }
//        System.out.println(a%b==0?Math.floorDiv(a,b):Math.floorDiv(a,b)+1);
    }
}


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

#include <algorithm>
#include <array>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>
 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
 
int main() {
  int H, N;
  cin >> H >>  N;
 
  vector<int> A(N);
  rep(i, N)
    cin >> A[i];
  
  rep(i, N) {
    H -=A[i];
    if(H<=0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
 
  return 0;
}
#include <algorithm>
#include <array>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>

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

using namespace std;

int main() {
  int H, N;
  cin >> H >>  N;

  vector<int> A(N);
  rep(i, N)
    cin >> A[i];
  
  rep(i, N) {
    H -=A[i];
    if(H<=0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;

  return 0;
}


Compiler output:
a.cc:50:5: error: redefinition of 'int main()'
   50 | int main() {
      |     ^~~~
a.cc:16:5: note: 'int main()' previously defined here
   16 | int main() {
      |     ^~~~
Language: Java

import java.util.*;
public class C {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int hp=sc.nextInt(),n=sc.nextInt();
		int sum = 0;
		for(int i=0;i<n;i++)
			sum+=sc.nextInt();
		String can = sum>=hp?"Yes":"No";
		System.out.print(can);
	}
}


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

#include <stdio.h>

int main(void){
  int h, n;
  int *a;
  int sum=0;
  scanf("%d %d", &h, &n);
  a = (int *)malloc((int)*n);
  for(int i = 0; i < n; i++){
    scnaf("%d ", &a[i]);
    sum = sum + a[i];
  }
  if(sum>=h){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:14: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    8 |   a = (int *)malloc((int)*n);
      |              ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:8:14: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    8 |   a = (int *)malloc((int)*n);
      |              ^~~~~~
main.c:8:14: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:8:26: error: invalid type argument of unary '*' (have 'int')
    8 |   a = (int *)malloc((int)*n);
      |                          ^~
main.c:10:5: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   10 |     scnaf("%d ", &a[i]);
      |     ^~~~~
      |     scanf
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long int
#define mod 1000000007
#define string_mod 2549536629329_base_255
#define pb push_back
#define F first
#define S second
#define ff first
#define endl "\n"
#define ss second
#define all(v) v.begin(), v.end()
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
int power(int x, unsigned int y, int p)
{
    int res = 1;
    x = x % p;
  //  cout << x << " ";
    while (y > 0)
    {

        if (y & 1)
            res = (res * x) % p;

        y = y >> 1;
        x = (x * x) % p;
    }
    return res%p;
}
int lcm(int a, int b)
{
    return (a * b) / __gcd(a, b);
}
int fac[100001];
int inv[100001];
int comb(int a,int b){
    if(a<b)
        return 0;
    return ((fac[a] * inv[b] )%mod* inv[a - b]%mod);
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int tc;
    tc=1;
    while (tc--)
    {
        int a, b;
        cin>>a>>b;
      int a[n],sum=0;
      for(int i=0;i<n;i++){
      cin>>a[i];
        sum+=a[i];

      }
      if(sum>=a){
        cout<<"Yes"<<endl"}
         else{
           cout<<"No"<<endl;
         }
    }

    return 0;
}

Compiler output:
a.cc:63:26: warning: missing terminating " character
   63 |         cout<<"Yes"<<endl"}
      |                          ^
a.cc:63:26: error: missing terminating " character
   63 |         cout<<"Yes"<<endl"}
      |                          ^~
a.cc: In function 'int32_t main()':
a.cc:56:13: error: 'n' was not declared in this scope
   56 |       int a[n],sum=0;
      |             ^
a.cc:58:13: error: invalid types 'long long int[long long int]' for array subscript
   58 |       cin>>a[i];
      |             ^
a.cc:59:15: error: invalid types 'long long int[long long int]' for array subscript
   59 |         sum+=a[i];
      |               ^
a.cc:64:10: error: expected ';' before 'else'
   64 |          else{
      |          ^~~~
a.cc:70:2: error: expected '}' at end of input
   70 | }
      |  ^
a.cc:46:1: note: to match this '{'
   46 | {
      | ^
Language: C++

#include<iostram>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  int A[b];
  for(int i=0;i<b;i++){
    cin>>A[i];
  }
  int max=0;
  for(int i=1;i<b;i++){
    if(A[max]<A[i]){
      int t=A[max];
      A[max]=A[i];
      A[i]=t;
    }
  }
  int count=0;
  for(int i=0;i<b;i++){
    count+=A[i];
  }
  if(count>=a){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
 return 0; 
}

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

#include<iostream>
using namespace std;

int main(){
  int H, N;
  int wa=0;
  int a;
  for(i=0; i<N; i++) {
    cin >> a;
    wa += a;
  }
  if(H<=wa) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

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

#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define ld long double
#define rep(i,h) for(int i = 0; i < h; ++i)
#define rep1(i,h) for(int i = 0; i <= h; ++i)
#define rep2(i,k,h) for(int i = k; i < h; ++i)
#define rep3(i,k,h) for(int i = k; i <= h; ++i)
#define INF LLong_MAX // long long INF
#define inf INT_MAX // int inf

typedef pair<int,int> int_pair;
typedef pair<string,string> string_pair;


int main() {
    int h,n;
    cin >> h >> n;
    vector<int> a(n);
    rep(i,n) {
        cin >> a.at(i);
    }
    int i =0;
    while(h > 0) {
        h -= a.at(i);
        i++;
    }
    if(h <=0) {
        cout << "Yes" << endl;
    }else {
        cout << "No" << endl;
    }
}

int main() {
    int n,k;
    cin >> n >>k;
}

Compiler output:
a.cc:36:5: error: redefinition of 'int main()'
   36 | int main() {
      |     ^~~~
a.cc:17:5: note: 'int main()' previously defined here
   17 | int main() {
      |     ^~~~
Language: C++

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

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

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


int main() {
    int H, N;
    cin >> H >> N;
    int A[N];
    int sam = 0;
    rep(i, N) {
        cin >> A[i];
        sam += A[I];
    }
    if (H > sam)cout << "No";
    else cout << "Yes";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: 'I' was not declared in this scope
   13 |         sam += A[I];
      |                  ^
Language: Java

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main() {
	int h,n,a;
	long sum=0;
	cin >> h>> n ;
	
	rep(i,n){
		cin >> a;
		sum += a;
	}
	if(sum >= h) cout << "Yes" << endl;
	else cout << "No" << endl; 
	

	return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:2: error: illegal character: '#'
#define rep(i,n) for (int i = 0; i < (n); ++i)
^
Main.java:2: error: class, interface, enum, or record expected
#define rep(i,n) for (int i = 0; i < (n); ++i)
                                 ^
Main.java:2: error: class, interface, enum, or record expected
#define rep(i,n) for (int i = 0; i < (n); ++i)
                                          ^
Main.java:4: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:9: error: not a statement
	cin >> h>> n ;
	        ^
Main.java:12: error: not a statement
		cin >> a;
		    ^
Main.java:15: error: not a statement
	if(sum >= h) cout << "Yes" << endl;
	                           ^
Main.java:16: error: not a statement
	else cout << "No" << endl; 
	                  ^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:11: error: ';' expected
	rep(i,n){
	        ^
12 errors
Language: C

include <stdio.h>

int main(void){
  int h, n;
  int *a;
  int sum=0;
  scanf("%d %d", &h, &n);
  a = (int *)malloc((int)*n);
  for(int i = 0; i < n; i++){
    scnaf("%d ", &a[i]);
    sum = sum + a[i];
  }
  if(sum>=h){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}

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

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

int n, b;
int x[100005];

int main() {
	cin >> a >> n;
	for (int i = 1; i <= n; i++) cin >> x[i];
	sort(x + 1, x + n + 1, greater<int>());
	int tot = 0;
	for (int i = 1; i <= n; i++) tot += x[i];
	if (tot >= a) puts("Yes");
	else puts("No");
	return 0;
}


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

h,n=[int(i) for i in input().split()]
t=[int(i) for i in input().split()]
if sum(t)>=h:print("yes")
else:print("no")

Compiler output:
a.cc:1:1: error: 'h' does not name a type
    1 | h,n=[int(i) for i in input().split()]
      | ^
Language: C++

#include <iostream>
 
using namespace std;
 
int main(void) {
  int h;
  int nl
  
  cin >> h;
  cin >> n;
  
  int a_sum = 0;
    
  for (int i = 0; i < n; i++) {
     int tmp;
     cin >> tmp;
     a_sum += tmp;
  }

  if (a_sum >= h) {
      cout << "Yes" << endl; 
  } else {
      cout << "No" << endl; 
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'cin'
    9 |   cin >> h;
      |   ^~~
a.cc:10:10: error: 'n' was not declared in this scope
   10 |   cin >> n;
      |          ^
Language: C++

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

int main(){
  int n,m,ans;
  ans=0;
  cin >> m >> n;
  vector<int> a(n,0);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  for(int i=0;i<n,i++){
    ans=ans+a[i];
  }
  if(m>ans)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected ';' before ')' token
   12 |   for(int i=0;i<n,i++){
      |                      ^
      |                      ;
Language: C++

#include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<(n);i++) 
using namespace std;
typedef Long Long ll;

int main() {
    int H, N;
    cin >> H >> N;
    int A[N];
    int sam = 0;
    rep(i, N) {
        cin >> A[i];
        sam += A[I];
    }
    if (H > sam)cout << "No";
    else cout << "Yes";
}

Compiler output:
a.cc:4:9: error: 'Long' does not name a type; did you mean 'long'?
    4 | typedef Long Long ll;
      |         ^~~~
      |         long
a.cc: In function 'int main()':
a.cc:13:18: error: 'I' was not declared in this scope
   13 |         sam += A[I];
      |                  ^
Language: C++

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

int main() {
  int h,n;
  cin>>h>>n;
  
  char A;
  for(int i=0;i<n;i++) {
cin >> A.at(i);
  }
^>{$€
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: request for member 'at' in 'A', which is of non-class type 'char'
   10 | cin >> A.at(i);
      |          ^~
a.cc:12:1: error: expected primary-expression before '^' token
   12 | ^>{$€
      | ^
a.cc:12:2: error: expected primary-expression before '>' token
   12 | ^>{$€
      |  ^
a.cc:12:3: error: expected primary-expression before '{' token
   12 | ^>{$€
      |   ^
a.cc:13:2: error: expected '}' at end of input
   13 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
int a[100005];
int main(){
	int h,b;
	cin>>n>>b;
	int ans=0;
	for(int i=0;i<b;i++){
		cin>>a[i];
		ans+=a[i];
	}
	if(ans>=n)cout<<"Yes";
	else cout<<"No";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'n' was not declared in this scope
    7 |         cin>>n>>b;
      |              ^
Language: C++

#include <bits/stdc++.h>
#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++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
    int H,N,A[100000],sum=0;
    cin >> H >> N;
    REP(i,N){
        cin >>A[i];
        sum = sum+A[i]
    }
    if(H>sum){
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
    }

    return 0;    
}

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

#include <iostream>
using namespace std;
int main(){
  int H,A;
  cin >> H >> N;
  int A[N];
  for(int i = 0;i < N;i++)
    cin >> A[i];
  for(int i = 0;i < N;i++){
      H -= A[N];
  }
  if(H <= 0)
  cout << "Yes" << endl;
  else{
      cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'N' was not declared in this scope
    5 |   cin >> H >> N;
      |               ^
a.cc:8:13: error: invalid types 'int[int]' for array subscript
    8 |     cin >> A[i];
      |             ^
Language: C++

#include<iostream>
using namespace std;

int a[1000000];
int main(){
  
  int h, n;
  int sum = 0;
  for(int i = 0; i < n; i++){
  	cin >> a[i];
    sum += s[i];
  }
  
  if(sum >= n) cout <<"Yes"<<endl;
  else cout << "No" << endl;
  
 return 0; 
}

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

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

long long INF = 1e18;

int main(){
    int h,n;
   cin>>h>>n;
   int a[n+100];
   int sum = 0;
   for(int i=0; i<n;i++){
       cin>>a[i];
       sum+=a[i];

   }

   if(sum < h){
       cout<<no<<endl;
   }else{
       cout<<yes<<endl;
   }
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: 'no' was not declared in this scope; did you mean 'n'?
   18 |        cout<<no<<endl;
      |              ^~
      |              n
a.cc:20:14: error: 'yes' was not declared in this scope
   20 |        cout<<yes<<endl;
      |              ^~~
a.cc:22:14: error: expected '}' at end of input
   22 |     return 0;
      |              ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: Java

import java.util.*;

public class B {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        long h = sc.nextLong();
        int n = sc.nextInt();
        long s = 0;
        for(int i = 0; i < n; ++i) {
            s += sc.nextLong();
        }
        String ans = (s >= h) ? "Yes" : "No";
        System.out.println(ans);
    }
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using P =pair<int,int>;
int main(){
  ll a,n;
  cin>>a>>n;
  ll s=0;
  for(ll i=0;i<n;i++){
    ll b;
    cin>>b;
    s+=b;
  }
  if(a>b)cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 'b' was not declared in this scope
   14 |   if(a>b)cout<<"No"<<endl;
      |        ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int main()
{
  
ll h,a;
cin>>h>>n;
ll a[n];
for(ll i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
if(2*a[n-1]>=h)
cout<<"Yes"<<endl;
else cout<<"No"<<endl;

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'n' was not declared in this scope
    9 | cin>>h>>n;
      |         ^
a.cc:12:7: error: invalid types 'long long int[long long int]' for array subscript
   12 | cin>>a[i];
      |       ^
Language: C++

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

int n, b;
int x[100005];

int main() {
	cin >> n >> b;
	for (int i = 1; i <= n; i++) cin >> x[i];
	sort(x + 1, x + n + 1, greater<int> );
	int tot = 0;
	for (int i = 1; i <= b; i++) tot += x[i];
	if (tot >= a) puts("Yes");
	else puts("No");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:45: error: expected primary-expression before ')' token
   10 |         sort(x + 1, x + n + 1, greater<int> );
      |                                             ^
a.cc:13:20: error: 'a' was not declared in this scope
   13 |         if (tot >= a) puts("Yes");
      |                    ^
Language: C++

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
	ll h,n,x=0,y;
	cin>>h>>n;
	for(int a=0;a<n;a++)
	{
		cin>>y;
		x=x+y;	
	}
	if(x>=h)
	cout<<"Yes";
	else 
	cout<<"No"
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: expected ';' before 'return'
   16 |         cout<<"No"
      |                   ^
      |                   ;
   17 |         return 0;
      |         ~~~~~~
Language: C++

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


int main(){
  long long h,n;
  long long a[n],b=0;
  cin>>h,n;
  for(int i=0;i<n;i++){
    cin>>a[i];
    b+=a[i]
  }
  if(b>=h){
    
    cout<<"Yes";
  }else{
    
  cout<<"No";
  }


  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main () {
  int N, N;
  cin >> H >> N;
  long sum = 0, a;
  for(int i = 0; i < N; i++){
    cin >> a;
    sum += a;
  }
  if(sum < H)cout << "No" << endl;
  else cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: redeclaration of 'int N'
    4 |   int N, N;
      |          ^
a.cc:4:7: note: 'int N' previously declared here
    4 |   int N, N;
      |       ^
a.cc:5:10: error: 'H' was not declared in this scope
    5 |   cin >> H >> N;
      |          ^
Language: C++

hp, _x = gets.split.map(&:to_i)
sum = gets.split.map(&:to_i).inject(:+)

puts hp > sum ? 'No' : 'Yes'

Compiler output:
a.cc:4:17: warning: multi-character character constant [-Wmultichar]
    4 | puts hp > sum ? 'No' : 'Yes'
      |                 ^~~~
a.cc:4:24: warning: multi-character character constant [-Wmultichar]
    4 | puts hp > sum ? 'No' : 'Yes'
      |                        ^~~~~
a.cc:1:1: error: 'hp' does not name a type
    1 | hp, _x = gets.split.map(&:to_i)
      | ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,s=0;
int main(){
  scanf("%d%d",&n,&m);
  int x;
  for(int i=1;i<=m;i++){
    scanf("%d",&x);
    s+=x;
  }
  if(s>=n) printf("Yes\n");
  else printf("No\n");

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected '}' at end of input
   12 |   else printf("No\n");
      |                       ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

H, N = map(int, input().split())
A = map(int, input().split())
if sum(A) >= H:
  print('Yes')
else:
  print('No')


Compiler output:
a.cc:4:9: warning: multi-character character constant [-Wmultichar]
    4 |   print('Yes')
      |         ^~~~~
a.cc:6:9: warning: multi-character character constant [-Wmultichar]
    6 |   print('No')
      |         ^~~~
a.cc:1:1: error: 'H' does not name a type
    1 | H, N = map(int, input().split())
      | ^
Language: C++


#include <iostream>
#include <cstring>
#include <fstream>
#include <vector>
#include <algorithm>
#include <string>
#include <limits>
#include <map>
#include <numeric>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <stack>

typedef long long li;
using namespace std;

li max(li a, li b) {
    return a > b ? a : b;
}

li max(li a, li b, li c) {
    return max(a, max(b, c));
}

li max(li a, li b, li c, li d) {
    return max(a, max(b, max(c, d)));
}

li max(li a, li b, li c, li d, li e) {
    return max(a, max(b, max(c, max(d, e))));
}


li pow_mod(li n, li e, li mod)
{
    li r = 1;
    
    while(e > 0)
    {
        if(e & 1)
            r *= n;
            r %= mod;
        
        n *= n;
        n %= mod;
        e >>= 1;
    }
    
    return r;
}

double solve(int n, unordered_map<int, double> & m) {
    double maxV = 0.0;
    
    if (m.count(n)) return m[n];
    if (n == 0) return 0.0;
    
    for (int i = 1; i <= n; i++) {
        maxV = max(maxV, solve(n - i, m)+ (double)i / (double)n);
    }
    
    return m[n] = maxV;
}

int solve(vector<int> & v, int n) {
    if (n < 0) return 0;
    vector<int> a, b;
    int minV = 0;
    
    for (int num: v) {
        if (num & (1 << n)) a.push_back(num);
        else b.push_back(num);
    }
    
    
    if (a.size() && b.size()) minV += (1 << n);
    
    if (a.size() && b.size()) minV += min(solve(a, n - 1), solve(b, n - 1));
    else if (a.size()) minV += solve(a, n - 1);
    else if (b.size()) minV += solve(b, n - 1);
    
    return minV;
    
}

int main() {
//    ifstream fin("read.txt");
    int h, n, num;
    
    cin >> h >> n;

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

    if (h <= 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}




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

#include<iostream>
using namespace std;
int sum;
int main(void)
{
    int mon,n;
    cin >> mon >> n;
    while(n--)
    {
        int temp;
        cin >> temp;
        sum+=temp;
    }
    if(temp>=mon)
        cout<< "Yes";
    else cout << "No";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 'temp' was not declared in this scope; did you mean 'tm'?
   14 |     if(temp>=mon)
      |        ^~~~
      |        tm
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
int main(){
  int H,N;
  cin>>H>>N;
  int sou = 0;
  for(int i = 0;i<N;i++){
    int temp;
    cin>>temp;
    sou += temp;
  }
  if(H>temp){
    cout << "No" << endl;
  }
  else{
    cout << "Yes" << endl;
  }
  retrn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 'temp' was not declared in this scope; did you mean 'tm'?
   15 |   if(H>temp){
      |        ^~~~
      |        tm
a.cc:21:3: error: 'retrn' was not declared in this scope
   21 |   retrn 0;
      |   ^~~~~
Language: C++

// 失敗するからこそ そこから立ち向かって行く強さがあって そんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#include<bits/stdc++.h>
using namespace std;

#if defined(DAIJOBU)
#include "/home/pavan/debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif

#define fi first
#define se second
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef long double ld;

int main(){
	FIO
	
	int h, n;cin >> h >>  n;
	forn(i, n){cin >> x; s+= x;}
	if(s>=x )cout << "Yes";
	else cout << "No";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:27: error: 'x' was not declared in this scope
   36 |         forn(i, n){cin >> x; s+= x;}
      |                           ^
a.cc:36:30: error: 's' was not declared in this scope
   36 |         forn(i, n){cin >> x; s+= x;}
      |                              ^
a.cc:37:12: error: 's' was not declared in this scope
   37 |         if(s>=x )cout << "Yes";
      |            ^
a.cc:37:15: error: 'x' was not declared in this scope
   37 |         if(s>=x )cout << "Yes";
      |               ^
Language: C++

#pragma GCC optimize("Ofast")
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//typedef tree < int , null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> TREE;
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define pss pair<short,short>
#define pld pair<long double,long double >
#define ld long double
#define piii  pair<pii,int>
#define vii vector<pair<int,int> >
#define st first
#define nd second
#define pll pair<ll,ll>
#define speed ios::sync_with_stdio(false);cin.tie();cout.tie();
#define M_PI 3.14159265358979323846
//#define int long long
const int mod=1000000007;
//const int mod=1009;
//const int mod=998244353;
const int inf=1000000009;
const long long INF=1000000000000000009;
const long long big=1000000000000000;
const long double eps=0.000000000000000000001;
using namespace std;
int main()
{
    speed
    int h,n;
    cin>>h>>n;
    int suma=0;
    for(int i=1;i<=n;i++)
    {
        int a;
        cin>>a;
        suma+=a;
    }
    if(suma>=a)
        cout<<"Yes";
    else
        cout<<"No";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:14: error: 'a' was not declared in this scope
   47 |     if(suma>=a)
      |              ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back

typedef long long ll;

const ll MOD = 1e9+7;
const ll INF = 1e9+5;

int main() {
	int a, b, c, d, n, m;
	string s, t, r;
	cin >> n >> m;
  int sum = 0;
	for (int i=0 ; i<m ; i++) {
      int x;
      cin >>x;
      sum += x;
    }
  	if (x >= n) cout <<"Yes\n";
  	else cout <<"No\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 'first' was not declared in this scope
    5 | #define x first
      |           ^~~~~
a.cc:25:13: note: in expansion of macro 'x'
   25 |         if (x >= n) cout <<"Yes\n";
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(void){
  int n,k; cin>>n>>k;
  vector<long long> h(n);
  for(auto& i:h) cin>>i;
  sort(h.begin(),h.end());
  long long res=0;
  for(auto& i:(n-k)) res+=i;
  cout<<res;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'begin' was not declared in this scope
    9 |   for(auto& i:(n-k)) res+=i;
      |                   ^
a.cc:9:19: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:9:19: error: 'end' was not declared in this scope
    9 |   for(auto& i:(n-k)) res+=i;
      |                   ^
a.cc:9:19: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll =long long int ;
// Its  a Greedy Problem and we just going to k bigest elements as 0 and sum the rest;
int main()
{
  ll n,k,sum=0;
  cin>>n>>k;
  ll arr[n];
  for(int i=0;i<n;i++)
  {
    ll x;
    cin>>x;
    sum+=x;
    arr[i]=x;
  }
  
  sort(arr,arr+n);
  
  if(k==0)
    cout<<0<<endl;
  else
  {
    if(n-k>0)
    {
      ll sum1=0;
      for(int j=0;j<n-k;j++)
      {
        sum1+=arr[i];
      }
      cout<<sum1<<endl;
    }
    else
    {
      cout<<0<<endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:19: error: 'i' was not declared in this scope
   29 |         sum1+=arr[i];
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,k,;
  cin>>n>>k;
  int arr[n];
  while(n-->0){
    cin>>arr[n-1];
  }
  sort(arr,arr+n);
  int ans =0;
  while(k<n){
    ans+=arr[k++];
  }
  cout<<ans<<"\n";
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:4:11: error: expected unqualified-id before ';' token
    4 |   int n,k,;
      |           ^
Language: C++

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

int main(){
    int n,k; std::cin >> n >> k;
    std::vector<int> h(n);
    rep(i,n) std::cin >> h[i];
    std::sort(h.begin(),h.end(),std::greater<int>());

    long ans=0;
    for(int i=k; i<n; ++i)
        ans += h[i];
    std::cout << ans << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     rep(i,n) std::cin >> h[i];
      |         ^
a.cc:8:5: error: 'rep' was not declared in this scope
    8 |     rep(i,n) std::cin >> h[i];
      |     ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int inf{int(1e9)};
int main(void){
  int N, K;
  cin >> N >> K;
  vector <int> H(N);
  rep(i,N) cin >> H[i];
  sort(all(H);
  rep(i,K) H.pop_back();
  ll ans = 0;
  rep(i,H.size()) ans += H[i];
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: expected ')' before ';' token
   13 |   sort(all(H);
      |       ~      ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    int t=1;
    // cin>>t;
    while(t--)
    {
        int h,n;
        cin>>n>>h;
        vector<ll>a(n);
        ll sum=0;
        for(int i=0;i<n;i++) 
        {
            cin>>a[i];
            // sum+=a[i];
        }
        sort(a.begin(),a.end());
        int sum=0;
        for(int i=0;i<min(n,n-k);i++)
        sum+=a[i];
        cout<<sum;
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: conflicting declaration 'int sum'
   20 |         int sum=0;
      |             ^~~
a.cc:13:12: note: previous declaration as 'long long int sum'
   13 |         ll sum=0;
      |            ^~~
a.cc:21:31: error: 'k' was not declared in this scope
   21 |         for(int i=0;i<min(n,n-k);i++)
      |                               ^
Language: C++

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

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | int main()
      | ~~~
Language: C++

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

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

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


int main(){
	int h,k,d;
	cin>>h>>k;
	int a[h];
	unsigned int c=0;
	for(int i =0 ; i<h ; i++){
		cin>>d;
		a[i]=d;
		}
    sort(a,a+h);
    for(int j=0;j<h-k;j++){
    	c+=a[j];
	}
	if(k>=h){
		cout<<"0";
	}
	else
	cout<<c3 
return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: 'c3' was not declared in this scope; did you mean 'c'?
   23 |         cout<<c3
      |               ^~
      |               c
Language: Java

import java.util.*;
public class Program{
	public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	long ans = 0;
      	for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    }
}


Compiler output:
Main.java:2: error: class Program is public, should be declared in a file named Program.java
public class Program{
       ^
1 error
Language: Java

import java.util.*;
public class Program{
	public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	int ans = 0;
      	for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    }
}


Compiler output:
Main.java:2: error: class Program is public, should be declared in a file named Program.java
public class Program{
       ^
1 error
Language: Java

import java.util.*;
public class Program{
	public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	int ans = 0;
      	for (int i = 1 ; i <= max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    }
}


Compiler output:
Main.java:2: error: class Program is public, should be declared in a file named Program.java
public class Program{
       ^
Main.java:12: error: cannot find symbol
      	for (int i = 1 ; i <= max(0,n-t) ; i++)
      	                      ^
  symbol:   method max(int,int)
  location: class Program
2 errors
Language: Java

import java.util.*;
public class Program{
	public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	n = scan.nextInt();
      	t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	int ans = 0;
      	for (int i = 1 ; i <= max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    }
}

Compiler output:
Main.java:2: error: class Program is public, should be declared in a file named Program.java
public class Program{
       ^
Main.java:5: error: cannot find symbol
      	n = scan.nextInt();
      	^
  symbol:   variable n
  location: class Program
Main.java:6: error: cannot find symbol
      	t = scan.nextInt();
      	^
  symbol:   variable t
  location: class Program
Main.java:7: error: cannot find symbol
		int [] ar = new int[n + 1];
		                    ^
  symbol:   variable n
  location: class Program
Main.java:8: error: cannot find symbol
      	for (int i = 1 ; i <= n ; i++)
      	                      ^
  symbol:   variable n
  location: class Program
Main.java:12: error: cannot find symbol
      	for (int i = 1 ; i <= max(0,n-t) ; i++)
      	                            ^
  symbol:   variable n
  location: class Program
Main.java:12: error: cannot find symbol
      	for (int i = 1 ; i <= max(0,n-t) ; i++)
      	                              ^
  symbol:   variable t
  location: class Program
7 errors
Language: C++

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


int main(){
    int n,k;
    cin >> n >> k;
    vector<int> h(n);
    rep(i,n) cin >> h[i];
    sort(h.rbegin(),h.rend());
    if(n <= k){
        ans = 0;
    }
    else{
        for(int i=n-1; i>k; i--){
            ans += h[i];
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         ans = 0;
      |         ^~~
      |         abs
a.cc:18:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |             ans += h[i];
      |             ^~~
      |             abs
a.cc:21:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

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


int main(){
    int n,k;
    cin >> n >> k;
    vector<int> h(n);
    rep(i,n) cin >> h[i];
    sort(h.rbegin(),h.rend());
    if(n <= k){
        ans = 0;
    }
    else{
        for(int i=n-1; i>k; i++){
            ans += h[i];
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         ans = 0;
      |         ^~~
      |         abs
a.cc:18:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |             ans += h[i];
      |             ^~~
      |             abs
a.cc:21:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

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

int main(){
    long long N, K;
    long long H_tmp;
    long long sum = 0;
    long long sum_tgt = 0;

    std::cin >> N >> K;
    if(K >= N){
        goto finish;
    }
    vector<long long> mons_list(N);

    for(long long i = 0; i < N; i++){
        std::cin >> H_tmp;
        sum = sum + H_tmp;
        mons_list[i] = H_tmp;
    }

    std::sort(mons_list.begin(), mons_list.end(), std::greater<long long>());
    for(long long i = 0; i < K; i++){
        sum_tgt = sum_tgt + mons_list[i];
    }
    sum = sum - sum_tgt;
    
    finish:
    std::cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: jump to label 'finish'
   30 |     finish:
      |     ^~~~~~
a.cc:14:14: note:   from here
   14 |         goto finish;
      |              ^~~~~~
a.cc:16:23: note:   crosses initialization of 'std::vector<long long int> mons_list'
   16 |     vector<long long> mons_list(N);
      |                       ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
  ll h,n;
  cin>>h>>n;
  vector<ll> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a.rbegin(),a.rend());
  ll ans=0;
  for(int i=0;i<n;i++){
    if(i>=k){
      ans+=a[i];
    }
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'k' was not declared in this scope
   14 |     if(i>=k){
      |           ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: expected ';' before 'cout'
   21 |       Ans += vec.at(i)
      |                       ^
      |                       ;
   22 |     cout << Ans << endl;
      |     ~~~~
Language: C++

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

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


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

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

int mian(){
  int N, K ; 
  vector<int64_t> H(N) ; 
  int64_t cnt = 0 ; 
  
  for(int i = 0 ; i < N ; i++){
    cin >> H.at(i) ; 
  }
  sort(H.begin() , H.end()) ; 
  reverse(H.begin() , H.end()) ; 
  
  for(int64_t i = K+1 ; i < N ; i++ ){
    cnt = cnt + H.at(i) ; 
  }
  
  cout << cnt << endl ; 
}

Compiler output:
a.cc: In function 'int mian()':
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

typedef long long ll;
#define rep(i,x) for(int i=0;i<x;i++)
#define put(ans)    cout << ans << endl;

double kaijyo(int n){
    int k(1);
    for(int i=n;i>0;i--){
        k *= i;
    }

    return k;
}

double distance(int x[],int y[],int i,int j){
    int dx = (x[i] - x[j]) * (x[i] - x[j]);
    int dy = (y[i] - y[j]) * (y[i] - y[j]);
    return sqrt(dx+dy);
}

int main(){
    int n,k;
    cin >> n >> k;
    vector<ll> v(n);
    rep(i,n){
        cin >> v[i];
    }
    sort(v.begin(),v.end(),greater<ll>());

    rep(i,min(k,))    v[i]=0;

    ll ans(0);
    rep(i,n){
        ans += v[i];
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:17: error: expected primary-expression before ')' token
   32 |     rep(i,min(k,))    v[i]=0;
      |                 ^
a.cc:5:32: note: in definition of macro 'rep'
    5 | #define rep(i,x) for(int i=0;i<x;i++)
      |                                ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define rep(i,n) for(i=0;i<n;i++)
#define PI 3.14159265358979323846264338327950L
  /* 配列の要素を交換する */
void Swap(long int x[ ], int i, int j)
{
    int temp;

    temp = x[i];
    x[i] = x[j];
    x[j] = temp;
}
void Qdsort(long int x[ ], int left, int right)
{
    int i, j;
    int pivot;

    i = left;                      /* ソートする配列の一番小さい要素の添字 */
    j = right;                     /* ソートする配列の一番大きい要素の添字 */

    pivot = x[(left + right) / 2]; /* 基準値を配列の中央付近にとる */

    while (1) {                    /* 無限ループ */

        while (x[i] > pivot)       /* pivot より小さい値が */
            i++;                   /* 出るまで i を増加させる */

        while (pivot > x[j])       /* pivot より大きい値が */
            j--;                   /*  出るまで j を減少させる */
        if (i >= j)                /* i >= j なら */
            break;                 /* 無限ループから抜ける */

        Swap(x, i, j);             /* x[i] と x[j]を交換 */
        i++;                       /* 次のデータ */
        j--;
    }
    if (left < i - 1)              /* 基準値の左に 2 以上要素があれば */
        QSort(x, left, i - 1);     /* 左の配列を Q ソートする */
    if (j + 1 <  right)            /* 基準値の右に 2 以上要素があれば */
        QSort(x, j + 1, right);    /* 右の配列を Q ソートする */
}
int main(){
    int n,k,i;
    scanf("%d%d",&n,&k);
    long int h[n],sum=0;
    rep(i,n){
        scanf("%ld",&h[i]);
        sum+=h[i];
    }
    if(n<=k){
        printf("0");
    }else{
        Qdsort(h,0,n-1);
        rep(i,k) sum=sum-h[i];
        printf("%ld",sum);
    }
    return 0;
}

Compiler output:
main.c: In function 'Qdsort':
main.c:40:9: error: implicit declaration of function 'QSort'; did you mean 'qsort'? [-Wimplicit-function-declaration]
   40 |         QSort(x, left, i - 1);     /* 左の配列を Q ソートする */
      |         ^~~~~
      |         qsort