結果
問題 |
No.1374 Absolute Game
|
ユーザー |
![]() |
提出日時 | 2021-02-05 23:24:54 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 85 ms / 2,000 ms |
コード長 | 225 bytes |
コンパイル時間 | 140 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 87,680 KB |
最終ジャッジ日時 | 2024-07-02 14:33:58 |
合計ジャッジ時間 | 2,823 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
ソースコード
N = int(input()) A = list(map(int, input().split())) if sum(A) < 0: A = [-a for a in A] A.sort() X = Y = 0 f = 1 while A: if f: X += A.pop() else: Y += A.pop() f = 1 - f print(abs(X)-abs(Y))