結果
| 問題 | No.609 Noelちゃんと星々 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-09 10:14:25 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 496 bytes |
| 記録 | |
| コンパイル時間 | 60 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 29,032 KB |
| 最終ジャッジ日時 | 2026-10-02 08:14:55 |
| 合計ジャッジ時間 | 4,710 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 25 |
ソースコード
from collections import Counter
def main():
N = int(input())
Y = tuple(map(int, input().split()))
if N == 1:
print(Y[0])
return
elif N == 2:
n = Y[:]
else:
n = sorted(Y)
max_i = n.index(max(n))
n = n[:max_i][::-1]
min_i = n.index(min(n))
n = n[:min_i]
counter = Counter(n)
reference = counter.most_common()[0][0]
dist = 0
for i in Y:
dist += abs(reference - i)
print(dist)
main()