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

int main(){
 int N,M;
 cin >> N >> M;
 int S =0;
 vector<int> a(N);  
for(int i=0; i<N; i++){
    cin >> a[i] ;
    S += a[i];
}
sort(a.begin(), a.end());
reverse(a.begin(), a.end());
S /= 4;
S /= M;
if(a[M-1] > S){
 cout << "Yes" << endl;
}
else {
  cout << "No" << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:2: error: 'cin' was not declared in this scope
    3 |  cin >> N >> M;
      |  ^~~
a.cc:5:2: error: 'vector' was not declared in this scope
    5 |  vector<int> a(N);
      |  ^~~~~~
a.cc:5:9: error: expected primary-expression before 'int'
    5 |  vector<int> a(N);
      |         ^~~
a.cc:7:12: error: 'a' was not declared in this scope
    7 |     cin >> a[i] ;
      |            ^
a.cc:10:6: error: 'a' was not declared in this scope
   10 | sort(a.begin(), a.end());
      |      ^
a.cc:10:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 | sort(a.begin(), a.end());
      | ^~~~
      | short
a.cc:11:1: error: 'reverse' was not declared in this scope
   11 | reverse(a.begin(), a.end());
      | ^~~~~~~
a.cc:15:2: error: 'cout' was not declared in this scope
   15 |  cout << "Yes" << endl;
      |  ^~~~
a.cc:15:19: error: 'endl' was not declared in this scope
   15 |  cout << "Yes" << endl;
      |                   ^~~~
a.cc:18:3: error: 'cout' was not declared in this scope
   18 |   cout << "No" << endl;
      |   ^~~~
a.cc:18:19: error: 'endl' was not declared in this scope
   18 |   cout << "No" << endl;
      |                   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n,m,s=0;
  int a[1000000];
  cin>>n>>m;
  for(int i=0;i<n;i++){
    cin>>a[i];
  s+=a[i];
  }
    sort(a,a+n,greater<int>());
  for(int i=0;i<m;i++){
    if((double)(s/(4*m)))>a[i]){
      cout<<"No\n";
      return 0;
    }
  }
  cout<<"Yes\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: expected primary-expression before '>' token
   14 |     if((double)(s/(4*m)))>a[i]){
      |                          ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define repi(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define SIZE_OF_ARRAY(array)    (sizeof(array)/sizeof(array[0]))
typedef long long ll;
using namespace std;

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

  int n,m;
  cin >> n >> m;
  int a[n];
  double sum=0;
  rep(i,n) {
    cin >> a[i];
    sum+=a[i];
  }
  int ans=0;
  double sum=sum/(4*m)
  rep(i,n){
    if(a[i]>=sum){
	ans++;
      }
  }
  if(ans>=m){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:21:10: error: redeclaration of 'double sum'
   21 |   double sum=sum/(4*m)
      |          ^~~
a.cc:15:10: note: 'double sum' previously declared here
   15 |   double sum=0;
      |          ^~~
a.cc:22:7: error: 'i' was not declared in this scope
   22 |   rep(i,n){
      |       ^
a.cc:2:32: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
      |                                ^
Language: C++

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

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

  vector<int> A(N);

  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  
  int sum = 0;
  
  for (int i = 0; i < N; i++) {
    sum = sum + A.at(i);
  }
  
  int count = 0;
  
  for (int i = 0; i < N; i++) {
    if (A.at(i) >= (sum / 4M)) {
      count++;
    }
  }
  
  if (count >= M) {
    cout << "Yes" <<endl;
  } else {
    cout << "No" <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: unable to find numeric literal operator 'operator""M'
   23 |     if (A.at(i) >= (sum / 4M)) {
      |                           ^~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
int main() {
    ll n, m, sum;
    sum = 0;
    cin >> n >> m;
    ll a[n];
    rep(i, n) cin >> a[i];
    rep(i, n) sum += a[i];
    sort(a, a + n);
    if (a[n - 1 - m] < sum / (4 * m)) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << 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(a, a + n);
      |     ^~~~
      |     short
Language: C++

using namespace std;
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main () {
  long long N;
  cin>>N;
  long long M;
  cin>>M;
  vector<int> v(N);
  long long ans;
  ans=0;
  for (int i = 0; i < N; i++) {
  cin >> v.at(i);
    long long d;
    d=std::accumulate(v.begin(), v.end(), 0);
    double f;
    f=d/(4*M);
    if(v.at(i)>f){
      ans++;
    }
  }
  if(ans>=M){
    cout<<"Yes"<<endl;
  }
  else {
cout<<"No"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> v(N);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> v(N);
      |          ^~~
a.cc:13:10: error: 'v' was not declared in this scope
   13 |   cin >> v.at(i);
      |          ^
a.cc:15:12: error: 'accumulate' is not a member of 'std'
   15 |     d=std::accumulate(v.begin(), v.end(), 0);
      |            ^~~~~~~~~~
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<<"Yes"<<endl;
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:18: error: 'endl' was not declared in this scope
   23 |     cout<<"Yes"<<endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:26:1: error: 'cout' was not declared in this scope
   26 | cout<<"No"<<endl;
      | ^~~~
a.cc:26:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:13: error: 'endl' was not declared in this scope
   26 | cout<<"No"<<endl;
      |             ^~~~
a.cc:26:13: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n,m,s=0;
  int a[1000000];
  cin>>n>>m;
  for(int i=0;i<n;i++){
    cin>>a[i];
  s+=a[i];
  }
    sort(a,a+n,greater<int>());
  for(int i=0;i<m;i++){
    if((double)(s*(1/(4*m))>a[i]){
      cout<<"No\n";
      return 0;
    }
  }
  cout<<"Yes\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:34: error: expected ')' before '{' token
   14 |     if((double)(s*(1/(4*m))>a[i]){
      |       ~                          ^
      |                                  )
a.cc:18:3: error: expected primary-expression before '}' token
   18 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i, n) ;for (int i = 0;i < (int)(n);i++)
#define rep2(i, s, n) ;for (int i = s; i < (int)(n);i++)
#define ALL(vec)  (vec).begin(),(vec).end()
#define pi 3.1415926535897932384626433832795
#define MAX_INF 9223372036854775807
#define MIN_INF (922337203685477587+1)
#define sosuu 1000000007

int main() {
  int N, M;
  cin >> N >> M;
  
  int A[N];
  int sum=0;
  int ans=0;
  rep(i, N){
  cin >> A[i];
      sum+=A[i];
      }
  rep(i, N){
    if(A[i]>=sum/(4*M)&&sum%(4*M)==0)
       ans++;
    if(A[i]>=a+sum/(4*M&&)sum%(4*M)!=0)
       ans++;
      }
  if(ans>=M)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: 'a' was not declared in this scope
   26 |     if(A[i]>=a+sum/(4*M&&)sum%(4*M)!=0)
      |              ^
a.cc:26:26: error: expected primary-expression before ')' token
   26 |     if(A[i]>=a+sum/(4*M&&)sum%(4*M)!=0)
      |                          ^
a.cc:26:27: error: expected ')' before 'sum'
   26 |     if(A[i]>=a+sum/(4*M&&)sum%(4*M)!=0)
      |       ~                   ^~~
      |                           )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
int main()
{
    int n, m;
    cin >> n;
    cin >> m;
    int a[n];
    int sum = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        sum += a[i];
    }
    int x = 0, Count = 0;
    float k = sum / (4 * m);
    x = (int)k;
    if (k - (int)k >= 0.5)
        x++;
    for (int i = 0; i < n; i++)
    {
        if (a[i] >= x)
            Count++;
    }
    if (Count >= m)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

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

#include <bits/stdc++.h>
 using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
 int main(){
   int a,b,c,e;
   cin>>a>>b;
   vector<int> d(a);
   c=0;
   rep(i,a){
     cin>>a.at(i);
     c+=a.at(i);
   }
   sort(d.begin(),d.end());
   reverse(d.begin(),d.end());
   e=0;
    rep(i,b){
     if(a.at(i)<c/(4*b)){
       e++;
       break;
     }
    }
   if(e==0){
     cout<<"Yes"<<endl;
   }
   else{
     cout<<"No"<<endl;
   }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: request for member 'at' in 'a', which is of non-class type 'int'
   10 |      cin>>a.at(i);
      |             ^~
a.cc:11:11: error: request for member 'at' in 'a', which is of non-class type 'int'
   11 |      c+=a.at(i);
      |           ^~
a.cc:17:11: error: request for member 'at' in 'a', which is of non-class type 'int'
   17 |      if(a.at(i)<c/(4*b)){
      |           ^~
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

void Main()
{
	int N;
    int M;
  
  	cin >> N;
    cin >> M;
  
    int A[N];
  
    int count = 0;
  
    for(int i = 0; i < N; i++){
      cin >> A[i];
    }
  
    for(int i = 0; i < M; i++){
      if(A[i] >= (1 / (4 * M))){
        count++;
      }
    }
  
  if(count == M)
    printf("Yes");
  
  else
    printf("No");
  
	
	
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
import java.io.*;
public class solution {
    public static void main(String[] args) throws Exception{
        
        Scanner sc = new Scanner(System.in);
        int tests;
        int n;
        int m;
      int l;
      int sum=0;
        
        int[] A = new int[n];
       
        n = sc.nextInt();
      m = sc.nextInt();
      for(int i=0;i<n;i++){
        A[i]= sc.nextInt();
         sum = sum+A[i];
      }
      int count=0;
      for(int i=0;i<n;i++){
       if(A[i] >= sum/(4*m)){
         count++;
       }
        
      }
          if(count>=m){
            System.out.println("Yes");
          }
          else{
             System.out.println("No");
          }
       
       
        
  }
}
        

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

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> vote(n);
    int total = 0;
    for (int i = 0; i < n; i++) {
        int num;
        cin >> num;
        total += num;
        vote.at(i) = num;
    }
    sort(vote.begin(), vote.end(), greater<int>());
    int x = total / 4 / m;
    if (vote.at(m - 1) >= x) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n >> m;
      |     ^~~
a.cc:4:5: error: 'vector' was not declared in this scope
    4 |     vector<int> vote(n);
      |     ^~~~~~
a.cc:4:12: error: expected primary-expression before 'int'
    4 |     vector<int> vote(n);
      |            ^~~
a.cc:10:9: error: 'vote' was not declared in this scope
   10 |         vote.at(i) = num;
      |         ^~~~
a.cc:12:10: error: 'vote' was not declared in this scope
   12 |     sort(vote.begin(), vote.end(), greater<int>());
      |          ^~~~
a.cc:12:36: error: 'greater' was not declared in this scope
   12 |     sort(vote.begin(), vote.end(), greater<int>());
      |                                    ^~~~~~~
a.cc:12:44: error: expected primary-expression before 'int'
   12 |     sort(vote.begin(), vote.end(), greater<int>());
      |                                            ^~~
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |     sort(vote.begin(), vote.end(), greater<int>());
      |     ^~~~
      |     short
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:15:26: error: 'endl' was not declared in this scope
   15 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << "No" << endl;
      |         ^~~~
a.cc:17:25: error: 'endl' was not declared in this scope
   17 |         cout << "No" << endl;
      |                         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int array_sum_from_i(vector<int> &data, int i) {
  // ベースケース
  if (i == data.size()) {
    return 0;  // 対象の要素がないので総和は0
  }
  // 再帰ステップ
  int s = array_sum_from_i(data, i + 1);  // i+1番目以降の要素の総和
  return data.at(i) + s;  // 「i番目以降の要素の総和」=「i番目の要素」+ s
}
 
// dataの全ての要素の総和を計算する
int array_sum(vector<int> &data) {
  return array_sum_from_i(data, 0);
}
int main() {
  int n,m;
    cin>>n>>m;
  vector <int>a(n);
  for (int i = 0; i < n; i++) {
    cin>>a.at(i);
  }
  sort(vec.begin(), vec.end());
  if (a.at(m-1)>=array_sum(a)/4m){
    cout<<"Yes"<<endl;
    else {
      cout<<"No"<<endl;
    }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:8: error: 'vec' was not declared in this scope
   24 |   sort(vec.begin(), vec.end());
      |        ^~~
a.cc:25:31: error: unable to find numeric literal operator 'operator""m'
   25 |   if (a.at(m-1)>=array_sum(a)/4m){
      |                               ^~
a.cc:27:5: error: expected '}' before 'else'
   27 |     else {
      |     ^~~~
a.cc:25:34: note: to match this '{'
   25 |   if (a.at(m-1)>=array_sum(a)/4m){
      |                                  ^
Language: C++

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

int main() {
	int n, m, a[100],c=0,all=0;
	cin >> n, m;
	for (int i = 0; i < n; i++){
		cin>>a[i];
		all+=a[i];
	}
	for (int i = 0; i < n; i++){
		if(a[i]>=all/4.0/m)c++;
	}
	if (c >= m)cout << "Yes";
	else cot << "No";
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: 'cot' was not declared in this scope; did you mean 'cos'?
   16 |         else cot << "No";
      |              ^~~
      |              cos
Language: Java

import java.util.Scanner;


public class Main162 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();
		int[] A = new int[N];
		int minMax = 0;
		int sum = 0;

		for(int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
			sum = sum + A[i];
		}

		quick_sort(A, 0, N-1);

		if(A[N-M] > (sum / (4 * 2))) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}

	static void quick_sort(int[] d, int left, int right) {
        if (left>=right) {
            return;
        }
        int p = d[(left+right)/2];
        int l = left, r = right, tmp;
        while(l<=r) {
            while(d[l] < p) { l++; }
            while(d[r] > p) { r--; }
            if (l<=r) {
                tmp = d[l]; d[l] = d[r]; d[r] = tmp;
                l++; r--;
            }
        }
        quick_sort(d, left, r);  // ピボットより左側をクイックソート
        quick_sort(d, l, right); // ピボットより右側をクイックソート
    }

}

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

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define YY cout << "Yes" << endl
#define NN cout << "No" << endl
#define pint pair<int,int>
#define vi(v) rep(i,v.size())cin >> v[i]
#define vc(v) rep(i,v.size())cout << v[i] << endl
#define ni(n) cin >> n
#define nc(n) cout << n << endl
const int INF = 1000000007;
const long double EPS = 1e-15;
const long double PI = acos(-1);
typedef long long ll;
using namespace std;
using Graph = vector<vector<int>>;
using Graph_weighted = vector<vector<pair<int,int>>>;
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; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
int solve(){
  int n,m;
  cin >> n >> m;
  vector<int>cnt(n);
  ll sum = 0;
  rep(i,n){
    int tmp;
    cin >> tmp;
    cnt[i] += tmp;
    sum += tmp;
  }
  int cn = 0;
  rep(i,n){
    if(cnt[i] >= (((double)sum * (1.0 / (4.0 * m))))cn++;
  }
  if(cn >= m)cout << "Yes" << endl;
  else cout << "No" << endl;
  cout << cn << endl;
  return 0;
}
int main(){
  // ios::sync_with_stdio(false);cin.tie(nullptr);
  // cout << fixed;cout << setprecision(16);
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'int solve()':
a.cc:38:53: error: expected ';' before 'cn'
   38 |     if(cnt[i] >= (((double)sum * (1.0 / (4.0 * m))))cn++;
      |                                                     ^~
      |                                                     ;
a.cc:39:3: error: expected primary-expression before '}' token
   39 |   }
      |   ^
a.cc:38:58: error: expected ')' before '}' token
   38 |     if(cnt[i] >= (((double)sum * (1.0 / (4.0 * m))))cn++;
      |       ~                                                  ^
      |                                                          )
   39 |   }
      |   ~                                                       
a.cc:39:3: error: expected primary-expression before '}' token
   39 |   }
      |   ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n,m;
  cin>>n>>m;
  int sum=0;
  vector<int> v;
  for(int i=0;i<n;i++)
  {
    int x;cin>>x;v.push_back(x);
    sum+=x;
  }
  sum=sum/4*m;
  for(int i=0;i<n;i++)
  {
    if(v[i]>=sum)
    {
      count++;
    }
  }
  if(count>=m)
  {cout<<"Yes";}else{cout<<"No";}
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> v;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> v;
      |          ^~~
a.cc:11:18: error: 'v' was not declared in this scope
   11 |     int x;cin>>x;v.push_back(x);
      |                  ^
a.cc:17:8: error: 'v' was not declared in this scope
   17 |     if(v[i]>=sum)
      |        ^
a.cc:19:7: error: 'count' was not declared in this scope
   19 |       count++;
      |       ^~~~~
a.cc:22:6: error: 'count' was not declared in this scope
   22 |   if(count>=m)
      |      ^~~~~
Language: C++

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

int main() {
  int N,M;
  cin>>N>>M;
  vector<int> A(N);
  for(int i=0; i<N; i++){
    cin>>A.at(i);
  }
  sort(A.begin(),A.end());
  reverse(A.begin(),A.end());
  int sum =0;
  for(int i=0; i<N; i++){
    sum += A.at(i);
  }
  if(sum%(4*M)==0){
    int ave =sum/(4*M) ;
  }
  else{
    int ave = sum/(4*M)+1;
  }
  bool ans = true;
  for(int i=0; i<M; i++){
    if(A.at(i)<=ave){
      ans = false;
    }
  }
  if(ans){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'ave' was not declared in this scope
   25 |     if(A.at(i)<=ave){
      |                 ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[100];
bool cmp(int x,int y)
{
	return x>y; 
}
int main()
{
	int n,m;cin>>n>>m;
	int s=0;
	for(int i=0;i<n;s+=a[i++])
		cin>>a[i];
	sort(a,a+n,cmp);
	if(a[m-1]<s/4m)	cout<<"No";
	else			cout<<"Yes";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: unable to find numeric literal operator 'operator""m'
   15 |         if(a[m-1]<s/4m) cout<<"No";
      |                     ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,ans=0,a[110],num=0;

bool cmp(int a,int b)
{
    return a>b;
}

int main() 
{   cin>>n>>m;
    for(int i=1;i<=n;++i)
        cin>>a[i],ans+=a[i];
    sort(a+1,a+1+n)
    if(a[m]*4*m<ans)
        cout<<"NO"<<endl;
    else
        cout<<"YES"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before 'if'
   14 |     sort(a+1,a+1+n)
      |                    ^
      |                    ;
   15 |     if(a[m]*4*m<ans)
      |     ~~              
a.cc:17:5: error: 'else' without a previous 'if'
   17 |     else
      |     ^~~~
Language: C++

#include<iostream>
#include<vector>
#define int double
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> arr(n, 0);
  int sum = 0;
  for(int i = 0; i < n; i++){
    cin >> arr[i];
    sum = sum+(arr[i]/(4*m));
  }
 
  int count = 0;
  for(int i = 0; i < n; i++){
  	if(arr[i] > sum){
      count++;
  	}
    if(count == m){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl; 
  return 0;
}

Compiler output:
a.cc:3:13: error: '::main' must return 'int'
    3 | #define int double
      |             ^~~~~~
a.cc:6:1: note: in expansion of macro 'int'
    6 | int main(){
      | ^~~
Language: Java

import java.util.*;
public class Main
{
  public static void main(String args[])
  {
    Scanner in=new Scanner(System.in);
    int N=in.nextInt();
    int M=in.nextInt();int A[]=new int [N];
    int i,p=0,m=0;
    for(i=0;i<N;i++)
    {
      A[i]=in.nextInt();
      p=p+A[i];
    }
    for(i=0;i<N;i++)
    {
      if(A[i]>=(p/(4*M)))
      {
        m++;
      }
    }
    if(m>=M)
      System.out.println("Yes")
      else
        System.out.println("No");
  }
}
      
    

Compiler output:
Main.java:23: error: ';' expected
      System.out.println("Yes")
                               ^
1 error
Language: C

#include <array>
#include <deque>
#include <forward_list>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <iterator>
#include <algorithm>
#include <cfenv>
#include <random>
#include <numeric>
#include <cmath>
#include <iosfwd>
#include <iostream>
#include <ios>
#include <streambuf>
#include <istream>
#include <ostream>
#include <iomanip>
#include <sstream>
#include <fstream>
using namespace std;

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


int main(){
    int N,M;
    int A[1000];
    int flg = 1;
    double sum=0;
    cin >> N >> M;
    for (int i = 0 ; i < N ; i++){
        cin >> A[i];
        sum += A[i];
    }
    sum /= (double)(4*M);
    qsort(A,N,sizeof(int),compare_int);
    for (int i = 0 ; i < M ; i++){
        if(sum > A[i]){
            flg--;
            break;
        }
    }
    if(flg){
        cout << "Yes";
    }else{
        cout << "No";
    }
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int M, N;
  cin >> M >> N;
  
  vector<int64_t> vec(N);
  int64_t sum = 0;
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
    sum = sum + vec.at(i);
  }
  
  int64_t count = 0;
  for (int i = 0; i < N; i++) {
    if (vec.at(i) > 1 / (4 * M)) {
      count++;
    }
  }
  
  string res = "No";
  if (M =< count) {
    res = "Yes"; 
  }
  
  cout << res << endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: expected primary-expression before '<' token
   24 |   if (M =< count) {
      |          ^
Language: C++

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

int main(){
int N,M,a;
  vector<int> A(N);
  a=0;
  cin>>N>>M;
  for(int i=0;i<N;i++){
cin>>A.at(i);
  }
  if(A.at(i)>=1/(4*M)){
    a++;
  }
  if(a>=M){
cout<<"Yes"<<endl;
  }
  else{
cout<<"No"<<endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'i' was not declared in this scope
   12 |   if(A.at(i)>=1/(4*M)){
      |           ^
Language: C++

#include <iostream>

bool judge(int m, int total, int a)
{
  return (a > total / 4 / m);
}

int main()
{
    int n,m,a;
    std::vector<int> a;

  	std::cin >> n >> m;
	a.resize(n);

  	int total = 0;
    for (int i = 0; i < n; ++i)
    {
      std::cin >> a[i];
      total += a[i];
    }

  	int selectable = 0;
    for (int i = 0; i < n; ++i)
    {
      if (judge(m, total, a[i]))
      {
        ++selectable;
      }
      
      if (selectable >= m)
      {
        std::cout << "Yes" << std::endl;
        return 0;
      }
    }

  	std::cout "No" << std::endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'vector' is not a member of 'std'
   11 |     std::vector<int> a;
      |          ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:11:17: error: expected primary-expression before 'int'
   11 |     std::vector<int> a;
      |                 ^~~
a.cc:14:11: error: request for member 'resize' in 'a', which is of non-class type 'int'
   14 |         a.resize(n);
      |           ^~~~~~
a.cc:19:20: error: invalid types 'int[int]' for array subscript
   19 |       std::cin >> a[i];
      |                    ^
a.cc:20:17: error: invalid types 'int[int]' for array subscript
   20 |       total += a[i];
      |                 ^
a.cc:26:28: error: invalid types 'int[int]' for array subscript
   26 |       if (judge(m, total, a[i]))
      |                            ^
a.cc:38:18: error: expected ';' before string constant
   38 |         std::cout "No" << std::endl;
      |                  ^~~~~
      |                  ;
Language: C++

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

using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> vec(N);
    int sum=0;
    for(int n=0; n<N; n++) {
        cin >> vec[n];
        sum += vec[n];
    }
    
    sort(vec.begin(), vec.end(), greater<int>());

    if(sum/h%(4*M)) {
        if(vec[M-1]<=M) {
            cout << "No" << endl;
        } else {
            cout << "Yes" << endl;
        }
    } else {
        if(vec[M-1]<M) {
            cout << "No" << endl;
        } else {
            cout << "Yes" << endl;
        }
    }
    

    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: 'h' was not declared in this scope
   19 |     if(sum/h%(4*M)) {
      |            ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: invalid types 'int[int]' for array subscript
    7 |     cin>>a[i];
      |           ^
a.cc:8:9: error: invalid types 'int[int]' for array subscript
    8 |     c+=a[i];
      |         ^
a.cc:11:18: error: invalid types 'int[int]' for array subscript
   11 |     if((c/4*m)<=a[i]) d++;
      |                  ^
Language: C++

#include <bits/stdc++.h>
 using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
 int main(){
   int a,b,c,d;
   cin>>a>>b;
   vector<int> d;
   c=0;
   rep(i,a){
     cin>>a.at(i);
     c+=a.at(i);
   }
   sort(d.begin(),d.end());
   reverse(d.begin(),d.end());
   d=0;
    rep(i,b){
     if(a.at(i)<c/(4*b)){
       d++;
       break;
     }
    }
   if(d==0){
     cout<<"Yes"<<endl;
   }
   else{
     cout<<"No"<<endl;
   }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: conflicting declaration 'std::vector<int> d'
    7 |    vector<int> d;
      |                ^
a.cc:5:14: note: previous declaration as 'int d'
    5 |    int a,b,c,d;
      |              ^
a.cc:10:13: error: request for member 'at' in 'a', which is of non-class type 'int'
   10 |      cin>>a.at(i);
      |             ^~
a.cc:11:11: error: request for member 'at' in 'a', which is of non-class type 'int'
   11 |      c+=a.at(i);
      |           ^~
a.cc:13:11: error: request for member 'begin' in 'd', which is of non-class type 'int'
   13 |    sort(d.begin(),d.end());
      |           ^~~~~
a.cc:13:21: error: request for member 'end' in 'd', which is of non-class type 'int'
   13 |    sort(d.begin(),d.end());
      |                     ^~~
a.cc:14:14: error: request for member 'begin' in 'd', which is of non-class type 'int'
   14 |    reverse(d.begin(),d.end());
      |              ^~~~~
a.cc:14:24: error: request for member 'end' in 'd', which is of non-class type 'int'
   14 |    reverse(d.begin(),d.end());
      |                        ^~~
a.cc:17:11: error: request for member 'at' in 'a', which is of non-class type 'int'
   17 |      if(a.at(i)<c/(4*b)){
      |           ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main ()
{
    int n, m;
    cin >> n >> m;
    vector<int> A(n);
    int total_votes = 0;
    for (int i=0; i<n; i++) {
        cin >> A[i];
        total_votes += A[i];
    }
    int min_val = total_votes/(4*m);
    sort(A.begin(), A.end(), greater<int>());
    int i=0;
    for (i=0; i<n; i++) {
        if (A[i] < min_val) break;
    }
    if (i >= m) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}#include <bits/stdc++.h>

using namespace std;

int main ()
{
    int n, m;
    cin >> n >> m;
    vector<int> A(n);
    int total_votes = 0;
    for (int i=0; i<n; i++) {
        cin >> A[i];
        total_votes += A[i];
    }
    int min_val = total_votes/(4*m);
    sort(A.begin(), A.end(), greater<int>());
    int i=0;
    for (i=0; i<n; i++) {
        if (A[i] < min_val) break;
    }
    if (i >= m) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc:24:2: error: stray '#' in program
   24 | }#include <bits/stdc++.h>
      |  ^
a.cc:24:3: error: 'include' does not name a type
   24 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:28:5: error: redefinition of 'int main()'
   28 | int main ()
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main ()
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<vector<int> > Graph;
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; }


int main(){
    int n,m;
    cin >> n >> m;
    vector<int> a(n);
    int s = 0;
    rep(i,n){
        cin >> a[i];
        s += a[i];
    }
    int cnt=0;
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());


    rep(i,n){
        if(a[i]>=(s+1)/(4*m))cnt++;
    }
    if(cnt>=m)cout << "Yes" << endl;
    else cout << "No" << endl;˜
    return 0;
}

Compiler output:
a.cc:29:32: error: stray '\16' in program
   29 |     else cout << "No" << endl;<U+02DC><U+000E>
      |                                       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:29:31: error: '\U000002dc' was not declared in this scope
   29 |     else cout << "No" << endl;˜
      |                               ^
Language: C++

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

int main() {
	int n, m, a[100],c=0,all=0;
	cin >> n, m;
	for (int i = 0; i < n; i++{
		cin>>a[i];
		all+=a[i];
	}
	for (int i = 0; i < n; i++{
		if(a[i]>=all/4/m)c++;
	}
	if(c>=m)cout<<"Yes";
	else cot<<#"No"
} 

Compiler output:
a.cc:16:19: error: stray '#' in program
   16 |         else cot<<#"No"
      |                   ^
a.cc: In function 'int main()':
a.cc:8:35: error: expected ')' before '{' token
    8 |         for (int i = 0; i < n; i++{
      |             ~                     ^
      |                                   )
a.cc:12:35: error: expected ')' before '{' token
   12 |         for (int i = 0; i < n; i++{
      |             ~                     ^
      |                                   )
a.cc:16:14: error: 'cot' was not declared in this scope; did you mean 'cos'?
   16 |         else cot<<#"No"
      |              ^~~
      |              cos
Language: C++

#include<iostream>

using namespace std;

int main()
{
 int N,M,i,counter=0;
  int n[N];
  int total=0;
  cin>>N>>M;
 for(i=0;i<N;i++)
 {
 cin>>n[i];
   total=total+n[i];
 }
  total=total/4;
  for(i=0;i<n;i++)
  {
  	if(n[i]>total/M)
    {
    	counter++;
    }
  }
  if(counter>=M)
  {
  cout<<"Yes";
  }
  else
    cout<<"No";
  
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |   for(i=0;i<n;i++)
      |           ~^~
Language: C++

#inlcude <bits/stdc++.h>
using namespace std;
int main(){
  int n,m,c=0,d=0;
  int a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
    c+=a[i];
  }
  for(int i=0;i<n;i++){
    if((c/4*m)<=a[i]) d++;
  }
  if(d==m){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude <bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>a[i];
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlcude <bits/stdc++.h>
a.cc:7:11: error: invalid types 'int[int]' for array subscript
    7 |     cin>>a[i];
      |           ^
a.cc:8:9: error: invalid types 'int[int]' for array subscript
    8 |     c+=a[i];
      |         ^
a.cc:11:18: error: invalid types 'int[int]' for array subscript
   11 |     if((c/4*m)<=a[i]) d++;
      |                  ^
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout<<"Yes"<<endl;
      |     ^~~~
a.cc:14:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:18: error: 'endl' was not declared in this scope
   14 |     cout<<"Yes"<<endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlcude <bits/stdc++.h>
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout<<"No"<<endl;
      |     ^~~~
a.cc:17:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:17: error: 'endl' was not declared in this scope
   17 |     cout<<"No"<<endl;
      |                 ^~~~
a.cc:17:17: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
typedef long long ll;
typedef pair<int, int> P;
 
int main(){
  int n, k;
  cin >> n >> m;
  vector<int> a(n);
  
  int vote=0;
  int v;
  rep(i, n){
    cin >> v;
    vote += v;
    a.at(i) = v;
  }
  sort(a.begin(), a.end());
  if(a.at(n-m) >= (float)(vote/((float)(4*m)))) cout << "Yes" << endl;
  else                        cout << "No"  << endl;
  
  return 0;
}



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

#include <iostream>
#include <vector>
using namespace std;
//TODO add string to vector of integers macro or function
vector<int> str_to_vect(string s)
{
	vector<int> v;
	for(int i=0;i<s.size();++i)
	{
		v.push_back((int)s[i]-48);
	}
	return v;
}
int main()
{
	int n,m;
	cin>>n>>m;
	int ar[n]; 
	int sum=0;
	for(int i=0;i<n;i++)
	{
		cin>>ar[i];
		sum+=ar[i];
	}
	sort(ar,ar+n);
	int f=0;
	for (int i = n-1; i >= 0 ; i--)
	{
		if((double)ar[i]/sum>=1.0/(4*m))
			f++;
	}
	if(f>=m)
		cout<<"YES\n";
	else
		cout<<"NO\n";
	return 0;
}

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

#string = ' '.join(list(input() for _ in range(int(input()))))
n,m = map(int,input().split())
a = list(map(int,input().split()))
c = 0
k = (1/(4*m))*(sum(a))
for i in a:
    if i>=k:
        c+=1
if c>=m:
    print("Yes")
else:
    print("No")

    


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #string
    1 | #string = ' '.join(list(input() for _ in range(int(input()))))
      |  ^~~~~~
a.cc:2:1: error: 'n' does not name a type
    2 | n,m = map(int,input().split())
      | ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int n,m,min,i,a[100],s=0,j=0;
    double min;
    cin >> n >> m;
    for(i=0;i<n;i++){
        cin >> a[i];
        s+=a[i];
    }
    min=s/(4*m);
    for(i=0;i<n;i++){
        if(a[i]>=min)j++;
        if(j==m){
    cout << "Yes";
    return 0;
        }
    }
    cout << "No";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: conflicting declaration 'double min'
    6 |     double min;
      |            ^~~
a.cc:5:13: note: previous declaration as 'int min'
    5 |     int n,m,min,i,a[100],s=0,j=0;
      |             ^~~
Language: C++

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

int main(){
  int n, m, sum;
  cin >> n >> m;
  double anchor = 1 / (4 * M);
  int a[n];
  sum = 0;
  for(int i = 0; i < n; i++){
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a+n, greater<>());
  bool flag = true;
  for(int i = 0; i < m; i++){
    if(4 * m * a[i] < sum) flag = false;
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: 'M' was not declared in this scope
    7 |   double anchor = 1 / (4 * M);
      |                            ^
Language: C++

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

int main() {
  int N,M;
  cin>>N>>M;
  vector<int>A(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  int S=0;
  for(int i=0;i<N;i++){
    S=S+A.at(i);
  }
  int B=0:
  for(int i=0;i<N;i++){
    if(A.at(i)>=S/4*M){
      B=B+1;
    }
  }
  if(B>=M){
    cout<<"Yes"<< endl;
  }
  else{
    cout<<"No"<< endl;
  }
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: expected ',' or ';' before ':' token
   15 |   int B=0:
      |          ^
a.cc:16:15: error: 'i' was not declared in this scope
   16 |   for(int i=0;i<N;i++){
      |               ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int M =sc.nextInt();
    int A[] =new int[N];
    int B[] =new int[N+1];
     B[0] =0;
    for(int i=0;i<N;i++){
      A[i] =sc.nextInt();
      B[i+1]=B[i]+A[i];
    }
    C =B[N]/M/4;
    Arrays.sort(A, Collections.reverseOrder());
    if(A[M-1]<C){System.out.println("No");}
    else{System.out.println("Yes");}
  }
}

Compiler output:
Main.java:14: error: cannot find symbol
    C =B[N]/M/4;
    ^
  symbol:   variable C
  location: class Main
Main.java:15: error: no suitable method found for sort(int[],Comparator<Object>)
    Arrays.sort(A, Collections.reverseOrder());
          ^
    method Arrays.<T#1>sort(T#1[],Comparator<? super T#1>) is not applicable
      (inference variable T#1 has incompatible bounds
        equality constraints: int
        upper bounds: Object)
    method Arrays.<T#2>sort(T#2[],int,int,Comparator<? super T#2>) is not applicable
      (cannot infer type-variable(s) T#2
        (actual and formal argument lists differ in length))
  where T#1,T#2 are type-variables:
    T#1 extends Object declared in method <T#1>sort(T#1[],Comparator<? super T#1>)
    T#2 extends Object declared in method <T#2>sort(T#2[],int,int,Comparator<? super T#2>)
Main.java:16: error: cannot find symbol
    if(A[M-1]<C){System.out.println("No");}
              ^
  symbol:   variable C
  location: class Main
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Language: C++

#include <bits/stdc++.h>
 using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
 int main(){
   int a,b,c,d;
   cin>>a>>b;
   vector<int> d(a);
   c=0;
   rep(i,a){
     cin>>a.at(i);
     c+=a.at(i);
   }
   sort(d.begin(),d.end());
   reverse(d.begin(),d.end());
   d=0;
    rep(i,b){
     if(a.at(i)<c/(4*b)){
       d++;
       break;
     }
    }
   if(d==0){
     cout<<"Yes"<<endl;
   }
   else{
     cout<<"No"<<endl;
   }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: conflicting declaration 'std::vector<int> d'
    7 |    vector<int> d(a);
      |                ^
a.cc:5:14: note: previous declaration as 'int d'
    5 |    int a,b,c,d;
      |              ^
a.cc:10:13: error: request for member 'at' in 'a', which is of non-class type 'int'
   10 |      cin>>a.at(i);
      |             ^~
a.cc:11:11: error: request for member 'at' in 'a', which is of non-class type 'int'
   11 |      c+=a.at(i);
      |           ^~
a.cc:13:11: error: request for member 'begin' in 'd', which is of non-class type 'int'
   13 |    sort(d.begin(),d.end());
      |           ^~~~~
a.cc:13:21: error: request for member 'end' in 'd', which is of non-class type 'int'
   13 |    sort(d.begin(),d.end());
      |                     ^~~
a.cc:14:14: error: request for member 'begin' in 'd', which is of non-class type 'int'
   14 |    reverse(d.begin(),d.end());
      |              ^~~~~
a.cc:14:24: error: request for member 'end' in 'd', which is of non-class type 'int'
   14 |    reverse(d.begin(),d.end());
      |                        ^~~
a.cc:17:11: error: request for member 'at' in 'a', which is of non-class type 'int'
   17 |      if(a.at(i)<c/(4*b)){
      |           ^~
Language: C++

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

int main()
{
   int n, m, f, sum = 0;
   cin>>n>>m;
  int arr[n];
  f = 1/(4*m);
  for(int i = 0; i < n; i++)
  {
     cin>>arr[i];
    if(arr[i] >= f)
    {
      sum++;
    }
  }
  if(sum >= m)
  {
     cout<<"Yes"<<endl;
  }
  else
  {
    cout<<"No"<<endl;
  }
  return 0;
}

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

#include<iostream>

using namespace std;

int main(){
  int N,M;
  cin >> N >> M;
  int A[i];
  for(int i=0;i<N;i++)
    	cin >> A[i];
  int sum = 0;
   for(int i=0;i<N;i++)
    	sum += A[i];
  
  float limit = sum/(4.0*M);
  int cnt=0;
  for(int i=0;i<N;i++){
    if(limit < A[i]){
      cnt++;
    }
  }
  
  if(cnt >= M){
    cout << "Yes";
  }else
    cout << "No";
  return 0;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |   int A[i];
      |         ^
a.cc:10:16: error: 'A' was not declared in this scope
   10 |         cin >> A[i];
      |                ^
a.cc:13:16: error: 'A' was not declared in this scope
   13 |         sum += A[i];
      |                ^
a.cc:18:16: error: 'A' was not declared in this scope
   18 |     if(limit < A[i]){
      |                ^
Language: C++

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

int main(){
    int n, m, x, sum = 0;
    cin >> n >> m;
    vector<int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i];
    }
    x = (int)(sum / (4.0 * m));
    if(sum % (4.0 * m) > 0) x++;

    for(int i = 0; i < n; i++){
        if(a[i] >= x) m--;
    }

    cout << (m <= 0 ? "Yes" : "No") << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   13 |     if(sum % (4.0 * m) > 0) x++;
      |        ~~~ ^ ~~~~~~~~~
      |        |          |
      |        int        double
Language: C++

#include <iostream>
#include <vector>
#define rep(i, N) for(int i = 0; i < N; ++i)


using namespace std;

int main()
{
    int n,m;
    cin >> n >> m;

    vector<int> a;

    int totalVal = 0;
    rep(i, n)
    {
        int val;
        cin >> val;
        a.push_back(val);
        totalVal += val;
    }
    sort(a.begin(), a.end(), greater<int>());
    
    if (a[m-1] >= static_cast<float>(totalVal / (4 * m)))
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    
    return 0;
}


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

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <algorithm>
#include <queue>
#include <iterator>
#include <functional>
#include <numeric>
#include <cmath>
#include <stack>
#include <limits>
#include <ctime>

using namespace std;

#define ll int
#define sc(n) static_cast<ll>(n)
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {
	IO;
#ifdef _DEBUG
	ifstream cin("In.txt");
#endif	
	ll n,m,tot=0,a;
	cin >> n >> m;
	vector<ll>vc(n);
	for(size_t i = 0; i < n; i++) {
		cin >> a;
		tot += a;
		vc[i] = a;
	}
	int cnt = 0;
	for (auto& i : vc) {
		if (i*4*m >= tot)

Compiler output:
a.cc: In function 'int main()':
a.cc:40:34: error: expected statement at end of input
   40 |                 if (i*4*m >= tot)
      |                                  ^
a.cc:40:34: error: expected '}' at end of input
a.cc:39:28: note: to match this '{'
   39 |         for (auto& i : vc) {
      |                            ^
a.cc:40:34: error: expected '}' at end of input
   40 |                 if (i*4*m >= tot)
      |                                  ^
a.cc:25:12: note: to match this '{'
   25 | int main() {
      |            ^