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

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,k,i,x;
    cin >> n >>k;
    int arr[n],sum=0;
    for(i=0;i<n;i++){
        cin >> arr[i];
        sum+=arr[i];
    }
    x=sum/(4*k);
    sort(arr.begin(), arr.end());
    for(i=0;i<n;i++){
        if(arr[i]>x){
            k--;
        }
        if(k==0){
            cout<<"Yes";
            break;
        }
    }
    if(k!=1)
    cout << "No";

    return 0;
}

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

int main(){
    // int x,y,z;
    // cin>>x>>y>>z;
    // pair<string,int>p("A",x);
    // pair<string,int>q("B",y);
    // pair<string,int>r("c",z);
    // swap(p.second,q.second);
    // swap(p.second,r.second);
    // cout<<p.second<<" "<<q.second<<" "<<r.second;
    int n,m,sum=0;
    cin>>n>>m;
    vector<int> vec(n);
    for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
    sum+=vec.at(i);
    }
    sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());
    for(int i=1;i<=m;i++){
        if(vec.at(i-1)<(double)(sum/4/m)){
            printf("No");
            return 0;
        }
    }
    printf("Yes");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'cin' was not declared in this scope
   11 |     cin>>n>>m;
      |     ^~~
a.cc:12:5: error: 'vector' was not declared in this scope
   12 |     vector<int> vec(n);
      |     ^~~~~~
a.cc:12:12: error: expected primary-expression before 'int'
   12 |     vector<int> vec(n);
      |            ^~~
a.cc:14:12: error: 'vec' was not declared in this scope
   14 |     cin >> vec.at(i);
      |            ^~~
a.cc:17:10: error: 'vec' was not declared in this scope
   17 |     sort(vec.begin(),vec.end());
      |          ^~~
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |     sort(vec.begin(),vec.end());
      |     ^~~~
      |     short
a.cc:18:5: error: 'reverse' was not declared in this scope
   18 |     reverse(vec.begin(),vec.end());
      |     ^~~~~~~
a.cc:21:13: error: 'printf' was not declared in this scope
   21 |             printf("No");
      |             ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(){
a.cc:25:5: error: 'printf' was not declared in this scope
   25 |     printf("Yes");
      |     ^~~~~~
a.cc:25:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

n=int(input())
m=int(input())
a=[]
s=0
c=0
for i in range(0,n):
    e=int(input())
    a.append(e)
    s=s+a[i]
p=4*m
p=1/p
p=p*s
for i in range(0,n):
    if(a[i]>p):
        c=c+1
if(c>m):
    print("Yes")
else:
    print("No")


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

#include<bits/stdc++.h>
using namepspace std;
int main(){
int n,m,a=0,b=0;
  cin>>n>>m;
  while(n--){
    cin>>a;
    b+=a;
  }
  int c=b/(4*m);
  if(c>=m)
    cout<<"Yes"<<"\n";
  else
    cout<<"No"<<"\n";
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namepspace'
    2 | using namepspace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n>>m;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |     cout<<"Yes"<<"\n";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |     cout<<"No"<<"\n";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

typedef long long int ll;

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

    for(auto &v : a)
    {
    	cin>>v;
      sum+=v;
    }
  k=(1/(4*m))*sum;
  sort(a.begin(),a.end());
 for(int i=0;i<n;i++)
 {
 	if(v[i]>=k)
    {cout<<n-i-1<<"\n";break;}
 }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'k' was not declared in this scope
   16 |   k=(1/(4*m))*sum;
      |   ^
a.cc:20:12: error: 'v' was not declared in this scope
   20 |         if(v[i]>=k)
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    int n,m;
    int sum =0;
    int count =0;

    cin >> n >> m;
    int A[n];
    for (int i = 0; i < n; i++) cin >> A[i];
    for (int i = 0; i < n; i++)
        sum +=A[i];
    float border = (sum /(float)(4*m);
    for (int i = 0; i < n; i++)
           if (A[i]>=border) count++;
    
    cout << ((count >= m) ? "Yes" :"No" )<< endl;
}

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

#include <iostream>
using namespace std;

int main(){
    int n,m;
    int sum =0;
    int count =0;

    cin >> n >> m;
    int A[n];
    for (int i = 0; i < n; i++) cin >> A[n];
    for (int i = 0; i < n; i++)
        sum +=A[i];
    int border = sum /(4*m);
    for (int i = 0; i < n; i++)
           if (A[i]>border) count++;
    
    cout << (count >= m) ? "yes" :"no" << endl;
}

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

#include <iostream>
using namespace std;

int main(){
    int n,m;
    sum =0;
    count =0;

    cin >> n >> m;
    int A[n];
    for (int i = 0; i < n; i++) cin >> A[n];
    for (int i = 0; i < n; i++)
        sum +=A[n];
    int border = sum /4*m;
    for (int i = 0; i < n; i++)
           if (A[n]>border) count++;
    
    cout << (count >= m) << endl;


}

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

#include<iostream>
#include<vector>
#define NUM 100;
using namespace std;

int main(){
    bool ans = 1;
    long long n,m;
    long long sum = 0;
    cin >> n >> m;
    vector<long long> a(n);
    for(int i = 0;i < n;i++){
        cin >> a.at(i);
        sum += a.at(i);
    }
    sum /= 4*m;
    /**/
    sort(a.begin(),a.end());
    if(a.at(n - m) < sum){
        ans = 0;
    }

    if(ans){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    
    return 0;
}

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

#include<stdio.h>

int main(void){
  int m,n;
  
  scanf("%d %d",&n,&m);
  int a[n];
  int i;
  int sum = 0;
  for(i = 0;i < n;i++){
    scanf("%d",&a[i]);
    sum+=a[i];
  }
  float th = float(sum)/(4.0*m);
  int cnt=0;
  for(i=0;i < n;i++){
    if(a[i] >= th){
      cnt++;
    }
  }
  if(cnt >= m){
    printf("Yes");
  }
  else{
    printf("No");
  }
  return 0;
}
  


Compiler output:
main.c: In function 'main':
main.c:14:14: error: expected expression before 'float'
   14 |   float th = float(sum)/(4.0*m);
      |              ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int N,M;
  cin>>N>>M;
  vector <int> A(N);
  for(int i=0;i<N;i++){
   cin>>A.at(i);
  }
    int sum=0;
  for(int i=0;i<N;i++){
  sum+=A.at(i);
  
  }
  sort(A.begin(),A,end());
  string s;
  if(sum%4*M==0){
    if(sum/(4*M)<=A.at(N-M)) s="Yes";else s="No";
  }else{
    if((sum/(4*M))+1<=A.at(N-M)) s="Yes"; else s="No";
  } cout<<s<<endl;
  
 

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: no matching function for call to 'end()'
   15 |   sort(A.begin(),A,end());
      |                    ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
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];
   sort(a.rbegin(),a.rend());
   int sum=0;
   for(int i=0;i<n;i++) sum+=a[i];
   if(a[m-1]>=(sum/4/m) cout<<"Yes"<<endl;
   else cout<<"No"<<endl;
}



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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:29: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'void')
   16 |   a = sort(a.begin(),a.end());
      |                             ^
In file included from /usr/include/c++/14/vector:72,
                 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/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'void' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'void' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'void' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
   16 |   sort(a.begin,a.end);
      |   ~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/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:   template argument deduction/substitution failed:
a.cc:16:7: note:   couldn't deduce template parameter '_RAIter'
   16 |   sort(a.begin,a.end);
      |   ~~~~^~~~~~~~~~~~~~~
/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, 2 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, 2 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, 2 provided
Language: C++

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

Compiler output:
a.cc:27:13: warning: missing terminating " character
   27 |     cout << "Yes);
      |             ^
a.cc:27:13: error: missing terminating " character
   27 |     cout << "Yes);
      |             ^~~~~~
a.cc: In function 'int main()':
a.cc:16:7: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
   16 |   sort(a.begin,a.end);
      |   ~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/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:   template argument deduction/substitution failed:
a.cc:16:7: note:   couldn't deduce template parameter '_RAIter'
   16 |   sort(a.begin,a.end);
      |   ~~~~^~~~~~~~~~~~~~~
/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, 2 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, 2 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, 2 provided
a.cc:28:3: error: expected primary-expression before '}' token
   28 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
#include <sstream> 
using namespace std;
int main() {
  int n,m,t,deff = 0;
  double summ;
  vector<int> a;
  cin >> n;
  cin >> m;
  for (int i = 0; i < n; ++i)
  {
    cin >> t;
    a.push_back(t);
    summ += t;
  }
  a = a.sort(a.begin,a.end);
  for (int i = 0; i < m; ++i)
  {
    if (a[n-m] <= (summ / (i*4))) {
      deff = 1;
    }
  }
  if (deff == 1) {
    print('No');
  }
  else {
    print('Yes');
  }
}

Compiler output:
a.cc:24:11: warning: multi-character character constant [-Wmultichar]
   24 |     print('No');
      |           ^~~~
a.cc:27:11: warning: multi-character character constant [-Wmultichar]
   27 |     print('Yes');
      |           ^~~~~
a.cc: In function 'int main()':
a.cc:16:9: error: 'class std::vector<int>' has no member named 'sort'
   16 |   a = a.sort(a.begin,a.end);
      |         ^~~~
a.cc:24:5: error: 'print' was not declared in this scope; did you mean 'rint'?
   24 |     print('No');
      |     ^~~~~
      |     rint
a.cc:27:5: error: 'print' was not declared in this scope; did you mean 'rint'?
   27 |     print('Yes');
      |     ^~~~~
      |     rint
Language: C++

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

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

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

  double thr = 0.25/M;
  if((double)A.at(M-1) < thr){
    cout << "No" << endl;
  }els{
    cout << "Yes" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:4: error: 'els' was not declared in this scope
   20 |   }els{
      |    ^~~
Language: C++

#include<stdio.h>
#include<conio.h>
#include<iostream>
using namespace std;

int main()
{
    int a[10000];
    int d = 0;
    int i = 0;
    int c = 0;
    int n = 0;
    int m = 0;
    cin>>n;
    cin>>m;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        c = c + a[i];
    }
    for(i=0;i<n;i++)
    {
        if(a[i]>=(c/4*m))
        {
            d = d + 1;
        }
        if(d >= m )
        {
            cout<<"Yes";
            return 0;
            break;
        }
    }
    cout<<"No";
}

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

n,m = map(int,input().split())
a = list(map(int,input().split()))
count=0
sum=0
for i in range(n):
  sum = sum + a[i]
for i in range(n):
  if a[i] >= int(sum*(1/(4*m))):
    count +=1
  else:
    pass

if count>=m:
  print('Yes')
else:
  print('No')

Compiler output:
a.cc:14:9: warning: multi-character character constant [-Wmultichar]
   14 |   print('Yes')
      |         ^~~~~
a.cc:16:9: warning: multi-character character constant [-Wmultichar]
   16 |   print('No')
      |         ^~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n,m = map(int,input().split())
      | ^
Language: C++

l = input()
m = input()
z = l.split(" ")
M = int(z[1])
N = int(z[0])
C = (1/4M)N
F = m.split(" ")
X = []
for item in f:
   votes = int(item)
   X.append(votes)
   X.sort(reverse==true)
for i in range(M):
   if X[i]<C:
      print("No")
      return
print("Yes")


Compiler output:
a.cc:1:1: error: 'l' does not name a type
    1 | l = input()
      | ^
Language: C++

l = input()
m = input()
z = l.split(" ")
M = int(z[1])
N = int(z[0])
C = (1/4M)N
F = m.split(" ")
X = []
for item in f:
   votes = int(item)
   X.append(votes)
   X.sort(reverse=true)
for i in range(M):
   if X[i]<C:
      print("No")
      return
print("Yes")

Compiler output:
a.cc:1:1: error: 'l' does not name a type
    1 | l = input()
      | ^
Language: C++

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

int main(){
	int n,m,sum=0,count;
	double l=0;
	cin>>n>>m;
	vector<int> a(1000000);
	for(int i=0;i<n;i++){
		cin>>a[i];
		sum=sum+a[i];
	}
	sort(a.begin(),a.end(),std :: greater <int>());
	l=sum/(4*m);

	if(a[m-1]>=l{
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
	
	
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: expected ';' before '{' token
   19 |         if(a[m-1]>=l{
      |                     ^
      |                     ;
a.cc:22:9: error: expected primary-expression before 'else'
   22 |         else{
      |         ^~~~
a.cc:21:10: error: expected ')' before 'else'
   21 |         }
      |          ^
      |          )
   22 |         else{
      |         ~~~~
a.cc:19:11: note: to match this '('
   19 |         if(a[m-1]>=l{
      |           ^
Language: C++

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

int main(){
	int n,m,sum=0,count;
	double l=0;
	cin>>n>>m;
	vector<int> a(1000000);
	for(int i=0;i<n;i++){
		cin>>a[i];
		sum=sum+a[i];
	}
	sort(a.begin(),a.end(),std :: greater <int>());
	l=sum/(4*m)

	if(a[m-1]>=l{
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
	
	
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: expected ';' before 'if'
   17 |         l=sum/(4*m)
      |                    ^
      |                    ;
   18 | 
   19 |         if(a[m-1]>=l{
      |         ~~          
a.cc:22:9: error: 'else' without a previous 'if'
   22 |         else{
      |         ^~~~
Language: C++

n,m=map(int,input().split())
a=list(map(int,input().split()))
a_sum=sum(a)
#print(a_sum)
a.sort(reverse=True)
#print(a)
if a[m-1]/a_sum>=1/(4*m):
            print('Yes')
else:
            print('No')
            


Compiler output:
a.cc:4:2: error: invalid preprocessing directive #print
    4 | #print(a_sum)
      |  ^~~~~
a.cc:6:2: error: invalid preprocessing directive #print
    6 | #print(a)
      |  ^~~~~
a.cc:8:19: warning: multi-character character constant [-Wmultichar]
    8 |             print('Yes')
      |                   ^~~~~
a.cc:10:19: warning: multi-character character constant [-Wmultichar]
   10 |             print('No')
      |                   ^~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n,m=map(int,input().split())
      | ^
Language: C++

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

int main(void) {
	int n, m,sum=0;
	scanf("%d %d", &n, &m);
	int* arr = (int*)malloc(sizeof(int) * n);//int,n個分のサイズを確保
	//int* arr2 = new int[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &arr[i]);
		sum += arr[i];
	}
	std::sort(arr,arr+n,std::greater<int>());//範囲内の値を並び替える std::greater<int>()で大きい順に並び替える


	for (int i = 0; i < m;i++) {
		if (arr[i] < sum / (4.0 * m)) {
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:34: error: 'greater' is not a member of 'std'
   14 |         std::sort(arr,arr+n,std::greater<int>());//範囲内の値を並び替える std::greater<int>()で大きい順に並び替える
      |                                  ^~~~~~~
a.cc:14:42: error: expected primary-expression before 'int'
   14 |         std::sort(arr,arr+n,std::greater<int>());//範囲内の値を並び替える std::greater<int>()で大きい順に並び替える
      |                                          ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,x) for(int i=0;i<x; i++)
typedef long long  ll;
using namespace std;
int main(){
	int,N,M;
  cin>>N>>M;
  int A[N];
	int all=0;
  rep(i,N){
  	cin>>A[i];
    all+=A[i];
  }
  
  int sinsa=all/(4*M),counter=0;
  rep(i,N){
  	if(A[i]>=sinsa){
    	counter++;
    }
  }
  if(counter>=M){
  	cout<<"Yes";
  }else{
  	count<<"No";
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected unqualified-id before ',' token
    6 |         int,N,M;
      |            ^
a.cc:24:14: error: invalid operands of types '<unresolved overloaded function type>' and 'const char [3]' to binary 'operator<<'
   24 |         count<<"No";
      |         ~~~~~^~~~~~
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];
  }
  for(int i=0;i<n;i++)
  { 
    sum = sum + a[i];
  }
  int x = sum / (4*m);
  for(int i=0;i<n;i++)
  {
    if(x>=a[i])
      m--;
    if(m==0)
      cout<<"Yes";
   }
  else
     cout<<"No";
  return 0;
}
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: 'else' without a previous 'if'
   24 |   else
      |   ^~~~
Language: C++

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

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

	int sum{};
  
	std::vector<int> data(N);
	for(int i = 0; i < N; ++i) {
    	std::cin >> data[i];
		sum += data[i];
    }

	int line = sum / (4*M);
  
	std::cout << ((std::count_if(data.begin(), data.end(), [=](int n){return n>=line}) >= M) ? "Yes" : "No") << std::endl;
}

Compiler output:
a.cc: In lambda function:
a.cc:19:89: error: expected ';' before '}' token
   19 |         std::cout << ((std::count_if(data.begin(), data.end(), [=](int n){return n>=line}) >= M) ? "Yes" : "No") << std::endl;
      |                                                                                         ^
      |                                                                                         ;
Language: C++

#include <iostream>
#include <algorithm>

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

	int sum{};
  
	std::vector<int> data(N);
	for(int i = 0; i < N; ++i) {
    	std::cin >> data[i];
		sum += data[i];
    }

	int line = sum / (4*M);
  
	std::cout << ((std::count_if(data.begin(), data.end(), [=](int n){return n>=line}) >= M) ? "Yes" : "No") << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'vector' is not a member of 'std'
   10 |         std::vector<int> data(N);
      |              ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | 
a.cc:10:21: error: expected primary-expression before 'int'
   10 |         std::vector<int> data(N);
      |                     ^~~
a.cc:12:21: error: 'data' was not declared in this scope; did you mean 'std::data'?
   12 |         std::cin >> data[i];
      |                     ^~~~
      |                     std::data
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: 'std::data' declared here
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
a.cc:18:38: error: 'data' was not declared in this scope; did you mean 'std::data'?
   18 |         std::cout << ((std::count_if(data.begin(), data.end(), [=](int n){return n>=line}) >= M) ? "Yes" : "No") << std::endl;
      |                                      ^~~~
      |                                      std::data
/usr/include/c++/14/bits/range_access.h:344:5: note: 'std::data' declared here
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
a.cc: In lambda function:
a.cc:18:89: error: expected ';' before '}' token
   18 |         std::cout << ((std::count_if(data.begin(), data.end(), [=](int n){return n>=line}) >= M) ? "Yes" : "No") << std::endl;
      |                                                                                         ^
      |                                                                                         ;
Language: C++

#include <iostream>

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

	int sum{};
  
	std::vector<int> data(N);
	for(int i = 0; i < N; ++i) {
    	std::cin >> data[i];
		sum += data[i];
    }

	int line = sum / (4*M);
  
	std::cout << ((std::count_if(data.begin(), data.end(), [=](int n){return n>=line}) >= M) ? "Yes" : "No") << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: 'vector' is not a member of 'std'
    9 |         std::vector<int> data(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 | 
a.cc:9:21: error: expected primary-expression before 'int'
    9 |         std::vector<int> data(N);
      |                     ^~~
a.cc:11:21: error: 'data' was not declared in this scope; did you mean 'std::data'?
   11 |         std::cin >> data[i];
      |                     ^~~~
      |                     std::data
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: 'std::data' declared here
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
a.cc:17:29: error: 'count_if' is not a member of 'std'
   17 |         std::cout << ((std::count_if(data.begin(), data.end(), [=](int n){return n>=line}) >= M) ? "Yes" : "No") << std::endl;
      |                             ^~~~~~~~
a.cc:17:38: error: 'data' was not declared in this scope; did you mean 'std::data'?
   17 |         std::cout << ((std::count_if(data.begin(), data.end(), [=](int n){return n>=line}) >= M) ? "Yes" : "No") << std::endl;
      |                                      ^~~~
      |                                      std::data
/usr/include/c++/14/bits/range_access.h:344:5: note: 'std::data' declared here
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
a.cc: In lambda function:
a.cc:17:89: error: expected ';' before '}' token
   17 |         std::cout << ((std::count_if(data.begin(), data.end(), [=](int n){return n>=line}) >= M) ? "Yes" : "No") << std::endl;
      |                                                                                         ^
      |                                                                                         ;
Language: C++

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

int main(){
int n,m;
cin >> n>>m;
int a[102];
rep(i,n) cin >> a[i];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:6: error: expected primary-expression before '<<' token
   18 | else << "No" << endl;
      |      ^~
a.cc:18:22: error: expected '}' at end of input
   18 | else << "No" << endl;
      |                      ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <stdio.h>
int main(){
  int n,m,num,total,count;
  scanf("%d %d",&n,&m);
  int list[n];
  for (int i=0;i<n;i++){
    scanf("%d",&num);
    list[i]=num;
    total+=list[i];
  }
  for(int i=0;i<n;i++){
    if(list[i]=>1/(4*m)){
      count++
    }
  }
  if(count==m){
    print("Yes"){
    }else{
      print("No")
    }
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected primary-expression before '>' token
   12 |     if(list[i]=>1/(4*m)){
      |                ^
a.cc:13:14: error: expected ';' before '}' token
   13 |       count++
      |              ^
      |              ;
   14 |     }
      |     ~         
a.cc:17:5: error: 'print' was not declared in this scope; did you mean 'printf'?
   17 |     print("Yes"){
      |     ^~~~~
      |     printf
a.cc:18:6: error: expected '}' before 'else'
   18 |     }else{
      |      ^~~~
a.cc:16:15: note: to match this '{'
   16 |   if(count==m){
      |               ^
a.cc:19:7: error: 'print' was not declared in this scope; did you mean 'printf'?
   19 |       print("No")
      |       ^~~~~
      |       printf
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
double n,m;
cin >> n>>m;
double arr[n];
double vote =0;
for(int i= 0; i< n;i++)
{
cin>>arr[i];
vote+= arr[i];
}
sort(arr,arr+n);
reverse(arr, arr+n);

double acc = vote/(m*4);
if(arr[m-1] >=acc)
{
cout << "Yes" << endl;
}
else if(arr[m-1] < acc)
{
cout << "No" << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    7 | double arr[n];
      |            ^
a.cc:7:12: error: could not convert 'n' from 'double' to 'long unsigned int'
    7 | double arr[n];
      |            ^
      |            |
      |            double
a.cc:7:12: error: size of array 'arr' has non-integral type 'double'
a.cc:14:13: error: invalid operands of types 'double [1]' and 'double' to binary 'operator+'
   14 | sort(arr,arr+n);
      |          ~~~^~
      |          |   |
      |          |   double
      |          double [1]
a.cc:15:17: error: invalid operands of types 'double [1]' and 'double' to binary 'operator+'
   15 | reverse(arr, arr+n);
      |              ~~~^~
      |              |   |
      |              |   double
      |              double [1]
a.cc:18:7: error: invalid types 'double [1][double]' for array subscript
   18 | if(arr[m-1] >=acc)
      |       ^
a.cc:22:12: error: invalid types 'double [1][double]' for array subscript
   22 | else if(arr[m-1] < acc)
      |            ^
Language: C++

#include<iostream>
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 check=sum/(4*m);
  int items=0;
  for(int i=0;i<n;i++){
  	if(a[i]>=check)
      items++;
    if(items>m)
      break;
  }
  if(items<m)
    cout<<"No";
  else
    cout<<"Yes";
  
  

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

#include <bits/stdc++.h>
#include<stdio.h>
#include <stdlib.h>
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

using namespace std;

int main(){
    int N, M;
    int sum = 0;
    int c = 0;
    double D;
    cin >> N >> M;
    int A[N];

    for (int a = 0; a < N; a++){
        cin >> A[a];
        sum+=A[a];
    }
  
qsort(A, N, sizeof(int), compare_int);
  
  D=sum/(4.0*M);

for (int b = N; b >= 0;b--){

    if(D <= A[b-1]){
        c++;
    }else{
        break;
    }
}
if(c>=M){
    cout << "Yes" << endl;
}else{
    cout << "No" << endl;
}

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

#include <iostream>
using namespace std;
int n, m;
vector<int> a;

double sum(vector<int> a) {
  double result = 0;
  for_each(begin(a), end(a), [&](auto x) {
    result += x;
  });

  return result;
}

void solve() {
  sort(begin(a), end(a), greater<int>());
  double s = sum(a);

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

int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int ai;
    cin >> ai;
    a.push_back(ai);
  }

  solve();
}

Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<int> a;
      | ^~~~~~
a.cc:6:12: error: 'vector' was not declared in this scope
    6 | double sum(vector<int> a) {
      |            ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:19: error: expected primary-expression before 'int'
    6 | double sum(vector<int> a) {
      |                   ^~~
a.cc: In function 'void solve()':
a.cc:16:14: error: 'a' was not declared in this scope
   16 |   sort(begin(a), end(a), greater<int>());
      |              ^
a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |   sort(begin(a), end(a), greater<int>());
      |   ^~~~
      |   short
a.cc:17:17: error: 'sum' cannot be used as a function
   17 |   double s = sum(a);
      |              ~~~^~~
a.cc: In function 'int main()':
a.cc:31:5: error: 'a' was not declared in this scope; did you mean 'ai'?
   31 |     a.push_back(ai);
      |     ^
      |     ai
Language: C

#include<stdio.h>
int main(void)
{
	int a[100],n,m,i,j=0,g=0;
 
	scanf("%d%d",&n,&m);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		g+=a[i];
	}
	//a[n+1]='\0';
	for(i=0;i<n;i++)
		if(a[i]*4*m>=g)
			j++;
	if(j>=m)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}
#include<stdio.h>
int main(void)
{
	int a[100],n,m,i,j=0,g=0;
 
	scanf("%d%d",&n,&m);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		g+=a[i];
	}
	//a[n+1]='\0';
	for(i=0;i<n;i++)
		if(a[i]*4*m>=g)
			j++;
	if(j>=m)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}
提出情報

Compiler output:
main.c:22:5: error: redefinition of 'main'
   22 | int main(void)
      |     ^~~~
main.c:2:5: note: previous definition of 'main' with type 'int(void)'
    2 | int main(void)
      |     ^~~~
main.c:41:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   41 | 提出情報
      | ^~~~~~~~
Language: C++

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

int arr[1010];

int main() {
  
  int n, m, ss = 0, cnt =0;
  
  cin >> n >> m;
  
  for(int i=0; i<n; i++) {
    cin >> arr[i];
    ss += arr[i];
  }
  
  ss /= (4*m);
  
  for(int i=0; i<n; i++)
    cnt += (arr[i] >= ss);
  
  cout << (cnt >= M ? "Yes" : "No") << endl;
 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: 'M' was not declared in this scope
   22 |   cout << (cnt >= M ? "Yes" : "No") << endl;
      |                   ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
  	vector<int>v;
  	int n,m,sum=0;
  	cin>>n>>m;
  	for(int i=0;i<n;i++){
      int a;
      cin>>a;
      sum+=a;
      v.push_back(a);
    }
  	double ll = (1.00/((double)m*4.00)*sum;
	int nt=0;
    for(int i=0;i<n;i++){
      if(v[i]>=ll)
        nt++;
    }
	if(nt>=m)
        cout<<"YES\n";
    else
        cout<<"NO\n";
                 
    return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:16:47: error: expected ')' before ';' token
   16 |         double ll = (1.00/((double)m*4.00)*sum;
      |                     ~                         ^
      |                                               )
Language: C++

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

int main(){
  int M, N;
  cin >> M >> N;
  
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  
  std::sort(vec.begin(), vec.end(), std::greater<int>());
  int sum = std::accumulate(vec.begin(), vec.end(), 0);
  
  bool condition = (vec[M-1] >= sum / (M * 4));
  
  
  cout << condition?"Yes":"No" << endl;
  
}

Compiler output:
a.cc:1:24: error: missing terminating > character
    1 | #include <bits/stdc++.h
      |                        ^
a.cc: In function 'int main()':
a.cc:23:32: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   23 |   cout << condition?"Yes":"No" << endl;
      |                           ~~~~~^~~~~~~
Language: C++

def main():
    N, M = map(int, input().split(' '))
    An = list(map(int, input().split(' ')))
    thres = sum(An) / (4 * M)
    
    count = 0
    for a in An:
        if not thres > a:
            count += 1
            
    if count >= M:
        print('Yes')
    else:
        print('No')
    
    
    
    
main()

Compiler output:
a.cc:12:15: warning: multi-character character constant [-Wmultichar]
   12 |         print('Yes')
      |               ^~~~~
a.cc:14:15: warning: multi-character character constant [-Wmultichar]
   14 |         print('No')
      |               ^~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def main():
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,a,sum=0,count=0;
  cin>>n>>m;
  vector<int>v;
  while(cin>>a)
  {
    v.push(a);
    sum+=a;
  }
  float c=sum/(4*m);
  for(int i=0;i<v.size();i++)
  {
    if(v[i]>=c)
      count++;
  }
  if(count>=m)
    cout<<"Yes\n";
  else
    cout<<"No\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'class std::vector<int>' has no member named 'push'
   10 |     v.push(a);
      |       ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace srd;
int main()
{
  int n,m,a,sum=0,count=0;
  cin>>n>>m;
  vector<int>v;
  while(cin>>a)
  {
    v.push(a);
    sum+=a;
  }
  float c=sum/(4*m);
  for(int i=0;i<v.size();i++)
  {
    if(v[i]>=c)
      count++;
  }
  if(count>=m)
    cout<<"Yes\n";
  else
    cout<<"No\n";
  return 0;
}

Compiler output:
a.cc:2:17: error: 'srd' is not a namespace-name
    2 | using namespace srd;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n>>m;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int>v;
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
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:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int>v;
      |          ^~~
a.cc:10:5: error: 'v' was not declared in this scope
   10 |     v.push(a);
      |     ^
a.cc:14:17: error: 'v' was not declared in this scope
   14 |   for(int i=0;i<v.size();i++)
      |                 ^
a.cc:20:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |     cout<<"Yes\n";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |     cout<<"No\n";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<nits/stdc++.h>
using namespace srd;
int main()
{
  int n,m,a,sum=0,count=0;
  cin>>n>>m;
  vector<int>v;
  while(cin>>a)
  {
    v.push(a);
    sum+=a;
  }
  float c=sum/(4*m);
  for(int i=0;i<v.size();i++)
  {
    if(v[i]>=c)
      count++;
  }
  if(count>=m)
    cout<<"Yes\n";
  else
    cout<<"No\n";
  return 0;
}

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