結果

問題 No.609 Noelちゃんと星々
ユーザー KozumaKozuma
提出日時 2018-01-17 23:16:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 229 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 10,604 KB
実行使用メモリ 18,956 KB
最終ジャッジ日時 2023-08-25 23:08:47
合計ジャッジ時間 3,404 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 44 ms
12,124 KB
testcase_02 AC 33 ms
10,736 KB
testcase_03 WA -
testcase_04 AC 27 ms
9,808 KB
testcase_05 AC 89 ms
18,388 KB
testcase_06 AC 78 ms
16,960 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 61 ms
14,372 KB
testcase_11 AC 58 ms
14,088 KB
testcase_12 WA -
testcase_13 AC 24 ms
9,424 KB
testcase_14 WA -
testcase_15 AC 79 ms
17,072 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 81 ms
16,944 KB
testcase_20 AC 94 ms
18,956 KB
testcase_21 AC 94 ms
18,828 KB
testcase_22 AC 94 ms
18,788 KB
testcase_23 AC 94 ms
18,788 KB
testcase_24 AC 93 ms
18,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

Y.sort()

sum = 0
if N % 2 != 0:
	center = Y[int(N / 2) + 1]
else:
	center = int((Y[int(N / 2) - 1] + Y[int(N / 2)]) / 2)

for i in Y:
		sum += abs(i - center)

print(sum)
	

0