結果

問題 No.609 Noelちゃんと星々
ユーザー akitsugu777akitsugu777
提出日時 2018-11-19 13:23:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 113 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 18,940 KB
最終ジャッジ日時 2023-08-26 02:04:40
合計ジャッジ時間 3,449 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
16,272 KB
testcase_01 AC 39 ms
12,240 KB
testcase_02 AC 29 ms
10,672 KB
testcase_03 AC 35 ms
11,848 KB
testcase_04 AC 24 ms
9,780 KB
testcase_05 AC 80 ms
18,396 KB
testcase_06 AC 71 ms
17,048 KB
testcase_07 AC 44 ms
13,444 KB
testcase_08 AC 20 ms
9,184 KB
testcase_09 AC 36 ms
11,268 KB
testcase_10 AC 52 ms
14,524 KB
testcase_11 AC 48 ms
14,076 KB
testcase_12 AC 61 ms
15,588 KB
testcase_13 AC 21 ms
9,332 KB
testcase_14 AC 16 ms
8,604 KB
testcase_15 AC 72 ms
17,136 KB
testcase_16 AC 84 ms
18,616 KB
testcase_17 AC 66 ms
16,292 KB
testcase_18 AC 28 ms
10,760 KB
testcase_19 AC 68 ms
16,984 KB
testcase_20 AC 83 ms
18,760 KB
testcase_21 AC 81 ms
18,936 KB
testcase_22 AC 81 ms
18,940 KB
testcase_23 AC 81 ms
18,908 KB
testcase_24 AC 82 ms
18,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
l = sorted(map(int,input().split()))

x = l[n//2]

y = 0
for i in l:
    y += abs(x-i)

print(y)
0