Untitled
user_5668965
c_cpp
a year ago
216 B
15
Indexable
#include<bits/stdc++.h>
using namespace std;
int a[101],n,c,tot,ans;
int main(){
cin>>n;
while(cin>>a[c++]);
sort(a,a+n);
for(auto i:a) tot+=i;
while(1) if((ans+=a[c--])>tot/2) {cout<<(n-c-1);break;}
}Editor is loading...
Leave a Comment