Submission #382133

#TimeUsernameProblemLanguageResultExecution timeMemory
382133BlancaHMAkcija (COCI15_akcija)C++14
80 / 80
37 ms1132 KiB
#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 timeMemoryGrader output
Fetching results...