結果

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

ソースコード

diff #

N = int(input())
P = sorted(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