# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156128 | mdn2002 | Akcija (COCI15_akcija) | C++14 | 85 ms | 804 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;
long long mod=1e9+7;
int n,a[100005],ans=0,k=0;
int main()
{
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
sort(a,a+n);
for(int i=n-1;i>=0;i--)
{
k++;
if(k==3)
{
k=0;
continue;
}
ans+=a[i];
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |