# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1130407 | AndrijaM | Akcija (COCI15_akcija) | C++20 | 14 ms | 1096 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
///#define endl '\n'
const int maxn=2e5+10;
const int mod=1e9+7;
signed main()
{
ios::sync_with_stdio(false);
///freopen("dulciuri.in","r",stdin);
///freopen("dulciuri.out","w",stdout);
int n;
cin>>n;
int a[n];
int ans=0;
for(int i=0;i<n;i++)
{
cin>>a[i];
ans+=a[i];
}
sort(a,a+n);
reverse(a,a+n);
for(int i=2;i<n;i+=3)
{
ans-=a[i];
}
cout<<ans<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |