結果

問題 No.1374 Absolute Game
ユーザー H3PO4H3PO4
提出日時 2022-04-21 09:45:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 973 ms
コンパイル使用メモリ 10,584 KB
実行使用メモリ 32,396 KB
最終ジャッジ日時 2023-09-04 08:22:08
合計ジャッジ時間 9,222 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
29,676 KB
testcase_01 AC 137 ms
29,648 KB
testcase_02 AC 137 ms
29,540 KB
testcase_03 AC 138 ms
29,520 KB
testcase_04 AC 144 ms
29,624 KB
testcase_05 AC 140 ms
29,664 KB
testcase_06 AC 140 ms
29,656 KB
testcase_07 AC 140 ms
29,712 KB
testcase_08 AC 142 ms
30,264 KB
testcase_09 AC 154 ms
31,020 KB
testcase_10 AC 154 ms
31,376 KB
testcase_11 AC 148 ms
30,576 KB
testcase_12 AC 144 ms
30,076 KB
testcase_13 AC 152 ms
31,268 KB
testcase_14 AC 155 ms
32,396 KB
testcase_15 AC 155 ms
32,324 KB
testcase_16 AC 156 ms
32,200 KB
testcase_17 AC 155 ms
32,208 KB
testcase_18 AC 156 ms
32,340 KB
testcase_19 AC 156 ms
32,396 KB
testcase_20 AC 148 ms
30,368 KB
testcase_21 AC 149 ms
30,628 KB
testcase_22 AC 158 ms
31,780 KB
testcase_23 AC 142 ms
30,060 KB
testcase_24 AC 143 ms
30,096 KB
testcase_25 AC 144 ms
29,812 KB
testcase_26 AC 147 ms
30,160 KB
testcase_27 AC 150 ms
30,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N = int(input())
C = np.fromstring(input(), dtype=np.int64, sep=' ')
if C.sum() < 0:
    C = -C
C = np.sort(C)[::-1]
ans = np.abs(np.sum(C[0::2])) - np.abs(np.sum(C[1::2]))
print(ans)
0