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

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,sta,end) for(ll i=sta;i<end;i++)
#define all(x) x.begin(),x.end()
#define MOD 1000000007
#define vvl vector<vector<ll>>
#define vl  vector<ll>
#define acc_io cin.tie(0);ios::sync_with_stdio(false)
//name[i]   -> vl  name(i)
//name[i][j]-> vvl name(i,vl(j))
//or-> ||

signed main(){
	acc_io;
	ll n,m;
	cin>>n>>m;
	vl a(n);
	ll sum=0;
	rep(i,0,n){
		cin>>a[i];
		sum+=a[i];
	}
	ll cnt=0;
	rep(i,0,n){
		if(4*m*a[i])>=sum)cnt++;
	}
	cout<<((cnt<m)?"No":"Yes")<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:29: error: expected primary-expression before '>=' token
   26 |                 if(4*m*a[i])>=sum)cnt++;
      |                             ^~
Language: C++

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

using namespace std;
using ll = long long;

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

  vector<int> v(n);
  for (auto i = 0; i != n; ++i) {
    cin >> v[i];
  }

  const auto threshold = accumulate(begin(v), end(v), 0) / 4 / m;
  cout << (m <= count_if(begin(v), end(v),
                         [&](auto x) { return x >= threshold; })
               ? "Yes"
               : "No")
       << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'count_if' was not declared in this scope
   18 |   cout << (m <= count_if(begin(v), end(v),
      |                 ^~~~~~~~
Language: C++



def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N, M = read_ints()
    A = read_ints()
    total = sum(A)
    threshold = total/(4*M)
    if sum(1 for a in A if a >= threshold) >= M:
        return 'Yes'
    return 'No'


if __name__ == '__main__':
    print(solve())


Compiler output:
a.cc:17:16: warning: multi-character character constant [-Wmultichar]
   17 |         return 'Yes'
      |                ^~~~~
a.cc:18:12: warning: multi-character character constant [-Wmultichar]
   18 |     return 'No'
      |            ^~~~
a.cc:21:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   21 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:3:1: error: 'def' does not name a type
    3 | def read_int():
      | ^~~
Language: C++

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

int main() {
 int M,N;
  cin>>M>>N;
  int A[N];
  for(int i=0;i<N;i++){
    cin>>A(i);
  }
  sort(A,A+N,greater<int>());
  int X=A(M-1);
  if(X=>1/(4*M)){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'A' cannot be used as a function
    9 |     cin>>A(i);
      |          ~^~~
a.cc:12:10: error: 'A' cannot be used as a function
   12 |   int X=A(M-1);
      |         ~^~~~~
a.cc:13:8: error: expected primary-expression before '>' token
   13 |   if(X=>1/(4*M)){
      |        ^
Language: C++

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

int main() {
 int M,N;
  cin>>M>>N;
  int A[N];
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  sort(A,A+N,greater<int>());
  int X=A.at(M-1);
  if(X=>1/4M){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: request for member 'at' in 'A', which is of non-class type 'int [N]'
    9 |     cin>>A.at(i);
      |            ^~
a.cc:12:11: error: request for member 'at' in 'A', which is of non-class type 'int [N]'
   12 |   int X=A.at(M-1);
      |           ^~
a.cc:13:8: error: expected primary-expression before '>' token
   13 |   if(X=>1/4M){
      |        ^
a.cc:13:11: error: unable to find numeric literal operator 'operator""M'
   13 |   if(X=>1/4M){
      |           ^~
Language: C++

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

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> v(n);
    int a;
    int sum = 0;

    for(int i=0; i<n; i++){
        cin >> a;
        sum += a;
        v.push_back(a);
    }
    sort(v.begin(), v.end(),greater<int>());
    for(int i=0; i<m; i++){
        if(v[i] < sum / (4*m)){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
     return 0;
}

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

#include <bits/stdc++.h>
     
    using namespace std;
     
    int main()
    {
       int n,m,sum=0,count=0;
       cin>>n>>m;
       int a[n];
       for(int i=0;i<n;i++)
       {
           cin>>a[i];
           sum+=a[i];
       }
      float s=float(sum)/(4.0*M);
       
       for(int i=0;i<n;i++)
       {
           if(a[i]>=s)
           count++;
       }
       if(count>=m)
       cout<<"Yes"<<endl;
       else
       cout<<"No"<<endl;
     
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:31: error: 'M' was not declared in this scope
   15 |       float s=float(sum)/(4.0*M);
      |                               ^
Language: C++

int main(){
    int n,m,a[10000];
    cin >> n >> m;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    long long  sum = 0;
    for(int k=0;k<n;k++){
        sum += a[k];
    }
    int kijun = sum/(4*m);
    int flg = 0;
    for(int j=0;j<n;j++){
        if(a[j] >= kijun){
            flg += 1;
        }
    }
    if(flg>=m){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

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:5:9: error: 'scanf' was not declared in this scope
    5 |         scanf("%d",&a[i]);
      |         ^~~~~
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:19:26: error: 'endl' was not declared in this scope
   19 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << "No" << endl;
      |         ^~~~
a.cc:21:25: error: 'endl' was not declared in this scope
   21 |         cout << "No" << endl;
      |                         ^~~~
Language: C++

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

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


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

#include <bits/stdc++.h>
 
using namespace std;
 
 
 
//c++ templte for help...........................................................
 
//#define deb(x) cout<<#x<<" "<<x<<endl;/* for debuging  printing variable with name*/
//#define debb(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;										
//#define debbb(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;			
 
typedef long long ll;
	
 
//for loop
//#define fo(i,n) for(int i=0;i<(ll)n;i++)
//#define Fo(i,k,n) for(int i=k;i<n;i++)
 
 
//to print vector element 
//template<typename T>
//void printV(T vec){
	//fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
	//cout<<endl;
	//}
	
 
//#define modulo 998244353
//const int INF=1e9+5;
 
 
 
 
//c++ template for help........................................................

int main() {
	//stringstream ss;
	//ss<<"akhil";
	//cout<<ss.str()<<endl;
	//cout<<setprecision(2);
	//ios::sync_with_stdio(0);
	//cin.tie(0);
	
	
	 // TESTCASE KO DEKH KA BHAUT SARA CONDITION GENERATE MAT KRO 
	 // PAPER PD CONFIRM HO JAO THORA JADA TIME HI KYU NA LGA
	 // greedy ma jadatr exceptional case check kr ke dekh lo
	 
	 // WHILE DOING THE QUESTION OF DYNAMIC PROGRAMMING GREEDY KA TRAH SOCHNA BAND KRO
	 // DP M DATA KA BHI USE KRNA PDTA HA BE BHULO MT 
	 // DP BHI WO LEETCODE WALE MATRIX KA QUESTION KI TARAH HA
	 // CONSTRAIN WILL BE THE DIMENSION OF DP
	 // DP MA STATE PTA KRO AUR PHIR FUNCTION GENERATE KRO
	 // OBJECT KO CHOOSE KIA YA NAE KIA AGAR KIA TO KYA HOGA AUR NAE KIA TO KYA HOGA
	 // KYA KYA CHEJ IMPORTANT HA WO STATE BN JYAGA AUR HUM LOG STATE KO CHANGE KR SKTA HA JYSA KNPSACK 2 WALE PROBLEM MA KIA THA
	 
	 
	 ll n,m;
	 cin>>n>>m;
	 
	 vector<ll> vec(n);
	 ll sum=0;
	 for(ll i=0;i<n;i++){
		cin>>vec[i];12 3
4 56 78 901 2 345 67 890 123 45 6 789
		sum+=vec[i];
	 }
	 
	 
	
	ll g=sum/(4*m);
	ll count=0;
	for(ll x: vec){
		if(x>=g) count++;
	}
	
	
	if(count>=m) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	

	 

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:31: error: expected ';' before numeric constant
   65 |                 cin>>vec[i];12 3
      |                               ^~
      |                               ;
Language: C

#include<stdio.h>

int main(void)
{
  int    N, i, AA;
  double M, A[1001], c;
  
  c=0; AA=0;
  scanf("%d%lf",&N,&M);
  for(i=0; i<N; i++){
    scanf("%lf",&A[i]);
    AA=AA+A[i];
  }
  for(i=0; i<N; i++)
    if(A[i]>=AA/(4*M)))
      c++;
  if(c>=M)
    printf("Yes\n");
  else
    printf("No\n");
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:23: error: expected statement before ')' token
   15 |     if(A[i]>=AA/(4*M)))
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    double 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);
    }
    else if(A.at(M-1)<sum/(4*M)) cout << "No" << endl;
    else cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'else' without a previous 'if'
   16 |     else if(A.at(M-1)<sum/(4*M)) cout << "No" << endl;
      |     ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:28: error: expected ')' before '{' token
   16 |         if(x >= sum / (4*m){
      |           ~                ^
      |                            )
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
Language: C++

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

int main(){
    int n, m, a[1000];
    cin >> n >> m;

    for (int i = 0; i < n; ++i) cin >> a[i];

    int sum = 0;
    for (int i = 0; i < n; ++i) sum += a[i];

    sort(a, a + n, greater<int>());

    if (a[m-1] * 4 * m >= sum )) cout << "Yes" << endl;
    else cout << "No" << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:32: error: expected primary-expression before ')' token
   16 |     if (a[m-1] * 4 * m >= sum )) cout << "Yes" << endl;
      |                                ^
Language: C++

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

int main(){
    int n, m, a[1000];
    cin >> n >> m;

    for (int i = 0; i < n; ++i) cin >> a[i];

    int sum = 0;
    for (int i = 0; i < n; ++i) sum += a[i];

    sort(a, a + n, greater<int>());

    if (a[m-1] 4 * m >= sum )) cout << "Yes" << endl;
    else cout << "No" << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: expected ')' before numeric constant
   16 |     if (a[m-1] 4 * m >= sum )) cout << "Yes" << endl;
      |        ~      ^~
      |               )
a.cc:16:30: error: expected primary-expression before ')' token
   16 |     if (a[m-1] 4 * m >= sum )) cout << "Yes" << endl;
      |                              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n,m;
  cin>>n>>m;
  int a;
  vector<double> v;
  int sum=0;
  for(int i=0;i<n;i++){
    cin>>a;
    sum+=a;
    v.push_back(a);
  }
  for(int i=0;i<n;i++){
    v[i] = (double)v[i]/sum;
  }
  sort(v.begin(),v.end());
  if(v[n-1-m]>=1.0/(4*m)){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }

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

#include<stdio.h>
int main()
{
  int N,i,s=0,M;
  scanf("%d %d",&N,&M);
  int x[N];
  for(i=0;i<N;i++)
    {
    	
    scanf("%d",&x[i]);
    s+=x[i];
  	}
  for(i=0;i<N;i++)
    {
    for(j=i+1;j<N;j++)
      {
      if(x[i]>x[j])
        {
        t=x[i];
        x[i]=x[j];
        x[j]=t;
        }
      }
    }
  a=s/(4*M);
  if(x[M]>=s)
    {
    printf("YES");
    }
  else
    {
    printf("NO");
    }
    
  
  
}

Compiler output:
main.c: In function 'main':
main.c:15:9: error: 'j' undeclared (first use in this function)
   15 |     for(j=i+1;j<N;j++)
      |         ^
main.c:15:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:9: error: 't' undeclared (first use in this function)
   19 |         t=x[i];
      |         ^
main.c:25:3: error: 'a' undeclared (first use in this function)
   25 |   a=s/(4*M);
      |   ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
   18 |   sort(A.bigin(),A.end(),greater<int>());
      |          ^~~~~
      |          begin
Language: C++

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,M = map(int, readline().split())

A = list(map(int, readline().split()))

sum = sum(A)
ct = 0
for a in A:
    if sum * (1/(4*M)) <= a:
        ct += 1

if ct >= M:
    print('Yes')
else:
    print('No')

Compiler output:
a.cc:18:11: warning: multi-character character constant [-Wmultichar]
   18 |     print('Yes')
      |           ^~~~~
a.cc:20:11: warning: multi-character character constant [-Wmultichar]
   20 |     print('No')
      |           ^~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int m,n;
int a[105],sum,num;
#define ll long long
int main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		sum+=a[i];
	}
	sort(a+1,a+n+1)
	reverse(a+1,a+n+1)
	if(a[m]>=(sum/(4.0*m)))cout<<"Yes";
	else cout<<"No";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: expected ';' before 'reverse'
   14 |         sort(a+1,a+n+1)
      |                        ^
      |                        ;
   15 |         reverse(a+1,a+n+1)
      |         ~~~~~~~         
a.cc:17:9: error: 'else' without a previous 'if'
   17 |         else cout<<"No";
      |         ^~~~
Language: C++

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func readLine() string {
	sc.Scan()
	return sc.Text()
}

func main()  {
	var N, M int
	fmt.Scan(&N, &M)

	inputs := strings.Split(readLine(), " ")

	sum := 0

	for i := 0; i < N; i++{
		num, _ := strconv.Atoi(inputs[i])
		sum += num
	}

	count := 0

	for i := 0; i < N; i++ {
		num, _ := strconv.Atoi(inputs[i])

		if num >= (sum / (4 * M)){
			count++
		}
	}

	if count >= M {
		fmt.Println("Yes")
	}else{
		fmt.Println("No")
	}
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:18:1: error: 'func' does not name a type
   18 | func main()  {
      | ^~~~
Language: Java

import java.util.*;
class Main{
    static Scanner sc=new Scanner(System.in);
    public static void main(String[] args){
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] a = new int[N];
        int sum = 0;
        for(int i=0;i<N;i++){
            a[i] = sc.nextInt();
            sum = sum+a[i];
        }
        Arrays.list(a);
      	Collections.reverse(num1);
        boolean anst = true;
        for(int i=0;i<M;i++){
            if(a[M-(i+1)]<(sum/(4*M))){
                anst = false;
                break;
            }
        }
        if(anst)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
}

Compiler output:
Main.java:13: error: cannot find symbol
        Arrays.list(a);
              ^
  symbol:   method list(int[])
  location: class Arrays
Main.java:14: error: cannot find symbol
      	Collections.reverse(num1);
      	                    ^
  symbol:   variable num1
  location: class Main
2 errors
Language: Java

import java.util.*;
class Main{
    static Scanner sc=new Scanner(System.in);
    public static void main(String[] args){
        int N = sc.nextInt();
        int M = sc.nextInt();
        int a[] = new int[N];
        int sum = 0;
        for(int i=0;i<N;i++){
            a[i] = sc.nextInt();
            sum = sum+a[i];
        }
        Arrays.list(a);
        boolean anst = true;
        for(int i=0;i<M;i++){
            if(a[M-(i+1)]<(sum/(4*M))){
                anst = false;
                break;
            }
        }
        if(anst)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
}

Compiler output:
Main.java:13: error: cannot find symbol
        Arrays.list(a);
              ^
  symbol:   method list(int[])
  location: class Arrays
1 error
Language: C++

import java.util.*;
class Main{
    static Scanner sc=new Scanner(System.in);
    public static void main(String[] args){
        int N = sc.nextInt();
        int M = sc.nextInt();
        int a[] = new int[N];
        for(int i=0;i<N;i++){
            a[i] = sc.nextInt();
        }
        boolean anst = true;
        for(int i=0;i<M;i++){
            if(a[i]<(1/(4*M))){
                anst = false;
                break;
            }
        }
       if(anst)
           System.out.println("Yes");
        else
            System.out.println("No");
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:12: error: 'Scanner' does not name a type
    3 |     static Scanner sc=new Scanner(System.in);
      |            ^~~~~~~
a.cc:4:11: error: expected ':' before 'static'
    4 |     public static void main(String[] args){
      |           ^~~~~~~
      |           :
a.cc:4:29: error: 'String' has not been declared
    4 |     public static void main(String[] args){
      |                             ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'args'
    4 |     public static void main(String[] args){
      |                                      ^~~~
a.cc:23:2: error: expected ';' after class definition
   23 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:17: error: 'sc' was not declared in this scope
    5 |         int N = sc.nextInt();
      |                 ^~
a.cc:7:19: error: initializer fails to determine size of 'a'
    7 |         int a[] = new int[N];
      |                   ^~~~~~~~~~
a.cc:7:19: error: array must be initialized with a brace-enclosed initializer
a.cc:11:9: error: 'boolean' was not declared in this scope; did you mean 'bool'?
   11 |         boolean anst = true;
      |         ^~~~~~~
      |         bool
a.cc:14:17: error: 'anst' was not declared in this scope
   14 |                 anst = false;
      |                 ^~~~
a.cc:18:11: error: 'anst' was not declared in this scope
   18 |        if(anst)
      |           ^~~~
a.cc:19:12: error: 'System' was not declared in this scope
   19 |            System.out.println("Yes");
      |            ^~~~~~
a.cc:21:13: error: 'System' was not declared in this scope
   21 |             System.out.println("No");
      |             ^~~~~~
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 total = 0;
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
            total += A[i];
        }
        double benchmark = (double)total/(M*4);
        int ok = 0;
        for(int i=0; i<N; i++){
            if(A[i] >= benchmark){
                ok++;
            }
        }
        if(ok>=M){
            System.out.println("Yes");
        }else System.out.println("No");

    }    
}

Compiler output:
Main.java:2: error: illegal character: '\u3000'
public class?Main {
            ^
1 error
Language: Java

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

public class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();
        int sum_M =0;

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

        Arrays.sort(A);

        //double AAA = A[N-M];
        //double BBB = (double)sum/4*(double)M;
        //System.out.println("\n"+AAA+"\n"+BBB+"\n"+(AAA-BBB));
        if(AAA < BBB ){
            System.out.println("No");
        }else{
            System.out.println("Yes");
        }




    }
}

Compiler output:
Main.java:23: error: cannot find symbol
        if(AAA < BBB ){
           ^
  symbol:   variable AAA
  location: class Main
Main.java:23: error: cannot find symbol
        if(AAA < BBB ){
                 ^
  symbol:   variable BBB
  location: class Main
2 errors
Language: Java

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

public class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();
        int sum_M =0;

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

        Arrays.sort(A);

        //double AAA = A[N-M];
        //double BBB = (double)sum/4*(double)M;
        System.out.println("\n"+AAA+"\n"+BBB+"\n"+(AAA-BBB));
        if(AAA < BBB ){
            System.out.println("No");
        }else{
            System.out.println("Yes");
        }




    }
}

Compiler output:
Main.java:22: error: cannot find symbol
        System.out.println("\n"+AAA+"\n"+BBB+"\n"+(AAA-BBB));
                                ^
  symbol:   variable AAA
  location: class Main
Main.java:22: error: cannot find symbol
        System.out.println("\n"+AAA+"\n"+BBB+"\n"+(AAA-BBB));
                                         ^
  symbol:   variable BBB
  location: class Main
Main.java:22: error: cannot find symbol
        System.out.println("\n"+AAA+"\n"+BBB+"\n"+(AAA-BBB));
                                                   ^
  symbol:   variable AAA
  location: class Main
Main.java:22: error: cannot find symbol
        System.out.println("\n"+AAA+"\n"+BBB+"\n"+(AAA-BBB));
                                                       ^
  symbol:   variable BBB
  location: class Main
Main.java:23: error: cannot find symbol
        if(AAA < BBB ){
           ^
  symbol:   variable AAA
  location: class Main
Main.java:23: error: cannot find symbol
        if(AAA < BBB ){
                 ^
  symbol:   variable BBB
  location: class Main
6 errors
Language: Java

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

public class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();
        int sum_M =0;

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

        Arrays.sort(A);

        double AAA = A[N-M];
        double BBB = (double)sum/4*(double)M;
        if((AAA < BBB ){
            System.out.println("No");
        }else{
            System.out.println("Yes");
        }




    }
}

Compiler output:
Main.java:22: error: ')' expected
        if((AAA < BBB ){
                       ^
1 error
Language: Java

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

public class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int M = stdIn.nextInt();
        int sum_M =0;

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

        Arrays.sort(A);

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




    }
}

Compiler output:
Main.java:20: error: illegal start of expression
        if((long)A[N-M] +> (long)(sum/(4*M)) ){
                         ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int  N,M,A[N];
  cin>>N>>M;
  int c,count=0;
  for(int i=0;i<N;i++){
    cin>>A[i];
    c+=A[i];
  }
  c=c/(4*M);
  for(int i=0;i<N;i++){
    if(c<=A[i]){
      count++;
    }
  }
  if(count==M){
    cout<<Yes;
  }
  else{
    cout<<No;
  }
  return 0;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'Yes' was not declared in this scope
   18 |     cout<<Yes;
      |           ^~~
a.cc:21:11: error: 'No' was not declared in this scope; did you mean 'N'?
   21 |     cout<<No;
      |           ^~
      |           N
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int  N,M,A[N];
  cin>>N>>M;
  int c,count=0;
  for(int i=0;i<N;i++){
    cin>>A[i];
    c+=A[i];
  }
  c=c/(4*M);
  for(int i=0;i<N;i++){
    if(c<=A[i]){
      count++;
    }
  }
  if(count==M){
    cout<<YES;
  }
  else{
    cout<<NO;
  }
  return 0;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'YES' was not declared in this scope
   18 |     cout<<YES;
      |           ^~~
a.cc:21:11: error: 'NO' was not declared in this scope; did you mean 'N'?
   21 |     cout<<NO;
      |           ^~
      |           N
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int  N,M,A[N];
  cin>>N>>M;
  int c,count=0;
  for(int i=0;i<N;i++){
    cin>>A[i];
    c+=A[i];
  }
  for(int i=0;i<N;i++){
    if(c<=A[i]){
      count++;
    }
  }
  if(count==M){
    cout<<YES;
  }
  else{
    cout<<NO;
  }
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: 'YES' was not declared in this scope
   17 |     cout<<YES;
      |           ^~~
a.cc:20:11: error: 'NO' was not declared in this scope; did you mean 'N'?
   20 |     cout<<NO;
      |           ^~
      |           N
Language: C++

#include<bits/stdc++.h>
using namespace std;
int32_t main()
{
  int n,m,count=0;cin>>n>>m;
  int a[n],sum=0;
  for(int i=0;i<n;i++)cin>>a[i],sum+=a[i];
  int r=(4*m);
  sort(a,a+n,greater<int>());
  for(int i=0;i<n;i++)
  {if(a[i]>=(a[i]/r))count++;
   if(count==m)return cout<<"Yes";
  }
  cout<<"No";

           return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:12:27: error: cannot convert 'std::basic_ostream<char>' to 'int32_t' {aka 'int'} in return
   12 |    if(count==m)return cout<<"Yes";
      |                       ~~~~^~~~~~~
      |                           |
      |                           std::basic_ostream<char>
Language: C++

#include<bits/stdc++.h>

using namespace std;


int main(){
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    int sum = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        sum += a[i];
    }
    int min = sum/(4*m);
    int counter = 0;
    for(int i = 0; i < n; i++){
        if(a[i] >= min) counter++;
    }
    if(counter >= m) cout << "Yes\n"
    else cout << "No\n";
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:37: error: expected ';' before 'else'
   20 |     if(counter >= m) cout << "Yes\n"
      |                                     ^
      |                                     ;
   21 |     else cout << "No\n";
      |     ~~~~
Language: C++

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

int main() {

int n,m,c=0;double tot=0.0;cin>>n>>m;
int arr[102];
for(int i=1;i<=n;++i)
{
	cin>>arr[i];

	}
for(int j=1;j<=n;++j)
{

	tot+=arr[j];
	}
for(int y=1;y<=n;y++)
{
   if(arr[y]>=(tot/(4*m)))
   {
	c++;
   }
   
   }
}if(c>=m)
	cout<<"Yes"<<endl;
else
	cout<<"No"<<endl;















    return 0;
}


Compiler output:
a.cc:30:2: error: expected unqualified-id before 'if'
   30 | }if(c>=m)
      |  ^~
a.cc:32:1: error: expected unqualified-id before 'else'
   32 | else
      | ^~~~
a.cc:49:5: error: expected unqualified-id before 'return'
   49 |     return 0;
      |     ^~~~~~
a.cc:50:1: error: expected declaration before '}' token
   50 | }
      | ^
Language: C++

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

int main(){
    
    int n,m,tot;
    int dum;
    scanf(" %d %d", &n, &m);
    vector<int> lis (n,0);
    tot = 0;
    for(int i = 0;i<n;i++){
        scanf(" %d", &dum); lis[i] = dum;
        tot+=dum;
    }
    if(n==1 && m == 1){printf("YES\n"); return;}
    
    int thr= tot / (4*m);
    thr++; // = (tot %(4*m))? thr+1 : thr;
    tot = 0;
    for(int i = 0;i<n;i++){
        if(lis[i] >= thr) tot++;
    }
    
    if(tot<m) printf("No\n");
    else printf("Yes\n");
    return 0;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:41: error: return-statement with no value, in function returning 'int' [-fpermissive]
   17 |     if(n==1 && m == 1){printf("YES\n"); return;}
      |                                         ^~~~~~
Language: C++

#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }

int main() {
    int M, N;
    scanf("%d %d", &N, &M);
    int A[N];
    int SUM = 0;
    for (int i = 0; i < N; ++i) {
        scanf("%d", &A[i]);
        SUM += A[i];
    }
    qsort(A, sizeof(A) / sizeof(A[0]), sizeof(int), downint);

    if (A[M-1] >= (double)((SUM / (4 * M))) {
        printf("Yes");
        return 0;
    } else {
        printf("No");
        return 0;
    }
}

int A(){
    int A,B,C;
    scanf("%d %d %d",&A,&B,&C);
    printf("%d %d %d",C,A,B);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:44: error: expected ')' before '{' token
   18 |     if (A[M-1] >= (double)((SUM / (4 * M))) {
      |        ~                                   ^~
      |                                            )
a.cc:25:1: error: expected primary-expression before '}' token
   25 | }
      | ^
Language: C++

n, m = input().split()
a = list(map(int, input().split()))
list.sort(a, reverse=True)

n = 0
ninki = sum(a)/4/int(m)

for w in a:
    #print(sum(a))

    if w < ninki:
        n = 1

    if a.index(w) + 1 == int(m):
        break


if n == 0:
    print("Yes")
if n == 1:
    print("No")

Compiler output:
a.cc:9:6: error: invalid preprocessing directive #print
    9 |     #print(sum(a))
      |      ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n, m = input().split()
      | ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:29: error: expected ';' before 'return'
   22 |    else cout << "No" << endl
      |                             ^
      |                             ;
   23 |     return 0;
      |     ~~~~~~
Language: C++

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

int main(){
  int N,M;
  cin>>N>>M;
  int A[1010];
  int ans=0;
  for(int i=0;i<=N;i++){
    if(A(i)=>1/4M){
      ans++;
    }
  }
  if(ans<M){
    cout<<"No"<<endl;
  }
  else{
    cout<<"Yes"<<endl;
  }
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'A' cannot be used as a function
   10 |     if(A(i)=>1/4M){
      |        ~^~~
a.cc:10:13: error: expected primary-expression before '>' token
   10 |     if(A(i)=>1/4M){
      |             ^
a.cc:10:16: error: unable to find numeric literal operator 'operator""M'
   10 |     if(A(i)=>1/4M){
      |                ^~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner s = new Scanner(System.in);
    List<Integer> list = new ArrayList();
    int n = s.nextInt();
    int m = s.nextInt();
    int sum = 0;
    boolean coosable = true;
    for(int i = 0; i < n; i++){
      int value = s.nextInt();
      list.add(value);
      sum = sum + value;
    }
    Collections.sort(list);
    Collections.reverse(list);
    for(int i = 0; i < m; i++){
      if(list.get(i) < Math.ceil(double(sum / (4 * m)))){
        coosable = false;
      }
    }
    if(coosable){
      System.out.println("Yes");
    } else{
      System.out.println("No");
    }
  }
}

Compiler output:
Main.java:18: error: '.class' expected
      if(list.get(i) < Math.ceil(double(sum / (4 * m)))){
                                       ^
Main.java:18: error: ';' expected
      if(list.get(i) < Math.ceil(double(sum / (4 * m)))){
                                                      ^
2 errors
Language: C

#include<stdio.h>
int main(void){
  int n,m,a[101],i,j,b,c,s,sum,b[1001];
  scanf("%d %d",&n,&m);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    s=s+a[i];
  }
  for(i=1;i<=1000;i++){
    b[i]=0;
  }
  for(i=0;i<n;i++){
    b[a[i]]++;
  }
  for(i=1000;i>=1;i--){
    sum+=b[i];
    if(b[i]<s/(4*m)){
      printf("No\n");
      break;
    }
    if(sum>=m){
      printf("Yes\n");
      break;
    }
  }
  return 0;
}
    

Compiler output:
main.c: In function 'main':
main.c:3:32: error: conflicting types for 'b'; have 'int[1001]'
    3 |   int n,m,a[101],i,j,b,c,s,sum,b[1001];
      |                                ^
main.c:3:22: note: previous declaration of 'b' with type 'int'
    3 |   int n,m,a[101],i,j,b,c,s,sum,b[1001];
      |                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    int n, v, cnt=0, sum=0, x;
    float m;
    cin >> n >> m;
    vector<int> a;
    for(int i=0; i<n; i++)
    {
        cin >> x;
        a.push_back(x);
        sum += x;
    }
    //cout << sum << endl;
    float v = (1/(4*m))*sum;
    //cout << v << endl;
    for(int i=0; i<n; i++)
    {
        if(a[i]>=v) cnt++;
    }
    if(cnt>=m) cout << "YES" << endl;
    else cout << "NO" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: conflicting declaration 'float v'
   17 |     float v = (1/(4*m))*sum;
      |           ^
a.cc:6:12: note: previous declaration as 'int v'
    6 |     int n, v, cnt=0, sum=0, x;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007 
#define all(n)      (n).begin(), (n).end()
#define ll long long 

void solve(){
	int n,m; cin >> n >> m;
	int a[101];

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

	ll sum = 0;

	for(int i = 0; i < n; i++){
		sum += a[i];
	}

	ll popularity_no = (0.25)*(sum/m);
	int cnt = 0;

	for(int i = 0; i < n; i++){
		if(a[i] >= popularity_no){
			cnt++;
			if(cnt == m){
				cout << "Yes" << '\n';
				return 0;
			}
		}
	}
	
	cout << "No" << '\n';
	
	

}


int main (){
	
	//Write from here.
	
		solve();
	
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:29:40: error: return-statement with a value, in function returning 'void' [-fpermissive]
   29 |                                 return 0;
      |                                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007 
#define all(n)      (n).begin(), (n).end()
#define ll long long 

void solve(){
	int n,m; cin >> n >> m;
	int a[101];

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

	ll sum = 0;

	for(int i = 0; i < n; i++){
		sum += a[i];
	}

	ll popularity_no = (0.25)*(1.00/m) *(sum);
	int cnt = 0;

	for(int i = 0; i < n; i++){
		if(a[i] >= popularity_no){
			cnt++;
			if(cnt == m){
				cout << "Yes" << '\n';
				return 0;
			}
		}
	}
	
	cout << "No" << '\n';
	
	

}


int main (){
	
	//Write from here.
	
		solve();
	
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:29:40: error: return-statement with a value, in function returning 'void' [-fpermissive]
   29 |                                 return 0;
      |                                        ^
Language: C++

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


void solve(){
	int n,m; cin >> n >> m;
	int a[101];

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

	ll sum = 0;

	for(int i = 0; i < n; i++){
		sum += a[i];
	}

	ll popularity_no = (1.0/4)*(1.0/m) * (double)(sum);
	int cnt = 0;

	for(int i = 0; i < n; i++){
		if(a[i] >= popularity_no){
			cnt++;
		}
	}
	if(cnt >= m){
		cout << "Yes" << '\n';
	}else{
		cout << "No" << '\n';
	}
	

}


int main (){

	
		solve();
	
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:13:9: error: 'll' was not declared in this scope
   13 |         ll sum = 0;
      |         ^~
a.cc:16:17: error: 'sum' was not declared in this scope
   16 |                 sum += a[i];
      |                 ^~~
a.cc:19:11: error: expected ';' before 'popularity_no'
   19 |         ll popularity_no = (1.0/4)*(1.0/m) * (double)(sum);
      |           ^~~~~~~~~~~~~~
      |           ;
a.cc:23:28: error: 'popularity_no' was not declared in this scope
   23 |                 if(a[i] >= popularity_no){
      |                            ^~~~~~~~~~~~~
Language: C++

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

int main() {
  int N,M;
  cin >> N >> M;
  vector<int> vec(N);
  double sum=0;
  for (int i=0;i<N;i++){
    cin >> vec.at(i);
    sum += vec.at(i);
  }
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  int slctd=0;
  for (int i=0;i<N;i++){
    cin >> vec.at(i);
    if (vec.at(i) >= sum/4*M){
      slctd += 1;
    }
    else{
      slctd += 0;
    }
  }
  if (slctd >= M){
    cout << "Yes";
  }
  else{
    cout << "No";
  }

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

#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
#define PI 3.14159265359
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))

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

  int A[N];
  int sum = 0;
  rep(i, N) {
    cin >> A[i];
    sum += A[i];
  }
  int criterion = sum / (4 * M);

  sort(A, A + N);

  bool ans = true;
  rep(i, M) {
    if (A[N - 1 - i] = < criterion) {
      ans = false;
    }
  }

  if (ans == true)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:24: error: expected primary-expression before '<' token
   25 |     if (A[N - 1 - i] = < criterion) {
      |                        ^
Language: C++

# include <iostream>
# include <vector>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int minVal = n / (4 * m);
  vector <int> v;
  while (n--) {
    int in;
    cin >> in;
    v.push_back(in);
  }
  int count(0);
  for (int i : v) {
    if (i >= minVal) count++;
  if (count >= m) cout << "Yes\n";
  else cout << "No\n";
  return 0;
  }
    
  

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

9:03:24 PM: Executing task 'Main.main()'...

> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes
10 3
100 99 1 2 3 4 7 18 19 22

> Task :Main.main()
No

BUILD SUCCESSFUL in 2s
2 actionable tasks: 2 executed
9:03:27 PM: Task execution finished 'Main.main()'.


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
9:03:24 PM: Executing task 'Main.main()'...
^
Main.java:1: error: unclosed character literal
9:03:24 PM: Executing task 'Main.main()'...
                           ^
Main.java:1: error: unclosed character literal
9:03:24 PM: Executing task 'Main.main()'...
                                       ^
Main.java:1: error: illegal '.'
9:03:24 PM: Executing task 'Main.main()'...
                                          ^
Main.java:14: error: unclosed character literal
9:03:27 PM: Task execution finished 'Main.main()'.
                                    ^
Main.java:14: error: unclosed character literal
9:03:27 PM: Task execution finished 'Main.main()'.
                                                ^
6 errors
Language: C++

#include<iostream>
using namespace std;

int main(){
  int N,M
  int A[1010];
  int ans=0;
  for(int i=0;i<=N;i++){
    if(A(i)=>1/4M){
      ans++;
    }
  }
  if(ans<M){
    cout<<"No"<<endl;
  }
  else{
    cout<<"Yes"<<endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'int'
    6 |   int A[1010];
      |   ^~~
a.cc:9:8: error: 'A' was not declared in this scope
    9 |     if(A(i)=>1/4M){
      |        ^
a.cc:9:13: error: expected primary-expression before '>' token
    9 |     if(A(i)=>1/4M){
      |             ^
a.cc:9:16: error: unable to find numeric literal operator 'operator""M'
    9 |     if(A(i)=>1/4M){
      |                ^~
a.cc:13:10: error: 'M' was not declared in this scope
   13 |   if(ans<M){
      |          ^
Language: C

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

using namespace std;

int main(void) {
    int n, m, sum = 0, vote;
    cin >> n >> m;

    vector<int> a(n);

    for(int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i];
    }
    vote = sum / (4*m);

    sort(a.begin(), a.end(), greater<int>());

    int flag = 0;
    for(int i = 0; i < m; i++) {
        if(a[i] < vote) flag = 1;
    }

    if(flag) cout << "No" << endl;
    else cout << "Yes" << endl;
}


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

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: unable to find numeric literal operator 'operator""M'
   10 |     if (A >= 1/4M){
      |                ^~
Language: C

#include<stdio.h>

int main(){
    int N,M;
    int a[100+1] = {0};
    int all=0;
    int i,j,tmp;

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

    for( i = 1; i <= N; i++ ){
        scanf("%d", &a[i]);
        all += a[i];
    }

    for( i = 1; i <= N-1; i++ ){
        for( j = i+1; j <= N; j++ ){
            if( a[i] < a[j] ){
                tmp = a[i];
                a[i] = a[j];
                a[j] = tmp;
            }
        }
    }

/*    for(i=1;i<=N;i++){
        printf("%d ", a[i]);
    }
    printf("\n");
*/

    if( a[M] >= double(all/(4*M)) ) printf("Yes\n");
    else printf("No\n");

    return 0;
}




Compiler output:
main.c: In function 'main':
main.c:32:17: error: expected expression before 'double'
   32 |     if( a[M] >= double(all/(4*M)) ) printf("Yes\n");
      |                 ^~~~~~
Language: Java

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


Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from double to int
    double[] A = new int[n];
                         ^
Main.java:9: error: incompatible types: int[] cannot be converted to double[]
    double[] A = new int[n];
                 ^
2 errors
Language: C++

#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
    int n,m,x;
    vector<int>a;
    cin>>n>>m;
    for(int i=0; i<n; i++){
        cin>>x;
        a.push_back(x);
    }
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    int p=0;
    for(int j=0;j<n;j++){
        p=p+a[j];
    }
    if(p%(4*m)==0){
            int q=p/(4*m);
    }
    else if(p%(4*m)!=0){
            int q=p/(4*m)+1;
    }
    
    if(a[m-1]<q || n<m){
        cout<<"No";
    }
    else{
        cout<<"Yes";
    }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:26:15: error: 'q' was not declared in this scope
   26 |     if(a[m-1]<q || n<m){
      |               ^
Language: C++

#include <iostream>
using namespace std;

int a[1000];

int main()
{
	int n, m;
	cin >> n >> m;
	int u = 0;
	for (int i = 1; i <= n; ++i)
	{
		cin >> a[i];
		u = u + a[i];
	}
	for (int i = 1; i <= n; ++i)
	{
		if (a[i]*4*m >= u)
			a = a*1;
	}
	if (a >= m)
		cout << "Yes";
	else
		cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: invalid operands of types 'int [1000]' and 'int' to binary 'operator*'
   19 |                         a = a*1;
      |                             ~^~
      |                             | |
      |                             | int
      |                             int [1000]
a.cc:21:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if (a >= m)
      |             ~~^~~~
Language: C++

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

using namespace std;

int main()
{
    int n,m,sum=0,flag=0;
    scanf("%d %d",&n,&m);
    int *A;
    A = new int[n];
    for(int i=0;i<n;i++){
        scanf("%d",&A[i]);
        sum+=A[i];
    }

    sort(A,A+n,greater<int>());

    for(int i=0;i<m;i++){
        if(A[i]<sum/(4*m)){
            flag++;
            printf("No");
            break;
        }
    }
    if(flag==0){
        printf("Yes");
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: 'greater' was not declared in this scope
   17 |     sort(A,A+n,greater<int>());
      |                ^~~~~~~
a.cc:17:24: error: expected primary-expression before 'int'
   17 |     sort(A,A+n,greater<int>());
      |                        ^~~