Submission #339166

#TimeUsernameProblemLanguageResultExecution timeMemory
339166ammar2000Akcija (COCI15_akcija)C++17
80 / 80
36 ms1388 KiB
#include <bits/stdc++.h> using namespace std; int n,sum; int a[100000000]; int main() { cin>>n; for (int i=1;i<=n;i++) cin>>a[i]; sort (a+1,a+n+1); reverse(a+1,a+n+1); for (int i=1;i<=n;i++) { if (i%3) sum+=a[i]; } cout <<sum; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...