# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23191 | 2017-05-04T11:42:17 Z | model_code | Akcija (COCI15_akcija) | C++11 | 23 ms | 1504 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 1504 KB | Output is correct |
2 | Correct | 0 ms | 1504 KB | Output is correct |
3 | Correct | 0 ms | 1504 KB | Output is correct |
4 | Correct | 0 ms | 1504 KB | Output is correct |
5 | Correct | 0 ms | 1504 KB | Output is correct |
6 | Correct | 16 ms | 1504 KB | Output is correct |
7 | Correct | 13 ms | 1504 KB | Output is correct |
8 | Correct | 13 ms | 1504 KB | Output is correct |
9 | Correct | 23 ms | 1504 KB | Output is correct |
10 | Correct | 23 ms | 1504 KB | Output is correct |