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

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int main() {

    int n, m;
    cin >> n >> m;
    
    vector<int> a(n);
    double sum = 0;
    REP(i, n) {
        cin >> a[i];
        sum += a[i];
    }

    int tmp = 0;

    REP(i, n) {
        if (a[i] >= sum/4)
    }

    if (tmp >= m) {
        cout << "Yes" << endl;
        
    } else { 
        cout << "No" << endl;
        
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:32:5: error: expected primary-expression before '}' token
   32 |     }
      |     ^
Language: C++

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

int main() {
  int n, m;
  cin >> n >> m;
  vector<int>a(n);
  rep(i,n){
    cin >> a.at(i);
  }
  int k=0;
  rep(i,n){
    k+=a.at(i);
  }
  
  int ans=0;
  
  rep(i.n){
    if(k*(1/(4*m))<=a.at(i)){
      ans++;
    }
  }
  if(m<=ans){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" <<endl;
  }
  
      

}


Compiler output:
a.cc:20:10: error: macro "rep" requires 2 arguments, but only 1 given
   20 |   rep(i.n){
      |          ^
a.cc:2:9: note: macro "rep" defined here
    2 | #define rep(i,n) for (int i = 0; i < (n) ;i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:20:3: error: 'rep' was not declared in this scope
   20 |   rep(i.n){
      |   ^~~
Language: C++

#include<bits/stdc++.h>


using namespace std;


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

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

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

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:35: error: expected ';' before 'if'
   19 |         sort(a,a+n,greater<int>())
      |                                   ^
      |                                   ;
   20 | 
   21 |         if(a[m-1]>=(sum/(4*m)))
      |         ~~                         
a.cc:23:9: error: 'else' without a previous 'if'
   23 |         else
      |         ^~~~
Language: C++

#include<bits/stdc++.h>


using namespace std


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

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


	int count=0;

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

	if(count>=m)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;


	return 0;
}

Compiler output:
a.cc:4:20: error: expected ';' before 'int'
    4 | using namespace std
      |                    ^
      |                    ;
......
    7 | int main()
      | ~~~                 
a.cc: In function 'int main()':
a.cc:17:29: error: expected ';' before '}' token
   17 |                 sum=sum+a[i]
      |                             ^
      |                             ;
   18 |         }
      |         ~
Language: Java

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

Compiler output:
Main.java:39: error: reached end of file while parsing
}
 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b;
  cin >> a >> b;
  int c[a];
  int count = 0;
  for(int i=0;i<a;i++){
   cin >> c[i];
    count += c[i];
  }
  sort(c.begin(),c.end());
  reverse(c.begin(),c.end())
  if(c[b]>(count/4)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: request for member 'begin' in 'c', which is of non-class type 'int [a]'
   12 |   sort(c.begin(),c.end());
      |          ^~~~~
a.cc:12:20: error: request for member 'end' in 'c', which is of non-class type 'int [a]'
   12 |   sort(c.begin(),c.end());
      |                    ^~~
a.cc:13:13: error: request for member 'begin' in 'c', which is of non-class type 'int [a]'
   13 |   reverse(c.begin(),c.end())
      |             ^~~~~
a.cc:13:23: error: request for member 'end' in 'c', which is of non-class type 'int [a]'
   13 |   reverse(c.begin(),c.end())
      |                       ^~~
a.cc:17:3: error: 'else' without a previous 'if'
   17 |   else{
      |   ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: request for member 'end' in 'c', which is of non-class type 'int [a]'
   12 |   sort(c.end(),c.begin());
      |          ^~~
a.cc:12:18: error: request for member 'begin' in 'c', which is of non-class type 'int [a]'
   12 |   sort(c.end(),c.begin());
      |                  ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b;
  cin >> a >> b;
  int c[200];
  int count = 0;
  for(int i=0;i<a;i++){
   cin >> c[i];
    count += c[i];
  }
  sort(c.end(),c.begin());
  if(c[b]>(count/4)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: request for member 'end' in 'c', which is of non-class type 'int [200]'
   12 |   sort(c.end(),c.begin());
      |          ^~~
a.cc:12:18: error: request for member 'begin' in 'c', which is of non-class type 'int [200]'
   12 |   sort(c.end(),c.begin());
      |                  ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b;
  cin >> a >> b;
  int c[200];
  int count = 0;
  for(int=0;i<a;i++){
   cin >> c[i];
    count += c[i];
  }
  sort(c.end(),c.begin());
  if(c[b]>(count/4)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected unqualified-id before '=' token
    8 |   for(int=0;i<a;i++){
      |          ^
a.cc:8:10: error: expected ';' before '=' token
    8 |   for(int=0;i<a;i++){
      |          ^
      |          ;
a.cc:8:10: error: expected primary-expression before '=' token
a.cc:8:13: error: 'i' was not declared in this scope
    8 |   for(int=0;i<a;i++){
      |             ^
a.cc:8:16: error: expected ')' before ';' token
    8 |   for(int=0;i<a;i++){
      |      ~         ^
      |                )
a.cc:8:17: error: 'i' was not declared in this scope
    8 |   for(int=0;i<a;i++){
      |                 ^
a.cc:12:10: error: request for member 'end' in 'c', which is of non-class type 'int [200]'
   12 |   sort(c.end(),c.begin());
      |          ^~~
a.cc:12:18: error: request for member 'begin' in 'c', which is of non-class type 'int [200]'
   12 |   sort(c.end(),c.begin());
      |                  ^~~~~
Language: C++

z#include<iostream>
using namespace std;

int main(){
  int N,M;
  
  int A[110];
  
  float ALL = 0.0f;
  
  cin>>N>>M;
  
  for(int i = 0;i < N;i++){
    
    cin>>A[i];
    
    ALL += A[i];
  
  }
  
  ALL /= 4 * M;
  
  int res = 0;
  
  for(int i = 0;i < N;i++){
    
   if(ALL <= A[i]){
     res++;
   }
  
  }
  
  if(res >= M){
    cout<<"Yes";
  }else{
    cout<<"No";
  
  }
  
  return 0;


}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | z#include<iostream>
      |  ^
a.cc:1:1: error: 'z' does not name a type
    1 | z#include<iostream>
      | ^
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin>>N>>M;
      |   ^~~
a.cc:34:5: error: 'cout' was not declared in this scope
   34 |     cout<<"Yes";
      |     ^~~~
a.cc:36:5: error: 'cout' was not declared in this scope
   36 |     cout<<"No";
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
#define PI 3.14159265358979323846264338327950
int main () {
    int n 
    double m ;
    cin >> n >> m ;
    vector<double> vec (n);
    int tounter = 0;
    rep(i, n){
        cin >> vec[i];
    }
    int total = 0;
    rep(i,n){
        total += vec[i];
    }
    double num = total /(4*m);
    rep(i, n){
        if (vec[i] >= num){
            tounter++ ;
        }
    }
    if (tounter >= m){
    cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected initializer before 'double'
    9 |     double m ;
      |     ^~~~~~
a.cc:10:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   10 |     cin >> n >> m ;
      |            ^
      |            yn
a.cc:10:17: error: 'm' was not declared in this scope; did you mean 'tm'?
   10 |     cin >> n >> m ;
      |                 ^
      |                 tm
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define bs binary_search
#define pb push_back
#define pp pair<ll,ll>
#define all(v) v.begin(),v.end()
#define F first 
#define S second 
#define lc "\n"
ll power(ll x,ll y,ll p){ll res=1;x=x%p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;} 
ll MAX=1e18 , MIN=-1e18 , MOD=1000000007;
void solve()
{
    int n,m.i; cin>>n>>m;
    double k,sum=0;
	vector<int>v(n);
	for(i=0;i<n;i++) cin>>v[i],sum+=v[i];
	k=sum/(m*4);
	bool ok=true;
	sort(v.begin(),v.end());
	for(i=0;i<m;i++)
	{
		if(v[n-1-i]<k)
		{ok=false;break;}
	}
	if(ok) cout<<"Yes"<<lc;
	else cout<<"No"<<lc;
}
int main() 
{
    fastio
    int t=1; //cin>>t;
    while(t--) solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:16:12: error: expected initializer before '.' token
   16 |     int n,m.i; cin>>n>>m;
      |            ^
a.cc:16:24: error: 'm' was not declared in this scope
   16 |     int n,m.i; cin>>n>>m;
      |                        ^
a.cc:19:13: error: 'i' was not declared in this scope
   19 |         for(i=0;i<n;i++) cin>>v[i],sum+=v[i];
      |             ^
a.cc:23:13: error: 'i' was not declared in this scope
   23 |         for(i=0;i<m;i++)
      |             ^
Language: Java

import java.util.Scanner;
public class Popular_161B {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int m = scan.nextInt();

		int sum = 0;
String re = "Yes";

		for(int i = 1;i <= n;i++) {
			int a = scan.nextInt();

			 sum = sum + a;
			 if(i == n) {
				if(sum*(1/(4*m)) > a) {
					re = "No";
				}
		}
		}

		System.out.println(re);

		scan.close();

	}

}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,b; cin >> n >> b;
  vector<int> data(n);
  double vote=0;
  for(int i=0; i<n; i++){
    cin >> data.at(i);
    vote += data.at(i);
  }
  double x = vote/(4*b);
  int count=0;
  for(int i=0; i<n; i++){
    if(data.at(i) >= x) count++;
  }
  if(count>=m) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'm' was not declared in this scope
   17 |   if(count>=m) cout << "Yes" << endl;
      |             ^
Language: C++

#include "iostream"
#define ll long long int
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    
    int arr[n];
    ll sum=0;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        sum+=arr[i];
    }
    
    double lol= sum/(4*m);
    
    sort(arr, arr+n, greater<int>());

    int count=0;
    for(int i=0;i<n;i++)
    {
        if(arr[i]>=lol)
            count++;
        
    }
    
    if(count>=m)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    
    
    
}


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

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        long N, M;
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        M = sc.nextInt();
        long[] a = new long[(int)N];
        long check = 0;
        for(int i = 0 ; i < N ; i++)
        {
            a[i] = sc.nextLong();
            check += a[i];
        };
        check *= 1/4f/M;
        int count = 0;
        while(N-1 >= 0)
        {
            count += (a[N-1] >= check) ? 1 : 0;
            N--;
        }
        System.out.println(count >= M ? "Yes" : "No");
    }
}

Compiler output:
Main.java:20: error: incompatible types: possible lossy conversion from long to int
            count += (a[N-1] >= check) ? 1 : 0;
                         ^
1 error
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N, M, sum = 0, cnt = 0;
		N = sc.nextInt();
		M = sc.nextInt();
		int[] Arr = new int[N];
		for (int i = 0; i < N; i++) {
			Arr[i] = sc.nextInt();
			sum += Arr[i];
		}
		
		for(int i = 0; i<N; i++) {
			if(Arr[i]>=sum/4/M) {
				cnt++;
			}
		}
		System.out.println(cnt<M?"No":"Yes");

	}
}


Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

int main() {
  int n,m;
  cin >> n >> m;
  vector<int> N(n);
  for(int i=0; i<n; i++){
    cin >> N.at(i);
  }
  
  double sum;
  for(int i=0; i<n i++){
    sum=sum+N.at(i);
  }
  
  double judge=sum*(1/4*m);
  int count=0;
  for(int i=0; i<n; i++){
    if(N.at(i)>=judge){
      count++;
    }
  }
  
  if(count>=m){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


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

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

int main() {
  int n,m;
  cin >> n >> m;
  vector<int> N(n);
  for(int i=0; i<n; i++){
    cin >> N.at(i);
  }
  
  double sum;
  for(int i=0; i<n i++){
    sum=sum+N.at(i)
  }
  
  double judge=sum*(1/4*m);
  int count=0;
  for(int i=0; i<n; i++){
    if(N.at(i)>=judge){
      count++;
    }
  }
  
  if(count>=m){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: expected ';' before 'i'
   13 |   for(int i=0; i<n i++){
      |                   ^~
      |                   ;
a.cc:14:20: error: expected ';' before '}' token
   14 |     sum=sum+N.at(i)
      |                    ^
      |                    ;
   15 |   }
      |   ~
Language: C++

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

int main() {
  int n,m;
  cin >> n >> m;
  vector<int> N(n);
  for(int i=0; i<n; i++){
    cin >> N.at(i);
  }
  
  double judge=1/4*m;
  int count=0;
  for(int i=0; i<n; i++){
    if(N.at(i)>=judge){
      count++;
    }
  }
  
  if(count>=m){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
}


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

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

int main() {
  int n,m;
  cin >> n >> m;
  victor<int> N(n);
  for(int i=0; i<n; i++){
    cin >> N.at(i);
  }
  
  double judge=1/4*m;
  int count=0;
  for(int i=0; i<n; i++){
    if(N.at(i)>=judge){
      count++;
    }
  }
  
  if(count>=m){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'victor' was not declared in this scope
    7 |   victor<int> N(n);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   victor<int> N(n);
      |          ^~~
a.cc:9:12: error: 'N' was not declared in this scope
    9 |     cin >> N.at(i);
      |            ^
a.cc:15:8: error: 'N' was not declared in this scope
   15 |     if(N.at(i)>=judge){
      |        ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

N,M=map(int,input().split())
  A=list(map(int,input().split()))
  S=sum(A)
  cnt= 0
  for a in A:
if a>=S/ (4*M):
cnt+= 1
  if cnt>=M:
print("Yes")
  else:
print("No")

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N,M=map(int,input().split())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
    1 | N,M=map(int,input().split())
      |   ^
main.c:1:5: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | N,M=map(int,input().split())
      |     ^~~
main.c:1:9: error: expected expression before 'int'
    1 | N,M=map(int,input().split())
      |         ^~~
main.c:2:3: error: expected ',' or ';' before 'A'
    2 |   A=list(map(int,input().split()))
      |   ^
Language: C

#include<stdio.h>
//#include<stdlib.h>
//int sort(const int *a,const int*b){
return *b-*a;
}
int main(void){
  int n,m;
  scanf("%d",&n,&m);
  int a[n];
  double sum=0;
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
    sum+=a[i];
  }
 // qsort(a,n,sizeof(int),sort);
  int c=0;
  for(int i=0;i<n;i++){
	if(a[i]>=sum/4.0/m)c++;
  }
  if(c>=m)printf("Yes");
  else printf("No");
  return 0;
}
  


Compiler output:
main.c:4:1: error: expected identifier or '(' before 'return'
    4 | return *b-*a;
      | ^~~~~~
main.c:5:1: error: expected identifier or '(' before '}' token
    5 | }
      | ^
Language: C

#include <stdio.h>

int main(void){
    int N,M;
    scanf("%d %d",&N,&M);
    int a[110];
    int i;
    int sum=0;
    int c=0;
    for(i=1;i<N+1;i++){
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    for(i=1;i<N+1;i++){
        if(a[i]*4*M>=sum{
            c+=1;
        }
    
    }
    if(c>=M){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;

}

Compiler output:
main.c: In function 'main':
main.c:15:25: error: expected ')' before '{' token
   15 |         if(a[i]*4*M>=sum{
      |           ~             ^
      |                         )
main.c:19:5: error: expected expression before '}' token
   19 |     }
      |     ^
Language: C

#include <stdio.h>

int main(void)
{

    int n,m,a[1000],x=0,y=0,w=0,i;

    scanf("%d%d",&n,&m);

    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        x=x+a[i];
    }

     y=x*((double)1/4*m);

     for(i=0;i<n;i++){
         if(a[i]>=y) w++;
     }

     if(m<=w)  printf("Yes\n");
     else if(m>w)  printf("No\n");

     printf("%d%d%d",w,x,y);

     return 0;
}
~


Compiler output:
main.c:28:1: error: expected identifier or '(' before '~' token
   28 | ~
      | ^
Language: C

#include <stdio.h>
 
int main(void)
{
    
    int n,m,a[1000],x=0,y=0,w=0;
      
    scanf("%d%d",&n,&m);
  
    for(i=0;i<n;i++){
        scanf("%d",a[i]);
        x=x+a[i];
    }
  
     y=x*(1/4*m);
  
     for(i=0;i<n;i++){
         if(a[i]>y) w++;
     }
     
     if(m<=w)  printf("Yes\n");
     else if(m>=w)  printf("No\n");
    
     return 0;
}  

Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'i' undeclared (first use in this function)
   10 |     for(i=0;i<n;i++){
      |         ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void)
{
    
    int n,m,a[1000],x=0,y=0,w=0;
      
    scanf("%d%d",&n,&m);
  
    for(i=0;i<n;i++){
        scanf("%d",a[i]);
        x=x+a[i];
    }
  
     y=x*(1/4m);
  
     for(i=0;i<n;i++){
         if(a[i]>y) w++;
     }
     
     if(m<=w)  printf("Yes\n");
     else if(m>=w)  printf("No\n");
    
     return 0;
}  
    

Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'i' undeclared (first use in this function)
   10 |     for(i=0;i<n;i++){
      |         ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:13: error: invalid suffix "m" on integer constant
   15 |      y=x*(1/4m);
      |             ^~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: invalid operands of types 'double [105]' and 'double' to binary 'operator+'
   10 |     sort(a,a+n);
      |            ~^~
      |            | |
      |            | double
      |            double [105]
a.cc:12:11: error: invalid types 'double [105][double]' for array subscript
   12 |       if(a[n-1-i]<sum/(4*m)){
      |           ^
Language: C++

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

int main(){
  int N,M;cin>>N>>M;
  long long S=0;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
    S+=A.at(i);
  }
  sort(A.begin(),A.end());
  cout<<fixed<<setpresicion(2);
  cout<<(A.at(N-M)>=S/4/M?"Yes":"No")<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'setpresicion' was not declared in this scope
   13 |   cout<<fixed<<setpresicion(2);
      |                ^~~~~~~~~~~~
Language: C++

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

int main(){
  int N,M,;cin>>N>>M;
  long long S=0;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
    S+=A.at(i);
  }
  sort(A.begin(),A.end());
  cout<<(A.at(N-M)>=S/4/M?"Yes":"No")<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: expected unqualified-id before ';' token
    5 |   int N,M,;cin>>N>>M;
      |           ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
 
 
int main() {
    int n,m,ans=0,sum=0;
    cin >> n >> m;
    vector<int> A(n);
    rep(i,n){
        cin >> A[i];
        sum += A[i];
    }
    rep(i,n){
        if(A[i]*4*m>=sum) ans++;
    }
    cout << (ans>=m) ? "Yes":"No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:35: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   20 |     cout << (ans>=m) ? "Yes":"No" << endl;
      |                              ~~~~~^~~~~~~
Language: C

// Vicfred
// https://atcoder.jp/contests/abc161/tasks/abc161_b
// simulation
import std.algorithm;
import std.array;
import std.conv;
import std.stdio;

void main() {
    int n, m;
    readf("%s %s\n", &n, &m);

    int bound = 1/(4*m);

    int[] a = readln.split.map!(to!int).array;

    int answer = 0;
    foreach(votes; a) {
        if(votes >= bound)
            answer += 1;
    }

    if(answer >= m)
        "Yes".writeln;
    else
        "No".writeln;
}



Compiler output:
main.c:4:1: error: unknown type name 'import'
    4 | import std.algorithm;
      | ^~~~~~
main.c:4:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    4 | import std.algorithm;
      |           ^
main.c:5:1: error: unknown type name 'import'
    5 | import std.array;
      | ^~~~~~
main.c:5:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    5 | import std.array;
      |           ^
main.c:6:1: error: unknown type name 'import'
    6 | import std.conv;
      | ^~~~~~
main.c:6:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    6 | import std.conv;
      |           ^
main.c:7:1: error: unknown type name 'import'
    7 | import std.stdio;
      | ^~~~~~
main.c:7:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    7 | import std.stdio;
      |           ^
main.c: In function 'main':
main.c:11:5: error: implicit declaration of function 'readf' [-Wimplicit-function-declaration]
   11 |     readf("%s %s\n", &n, &m);
      |     ^~~~~
main.c:15:8: error: expected identifier or '(' before '[' token
   15 |     int[] a = readln.split.map!(to!int).array;
      |        ^
main.c:18:5: error: implicit declaration of function 'foreach' [-Wimplicit-function-declaration]
   18 |     foreach(votes; a) {
      |     ^~~~~~~
main.c:18:13: error: 'votes' undeclared (first use in this function)
   18 |     foreach(votes; a) {
      |             ^~~~~
main.c:18:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:18: error: expected ')' before ';' token
   18 |     foreach(votes; a) {
      |            ~     ^
      |                  )
main.c:18:22: error: expected ';' before '{' token
   18 |     foreach(votes; a) {
      |                      ^~
      |                      ;
main.c:25:5: error: 'else' without a previous 'if'
   25 |     else
      |     ^~~~
main.c:26:13: error: request for member 'writeln' in something not a structure or union
   26 |         "No".writeln;
      |             ^
Language: C

#include <stdio.h>

int main(int argc, const char* argv[])
{
	int itemNum, popItemNum, totalVotes = 0, choosenItem = 0;
	int votesArray[100];
	double winVotes = 0;

	scanf("%d %d", &itemNum, &popItemNum);

	// Counting total number of votes, also creating an array with partial votes
	for (int i = 0; i < itemNum; i++)
	{
		int partVotes;
		scanf("%d", &partVotes);
		totalVotes += partVotes;
		votesArray[i] = partVotes;
	}

	winVotes = totalVotes / (4 * popItemNum);

	// Using popItemNum(M) as counter to judge if the requirement of task is fulfilled. 
	// If goes beyond 0, then it means M popular items can be selected. 

	for (int i = 0; i < itemNum; i++)
	{
		if (votesArray[i] >= winVotes)
		{
			choosenItem++;
		}
	}

	if (popItemNum <= choosenItem)
	{
		printf_s("Yes \n");
	}
	else
	{
		printf_s("No \n");
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:17: error: implicit declaration of function 'printf_s'; did you mean 'printf'? [-Wimplicit-function-declaration]
   35 |                 printf_s("Yes \n");
      |                 ^~~~~~~~
      |                 printf
Language: C++

//Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    int n,m;
    cin>>n>>m;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int tot=0;
    tot=accumulate(a,a+n,tot);
    double vote=ceil(tot/(4.0*m))

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: expected ',' or ';' before 'int'
   16 |     int ans=0;
      |     ^~~
a.cc:20:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |             ans++;
      |             ^~~
      |             abs
a.cc:23:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     if(ans>=m){
      |        ^~~
      |        abs
Language: C++

//Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    int n,m;
    cin>>n>>m;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int tot=0,vote=0;
    tot=accumulate(a,a+n,tot);
    vote=tot/(4*m);

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: expected primary-expression before '>' token
   19 |         if(a[i]=>vote){
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int m,n;
  cin>>n>>m;
  vector<int>a(n);
  int sum=0;
  for(int i;i<n;i++){
    cin>>a.at(i);
    sum+=a.at(i);
  }
  sort(a.rbegin(),a.rend());
  int count=0;
  if(a.at(i)>sum/4/m){
    cout<<"No"<<endl;
  }
  else{
    cout<<"Yes"<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: 'i' was not declared in this scope
   15 |   if(a.at(i)>sum/4/m){
      |           ^
Language: C++

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

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

 
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
  ll N, M, A;
  bool ans = false;
  cin >> N >> M;
  rep(i,N) {
    cin >> A;
    if (A > 1 / (4*M)) {
      ans = true;
      break;
    }
  }
  if (ans) cout << "Yes";
  else cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:7: error: 'i' was not declared in this scope
   36 |   rep(i,N) {
      |       ^
a.cc:36:3: error: 'rep' was not declared in this scope
   36 |   rep(i,N) {
      |   ^~~
Language: C++

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

int main() {
	int N, M;
	int hyou=0;
	vector<auto> A;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		hyou += A[i];
	}

	sort(A.begin(), A.end());
	reverse(A.begin(), A.end());
	hyou /= 4;
	for (int i = 0; i < M; i++) {
		if (A[i] >= hyou) {}
		else {
			cout << "No" << endl;
			break;
		}
	}

	cout << "Yes" << endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: template argument 1 is invalid
    7 |         vector<auto> A;
      |                    ^
a.cc:7:20: error: template argument 2 is invalid
a.cc:9:25: error: invalid types 'int[int]' for array subscript
    9 |                 cin >> A[i];
      |                         ^
a.cc:10:26: error: invalid types 'int[int]' for array subscript
   10 |                 hyou += A[i];
      |                          ^
a.cc:13:16: error: request for member 'begin' in 'A', which is of non-class type 'int'
   13 |         sort(A.begin(), A.end());
      |                ^~~~~
a.cc:13:27: error: request for member 'end' in 'A', which is of non-class type 'int'
   13 |         sort(A.begin(), A.end());
      |                           ^~~
a.cc:14:19: error: request for member 'begin' in 'A', which is of non-class type 'int'
   14 |         reverse(A.begin(), A.end());
      |                   ^~~~~
a.cc:14:30: error: request for member 'end' in 'A', which is of non-class type 'int'
   14 |         reverse(A.begin(), A.end());
      |                              ^~~
a.cc:17:22: error: invalid types 'int[int]' for array subscript
   17 |                 if (A[i] >= hyou) {}
      |                      ^
Language: Java


import java.util. ArrayList;
import java.util.Scanner;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> a = new ArrayList<>();
        while(sc.hasNext()== true ){
            a.add(sc.nextInt());
        }
        int sumo = 0;
        for (int i =0; i<a.size(); i++){
            sumo += a.get(i);
        }
        sumo -= a.get(0);
        sumo -= a.get(1);
        int ans = a.get(0) - sumo;
        if( a.get(0)< sumo){
            System.out.println(-1);
        }else{
            System.out.println(ans);
        }
    }
}



/*

n m
a

n種類の商品からm個選ぶ
ただし、mに該当するものはsum(a1~ai)の1/4M以上じゃなければいけない
m個ちゃんと選べるならYes,選べないならNo

Collections.Max

*/

import java.lang.Math;
import java.util.Collections;
import java.util. ArrayList;
import java.util.Scanner;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Long> a = new ArrayList<>();
        while(sc.hasNext()== true ){
            a.add(sc.nextLong());
        }
        long sumo = 0;
        for (int i =0; i<a.size(); i++){
            sumo += a.get(i);
        }
        long n = a.get(0);
        long m = a.get(1);
        String ans = null;
        sumo = sumo - (n + m);
        int cnt = 0;
        //sumoがaの総和になった
        //ここから最大値をm個とる
        long thres = Math.round(sumo/(4*m));
        for (long i=0; i < m; i++){
            long b = Collections.max(a);
            if (b >= thres){
                cnt +=1;
                a.remove(a.indexOf(b));
            }else{
                a.remove(a.indexOf(b));
            }
        }
        if (cnt >= m){
            ans = "Yes";
        }else{
            ans ="No";
        }
        System.out.println(ans);
    }
}


Compiler output:
Main.java:41: error: class, interface, enum, or record expected
import java.lang.Math;
^
Main.java:42: error: class, interface, enum, or record expected
import java.util.Collections;
^
Main.java:43: error: class, interface, enum, or record expected
import java.util. ArrayList;
^
Main.java:44: error: class, interface, enum, or record expected
import java.util.Scanner;
^
4 errors
Language: C++

#include <stdio.h>
int main(void){
  int N, M;
  int i;
  int sum=0;
  int count=0;
  
  scanf("%d %d", &N, &M);
  
  int A[N];
  
  for(i=0; i<N; i++){
    scanf("%d", &A[i]);
    sum++A[i];
  }
  
  for(i=0; i<N; i++){
    if(A[i]*4*M>=sum)
      count++;
  }
  
  if(count>=M)
    printf("Yes");
  else
    printf("No");
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: expected ';' before 'A'
   14 |     sum++A[i];
      |          ^
      |          ;
Language: C++

#include <stdio.h>
 
int main(void){
  
  int N,M,c;
  int i=0,sum=0,d=0; 
  int a[1000];
 
  
  scanf("%d %d", &N, &M);
  
  for(i=0; i<N; i++){
    scanf("%d",&a[i]);
  }
  
  for(i=0; i<n; i++){
    sum += a[i];
  }
  
  c = (sum/(4*M));
  
  for(i=0; i<=M; i++){
    if(a[i] >= c){
      d++;
    }
  }
  
  if(d=M){
    printf("Yes");
  }
  	else{
    printf("No");
  }
  
  return 0;
}
#include <stdio.h>
 
int main(void){
  
  int N,M,c;
  int i=0,sum=0,d=0; 
  int a[1000];
 
  
  scanf("%d %d", &N, &M);
  
  for(i=0; i<N; i++){
    scanf("%d",&a[i]);
  }
  
  for(i=0; i<N; i++){
    sum += a[i];
  }
  
  c = (sum/(4*M));
  
  for(i=0; i<=M; i++){
    if(a[i] >= c){
      d++;
    }
  }
  
  if(d=M){
    printf("Yes");
  }
  	else{
    printf("No");
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: 'n' was not declared in this scope
   16 |   for(i=0; i<n; i++){
      |              ^
a.cc: At global scope:
a.cc:39:5: error: redefinition of 'int main()'
   39 | int main(void){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(void){
      |     ^~~~
Language: C++

#include <stdio.h>
 
int main(void){
  
  int N,M,c;
  int i=0,sum=0,d=0; 
  int a[1000];
 
  
  scanf("%d %d", &N, &M);
  
  for(i=0; i<N; i++){
    scanf("%d",&a[i]);
  }
  
  for(i=0; i<n; i++){
    sum += a[i];
  }
  
  c = (sum/(4*M));
  
  for(i=0; i<=M; i++){
    if(a[i] >= c){
      d++;
    }
  }
  
  if(d=M){
    printf("Yes");
  }
  	else{
    printf("No");
  }
  
  return 0;
}

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

#include <stdio.h>
 
int main(void){
  
  int N,M,c;
  int i=0,sum=0,d=0; 
  int a[1000];
 
  
  scanf("%d %d", &N, &M);
  
  for(i=0; i<N; i++){
    scanf("%d",&a[i]);
  }
  
  for(i=0; i<n; i++){
    sum += a[i];
  }
  
  c = (sum/(4*M));
  
  for(i=0; i<=M; i++){
    if(a[i] >= c){
      d++;
    }
  }
  
  if(f=M){
    printf("Yes");
  }
  	else{
    printf("No");
  }
  
  return 0;
}
#include <stdio.h>
 
int main(void){
  
  int N,M,c,;
  int i=0,sum=0,d=0; 
  int a[1000];
 
  
  scanf("%d %d", &N, &M);
  
  for(i=0; i<N; i++){
    scanf("%d",&a[i]);
  }
  
  for(i=0; i<n; i++){
    sum += a[i];
  }
  
  c = (sum/(4*M));
  
  for(i=0; i<=M; i++){
    if(a[i] >= c){
      d++;
    }
  }
  
  if(f=M){
    printf("Yes");
  }
  	else{
    printf("No");
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: 'n' was not declared in this scope
   16 |   for(i=0; i<n; i++){
      |              ^
a.cc:28:6: error: 'f' was not declared in this scope
   28 |   if(f=M){
      |      ^
a.cc: At global scope:
a.cc:39:5: error: redefinition of 'int main()'
   39 | int main(void){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(void){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:41:13: error: expected unqualified-id before ';' token
   41 |   int N,M,c,;
      |             ^
a.cc:52:14: error: 'n' was not declared in this scope
   52 |   for(i=0; i<n; i++){
      |              ^
a.cc:64:6: error: 'f' was not declared in this scope
   64 |   if(f=M){
      |      ^
Language: C++

#include <stdio.h>
 
int main(void){
  
  int N,M,c,;
  int i=0,sum=0,d=0; 
  int a[1000];
 
  
  scanf("%d %d", &N, &M);
  
  for(i=0; i<N; i++){
    scanf("%d",&a[i]);
  }
  
  for(i=0; i<n; i++){
    sum += a[i];
  }
  
  c = (sum/(4*M));
  
  for(i=0; i<=M; i++){
    if(a[i] >= c){
      d++;
    }
  }
  
  if(f=M){
    printf("Yes");
  }
  	else{
    printf("No");
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected unqualified-id before ';' token
    5 |   int N,M,c,;
      |             ^
a.cc:16:14: error: 'n' was not declared in this scope
   16 |   for(i=0; i<n; i++){
      |              ^
a.cc:28:6: error: 'f' was not declared in this scope
   28 |   if(f=M){
      |      ^
Language: C++

#include<stdio.h>
int main(void)
{
  int N,i,M;
  scanf("%d %d",&N,&M);
  int A[N],sum=0,number=0;
  for(i=0;i<N;i++)
  {
  scanf("%d",&A[i]);
    sum=+A[i];
  }
  for(i=0;i<N;i++)
  {
  if(sum=<A[i]*4*M)
    number++;
  }
  if(number<M)
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: expected primary-expression before '<' token
   14 |   if(sum=<A[i]*4*M)
      |          ^
Language: C++

#include<stdio.h>
int main(void)
{
  int N,i,M;
  scanf("%d %d",&N,&M);
  int A[N],sum=0,number=0;
  for(i=0;i<N;i++)
  {
  scanf("%d",&A[i]);
    sum=+A[i];
  }
  sum=sum/(4*M);
  for(i=0;i<N,i++)
  {
  if(A[i]>sum)
    number++;
  }
  if(number<M)
    printf("No");
  else
    printf("Yes");
  return 0;
}
    

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

#include<stdio.h>

int main() {
  int n,m,i;
  int a[1000] = 0;
  int sum = 0;
  int re = 0;

  scanf("%d %d", &n, &m);

  for(i=0;i<n;i++) {
     scanf("%d", &a[i]);
     sum = sum + a[i];
  }

  for(i=0;i<n;i++) {
     if(a[i] > sum/4*m)
        re += 1;
  }
  
  if(re >= m)
    printf("Yes");
  else
    printf("No");

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: array must be initialized with a brace-enclosed initializer
    5 |   int a[1000] = 0;
      |                 ^
Language: C++

#include<stdio.h>

int main() {
  int n,m,i;
  int a[1000] = 0;
  int sum = 0;
  int re = 0;

  scanf("%d %d", &n, &m);

  for(i=0;i<n;i++) {
     scanf("%d",a[i]);
     sum = sum + a[i];
  }

  for(i=0;i<n;i++) {
     if(a[i] > sum/4*m)
        re++;
  }
  
  if(re >= m)
    printf("Yes");
  else
    printf("No");

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: array must be initialized with a brace-enclosed initializer
    5 |   int a[1000] = 0;
      |                 ^
Language: C

#include<stdio.h>

int main(void){
    int n,m,i,j,sum=0,temp;
    scanf("%d %d",&n,&m);
    int a[n];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    for(i=0;i<n;i++){
        for(j=n-1;j>i;j--){
            if(a[j]>a[j-1]){
                temp=a[j];
                a[j]=a[j-1];
                a[j-1]=temp;
            }
        }
    }
    if(a[m-1]*4*m>=sum{
        printf("Yes");
    }
    else
    {
        printf("No");
    }
    
}

Compiler output:
main.c: In function 'main':
main.c:20:23: error: expected ')' before '{' token
   20 |     if(a[m-1]*4*m>=sum{
      |       ~               ^
      |                       )
main.c:28:1: error: expected expression before '}' token
   28 | }
      | ^
Language: C

#include<stdio.h>
int main(void){
  int kind,choice,count=0;
  int i;
  double sum=0;
  double judge;
    
  scanf("%d %d\n", &kind,&choice);
  int num[kind];
  for(i=0;i<kind;i++){
    scanf("%d ", &num[i]);
    sum+=num[i];
  }
  judge=sum/(4*choice);
  for(j=0;j<kind;j++){
    if(num[j]>=judge)
      count++;
  }
  if(count>=choice)
    printf("Yes");
  else
    printf("No");
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:7: error: 'j' undeclared (first use in this function)
   15 |   for(j=0;j<kind;j++){
      |       ^
main.c:15:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <stdio.h>
 
int main(void)
{
  int m,n;
  int a[1000];
  int sum=0;
  int flag=0;
  
  do{
    scanf("%d %d",&m,&n);
  } while((m<1 || m>100) || ((n<1 || n>100) || m>n));
  
  for(i=1; n>=i; i++){
    do{
      scanf("%d ",&a[i]);
    } while(a[i]<1 || a[i]>1000);
    sum += a[i];
  }
  for(i=1; n>=i; i++)
    if(a[i]>=sum/(4*m))
      flag++;
  
  if(m>=flag)
    puts("Yes");
  else
    puts("No");
  
  return 0;
}

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

#include<stdio.h>

int main(void){
    int a[1000];
    int N,M,i,all=0;
    scanf("%d %d",&N,&M);
    for(i=0;i<N;i++){
        scanf("%d",&a[i]);
        all+=a[i];
    }
    int les=0;
    for(i=0;i<N;i++){
        if(a[i] >= (all/(4*M));
            les++;
    }
    if(les>=M){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:31: error: expected ')' before ';' token
   13 |         if(a[i] >= (all/(4*M));
      |           ~                   ^
      |                               )
main.c:15:5: error: expected expression before '}' token
   15 |     }
      |     ^
Language: C++

#include<stdio.h>
int main (void){
  int N,M,;
  double MAX = 0;
  if(scanf("%d %d",&N,&M) == 1)
    MAX ++;
  int A[N][2],i,CHECK = 0;
  for(i=0;i<N; i++){
    if(scanf("%d",&A[i][0]) == 1)
      MAX --;
    A[i][1] = 0;
    MAX = MAX + A[i][0];
  }
  MAX = MAX / (4 * M);
  for(i = 0; i<N;i++){
    if(MAX <= A[i][0])
      CHECK++;
  }
  if(CHECK >= M)
    printf("Yes");
  else
    printf("No");
}


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

#include<stdio.h>
int main (void){
  int N,M,MAX = 0;
  if(scanf("%d %d",&N,&M) == 1)
  int A[N][2],i,CHECK = 0;
  for(i=0;i<N; i++){
    if(scanf("%d",&A[i][0]) == 1)
    A[i][1] = 0;
    MAX = MAX + A[i][0];
  }
  MAX = MAX / (4 * M);
  for(i = 0; i<N;i++){
    if(MAX <= A[i][0])
      CHECK++;
  }
  if(CHECK >= M)
    printf("Yes");
  else
    printf("No");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0;i<N; i++){
      |       ^
a.cc:7:20: error: 'A' was not declared in this scope
    7 |     if(scanf("%d",&A[i][0]) == 1)
      |                    ^
a.cc:9:17: error: 'A' was not declared in this scope
    9 |     MAX = MAX + A[i][0];
      |                 ^
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i = 0; i<N;i++){
      |       ^
a.cc:13:15: error: 'A' was not declared in this scope
   13 |     if(MAX <= A[i][0])
      |               ^
a.cc:14:7: error: 'CHECK' was not declared in this scope
   14 |       CHECK++;
      |       ^~~~~
a.cc:16:6: error: 'CHECK' was not declared in this scope
   16 |   if(CHECK >= M)
      |      ^~~~~
Language: C

#inculde <stdio.h>
 int main (void){
   int n,m;
   int a[1000];
   int count=0;
   int sum=0;
   int i;
   
   scanf("%d %d",&n,&m);
   for(i=0;i<n;i++){
     scanf("%d ",&a[i]);
     sum=sum+a[i];
   }
   for(i=0;i<n;i++){
     if(a[i]>=sum/4*m)
       count++;
   }
   
   if(count>=m)
     puts("Yes");
   else 
     puts("No");

Compiler output:
main.c:1:2: error: invalid preprocessing directive #inculde; did you mean #include?
    1 | #inculde <stdio.h>
      |  ^~~~~~~
      |  include
main.c: In function 'main':
main.c:9:4: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    9 |    scanf("%d %d",&n,&m);
      |    ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #inculde <stdio.h>
main.c:9:4: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    9 |    scanf("%d %d",&n,&m);
      |    ^~~~~
main.c:9:4: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:20:6: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   20 |      puts("Yes");
      |      ^~~~
main.c:20:6: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:22:6: error: expected declaration or statement at end of input
   22 |      puts("No");
      |      ^~~~
Language: C

#include <stdio.h>
int main(void)
{
  int n,m,i,sum;
  scanf("%d",%n);
  scanf("%d",%m);
  int a[n],b=0;
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    sum+=a[i];
  }
  for(i=0;i<n;i++)
    if(a[i]*4*m>=sum)
      b++;
  if(b>=m)
    printf("Yes\n");
  else
    printf("No\n");
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:14: error: expected expression before '%' token
    5 |   scanf("%d",%n);
      |              ^
main.c:6:14: error: expected expression before '%' token
    6 |   scanf("%d",%m);
      |              ^