Submission #154252

#TimeUsernameProblemLanguageResultExecution timeMemory
154252RadugnnAkcija (COCI15_akcija)C++14
80 / 80
62 ms1272 KiB
#include <iostream> #include <algorithm> using namespace std; int v[100010],i,n; long long s; int main(){ cin>>n; for(i=1;i<=n;i++){ cin>>v[i]; s+=v[i]; } sort(v+1,v+n+1); for(i=n-2;i>=1;i-=3) s-=v[i]; cout<<s; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...