/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 35ms 17.219 MiB
#2 Accepted 34ms 17.359 MiB
#3 Accepted 35ms 17.309 MiB
#4 Accepted 35ms 17.316 MiB
#5 Accepted 62ms 18.801 MiB
#6 Accepted 57ms 18.566 MiB
#7 Accepted 96ms 39.617 MiB
#8 Accepted 113ms 41.402 MiB
#9 Accepted 115ms 43.09 MiB
#10 Accepted 126ms 42.094 MiB
#11 Wrong Answer 163ms 21.062 MiB
#12 Wrong Answer 161ms 21.559 MiB

Code

T = int(input())
for _ in range(T):
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    ans = 0
    for i in range(N):
        a = A.pop()
        if a<=0:
            break
        if i%2==0:
            ans += a
        else:
            ans -= a
    print(ans)

Information

Submit By
Type
Submission
Problem
P1208 C. Game on Integer
Contest
Educational Round 1
Language
PyPy 3 (Python 3.9.18 PyPy 7.3.15)
Submit At
2025-07-14 15:57:07
Judged At
2025-07-14 15:57:07
Judged By
Score
60
Total Time
163ms
Peak Memory
43.09 MiB