# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
163864 | beso123 | Akcija (COCI15_akcija) | C++14 | 59 ms | 1656 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>
#define int long long
using namespace std;
int n,a[100001];
main(){
cin>>n;
for(int k=1;k<=n;k++)
cin>>a[k];
int ans=0;
sort(a+1,a+n+1);
reverse(a+1,a+n+1);
for(int k=1;k<=n;k++)
if(k%3!=0)
ans+=a[k];
cout<<ans;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |