# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
292360 | MilosMilutinovic | Akcija (COCI15_akcija) | C++14 | 24 ms | 1280 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(){
int n;
scanf("%i",&n);
int a[n];
long long sum=0;
for(int i=0;i<n;i++)scanf("%i",&a[i]),sum+=a[i];
sort(a,a+n);
reverse(a,a+n);
for(int i=2;i<n;i+=3)sum-=a[i];
printf("%lld",sum);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |