提出 #31565453


ソースコード 拡げる

n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
answer = 0
for i in range(n):
    if i % 2 == 0:
        answer += a[i]
    else:
        answer -= a[i]
print(answer)

提出情報

提出日時
問題 B - Card Game for Two
ユーザ Pro_ktmr
言語 PyPy3 (7.3.0)
得点 200
コード長 208 Byte
結果 AC
実行時間 62 ms
メモリ 61912 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 12
セット名 テストケース
Sample sample_1.txt, sample_2.txt, sample_3.txt
All in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample_1.txt, sample_2.txt, sample_3.txt
ケース名 結果 実行時間 メモリ
in1.txt AC 62 ms 61752 KiB
in2.txt AC 46 ms 61496 KiB
in3.txt AC 51 ms 61524 KiB
in4.txt AC 52 ms 61648 KiB
in5.txt AC 50 ms 61912 KiB
in6.txt AC 50 ms 61712 KiB
in7.txt AC 49 ms 61616 KiB
in8.txt AC 46 ms 61776 KiB
in9.txt AC 49 ms 61840 KiB
sample_1.txt AC 45 ms 61644 KiB
sample_2.txt AC 51 ms 61704 KiB
sample_3.txt AC 50 ms 61708 KiB