Submission #156128

#TimeUsernameProblemLanguageResultExecution timeMemory
156128mdn2002Akcija (COCI15_akcija)C++14
80 / 80
85 ms804 KiB
#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 timeMemoryGrader output
Fetching results...