#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
const int maxn = 110;
int arr[maxn];
int main() {
int sum = 0, t = 0;
int n;
scanf("%d", &n);
for(int i = 0; i < n; ++i) {
scanf("%d", &arr[i]);
sum += arr[i];
}
sort(arr, arr + n);
for(int i = n - 1; i >= 0; --i) {
t += arr[i];
if(t * 2 > sum) {
printf("%d\n", n - i);
break;
}
}
return 0;
}
160A - Twins
最新推荐文章于 2017-09-03 19:25:46 发布