Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main()
- {
- long long n,d=0,sum=0;
- cin >> n;
- long long a[n];
- for (int i=0;i<n;i++){
- cin >> a[n];
- }
- sort(a,a+n);
- for (long long i=1;i<n;i++){
- sum=0;
- for (long long j=i;j>=0;j--){
- sum += a[j];
- }
- if (a[i]>sum){
- d++;
- }
- }
- cout << n-d << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement