結果

問題 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  
実行時間 127 ms / 2,000 ms
コード長 181 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,864 KB
最終ジャッジ日時 2024-05-09 23:51:03
合計ジャッジ時間 3,496 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
18,896 KB
testcase_01 AC 64 ms
14,832 KB
testcase_02 AC 54 ms
13,660 KB
testcase_03 AC 61 ms
14,716 KB
testcase_04 AC 45 ms
12,672 KB
testcase_05 AC 117 ms
21,080 KB
testcase_06 AC 105 ms
19,520 KB
testcase_07 AC 72 ms
16,012 KB
testcase_08 AC 38 ms
11,776 KB
testcase_09 AC 57 ms
14,092 KB
testcase_10 AC 84 ms
17,240 KB
testcase_11 AC 78 ms
16,696 KB
testcase_12 AC 95 ms
18,520 KB
testcase_13 AC 41 ms
12,160 KB
testcase_14 AC 34 ms
11,392 KB
testcase_15 AC 110 ms
19,788 KB
testcase_16 AC 123 ms
21,292 KB
testcase_17 AC 101 ms
19,048 KB
testcase_18 AC 53 ms
13,704 KB
testcase_19 AC 107 ms
19,700 KB
testcase_20 AC 127 ms
21,856 KB
testcase_21 AC 126 ms
21,856 KB
testcase_22 AC 125 ms
21,852 KB
testcase_23 AC 126 ms
21,864 KB
testcase_24 AC 127 ms
21,856 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