Untitled
user_5668965
c_cpp
9 days ago
216 B
1
Indexable
Never
#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;} }
Leave a Comment