# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
294521 | 7_7_7 | Akcija (COCI15_akcija) | C++17 | 18 ms | 1280 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
ios_base::sync_with_stdio(false);
cin >> n;
vector<int> a(n);
for(auto &x: a) cin >> x;
sort(a.begin(), a.end());
long long res = accumulate(a.begin(), a.end(), 0ll);
int cur = (int)a.size() - 3;
while(cur >= 0){
res -= a[cur];
cur -= 3;
}
cout << res << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |