# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153730 | BabinSinko | Akcija (COCI15_akcija) | C++14 | 66 ms | 2424 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 <cstdlib>
#include <cmath>
#include <iostream>
#include <cctype>
#include <ctime>
using namespace std;
long long n, c[100003], sol, x;
int compare (const void * a, const void * b){
return ( *(int*)a - *(int*)b );
}
int main(){
cin >> n;
for (int i; i < n; i++){
cin >> c[i];
sol = sol + c[i];
}
x = 1;
qsort (c, n, sizeof(long long), compare);
for (int i = (n - 1); i >= 0; i--){
if (x % 3 == 0){
sol = sol - c[i];
x = 0;
}
x = x + 1;
}
cout << sol;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |