Submission #268489

#TimeUsernameProblemLanguageResultExecution timeMemory
268489mayhoubsalehAkcija (COCI15_akcija)C++14
80 / 80
18 ms1664 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; const ll maxn=5e5+100; const ll inf=1e9+10; ll n; ll a[maxn]; int main() { IOS cin>>n; ll sum=0; for(ll i=0;i<n;i++)cin>>a[i],sum+=a[i];; sort(a,a+n); for(ll i=n-3;i>=0;i-=3){ sum-=a[i]; } cout<<sum<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...