# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
384621 |
2021-04-01T22:49:13 Z |
vulpes |
Akcija (COCI15_akcija) |
C++17 |
|
19 ms |
1260 KB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int n; cin >> n;
vector<int> a(n);
for (int &i : a) {
cin >> i;
}
sort(a.rbegin(), a.rend());
long long r = 0;
for (int i = 0; i < n; i++) {
if (i % 3 != 2) {
r += a[i];
}
}
cout << r << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
364 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
15 ms |
1132 KB |
Output is correct |
7 |
Correct |
10 ms |
1132 KB |
Output is correct |
8 |
Correct |
10 ms |
1132 KB |
Output is correct |
9 |
Correct |
19 ms |
1260 KB |
Output is correct |
10 |
Correct |
19 ms |
1260 KB |
Output is correct |