結果

問題 No.837 Noelちゃんと星々2
ユーザー AT274_
提出日時 2019-10-18 16:56:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 231 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 23,952 KB
最終ジャッジ日時 2024-06-25 14:38:59
合計ジャッジ時間 4,019 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 4 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if len(set(P)) == 1:
    print(1)
    exit()

q1, q2 = int(N / 4), int(N / 4 * 3)
p1, p2 = P[q1], P[q2]

ans = 0
for p in P:
    ans += min(abs(p - p1), abs(p - p2))
print(ans)
0