結果

問題 No.609 Noelちゃんと星々
ユーザー 1_7201_720
提出日時 2019-08-19 22:11:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 126 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 21,756 KB
最終ジャッジ日時 2024-04-15 11:20:35
合計ジャッジ時間 4,424 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
19,012 KB
testcase_01 AC 64 ms
14,980 KB
testcase_02 AC 54 ms
13,480 KB
testcase_03 AC 62 ms
14,644 KB
testcase_04 AC 45 ms
12,672 KB
testcase_05 AC 125 ms
20,960 KB
testcase_06 AC 112 ms
19,528 KB
testcase_07 AC 74 ms
15,912 KB
testcase_08 AC 39 ms
11,904 KB
testcase_09 AC 56 ms
14,164 KB
testcase_10 AC 88 ms
17,116 KB
testcase_11 AC 83 ms
16,824 KB
testcase_12 AC 99 ms
18,240 KB
testcase_13 AC 42 ms
12,156 KB
testcase_14 AC 37 ms
11,392 KB
testcase_15 AC 119 ms
19,824 KB
testcase_16 AC 129 ms
21,168 KB
testcase_17 AC 105 ms
19,048 KB
testcase_18 AC 53 ms
13,572 KB
testcase_19 AC 113 ms
19,520 KB
testcase_20 AC 134 ms
21,632 KB
testcase_21 AC 132 ms
21,624 KB
testcase_22 AC 131 ms
21,756 KB
testcase_23 AC 135 ms
21,632 KB
testcase_24 AC 132 ms
21,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
y = sorted(list(map(int, input().split())))

i = n // 2
ans = 0

for x in y:
  ans += abs(x-y[i])

print(ans)
0