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

import java.rmi.activation.ActivationGroup_Stub;
import java.util.Scanner;
import java.util.ArrayList;

public class B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> al = new ArrayList<Integer>();
        double total = 0;

        int N = sc.nextInt();
        double M = sc.nextInt();
        for (int i = 0; i < N; i++) {
            al.add(sc.nextInt());
        }

        int count = 0;
        for (int i = 0; i < N; i++) {
            total += al.get(i);
        }

        for (int j = 0; j < N; j++) {
            if (al.get(j) > (total/(4*M))) {
                count++;
            }
            else {
            }
        }

        if (count > M) {
            System.out.println("Yes");
        }

        else {
            System.out.println("No");
        }
    }
}


Compiler output:
Main.java:5: error: class B is public, should be declared in a file named B.java
public class B {
       ^
Main.java:1: error: package java.rmi.activation does not exist
import java.rmi.activation.ActivationGroup_Stub;
                          ^
2 errors
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: lvalue required as left operand of assignment
   18 |     if(a[i]*(4*m)=s) {
Language: C++

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

int main()
{
  int n, m;
  floot kijun, sousu;
  string ans;
  int i;
  cin >> n;
  cin >> m;
  vector<int> a(n);
  sousu = 0;
  for(i=0; i<n; i++)
  {
    cin >> a[i];
    sousu += a[i];
  }
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  kijun = sousu/(4*m);
  ans = "Yes";
  for(i=0; i<m; i++)
  {
    if(a[i] < kijun) ans = "No";
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'floot' was not declared in this scope; did you mean 'floor'?
    7 |   floot kijun, sousu;
      |   ^~~~~
      |   floor
a.cc:13:3: error: 'sousu' was not declared in this scope
   13 |   sousu = 0;
      |   ^~~~~
a.cc:21:3: error: 'kijun' was not declared in this scope
   21 |   kijun = sousu/(4*m);
      |   ^~~~~
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: expected ',' or ';' before 'if'
   18 |   if (vec.at(m) < thre){
      |   ^~
a.cc:21:3: error: 'else' without a previous 'if'
   21 |   else {
      |   ^~~~
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'sum' was not declared in this scope
   12 |     sum += vec.at(i);
      |     ^~~
a.cc:15:10: error: 'sum' was not declared in this scope
   15 |   thre = sum/(4*M);
      |          ^~~
Language: C++

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

int main() {
  int N,M;
  cin >> N >> M;
  vector<int> vec(N);
    for (int i = 0; i < N; i++) {
  cin >> vec.at(i);
}
  int thre;
  thre = 1/(4*M);
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  for (int i = 0; i < M; i++) {
    if (vec.at(i) >= thre){
        cout << vec.at(i) << endl;
    }
    else {
      break;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
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;
  vector<int> vec(N);
    for (int i = 0; i < N; i++) {
  cin >> vec.at(i);
}
  int thre;
  thre = 1/(4*M);
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  for (int i = 0; i < M; i++) {
    if (vec.at(i) >= thre){
        cout << vec.at(i) << endl;
    }
    else {
      break
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: expected ';' before '}' token
   20 |       break
      |            ^
      |            ;
   21 |     }
      |     ~       
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
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;
  vector<int> vec(N);
    for (int i = 0; i < N; i++) {
  cin >> vec.at(i);
}
  int thre;
  thre = 1/(4*M);
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  for (int i = 0; i < M; i++) {
    if (vec.at(i) !< thre){
        cout << vec.at(i) << endl;
    }
    else if {
      break
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: expected ')' before '!' token
   16 |     if (vec.at(i) !< thre){
      |        ~         ^~
      |                  )
a.cc:19:13: error: expected '(' before '{' token
   19 |     else if {
      |             ^
      |             (
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

/******************************************
* AUTHOR : Anik Das *
* NICK : sadn1ck *
* INSTITUTION : IIEST Shibpur *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define lld long long double
#define MOD 1000000007

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NUlld);
	//ios_base& scientific (ios_base& str);
	lld sum = 0;
	lld n = 0, m = 0;
	cin >> n >> m;
	lld a[n];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		sum = sum + a[i];
	}
	
	int count = 0;
	for (int j = 0; j < n; j++) {
		if (a[j] >= (sum / (4 * m))) {
			count++;
		}
	}
	if (count >= m) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}


return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'NUlld' was not declared in this scope; did you mean 'lld'?
   14 |         cin.tie(NUlld);
      |                 ^~~~~
      |                 lld
a.cc:8:18: error: 'long long' specified with 'double'
    8 | #define lld long long double
      |                  ^~~~
a.cc:16:9: note: in expansion of macro 'lld'
   16 |         lld sum = 0;
      |         ^~~
a.cc:8:18: error: 'long long' specified with 'double'
    8 | #define lld long long double
      |                  ^~~~
a.cc:17:9: note: in expansion of macro 'lld'
   17 |         lld n = 0, m = 0;
      |         ^~~
a.cc:8:18: error: 'long long' specified with 'double'
    8 | #define lld long long double
      |                  ^~~~
a.cc:17:9: note: in expansion of macro 'lld'
   17 |         lld n = 0, m = 0;
      |         ^~~
a.cc:8:18: error: 'long long' specified with 'double'
    8 | #define lld long long double
      |                  ^~~~
a.cc:19:9: note: in expansion of macro 'lld'
   19 |         lld a[n];
      |         ^~~
a.cc:19:15: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   19 |         lld a[n];
      |               ^
a.cc:19:15: error: could not convert 'n' from 'double' to 'long unsigned int'
   19 |         lld a[n];
      |               ^
      |               |
      |               double
a.cc:19:15: error: size of array 'a' has non-integral type 'double'
Language: C++

/******************************************
* AUTHOR : Anik Das *
* NICK : sadn1ck *
* INSTITUTION : IIEST Shibpur *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007

int main() {

	// #ifndef ONLINE_JUDGE 
	// freopen("/home/anik/Desktop/cp/input.txt", "r", stdin); 
	// freopen("/home/anik/Desktop/cp/output.txt", "w", stdout); 
	// #endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//ios_base& scientific (ios_base& str);
	ll t=0;
	// cin >> t;
	t=1;
	int sum=0;
	while(t--){
		int n=0, m=0;
		cin >> n >> m;
		int a[n];
		for(int i=0;i<n;i++){
			cin >> a[i];
			sum = sum + a[i];
		}
		int count=0;
		sort(a, a+n)
		for(int i=0;i<n;i++){
			if(a[i]>=(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:33:29: error: expected ';' before 'for'
   33 |                 sort(a, a+n)
      |                             ^
      |                             ;
   34 |                 for(int i=0;i<n;i++){
      |                 ~~~          
a.cc:34:29: error: 'i' was not declared in this scope
   34 |                 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> a(n);
  rep(i, n) cin >> a[i];
  int s =0;
  rep(i, n){
    if(a[i]*(4*m) >= s)cnt++;
  }
  if(cnt >= m){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   rep(i, n) cin >> a[i];
      |       ^
a.cc:7:3: error: 'rep' was not declared in this scope
    7 |   rep(i, n) cin >> a[i];
      |   ^~~
a.cc:12:6: error: 'cnt' was not declared in this scope; did you mean 'int'?
   12 |   if(cnt >= m){
      |      ^~~
      |      int
Language: C++

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 sum = 0;
        int cnt = 0;
        Integer[] items = new Integer[N];
        for (int i = 0; i < N; i++) {
            int itemVote = sc.nextInt();
            sum += itemVote;
            items[i] = itemVote;
        }
        Arrays.sort(items, Collections.reverseOrder());
        double baseNum = sum / (4 * M);
        for (int l = 0; l < M; l++) {
            double val = (double) items[l];
            if (val < baseNum) {
                continue;
            }
            cnt++;
        }
        if (cnt >= M) {
            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:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

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

double n,m,sumv,ans=0;
double a[100005];

signed main()
{
	cin>>n>>m;
	for (int i=1;i<=n;i++)
	{
		cin>>a[i];
		sumv+=a[i];
	}
	double num=sumv*(1.00/(4.00*m));
	
	for (int i=1;i<=n;i++)
	{
		if (a[i]>=num)  ans++;
	}
	if (ans>=m)  cout<<"Yes"<<endl;
	else cout<<"No"<<endl;=
	return 0;
  //dk
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:31: error: expected primary-expression before '=' token
   23 |         else cout<<"No"<<endl;=
      |                               ^
a.cc:24:9: error: expected primary-expression before 'return'
   24 |         return 0;
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
int main()
{
  int n,m;
  cin>>n>>m;
  vector<int>v(n);
  int sum=0;
  for(int i=0;i<n;++i)
  {
    cin>>v[i];
    sum+=v[i];
  }
  sort(v.rbegin(),v.rend());
  int cnt=0;
 // double r = sum*(1.0/double(4*m));
  cout<<r<<endl;
  bool ok=false;
  for(int i=0;i<n;++i)
  {
    if(double(v[i])>=r)
    {
      cnt++;
      if(cnt==m)
      {
        ok=true;
        cout<<"Yes"<<endl;
        break;
      }
    }
  }
  if(!ok)
  {cout<<"No"<<endl;}
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'r' was not declared in this scope
   18 |   cout<<r<<endl;
      |         ^
Language: C++

#include <iostream>
#include <vector>
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 popular = 0;
  for (int i = 0; i < N; i++) {
    if ((A[i]*4*M) >= sum) {
      popular++;
    }
  }
  if (poplar >= M) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 'poplar' was not declared in this scope; did you mean 'popular'?
   20 |   if (poplar >= M) {
      |       ^~~~~~
      |       popular
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
  double n, m, a[100010];
  double sum = 0;
  
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  
  sort(a, a+n);
  reverse(a, a+n);
  
  if (a[m-1] < sum / (4 * m)) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}


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

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


Compiler output:
main.c: In function 'main':
main.c:6:10: error: size of array 'a' has non-integer type
    6 |   double a[n];
      |          ^
main.c:9:19: error: array subscript is not an integer
    9 |     scanf("%lf",&a[i]);
      |                   ^
main.c:10:11: error: array subscript is not an integer
   10 |     sum+=a[i];
      |           ^
main.c:14:9: error: array subscript is not an integer
   14 |     if(a[i] >= (double)sum/(4*m))
      |         ^
Language: C++

#include <cstdio>
#include <iostream>
#include <vector>
 
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  std::cin >> n >> m;
  double sum = 0;
  std::vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    std::cin >> v[i];
    sum += v[i];
  }
  double bar = sum / 4 / m;
  int c = 0;
  for (int i = 0; i < n; ++i) {
    if (v[i] >= bar) ++c;
  }
  std::cout << (c >= m ) ? "Yes" : "No";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'ios_base' has not been declared
    6 |   ios_base::sync_with_stdio(false);
      |   ^~~~~~~~
Language: C++

#include <iostream>
#include <vector>
 
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  std::cin >> n >> m;
  double sum = 0;
  std::vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    std::cin >> v[i];
    sum += v[i];
  }
  double bar = sum / 4 / m;
  int c = 0;
  for (int i = 0; i < n; ++i) {
    if (v[i] >= bar) ++c;
  }
  std::cout << (c >= m ) ? "Yes" : "No";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'ios_base' has not been declared
    5 |   ios_base::sync_with_stdio(false);
      |   ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, M, sum=0, resultNum=0;
  cin >> N >> M;
  vector<int> vec(N,0);
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
    sum += vec.at(i);
  }

  //sort(vec.begin(), vec.end());

  // for(int i=0;i<N;i++){
  //   if (vec.at(i) >= sum/(4*M))
  //   {
  //     resultNum++;
  //   }
  // }
  for(int i:vec){
    if(i*4*M >= sum)){
      resultNum++;
    }
  }


  string answer;
  if(resultNum >= M){
    answer = "Yes";
  } else {
    answer = "No";
  }

  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: expected primary-expression before ')' token
   22 |     if(i*4*M >= sum)){
      |                     ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    int N;//商品の個数
    int M;//M個選ぶ
    int sum; //総得票数
    int x = 0;
    double x;
    int a[100];

    cin >> N;
    cin >> M;

    x = 1 / (4 * M);

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

    for(int i = 0; i < N; i++){
        if( a[i] >= x * sum){
            x++;
        }
    }
    if( x >= M){
        cout << "yes" << endl;
    } else {
        cout << "no" << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: conflicting declaration 'double x'
    9 |     double x;
      |            ^
a.cc:8:9: note: previous declaration as 'int x'
    8 |     int x = 0;
      |         ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: 'm' was not declared in this scope
   19 |     if(count>=m){
      |               ^
Language: C++

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

int N,M;
  cin>>N;
  cin>>M;
  int a[N];
  int sum=0;
  for(int i=0;i<N;i++){
  	cin>>a[i];
    sum+=a[i]
  }
  int count=0;
  for(int i=0;i<N;i++){
  	if(sum/(4*M)<=a[i]){
    count++;
    }
    if(count>=m){
    cout<< "Yes" <<endl;
    }else{cout<< "No" <<endl;
    }
    
  }
 
 

Compiler output:
a.cc:5:3: error: 'cin' does not name a type
    5 |   cin>>N;
      |   ^~~
a.cc:6:3: error: 'cin' does not name a type
    6 |   cin>>M;
      |   ^~~
a.cc:7:9: error: size of array 'a' is not an integral constant-expression
    7 |   int a[N];
      |         ^
a.cc:9:3: error: expected unqualified-id before 'for'
    9 |   for(int i=0;i<N;i++){
      |   ^~~
a.cc:9:15: error: 'i' does not name a type
    9 |   for(int i=0;i<N;i++){
      |               ^
a.cc:9:19: error: 'i' does not name a type
    9 |   for(int i=0;i<N;i++){
      |                   ^
a.cc:14:3: error: expected unqualified-id before 'for'
   14 |   for(int i=0;i<N;i++){
      |   ^~~
a.cc:14:15: error: 'i' does not name a type
   14 |   for(int i=0;i<N;i++){
      |               ^
a.cc:14:19: error: 'i' does not name a type
   14 |   for(int i=0;i<N;i++){
      |                   ^
Language: C++

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

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

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

int main(){
int N,M;
  cin>>N;
  cin>>M;
  int a[N];
  int sum=0;
  for(int i=0;i<N;i++){
  	cin>>a[i];
    sum+=a[i]
  }
  int count=0
  for(int i=0;i<N;i++){
  	if(sum/(4*M)<=a[i]){
    count++;
    }
    if(count>=m){
    cout<< "Yes" <<endl;
    }else{cout<< "No" <<endl;
    }
    
  }



}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: expected ';' before '}' token
   12 |     sum+=a[i]
      |              ^
      |              ;
   13 |   }
      |   ~           
a.cc:15:3: error: expected ',' or ';' before 'for'
   15 |   for(int i=0;i<N;i++){
      |   ^~~
a.cc:15:15: error: 'i' was not declared in this scope
   15 |   for(int i=0;i<N;i++){
      |               ^
Language: C++

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

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

  vector<int> a(n);
  //vectorに全入力値を代入する
  rep(i,n) cin >> a[i];

  //総投票数を計算する
  int s = 0;
  rep(i,n) s += a[i];

  int cnt = 0;
  rep(i,n) {
    if (a[i]*(4 * m) >= total) cnt++;
  }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'total' was not declared in this scope
   20 |     if (a[i]*(4 * m) >= total) cnt++;
      |                         ^~~~~
Language: C++

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


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

#include<iostream>
using namespace std;
int main(){
  int N, M;
  cin>>N>>M;
  int A[N],total;
  bool F[N],flag=true;
  for(int i=0;i<N;++i){
    cin>>A[i];
    total+=A[i];
  }
  for(int w=0;w<M;++w){
    int max=0;
    int num=0;
    for(int i=0;i<N;++i){
      if(F[i])continue;
      if(max<=A[i]){
      	max=A[i];
      	num=i;
      }
    }
    if(max>=total/(M*4))F[num]=true;
    else {
    	flag=false;
    	break;
    }
  }
  if(flag)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   30 |   return;
      |   ^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(void){
  int N, M;
  cin>>N>>M;
  int A[N],total;
  bool F[N],flag=true;
  for(int i=0;i<N;++i){
    cin>>A[i];
    total+=A[i];
  }
  for(int w=0;w<M;++w){
    int max=0;
    int num=0;
    for(int i=0;i<N;++i){
      if(F[i])continue;
      if(max<=A[i]){
      	max=A[i];
      	num=i;
      }
    }
    if(max>=total/(M*4))F[num]=true;
    else {
    	flag=false;
    	break;
    }
  }
  if(flag)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   30 |   return;
      |   ^~~~~~
Language: Java

import java.util.Scanner;

public class Main2 {
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int[] a = new int[N];
        int sum = 0;
        for (int i = 0; i < N; i++) {
            a[i] = scanner.nextInt();
            sum += a[i];
        }

        int count = 0;
        for (int i = 0; i < N; i++) {
            if (a[i] / (double) sum >= 1 / (4.0 * M)) {
                count++;
            }
        }
        

        System.out.print(count >= M ? "Yes" : "No");

        scanner.close();
    }
}

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin>>N>>M;
      |   ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> data(N);
      |   ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> data(N);
      |          ^~~
a.cc:8:10: error: 'data' was not declared in this scope
    8 |     cin>>data.at(i);
      |          ^~~~
a.cc:12:6: error: 'data' was not declared in this scope
   12 |   if(data.at(M-1)>=sum/4/M){
      |      ^~~~
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout<<"Yes"<<endl;
      |     ^~~~
a.cc:13:18: error: 'endl' was not declared in this scope
   13 |     cout<<"Yes"<<endl;
      |                  ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout<<"No"<<endl;
      |     ^~~~
a.cc:16:17: error: 'endl' was not declared in this scope
   16 |     cout<<"No"<<endl;
      |                 ^~~~
Language: C++

/*
 * AtCoder Beginner Contest 161 B - Popular Vote
 *
 * Time: 1ms
 * Memory: 256KB
 *
 * Author: DragonLee
 */

#include<iostream>

using namespace std;
typedef long long LL;
const int LEN = 1e2 + 10;
int A[LEN];

int main() {
    int N, M, sum = 0;
    cin >> N >> M;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        sum += A[i];
    }
    sort(A, A + N, greater<int>());
    cout << (A[M - 1] * 4 * M >= sum ? "Yes" : "No");
    return 0;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:25: error: unable to find numeric literal operator 'operator""M'
   21 |         if (v[i] > ((1/(4M)*sum)))
      |                         ^~
Language: C

#include <stdio.h>

int main(){
  int n,m,a[100],total=0,ans=0;
  scanf("%d%d",&n,&m);
  for (int i=0;i<n;i++) {
    scanf("%d",&a[i]);
    total+=a[i];
}
  for (int i=0;i<n;i++){
  if (1.0/(4*m) <=  double(a[i])/ total) ans++;
}
  if (ans>=m)printf("YES");
  else printf("NO");

  return 0;
  

}


Compiler output:
main.c: In function 'main':
main.c:11:21: error: expected expression before 'double'
   11 |   if (1.0/(4*m) <=  double(a[i])/ total) ans++;
      |                     ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int N, M;
    cin>>N>>M;
    vector<int> v;
    int count = 0;
    for(int i = 0; i < N; i++)
    {
        cin>>v[i];
    }
    int sum = accumulate<v.begin(), v.end(), 0>
    for(int i = 0; i < N; i++)
    {
        if (v[i] > ((1/(4M)*sum)))
        {
            count++;
        }
    }
    if(count>M)
    {
        cout<<"Yes";
    }
    else cout<<"No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:33: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]'
   13 |     int sum = accumulate<v.begin(), v.end(), 0>
      |                          ~~~~~~~^~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:873:7: note: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]' declared here
  873 |       begin() _GLIBCXX_NOEXCEPT
      |       ^~~~~
a.cc:13:42: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]'
   13 |     int sum = accumulate<v.begin(), v.end(), 0>
      |                                     ~~~~~^~
/usr/include/c++/14/bits/stl_vector.h:893:7: note: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]' declared here
  893 |       end() _GLIBCXX_NOEXCEPT
      |       ^~~
a.cc:13:15: error: cannot resolve overloaded function 'accumulate' based on conversion to type 'int'
   13 |     int sum = accumulate<v.begin(), v.end(), 0>
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:14:20: error: 'i' was not declared in this scope
   14 |     for(int i = 0; i < N; i++)
      |                    ^
Language: C++

//Popular Vote

#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 += A[i];
	}

	int count =0;

	
	//確認
	for(int i=1;i<=N;i++){
		if(A[i]<sum/(4*M)){
			count = count + 1;
		}else{
			count = count;
		}


	//出力
	if(count<M){
		cout << "No" <<endl;
	}else{
		cout << "Yes" <<endl;
	}

	return 0;
}


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

//Popular Vote

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

int main ()
{
	//整数の入力
	int N,M;
	cin >> N >> M;

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

	int count =0;

	
	//確認
	for(int i=1;i<=N;i++){
		if(A[i]<sum/(4*M)){
			count = count + 1;
		}else{
			count = count;
		}


	//出力
	if(count<M){
		cout << "No" <<endl;
	}else{
		cout << "Yes" <<endl;
	}

	return 0;
}


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

//Popular Vote

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

int main ()
{
	//整数の入力
	int N,M;
	cin >> N >> M;

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

	int count =0;

	
	//確認
	for(int i=1;i<=N;i++){
		if(A[i]<sum/(4*M)){
			count = count + 1;
		}else{
			count = count;
		}


	//出力
	if(count<M){
		cout << "No" <<endl;
	}else{
		cout << "Yes" <<endl;
	}

	return 0;
}

			
	

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'i' was not declared in this scope
   12 |         int A[i];
      |               ^
a.cc:15:24: error: 'A' was not declared in this scope
   15 |                 cin >> A[i];
      |                        ^
a.cc:24:20: error: 'A' was not declared in this scope
   24 |                 if(A[i]<sum/(4*M)){
      |                    ^
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

//Popular Vote

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

int main ()
{
	//整数の入力
	int N,M;
	cin >> N >> M;

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

	int count =0;

	
	//確認
	for(int i=1;i<=N;i++){
		if(A[i]<sum/4M){
			count = count + 1;
		}else{
			count = count;
		}


	//出力
	if(count<M){
		cout << "No" <<endl;
	}else{
		cout << "Yes" <<endl;
	}

	return 0;
}

			
	

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'i' was not declared in this scope
   12 |         int A[i];
      |               ^
a.cc:15:24: error: 'A' was not declared in this scope
   15 |                 cin >> A[i];
      |                        ^
a.cc:24:20: error: 'A' was not declared in this scope
   24 |                 if(A[i]<sum/4M){
      |                    ^
a.cc:24:29: error: unable to find numeric literal operator 'operator""M'
   24 |                 if(A[i]<sum/4M){
      |                             ^~
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

//Popular Vote

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

int main ()
{
	//整数の入力
	int N,M;
	cin >> N >> M;

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

	int count =0;

	
	//確認
	for(int i=1;i<=N;i++){
		if(A[N]<sum/4M){
			count = count + 1;
		}else{
			count = count;
		}


	//出力
	if(count<M){
		cout << "No" <<endl;
	}else{
		cout << "Yes" <<endl;
	}

	return 0;
}

			
	

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'i' was not declared in this scope
   12 |         int A[i];
      |               ^
a.cc:15:24: error: 'A' was not declared in this scope
   15 |                 cin >> A[i];
      |                        ^
a.cc:24:20: error: 'A' was not declared in this scope
   24 |                 if(A[N]<sum/4M){
      |                    ^
a.cc:24:29: error: unable to find numeric literal operator 'operator""M'
   24 |                 if(A[N]<sum/4M){
      |                             ^~
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

//Popular Vote

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

int main()
{
	//整数の入力
	int N,M;
	cin >> N >> M;

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

	int count =0;

	
	//確認
	for(int i=1;i<=N;i++){
		if(A[N]<sum/4M){
			count = count + 1;
		}else{
			count = count;
		}


	//出力
	if(count<M){
		cout << "No" <<endl;
	}else{
		cout << "Yes" <<endl;
	}

	return 0;
}

			
	

Compiler output:
a.cc: In function 'int main()':
a.cc:24:29: error: unable to find numeric literal operator 'operator""M'
   24 |                 if(A[N]<sum/4M){
      |                             ^~
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int>a(n);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         vector<int>a(n);
      |                ^~~
a.cc:9:14: error: 'a' was not declared in this scope
    9 |         cin>>a[i];
      |              ^
a.cc:13:12: error: 'a' was not declared in this scope
   13 |         s+=a[i];
      |            ^
a.cc:17:12: error: 'a' was not declared in this scope
   17 |         if(a[i]*(4*m) >= s){
      |            ^
Language: C

#include <stdio.h>

int main(void){
    int N,M,Z=0,SUM=0;
    int A[101];
    scanf("%d%d",&N,&M);
    for (int i=0; i<N; i++) {
        scanf("%d",&A[i]);
        SUM+=A[i];
    }
    int m;
    m=M;
    int H;
    H=SUM/(4*M)
    if (SUM%(4*M)!=0) {
        H++;
    }
    for (int i=0; i<N; i++) {
        if(A[i]>=H){
            m--;
        }
    }
    if (m>0) {
        printf("No\n");
        
    }
    else{
        printf("Yes\n");
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:16: error: expected ';' before 'if'
   14 |     H=SUM/(4*M)
      |                ^
      |                ;
   15 |     if (SUM%(4*M)!=0) {
      |     ~~
Language: C++

/*-----------Author: Araz Jabrayilov---------*/
/*------------@araz17----(~~)#5371-----------*/

#include <bits/stdc++.h>

#define ll long long
#define endl '\n'

using namespace std;




int main()
{
    ios_base :: sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int m = 0;
    int n = 0;
    int x = 0;
    int sum = 0;
    int <vector> a;

    cin >> n >> m;

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'int' is not a template
   22 |     int <vector> a;
      |     ^~~
a.cc:27:11: error: request for member 'push_back' in 'a', which is of non-class type 'int'
   27 |         a.push_back(a[i])
      |           ^~~~~~~~~
a.cc:27:22: error: invalid types 'int[int]' for array subscript
   27 |         a.push_back(a[i])
      |                      ^
a.cc:32:13: error: invalid types 'int[int]' for array subscript
   32 |         if(a[i] >= sum / (4 * m)){
      |             ^
Language: Java

import java.util.Scanner;

public class Main{

 public static void main(String[] args){
  
   Scanner sc = new Scanner(System.in);
   
   int n = sc.nextInt();
   
   int m = sc.nextInt();
   
   int count = 0;
   
   int all = 0;
   
   String yon = "";
   
   double d = 0.0;
   
   int[] array = new int[n];
   
   for (int i = 0; i<array.length; i++){
    
     array[i] = sc.nextInt();
     
     all += array[i];
     
   }
   
   d = all/(4*m)
   
   for(int i:array){
    
    if(i >= d){
      
      count += 1;
  	
    }
     
   }
   
   if(count >= m){
     
     yon = "Yes";
   
   }else{
     
     yon = "No";
     
   }
   
   System.out.println(yon);
   
 }
  
  
  
  
}  

Compiler output:
Main.java:31: error: ';' expected
   d = all/(4*m)
                ^
1 error
Language: C++

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

int main(){

  int N, M;
  cin >> N >> M;
  
  vector<int> score(N);
  for(int i = 0; i < N; i++){
    cin >> score.at(i);
  }
  
  int count = 0;
  
  for(int i = 0; i < N; i++){

    if(score.at(i) >= 1/(4 * M)){
      count++;}
  }
  
  if (score => M){

    cout << "Yes" << endl;}
  
  else { 
    cout << "No"<<endl;
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: expected primary-expression before '>' token
   22 |   if (score => M){
      |              ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:13:20: error: expected expression before 'int'
   13 |         if(a[i] >= int(sum/4/m)){
      |                    ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    7 |     double a[n];
      |              ^
a.cc:7:14: error: could not convert 'n' from 'double' to 'long unsigned int'
    7 |     double a[n];
      |              ^
      |              |
      |              double
a.cc:7:14: error: size of array 'a' has non-integral type 'double'
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    7 |     double a[n];
      |              ^
a.cc:7:14: error: could not convert 'n' from 'double' to 'long unsigned int'
    7 |     double a[n];
      |              ^
      |              |
      |              double
a.cc:7:14: error: size of array 'a' has non-integral type 'double'
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    7 |     int a[n];
      |           ^
a.cc:7:11: error: could not convert 'n' from 'double' to 'long unsigned int'
    7 |     int a[n];
      |           ^
      |           |
      |           double
a.cc:7:11: error: size of array 'a' has non-integral type 'double'
Language: C++

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

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

int main(){
  int N, M;
  cin >> N >> M;
  vector<int> A(N);
  for (int i=0; i<N; i++){
    cin >> A.at(i);
  }

  double total_vote = accumulate(A.begin(), A.end(), 0);
  double threshold = total_vote/(4*M);

  sort(A.begin(), A.end());
  reverse(A.begin(), A.end());

  if (A[M-1] >= threshold) printf("Yes\n");
  else printf("No\n");

}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |   sort(A.begin(), A.end());
      |   ^~~~
      |   short
a.cc:20:3: error: 'reverse' was not declared in this scope
   20 |   reverse(A.begin(), A.end());
      |   ^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'i' was not declared in this scope
   10 |     sort(a,a+i);
      |              ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    7 |     double a[n];
      |              ^
a.cc:7:14: error: could not convert 'n' from 'double' to 'long unsigned int'
    7 |     double a[n];
      |              ^
      |              |
      |              double
a.cc:7:14: error: size of array 'a' has non-integral type 'double'
a.cc:10:14: error: 'i' was not declared in this scope
   10 |     sort(a,a+i);
      |              ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'i' was not declared in this scope
   10 |     sort(a,a+i);
      |              ^
Language: C++

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

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

int main(){
  int N, M;
  cin >> N >> M;
  vector<int> A(N);
  for (int i=0; i<N; i++){
    cin >> A.at(i);
  }

  double total_vote = accumulate(A.begin(), A.end(), 0);
  double threshold = total_vote/(4*M);

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

  if (A[M-1] >= threshold) printf("Yes\n");
  else printf("No\n");

}


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

#include<stdio.h>
#include <math.h>

main(void)
{
  int N,M,i,counter=O,sum=0;
  int A[1000];
  
  scanf("%d %d",&N,&M);
  for(i=0;i<=N;i++)
  {
    scanf("%d",&A[i]);
    sum+=A[i];
  }
  

  for(i=0;i<=N;i++)
  {
    if(A[i]>=sum/(4*M))
    {
      counter++;
    }
  }
  
  if(M<=counter && M<=N)
  {
    printf("Yes");
  }
  
  else
  {
    printf("No");
  }

  return 0;
}


Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(void)
      | ^~~~
main.c: In function 'main':
main.c:6:21: error: 'O' undeclared (first use in this function)
    6 |   int N,M,i,counter=O,sum=0;
      |                     ^
main.c:6:21: note: each undeclared identifier is reported only once for each function it appears in