# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
384621 | vulpes | Akcija (COCI15_akcija) | C++17 | 19 ms | 1260 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|---|---|---|---|
Fetching results... |