n=int(input())
L=[int(input()) for i in range (n)]
L.sort()
z=0
for i in range (n):
if i%3==0:
continue
else:
z+=L[i]
if n%3==1:
z+=L[n-1]
elif n%3==2:
z+=L[n-1]+L[n-2]
print(z)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
25 ms |
3528 KB |
Output isn't correct |
2 |
Incorrect |
25 ms |
3388 KB |
Output isn't correct |
3 |
Incorrect |
25 ms |
3304 KB |
Output isn't correct |
4 |
Correct |
25 ms |
3272 KB |
Output is correct |
5 |
Correct |
30 ms |
3300 KB |
Output is correct |
6 |
Correct |
333 ms |
7404 KB |
Output is correct |
7 |
Correct |
283 ms |
7904 KB |
Output is correct |
8 |
Correct |
281 ms |
7796 KB |
Output is correct |
9 |
Incorrect |
334 ms |
8228 KB |
Output isn't correct |
10 |
Incorrect |
367 ms |
8352 KB |
Output isn't correct |