80 1,2WA了
查看原帖
80 1,2WA了
931633
742643qh楼主2024/3/25 16:54
#include<bits/stdc++.h>
using namespace std;
const int N=1e6+10;
int a[N];
int main()
{
	int t,num=0;
	ios::sync_with_stdio(false);
	cin >> t;
	for(int i = 1;i <= t;i++) 
		cin >> a[i];
	sort(a + 1,a + 1 + t);
	while(t > 0) {
		t -= a[t];
		num++;
	}
	cout << num << endl;
	return 0;
}

80分 WA在1,2点 求助

2024/3/25 16:54
加载中...