結果

問題 No.609 Noelちゃんと星々
ユーザー ああいいああいい
提出日時 2021-12-05 21:31:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 128 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 18,964 KB
最終ジャッジ日時 2023-09-21 15:01:44
合計ジャッジ時間 4,299 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
16,312 KB
testcase_01 AC 46 ms
12,208 KB
testcase_02 AC 35 ms
10,740 KB
testcase_03 AC 43 ms
11,916 KB
testcase_04 AC 29 ms
9,908 KB
testcase_05 AC 100 ms
18,400 KB
testcase_06 AC 84 ms
16,940 KB
testcase_07 AC 54 ms
13,424 KB
testcase_08 AC 23 ms
9,224 KB
testcase_09 AC 38 ms
11,364 KB
testcase_10 AC 64 ms
14,544 KB
testcase_11 AC 61 ms
14,104 KB
testcase_12 AC 74 ms
15,648 KB
testcase_13 AC 25 ms
9,440 KB
testcase_14 AC 20 ms
8,828 KB
testcase_15 AC 87 ms
17,132 KB
testcase_16 AC 100 ms
18,772 KB
testcase_17 AC 81 ms
16,316 KB
testcase_18 AC 35 ms
10,852 KB
testcase_19 AC 84 ms
16,940 KB
testcase_20 AC 103 ms
18,964 KB
testcase_21 AC 100 ms
18,920 KB
testcase_22 AC 99 ms
18,832 KB
testcase_23 AC 105 ms
18,856 KB
testcase_24 AC 99 ms
18,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
Y = list(map(int,input().split()))

Y.sort()
u = Y[(N+1) // 2 - 1]
S = 0
for i in Y:
    S += abs(u-i)
print(S)
0