QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#555644 | #8586. Party | Jioru | Compile Error | / | / | C++20 | 436b | 2024-09-10 07:22:07 | 2024-09-10 07:22:08 |
Judging History
answer
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> arr(n);
for (int i = 0; i < n; ++i)
cin >> arr[i];
sort(arr.begin(), arr.end(), [](int a, int b) {
return a > b;
});
ll ans = 0;
for (int i = 0; i < (n + 1) / 2; ++i)
ans += max(arr[i], 0);
cout << ans << endl;
return 0;
}
Details
answer.code: In function ‘int main()’: answer.code:16:5: error: ‘ll’ was not declared in this scope 16 | ll ans = 0; | ^~ answer.code:18:9: error: ‘ans’ was not declared in this scope; did you mean ‘abs’? 18 | ans += max(arr[i], 0); | ^~~ | abs answer.code:20:13: error: ‘ans’ was not declared in this scope; did you mean ‘abs’? 20 | cout << ans << endl; | ^~~ | abs