# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
739996 | unexpectedbro | Akcija (COCI15_akcija) | C++14 | 20 ms | 1236 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 <cstdio>
#include <algorithm>
using namespace std;
#define MAXN 100000
typedef long long llint;
int C[MAXN];
bool cmp(int a, int b) {
return a > b;
}
int main(void) {
int n; scanf ("%d", &n);
for (int i = 0; i < n; i++) {
scanf ("%d", &C[i]);
}
sort(C, C+n, cmp);
llint sol = 0;
for (int i = 0; i < n; i++) {
if (i % 3 == 2) {
continue;
}
sol += C[i];
}
printf ("%lld\n", sol);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |