結果

問題 No.609 Noelちゃんと星々
ユーザー ttrttr
提出日時 2020-02-22 20:18:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 181 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 21,772 KB
最終ジャッジ日時 2024-04-18 03:03:29
合計ジャッジ時間 4,526 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
19,104 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 64 ms
14,404 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 79 ms
15,800 KB
testcase_08 AC 40 ms
11,648 KB
testcase_09 AC 58 ms
13,916 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 100 ms
18,252 KB
testcase_13 WA -
testcase_14 AC 35 ms
11,264 KB
testcase_15 WA -
testcase_16 AC 131 ms
21,184 KB
testcase_17 AC 109 ms
18,932 KB
testcase_18 AC 54 ms
13,464 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
Y = [int(y) for y in input().split()]

Y.sort()
if N%2 == 1:
    x = Y[N//2]
else:
    x = (Y[N//2]+Y[N//2+1])//2
ans = 0
for y in Y:
    ans += abs(y-x)
print(ans)
0