Submission #384621

#TimeUsernameProblemLanguageResultExecution timeMemory
384621vulpesAkcija (COCI15_akcija)C++17
80 / 80
19 ms1260 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; vector<int> a(n); for (int &i : a) { cin >> i; } sort(a.rbegin(), a.rend()); long long r = 0; for (int i = 0; i < n; i++) { if (i % 3 != 2) { r += a[i]; } } cout << r << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...