結果

問題 No.609 Noelちゃんと星々
ユーザー Kozuma
提出日時 2018-01-17 23:16:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 229 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,732 KB
最終ジャッジ日時 2024-12-24 10:55:03
合計ジャッジ時間 4,040 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 10
権限があれば一括ダウンロードができます

ソースコード

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