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

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <vector>
#include <math.h>
#include <map>
#include <queue>
#include <set>
#include <stack>
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define debug(x) cout<<x<<endl
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
typedef long long ll;
using namespace std;
const int MAXN=1e5+50;
const int inf=0x3f3f3f3f;
const int mod=1e9+7;
//::iterator it;
ll a[200];
int main()
{
    std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    int n,m;
    cin>>n>>m;
    ll sum=0;
    rep(i,1,n){
        cin>>a[i];
        sum+=a[i];
    }
    int ans=0;
    for(int i=1;i<=n;i++)if(a[i]*4*M>=sum)ans++;
        if(ans>=m)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}
/*

*/

 
 

Compiler output:
a.cc: In function 'int main()':
a.cc:39:36: error: 'M' was not declared in this scope
   39 |     for(int i=1;i<=n;i++)if(a[i]*4*M>=sum)ans++;
      |                                    ^
Language: C++

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

int main(void)
{
  
  int N ,M;
  cin >> N >> M;
  int A[N];
  long float V =0;
  for(int i=0; i<N;i++)
  {
    cin >>A[i];
    V += A[i];
  }
  
  std::sort(A, A+N, std::greater<>());
  
#if 0  
  for(int i=0; i<N;i++)
  {
    cout << A[i] << ' ';
  }  
  cout <<endl;
    cout << A[M-1];
  cout <<endl;
    cout << V/4/M;
#endif
      
  if(A[M-1] < V/(4*M))
  {
    cout << "No";
  }else{
    cout << "Yes";
  }
  
 return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'long' specified with 'float'
   11 |   long float V =0;
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int N,M;
int A[1001];
int S;


int main(){
  int count;
  int a;
  cin >> N >> M;
  for (int i=0;i<N;i++){
    cin >> A[i];
    S += A[i];
  };
  a = S/(4*M);
  cout << "";
  for (int i=0;i<N;i++){
    if ( a <= A[i]){
      count += 1;
    };
  };

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,sum=0,c=0;
  cin>>n>>m;
  int a[n];
  for (int i=0;i<n;i++)
  {
    cin>>a[i];
    sum+=a[i];
  }
  int temp=1/(4*m);
  int tmp=temp*sum;
  for (int i=0;i<n;i++)
  {
    if(a[i]>=tmp)
      c++;
  }
  if(c>=m)
    cout<<"yes";
  else
    cout<<"no";
  

Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: expected '}' at end of input
   23 |     cout<<"no";
      |                ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected unqualified-id before 'for'
   17 |   for(int i=0;i<N;i++){
      |   ^~~
a.cc:17:15: error: 'i' was not declared in this scope
   17 |   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(i);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  int n = 0;
  for (int i = 0; i < N; i++) {
  	if(A.at(i) > 1 / (4 * M)) {
      n++
    }
  }
  if (n < M) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'i' was not declared in this scope
    7 |   vector<int> A(i);
      |                 ^
a.cc:14:10: error: expected ';' before '}' token
   14 |       n++
      |          ^
      |          ;
   15 |     }
      |     ~
Language: C++

#inlcude<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,sum=0,c=0;
  cin>>n>>m;
  int a[n];
  for (int i=0;i<n;i++)
  {
    cin>>a[i];
    sum+=a[i];
  }
  int temp=1/(4*m);
  int tmp=temp*sum;
  for (int i=0;i<n;i++)
  {
    if(a[i]>=tmp)
      c++;
  }
  if(c>=m)
    cout<<"yes";
  else
    cout<<"no";
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n>>m;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlcude<bits/stdc++.h>
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout<<"yes";
      |     ^~~~
a.cc:21:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<<"no";
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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



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

    sort(A);

    if(A[N-1]>=1/(4*M)) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: no matching function for call to 'sort(int [N])'
   17 |     sort(A);
      |     ~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: expected ';' before ')' token
   14 |    sum=(sum+(4*m)-1)/4*m);
      |                         ^
      |                         ;
Language: C++

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


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

#include <iostream>
#include <vector>
 
bool judge(int m, int total, int a)
{
  return (a => total / 4 / m);
}
 
int main()
{
    int n,m;
    std::vector<int> a;
 
  	std::cin >> n >> m;
	a.resize(n);
 
  	int total = 0;
    for (int i = 0; i < n; ++i)
    {
      std::cin >> a[i];
      total += a[i];
    }
 
  	int selectable = 0;
    for (int i = 0; i < n; ++i)
    {
      if (judge(m, total, a[i]))
      {
        ++selectable;
      }
      
      if (selectable >= m)
      {
        std::cout << "Yes" << std::endl;
        return 0;
      }
    }
 
  	std::cout << "No" << std::endl;
    return 0;
}


Compiler output:
a.cc: In function 'bool judge(int, int, int)':
a.cc:6:14: error: expected primary-expression before '>' token
    6 |   return (a => total / 4 / m);
      |              ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <memory>
#include <algorithm>

using namespace std;

void swap(int &a, int &b)
{
    int tmp = a;
    a = b;
    b = tmp;
}

int main()
{
    int N, M;
    vector<int> itemlist;

    cin >> N >> M;
    itemlist.resize( N );

    int total = 0;
    for (auto i = 0; i < N; i++) {
        cin >> itemlist[i];
        total += itemlist[i];
    }
    sort(itemlist.begin(), itemlist.end(), greater<int>());

    if (itemlist[M-1] <= num ) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:26: error: 'num' was not declared in this scope; did you mean 'enum'?
   32 |     if (itemlist[M-1] <= num ) {
      |                          ^~~
      |                          enum
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before 'cnt'
   13 |  if(arr[i]>=(sum/(4*m))cnt++;
      |                        ^~~
      |                        ;
a.cc:14:1: error: expected primary-expression before '}' token
   14 | }
      | ^
a.cc:13:30: error: expected ')' before '}' token
   13 |  if(arr[i]>=(sum/(4*m))cnt++;
      |    ~                         ^
      |                              )
   14 | }
      | ~                             
a.cc:14:1: error: expected primary-expression before '}' token
   14 | }
      | ^
Language: C++

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


Compiler output:
a.cc:25:31: error: extended character 　 is not valid in an identifier
   25 |   reverse(a.begin(), a.end());　
      |                               ^
a.cc: In function 'int main()':
a.cc:25:31: error: '\U00003000' was not declared in this scope
   25 |   reverse(a.begin(), a.end());　
      |                               ^~
a.cc:29:5: error: 'else' without a previous 'if'
   29 |     else {
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
    int N,M;
    cin >> N >> M;
    vector<int> A(N);
    REP(i, N){
        cin >> A[i];
    }
    sort(ALL(A),greater<int>());

    int sum = accumulate(ALL(A),0);

    if(sum / (double)(4*M) <= A[M-1]){
        cout << "Yes" << endl;
    }

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

    return 0;
}

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

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

int main(){

  ll N,M=0;
  
  cin>>N>>M;
  
  ll A[N];
  
  ll sum=0;
  rep(i,N){
    cin>>A[i];
    sum+=A[i];
  }
  double thres=sum;
  thres=thres/(4*M);
  sort(A, A + sizeof(A)/sizeof(A[0]), greater<int>() );  
  //rep(i,N)cout<<A[i]<<" ";
  if(A[M-1]<thres))cout<<"No"<<endl;
  else cout<<"Yes"<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: expected primary-expression before ')' token
   24 |   if(A[M-1]<thres))cout<<"No"<<endl;
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
double a[101];
int main() {
    
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    int votes = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        votes += a[i];
    }
    double limitVotes = (double)votes / (double)(4 * m);
    int cntM = m;
    for(int i = 0; i < n; i++){
        if(cntM == 0)
            break;
        if(a[i] >= limitVotes)
            cntM--;
    }
    if(cntM == 0){
        Yes
    } else {
        No
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'Yes' was not declared in this scope
   23 |         Yes
      |         ^~~
a.cc:25:9: error: 'No' was not declared in this scope
   25 |         No
      |         ^~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'sum' was not declared in this scope
    8 |          sum = 0;
      |          ^~~
Language: C++

#include <bits/stdc++.h>
#define MOD 1e9 + 7
#define PI 3.141592653589793238
#define pb push_back
#define ALL(V) (V).begin(), (V).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long int lint;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<int> VI;
typedef pair<ll, ll> P;
ll gcd(ll a, ll b) { return (a % b == 0 ? b : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll char_to_ll(char c) { return (int)(c - '0'); }
ll string_to_ll(string s) { return char_to_ll(atoi(s.c_str())); }
bool is_prime(ll x){ if(x <= 1) return false; for(ll i = 2; sqrt(i) <= x; i++) if(x % i == 0) return false; return true; }


int main() {
    int n,m,sum=0;
    cin >> n >> m;
    vector<int> a(n);  
    FOR(i,0,n) cin >> a.at(i);

    FOR(i,0,n) sum += a.at(i);
    bool ans = true;
    sort(a.begin(), a.end(), greater<int>());
    

    FOR(i,0,m){
        if(a.at(i) < sum/(4*m)){
            ans = false;
        }
    }

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

    

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

import java.util.*;
public class Main{
   public static void main(String[] args) {
     Scanner sc = new Scanner(System.in);
     int n = sc.nextInt();
     int m = sc.nextInt();
     int[] a = new int[n];
     int sum=0;
     for(int i=0;i<n;i++){
       a[i]=sc.nextInt();
       sum+=a[i];
     }
     quick_sort(a,0,n-1);
     int border = Math.ceil(sum/(4*m));
     if(a[n-m]<border){
       System.out.println("No");
     }else{
       System.out.println("Yes");
     }
   }
   static void quick_sort(int[] d, int left, int right) {
        if (left>=right) {
            return;
        }
        int p = d[(left+right)/2];
        int l = left, r = right, tmp;
        while(l<=r) {
            while(d[l] < p) { l++; }
            while(d[r] > p) { r--; }
            if (l<=r) {
                tmp = d[l]; d[l] = d[r]; d[r] = tmp;
                l++; r--;
            }
        }
        quick_sort(d, left, r);  // ピボットより左側をクイックソート
        quick_sort(d, l, right); // ピボットより右側をクイックソート
    }
}

Compiler output:
Main.java:14: error: incompatible types: possible lossy conversion from double to int
     int border = Math.ceil(sum/(4*m));
                           ^
1 error
Language: C++

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


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

#include<bits/stdc++.h>
using namespace std;
double a[101];
int main() {
    fastio
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    int votes = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        votes += a[i];
    }
    double limitVotes = (double)votes / (double)(4 * m);
    int cntM = m;
    for(int i = 0; i < n; i++){
        if(cntM == 0)
            break;
        if(a[i] >= limitVotes)
            cntM--;
    }
    if(cntM == 0){
        Yes
    } else {
        No
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'fastio' was not declared in this scope
    5 |     fastio
      |     ^~~~~~
a.cc:7:12: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |     cin >> n >> m;
      |            ^
      |            yn
a.cc:7:17: error: 'm' was not declared in this scope; did you mean 'tm'?
    7 |     cin >> n >> m;
      |                 ^
      |                 tm
a.cc:23:9: error: 'Yes' was not declared in this scope
   23 |         Yes
      |         ^~~
a.cc:25:9: error: 'No' was not declared in this scope
   25 |         No
      |         ^~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |   int a[i];
      |         ^
a.cc:10:12: error: 'a' was not declared in this scope
   10 |     cin >> a[i];
      |            ^
a.cc:15:8: error: 'a' was not declared in this scope
   15 |     if(a[i] >= sum/(4*m)) res++;
      |        ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 's' was not declared in this scope
   10 |     sum+=s[i];}
      |          ^
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     for(i=0;i<n;i++)
      |         ^
a.cc:22:9: error: 'cour' was not declared in this scope
   22 |         cour<<"No";
      |         ^~~~
Language: C++

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

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

#include <bits/stdc++.h>
using namespace std;
 
typedef long double LD;
typedef long long int ll;
#define pb push_back
#define mp make_pair
#define REP(i,n) for (ll i = 0; i < n; i++)
#define FOR(i,a,b) for (ll i = a; i < b; i++)
#define REPD(i,n) for (ll i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (ll i = a; i >= b; i--)
#define remax(a,b) a = max(a,b)
#define remin(a,b) a = min(a,b)
#define all(v) v.begin(),v.end()
#define rsort(v) sort(v.begin(), v.end(), greater <>());
typedef map<ll,ll> mll;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
#define F first
#define S second
#define PQ(type) priority_queue<type>
#define PQD(type) priority_queue<type,vector<type>,greater<type> >
#define ITR :: iterator it
#define WL(t) while(t--)
#define SZ(x) ((int)(x).size())
#define TR(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define inrange(i,a,b) ((i>=min(a,b)) && (i<=max(a,b)))
#define i1(x) cin>>x
#define i2(x,n) cin>>x>>n
#define o1(x) cout<<x
#define o2(x,n) cout<<x<<n
int main(){
    ll n,m;
    i2(n,m);
    vll a(n);
    ll s=0;
    REP(i,n){
        i1(a[i]);
        s+=a[i];
    }
    s=ceil(s/((double)(4*m));
    ll ans=0;
    REP(i,n)
        if(a[i]>=s)
            ans++;
    if(ans>=m)
        o1("Yes");
    else 
        o1("No");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:29: error: expected ')' before ';' token
   43 |     s=ceil(s/((double)(4*m));
      |           ~                 ^
      |                             )
Language: C++

#inlcude<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,sum=0,c=0;
  cin>>n>>m;
  int a[n];
  for (int i=0;i<n;i++)
  {
    cin>>a[i];
    sum+=a[i];
  }
  int temp=1/(4*m);
  int tmp=temp*sum;
  for (int i=0;i<n;i++)
  {
    if(a[i]>=tmp)
      c++;
  }
  if(c>=m)
    cout<<"yes";
  else
    cout<<"no";
  

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n>>m;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlcude<bits/stdc++.h>
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout<<"yes";
      |     ^~~~
a.cc:21:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<<"no";
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:16: error: expected '}' at end of input
   23 |     cout<<"no";
      |                ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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



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

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

    if(A[N-1]>=(1/4*M)) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;


    return 0;
}

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

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

int main(){
	
	long n,m; cin>>n>>m;
	long long arr[n]; long long co = 0; long long sum = 0;
	for(int i = 0; i < n; i++) { cin>>arr[i]; sum += arr[i]; }
	double need = ((double)sum/(4.0*(double)m));
	for(int i = 0; i < n; i++){
		if(arr[i] >= ceil(need)) co++;
	}
	if(co >= m) cout<<"Yes"<<"\n";
	else cout<<"No"<<"\n";
	
	
	
	
}#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	
	long n,m; cin>>n>>m;
	long long arr[n]; long long co = 0; long long sum = 0;
	for(int i = 0; i < n; i++) { cin>>arr[i]; sum += arr[i]; }
	double need = ((double)sum/(4.0*(double)m));
	for(int i = 0; i < n; i++){
		if(arr[i] >= ceil(need)) co++;
	}
	if(co >= m) cout<<"Yes"<<"\n";
	else cout<<"No"<<"\n";
	
	
	
	
}

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

/*
我的心脏怦怦跳，监管者就在附近
name:
Algorithm:
writer:Lxs(cdx)
place:
nothing is impossible
*/
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#include<string>
#include<iostream>
#include<cmath>
#include<set>
#include<stack>
#include<queue>
#include<unistd.h>
#include<stdio.h>
#include<cstring>
#define random(a,b) (rand()%(b-a+1)+a)
using namespace std;
bool prime(int x){
	 int i;
	 if(x<2) return 0;
	 for(i=2;i*i<=x;i++){
		if(x%i==0){return 0;}
	 }
	 return 1;
}
int a[110100];
bool f[101010];
int main()
{
	int n,m;
	cin>>n>>m;
	int i;
	long long double s=0;
	for(i=0;i<n;i++){
		cin>>a[i];
		s+=a[i];
	}
	int g=0;
	for(i=0;i<n;i++){
		if(a[i]>=double(s/(4*m))){
			g++;
		}
	}
	if(g>=m){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:14: error: 'long long' specified with 'double'
   37 |         long long double s=0;
      |              ^~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
	cin>>gs>>x;
	int a[gs],z=0;
	for(int i=0;i<gs;i++)
	{
		cin>>a[i];
		a[i]+=z;
	}
	int b=z/4, n=0;
	for(int i=0;i<gs;i++)
	{
		if(a[i]<b)
		{
			n++;
		}
	}
	if(n>=x)
	{
		cout<<"Yes"<<endl;
	}
	else
	{
		cout<<"No"<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: 'gs' was not declared in this scope
    5 |         cin>>gs>>x;
      |              ^~
a.cc:5:18: error: 'x' was not declared in this scope
    5 |         cin>>gs>>x;
      |                  ^
a.cc:9:22: error: 'a' was not declared in this scope
    9 |                 cin>>a[i];
      |                      ^
a.cc:15:20: error: 'a' was not declared in this scope
   15 |                 if(a[i]<b)
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(int i=0;i<(int)n;i++)
#define PI acos(-1)
#define fast_io ios_base::sync_with_stdio(false) ; cin.tie(0); cout.tie(0);
ll mod=1e9+7;

int main(){
    fast_io
    
    int n, m;
    cin>>n>>m;
    vector<int> a(n);
    int sum=0;
    rep(i,n) {
        cin>>a[i];
        sum+=a[i];
    }
    sort(a.begin(), a.end(), greater<int>());
    int cnt=0;
    rep(i,m){
        if(a[i]*4*m<sum{
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:24: error: expected ')' before '{' token
   23 |         if(a[i]*4*m<sum{
      |           ~            ^
      |                        )
a.cc:27:5: error: expected primary-expression before '}' token
   27 |     }
      |     ^
Language: C++

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

using namespace std;

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

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

    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   19 |     if(sum%(4*M)) {
      |        ~~~^~~~~~
      |        |     |
      |        |     int
      |        double
Language: Java

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


Compiler output:
Main.java:13: error: variable n might not have been initialized
        int[] A = new int[n];
                          ^
1 error
Language: C++

//  B - Popular Vote
// https://atcoder.jp/contests/abc161/tasks/abc161_b
#include <iostream>
#include <bits/stdc++.h>
#include <map>
#include <queue>
#include <set>
#include <string> 
#include <vector>
#include <numeric>

using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll, int> PLI;
typedef pair<int, int> PII;

#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;i<n;i++)
#define pi pair < ll , ll >
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define clr(x , val) memset(x , val , sizeof(x));

const ll mxsize = 2e5 + 5;
const ll linf = 1e9;
const long double inf = 10000000000.0;

#define fastIO                                                                 \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);

const ll mod = 998244353;
 
/******************************************** CODE STARTS FROM HERE *************************************************/ 

int main()
{
    fastIO;
    ll n , m;
    cin >> n >> m;
    vector < ll > arr(n);
    ll i;
    fo(i , n)
    {
        cin >> arr[i];
    }
    sort(arr.begin() , arr.end());
    ll sum = accumulate(arr.begin() , arr.end() , 0ll);
    bool ok = false;
    for(i = 0 ; i + m < n ; i++)
    {
        bool ok1 = true;
        for(ll j = i ; j < m ; j++)
        {
            if((arr[j] * 4 * m < sum)
            {
                ok1 = false;
                break;
            }
        }
        if(ok1)
        {
            ok = true;
            break;
        }
    }
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:38: error: expected ')' before '{' token
   59 |             if((arr[j] * 4 * m < sum)
      |               ~                      ^
      |                                      )
   60 |             {
      |             ~                         
a.cc:64:9: error: expected primary-expression before '}' token
   64 |         }
      |         ^
Language: C++

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

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

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

    long long sum = accumulate(a.begin(), a.end(), 0);

    long long ans = floor(sum / (4*m));

    int cont = 0;
    for (int x: a) {
        if (x >= ans) {
            cont++;
        }
    }

    cout << (cont >= m ? "Yes" : "No") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: 'floor' was not declared in this scope
   18 |     long long ans = floor(sum / (4*m));
      |                     ^~~~~
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 += a[i];
		}
	
	
	int count = 0 ;
	for(int i = 0 ; i < n ; i++)
	{
		if(a[i] > sum / (4 * m) )
		{
			++count ;
			
	}
	if(count >= m )
		cout<<"Yes";
	else
		cout<<"No";

}



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

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

int main(){
    double N, M; cin >> N >> M;
    int sum=0;
    vector<int> c;
    for(int i=0; i<N; i++){
        int tmp;
        cin >> tmp;
        sum += tmp;
        c.push_back(tmp);
    }
    sort(c.rbegin(), c.rend());
    //for(int i=0; i<N; i++) cout << c[i] << " ";
    double limit = sum/(4*M);
    //cout << limit << endl;
    if(c[M-1] < limit) cout << "No" << endl;
    else cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(c.rbegin(), c.rend());
      |     ^~~~
      |     short
Language: C

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

int main(){
	int n,m;
	scanf("%d %d",&n,&m);
	int arr[n];
	int i,j;
	for(i=0;i<n;i++){
		scanf("%d",&arr[i]);
	}
	
	int sum=0;
	for(i=0;i<n;i++){
		sum += aarr[i];
	}
	
	for (i=0; i<n; i++) {
    	for (j=i+1; j<n; j++) {
      		if (arr[i] > arr[j]) {
        		int tmp =  arr[i];
        		arr[i] = arr[j];
        		arr[j] = tmp;
      		}
    	}
  	}

	int count=0;
	double check = sum / (4*m);
	for(i=0;i<n;i++){
		if(arr[i] > check){
			count++:
		}
	}
	
	if(count == m){
		printf("Yes");
	}else{
		printf("No");
	}
		
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:24: error: 'aarr' undeclared (first use in this function); did you mean 'arr'?
   16 |                 sum += aarr[i];
      |                        ^~~~
      |                        arr
main.c:16:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:32: error: expected ';' before ':' token
   33 |                         count++:
      |                                ^
      |                                ;
Language: C++

#include <iostream>

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 d = sum/n;
    for(int i=0;i<n;i++){
        if(a[i]>=d){
          count++;
        }
    }
    if(count>=d){
      cout << "Yes" << endl;
    }
    else{
      cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: 'count' was not declared in this scope
   17 |           count++;
      |           ^~~~~
a.cc:20:8: error: 'count' was not declared in this scope
   20 |     if(count>=d){
      |        ^~~~~
Language: Java

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


Compiler output:
Main.java:15: error: no suitable method found for sort(int[],Comparator<Object>)
    Arrays.sort(A, Collections.reverseOrder());
          ^
    method Arrays.<T#1>sort(T#1[],Comparator<? super T#1>) is not applicable
      (inference variable T#1 has incompatible bounds
        equality constraints: int
        upper bounds: Object)
    method Arrays.<T#2>sort(T#2[],int,int,Comparator<? super T#2>) is not applicable
      (cannot infer type-variable(s) T#2
        (actual and formal argument lists differ in length))
  where T#1,T#2 are type-variables:
    T#1 extends Object declared in method <T#1>sort(T#1[],Comparator<? super T#1>)
    T#2 extends Object declared in method <T#2>sort(T#2[],int,int,Comparator<? super T#2>)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

using namespace std;
int main(){
  int n, m;
  cin >> n >> m;
  vector<int> item;
  int all = 0;
  for(int i = 0, temp; i < n; ++i){
    cin >> temp;
    all += temp;
    item.push_back(temp);
  }
  //cout << all << endl;
  sort(item.begin(), item.end(), greater<>());
  int minimum = all / 4 / m;
  string ans;
  ans = minimum < item[m - 1] ? "Yes" : "No";
  cout << ans << 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:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> item;
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> item;
      |          ^~~
a.cc:10:5: error: 'item' was not declared in this scope
   10 |     item.push_back(temp);
      |     ^~~~
a.cc:13:8: error: 'item' was not declared in this scope
   13 |   sort(item.begin(), item.end(), greater<>());
      |        ^~~~
a.cc:13:34: error: 'greater' was not declared in this scope
   13 |   sort(item.begin(), item.end(), greater<>());
      |                                  ^~~~~~~
a.cc:13:42: error: expected primary-expression before '>' token
   13 |   sort(item.begin(), item.end(), greater<>());
      |                                          ^
a.cc:13:44: error: expected primary-expression before ')' token
   13 |   sort(item.begin(), item.end(), greater<>());
      |                                            ^
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(item.begin(), item.end(), greater<>());
      |   ^~~~
      |   short
a.cc:15:3: error: 'string' was not declared in this scope
   15 |   string ans;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:16:3: error: 'ans' was not declared in this scope
   16 |   ans = minimum < item[m - 1] ? "Yes" : "No";
      |   ^~~
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << ans << endl;
      |   ^~~~
a.cc:17:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:18: error: 'endl' was not declared in this scope
   17 |   cout << ans << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <string>
#include <vector>
#include <algorithm>
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];
    }
    sort(a.begin(),a.end(),greater<int>());
    if(a[m-1]>=sum/(4*m)){cout<<"Yes";}
    else{cout<<"No";}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin>>n>>m;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <algorithm>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:17:27: error: 'cout' was not declared in this scope
   17 |     if(a[m-1]>=sum/(4*m)){cout<<"Yes";}
      |                           ^~~~
a.cc:17:27: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:10: error: 'cout' was not declared in this scope
   18 |     else{cout<<"No";}
      |          ^~~~
a.cc:18:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import java.util.*;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
	    int n = in.nextInt();
      	int m = in.nextInt();
      	List<Integer> items = new ArrayList<>();
      	int votes = 0;
      	for (int i = 0; i < n; i++) {
        	int vote = in.nextInt();
          	votes += vote;
         	items.add(vote);
        }
      	int condition = votes / 4 * m;
      	int checkCount = 0;
      	Collections.sort(items);
      	for (Integer check: items) {
      		if (check > condition && ++checkCount >= m) return true;    
        }
      	return false;
      
    }
 
}

Compiler output:
Main.java:20: error: incompatible types: unexpected return value
      		if (check > condition && ++checkCount >= m) return true;    
      		                                                   ^
Main.java:22: error: incompatible types: unexpected return value
      	return false;
      	       ^
2 errors
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: expected '}' before 'else'
   27 |     else {
      |     ^~~~
a.cc:25:37: note: to match this '{'
   25 |   if (a.at(m-1)>=array_sum(a)/(4*m)){
      |                                     ^
Language: C++

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

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


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

#include<bits/stdc++.h>
#define ll long long
using namespace std;
void solve()
{
	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];
	int  ans=0;
	int 
	for(int i=0;i<n;i++)
	{
		if(arr[i]>=(sum/(m*4)))
		++ans;
		if(ans==m)
		break;
	}
	if(ans==m)
	cout<<"Yes\n";
	else
	cout<<"No\n";
}
int main()
{
//	int t;cin>>t;
//	while(t--)
	solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:13:9: error: expected unqualified-id before 'for'
   13 |         for(int i=0;i<n;i++)
      |         ^~~
a.cc:13:21: error: 'i' was not declared in this scope
   13 |         for(int i=0;i<n;i++)
      |                     ^
Language: Java

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int[] A = new int[N];
		int i;
		int sum = 0;
		String ans = "Yes";
		double judge;
		for(i = o;i < N;i++){
			A[i] = sc.nextInt();
			sum += A[i];
		}
		Arrays.sort(A);
		judge = sum / ($ * M);
		for(i = 0;i < M;i++){
			if((double)A[N - 1 - i] < judge){
				ans = "No";
			}
		}
		System.out.println(ans);
	}
}

Compiler output:
Main.java:12: error: cannot find symbol
		for(i = o;i < N;i++){
		        ^
  symbol:   variable o
  location: class Main
Main.java:17: error: cannot find symbol
		judge = sum / ($ * M);
		               ^
  symbol:   variable $
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
double a[101];
int main(){
    //ios::sync_with_stdio(false);
    //cin.tie(0);
    double N,M;
    cin>>N>>m;
    double sum=0;
    for(int i=0;i<N;i++){
        cin>>a[i];
        sum+=a[i];
    }
    double v=(1/4*M)*sum;
    int cnt=0;
    for(int i=0;i<N;i++){
        if(a[i]>v)
            cnt++;
    }
    if(cnt>=M)
        cout<<"Yes";
    else
        cout<<"No";
}


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'j' was not declared in this scope
   13 |   for(i=0;i<m;j++){
      |               ^