結果
問題 |
No.1374 Absolute Game
|
ユーザー |
![]() |
提出日時 | 2022-03-18 11:02:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 90 ms / 2,000 ms |
コード長 | 250 bytes |
コンパイル時間 | 189 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 85,248 KB |
最終ジャッジ日時 | 2024-10-02 13:58:49 |
合計ジャッジ時間 | 3,506 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
ソースコード
import sys input=lambda:sys.stdin.readline().rstrip() N=int(input()) A=sorted(list(map(int,input().split()))) if N==1: print(abs(A[0])) elif sum(A)>0: print(abs(sum(A[N-1::-2]))-abs(sum(A[N-2::-2]))) else: print(abs(sum(A[::2]))-abs(sum(A[1::2])))