QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#188251 | #5481. Beast Bullies | IsaacMoris# | WA | 62ms | 5208kb | C++14 | 702b | 2023-09-25 17:27:25 | 2023-09-25 17:27:26 |
Judging History
answer
#include<iostream>
#include <bits/stdc++.h>
#define ll long long
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int N = 1e6 + 5, mod = 1e9 + 7;
void doWork() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.rbegin(), a.rend());
for (int i = 1; i < n; i++) {
a[0] -= a[i];
if (a[0] <= 0) {
cout << i + 1;
return;
}
}
cout << 1;
}
int main() {
IO
int t = 1;
//cin >> t;
for (int i = 1; i <= t; i++) {
// cout << "Case #" << i << ": ";
doWork();
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 62ms
memory: 5208kb
input:
500000 976631732 51389671 729809897 630844317 294721017 903231515 477913449 871071076 636104080 345822085 97441187 499323378 522845426 310022664 199310190 776622973 602672555 646874222 214723272 285341530 962727359 681361226 47426538 272153520 693133904 542337627 556307610 325596239 95738088 5495543...
output:
3
result:
wrong answer 1st lines differ - expected: '155101', found: '3'