結果

問題 No.609 Noelちゃんと星々
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-11 16:39:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 122 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 11,656 KB
実行使用メモリ 20,660 KB
最終ジャッジ日時 2023-10-20 01:32:25
合計ジャッジ時間 3,547 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
18,164 KB
testcase_01 AC 55 ms
13,936 KB
testcase_02 AC 47 ms
12,556 KB
testcase_03 AC 55 ms
13,732 KB
testcase_04 AC 41 ms
11,672 KB
testcase_05 AC 98 ms
20,256 KB
testcase_06 AC 89 ms
18,792 KB
testcase_07 AC 61 ms
15,148 KB
testcase_08 AC 35 ms
11,032 KB
testcase_09 AC 49 ms
13,108 KB
testcase_10 AC 71 ms
16,236 KB
testcase_11 AC 68 ms
15,932 KB
testcase_12 AC 77 ms
17,496 KB
testcase_13 AC 38 ms
11,260 KB
testcase_14 AC 32 ms
10,512 KB
testcase_15 AC 89 ms
18,940 KB
testcase_16 AC 99 ms
20,460 KB
testcase_17 AC 83 ms
18,188 KB
testcase_18 AC 47 ms
12,516 KB
testcase_19 AC 87 ms
18,796 KB
testcase_20 AC 101 ms
20,660 KB
testcase_21 AC 103 ms
20,660 KB
testcase_22 AC 102 ms
20,660 KB
testcase_23 AC 102 ms
20,660 KB
testcase_24 AC 101 ms
20,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
Y = list(map(int, input().split()))
Y.sort()

x = Y[n // 2]
ans = sum(abs(x - y) for y in Y)
print(ans)

0