# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
165017 | Rouge_Hugo | Akcija (COCI15_akcija) | C++14 | 67 ms | 1300 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 ll long long
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
int n;
int a[100009];
int main()
{
cin>>n;
ll sum=0;
for(int i=0;i<n;i++)cin>>a[i];
sort(a,a+n);
int re=0;
for(int i=n-1;i>-1;i--)
{
re%=3;
if (re==2){re++;continue;}
sum+=a[i];
re++;
}
cout<<sum;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |