Submission #382133

# Submission time Handle Problem Language Result Execution time Memory
382133 2021-03-26T13:02:00 Z BlancaHM Akcija (COCI15_akcija) C++14
80 / 80
37 ms 1132 KB
#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, greater<int>());
	for (int i = 2; i < N; i += 3)
		paid -= prices[i];
	cout << paid;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 30 ms 1132 KB Output is correct
7 Correct 26 ms 1132 KB Output is correct
8 Correct 25 ms 1132 KB Output is correct
9 Correct 37 ms 1132 KB Output is correct
10 Correct 36 ms 1132 KB Output is correct