結果
問題 | No.609 Noelちゃんと星々 |
ユーザー |
|
提出日時 | 2018-01-17 23:20:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 131 ms / 2,000 ms |
コード長 | 226 bytes |
コンパイル時間 | 330 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 21,732 KB |
最終ジャッジ日時 | 2024-12-24 10:55:21 |
合計ジャッジ時間 | 3,424 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
N = int(input())Y = list(map(int, input().split()))Y.sort()sum = 0if N % 2 != 0:center = Y[int(N / 2)]else:center = int((Y[int(N / 2) - 1] + Y[int(N / 2)]) / 2)for i in Y:sum += abs(i - center)print(sum)