# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
87804 | 2018-12-02T15:32:02 Z | asifthegreat | Akcija (COCI15_akcija) | C++14 | 26 ms | 3344 KB |
#include <bits/stdc++.h> using namespace std; int ara[300000]; int main() { int n; scanf("%d",&n); for(int i = 1; i <= n;i++){ scanf("%d",&ara[i]); } sort(ara+1,ara+1+n,greater<int>()); int sum = 0; int last_taken = -1; ara[n+1] = 0; ara[n+2] = 0; for(int i = 1; i <= n;i+=3){ sum += ara[i]; sum += ara[i+1]; } printf("%d\n",sum); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 400 KB | Output is correct |
4 | Correct | 2 ms | 512 KB | Output is correct |
5 | Correct | 2 ms | 624 KB | Output is correct |
6 | Correct | 20 ms | 1400 KB | Output is correct |
7 | Correct | 15 ms | 1796 KB | Output is correct |
8 | Correct | 14 ms | 2204 KB | Output is correct |
9 | Correct | 25 ms | 2852 KB | Output is correct |
10 | Correct | 26 ms | 3344 KB | Output is correct |