#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
364 KB |
Output isn't 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 |
25 ms |
1132 KB |
Output is correct |
8 |
Correct |
26 ms |
1132 KB |
Output is correct |
9 |
Incorrect |
37 ms |
1132 KB |
Output isn't correct |
10 |
Incorrect |
41 ms |
1132 KB |
Output isn't correct |