結果

問題 No.1374 Absolute Game
ユーザー convexineqconvexineq
提出日時 2021-02-05 22:11:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 196 bytes
コンパイル時間 527 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 96,312 KB
最終ジャッジ日時 2023-09-15 08:24:28
合計ジャッジ時間 4,498 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,664 KB
testcase_01 AC 71 ms
71,284 KB
testcase_02 AC 70 ms
71,500 KB
testcase_03 AC 74 ms
71,472 KB
testcase_04 AC 72 ms
71,616 KB
testcase_05 AC 70 ms
71,136 KB
testcase_06 AC 70 ms
71,468 KB
testcase_07 AC 70 ms
71,348 KB
testcase_08 AC 83 ms
79,624 KB
testcase_09 AC 106 ms
91,292 KB
testcase_10 AC 108 ms
93,496 KB
testcase_11 AC 93 ms
85,840 KB
testcase_12 AC 84 ms
80,420 KB
testcase_13 AC 100 ms
88,772 KB
testcase_14 AC 115 ms
96,180 KB
testcase_15 AC 116 ms
96,312 KB
testcase_16 AC 116 ms
96,160 KB
testcase_17 AC 116 ms
96,088 KB
testcase_18 AC 115 ms
96,280 KB
testcase_19 AC 118 ms
96,020 KB
testcase_20 AC 89 ms
81,956 KB
testcase_21 AC 92 ms
84,732 KB
testcase_22 AC 113 ms
95,896 KB
testcase_23 AC 76 ms
75,884 KB
testcase_24 AC 78 ms
76,256 KB
testcase_25 AC 81 ms
77,384 KB
testcase_26 AC 87 ms
80,396 KB
testcase_27 AC 92 ms
83,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
a.sort()
v = sum(a[::2])
w = sum(a[1::2])
ans = abs(v) - abs(w)
a = a[::-1]
v = sum(a[::2])
w = sum(a[1::2])
ans = max(ans,abs(v)-abs(w))
print(ans)
0