結果

問題 No.609 Noelちゃんと星々
ユーザー wajima_wataruwajima_wataru
提出日時 2017-12-24 17:41:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 181 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 19,100 KB
最終ジャッジ日時 2023-08-22 18:02:55
合計ジャッジ時間 2,950 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
16,192 KB
testcase_01 AC 45 ms
12,252 KB
testcase_02 AC 36 ms
11,176 KB
testcase_03 AC 41 ms
11,980 KB
testcase_04 AC 27 ms
10,020 KB
testcase_05 AC 93 ms
18,432 KB
testcase_06 AC 83 ms
16,952 KB
testcase_07 AC 52 ms
13,212 KB
testcase_08 AC 22 ms
9,280 KB
testcase_09 AC 37 ms
11,428 KB
testcase_10 AC 61 ms
14,516 KB
testcase_11 AC 57 ms
13,940 KB
testcase_12 AC 70 ms
15,604 KB
testcase_13 AC 23 ms
9,520 KB
testcase_14 AC 18 ms
8,836 KB
testcase_15 AC 81 ms
16,960 KB
testcase_16 AC 93 ms
18,600 KB
testcase_17 AC 75 ms
16,180 KB
testcase_18 AC 34 ms
10,996 KB
testcase_19 AC 80 ms
16,848 KB
testcase_20 AC 95 ms
19,100 KB
testcase_21 AC 96 ms
19,052 KB
testcase_22 AC 95 ms
18,956 KB
testcase_23 AC 96 ms
18,944 KB
testcase_24 AC 95 ms
18,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline

N = int(input())
Y = sorted([int(i) for i in readline().split()])

t = Y[len(Y) // 2]
ans = 0
for y in Y:
    ans += abs(t - y)
print(ans)
0