Submission #382130

#TimeUsernameProblemLanguageResultExecution timeMemory
382130BlancaHMAkcija (COCI15_akcija)C++14
40 / 80
38 ms1260 KiB
#include <iostream> #include <algorithm> using namespace std; int main() { int N; cin >> N; 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 timeMemoryGrader output
Fetching results...