Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
  using ll = intfast64_t;
  int n;
  cin >> n;
  vector<ll> a(n);
  for(auto&& x:a)cin >> x;
  sort(a.begin(), a.end());
  vector<ll> b(a);
  for(int i=0;i<n-1;i++)
    b[i+1] += b[i];
  int f = 0;
  for(int i=0;i<n-1;i++){
    cerr << i << " " << b[i] << " " << a[i+1] << endl;
    if(2 * b[i] < a[i+1])f = i + 1;
  }
  cout << n-f << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'intfast64_t' does not name a type; did you mean 'int_fast64_t'?
    6 |   using ll = intfast64_t;
      |              ^~~~~~~~~~~
      |              int_fast64_t
a.cc:9:10: error: 'll' was not declared in this scope
    9 |   vector<ll> a(n);
      |          ^~
a.cc:9:12: error: template argument 1 is invalid
    9 |   vector<ll> a(n);
      |            ^
a.cc:9:12: error: template argument 2 is invalid
a.cc:10:16: error: 'begin' was not declared in this scope
   10 |   for(auto&& x:a)cin >> x;
      |                ^
a.cc:10:16: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:10:16: error: 'end' was not declared in this scope
   10 |   for(auto&& x:a)cin >> x;
      |                ^
a.cc:10:16: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:11:10: error: request for member 'begin' in 'a', which is of non-class type 'int'
   11 |   sort(a.begin(), a.end());
      |          ^~~~~
a.cc:11:21: error: request for member 'end' in 'a', which is of non-class type 'int'
   11 |   sort(a.begin(), a.end());
      |                     ^~~
a.cc:12:12: error: template argument 2 is invalid
   12 |   vector<ll> b(a);
      |            ^
a.cc:14:6: error: invalid types 'int[int]' for array subscript
   14 |     b[i+1] += b[i];
      |      ^
a.cc:14:16: error: invalid types 'int[int]' for array subscript
   14 |     b[i+1] += b[i];
      |                ^
a.cc:17:26: error: invalid types 'int[int]' for array subscript
   17 |     cerr << i << " " << b[i] << " " << a[i+1] << endl;
      |                          ^
a.cc:17:41: error: invalid types 'int[int]' for array subscript
   17 |     cerr << i << " " << b[i] << " " << a[i+1] << endl;
      |                                         ^
a.cc:18:13: error: invalid types 'int[int]' for array subscript
   18 |     if(2 * b[i] < a[i+1])f = i + 1;
      |             ^
a.cc:18:20: error: invalid types 'int[int]' for array subscript
   18 |     if(2 * b[i] < a[i+1])f = i + 1;
      |                    ^