QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#112278 | #6605. The Witchwood | zararaza | WA | 0ms | 3384kb | C++17 | 402b | 2023-06-11 01:16:44 | 2023-06-11 01:16:46 |
Judging History
answer
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int mas[1050];
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int n, k; cin >> n >> k;
for (int i = 0; i < n; i++) cin >> mas[i];
sort(mas, mas + n, greater<int>());
int s = 0; for (int i = 0; i < k; i++) s += mas[i];
cout << s << endl;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3368kb
input:
5 2 9 8 10 2 4
output:
19
result:
ok 1 number(s): "19"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3384kb
input:
1000 921 574477968 51255457 2508704 653253382 156645487 11643451 116234725 195749025 540495922 587734721 387247487 82940369 82316321 175268731 103171750 380698907 187565561 216028471 110586267 480573 340881497 991681048 336946159 326492497 16121404 512034084 427853141 42975101 324239541 337875097 51...
output:
-1573093738
result:
wrong answer 1st numbers differ - expected: '260419911318', found: '-1573093738'