結果

問題 No.1374 Absolute Game
ユーザー gorugo30gorugo30
提出日時 2021-02-05 21:43:55
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 736 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 93,752 KB
最終ジャッジ日時 2023-09-15 07:33:27
合計ジャッジ時間 4,684 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,172 KB
testcase_01 AC 73 ms
71,000 KB
testcase_02 AC 72 ms
70,812 KB
testcase_03 AC 74 ms
71,084 KB
testcase_04 AC 73 ms
70,828 KB
testcase_05 AC 72 ms
71,036 KB
testcase_06 AC 72 ms
71,128 KB
testcase_07 AC 71 ms
71,084 KB
testcase_08 AC 84 ms
78,340 KB
testcase_09 AC 106 ms
89,264 KB
testcase_10 AC 110 ms
90,992 KB
testcase_11 AC 96 ms
84,256 KB
testcase_12 AC 88 ms
79,160 KB
testcase_13 AC 104 ms
87,188 KB
testcase_14 AC 118 ms
93,752 KB
testcase_15 AC 115 ms
93,392 KB
testcase_16 AC 116 ms
93,748 KB
testcase_17 AC 116 ms
93,688 KB
testcase_18 AC 115 ms
93,372 KB
testcase_19 AC 115 ms
93,508 KB
testcase_20 AC 88 ms
80,936 KB
testcase_21 AC 94 ms
83,284 KB
testcase_22 AC 114 ms
93,416 KB
testcase_23 AC 79 ms
75,256 KB
testcase_24 AC 80 ms
75,544 KB
testcase_25 AC 82 ms
76,424 KB
testcase_26 AC 87 ms
78,964 KB
testcase_27 AC 93 ms
82,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
C = list(map(int, input().split()))

C.sort()
x = sum(C[::2])
y = sum(C[1::2])
ans1 = abs(x) - abs(y)
C = C[::-1]
x = sum(C[::2])
y = sum(C[1::2])
print(max(ans1, abs(x) - abs(y)))
0