結果

問題 No.1374 Absolute Game
ユーザー titiatitia
提出日時 2021-02-05 21:48:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 219 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 19,116 KB
最終ジャッジ日時 2023-09-15 08:00:14
合計ジャッジ時間 2,607 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,964 KB
testcase_01 AC 15 ms
7,812 KB
testcase_02 AC 15 ms
7,812 KB
testcase_03 AC 15 ms
7,840 KB
testcase_04 AC 15 ms
7,924 KB
testcase_05 AC 15 ms
7,964 KB
testcase_06 AC 15 ms
7,872 KB
testcase_07 AC 15 ms
7,968 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

#print(C)
A=abs(sum(C[:N//2]))-abs(sum(C[N//2:]))
C.reverse()
B=abs(sum(C[:N//2]))-abs(sum(C[N//2:]))

print(min(abs(A),abs(B)))
0