結果
問題 |
No.609 Noelちゃんと星々
|
ユーザー |
|
提出日時 | 2017-12-09 20:55:33 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 165 ms / 2,000 ms |
コード長 | 347 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 27,840 KB |
最終ジャッジ日時 | 2024-11-30 05:31:02 |
合計ジャッジ時間 | 4,015 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
from collections import Counter def main(): N = int(input()) Y = tuple(map(int, input().split())) c = Counter(Y).most_common() y = sorted(Y) idx = N // 2 dist = float('inf') for i in (c[0][0], y[idx]): n = 0 for j in y: n += abs(i - j) dist = min(dist, n) print(dist) main()