# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382131 | BlancaHM | Akcija (COCI15_akcija) | C++14 | 41 ms | 1132 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 <iostream>
#include <algorithm>
using namespace std;
int main() {
int N;
cin >> N;
long long int prices[N], paid = 0;
for (int i = 0; i < N; i++) {
cin >> prices[i];
paid += prices[i];
}
sort(prices, prices+N);
for (int i = 0; i+2 < N; i += 3)
paid -= prices[i];
cout << paid;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |