結果

問題 No.837 Noelちゃんと星々2
ユーザー pluto77pluto77
提出日時 2020-10-06 10:25:45
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 300 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 21,404 KB
最終ジャッジ日時 2024-07-20 00:41:41
合計ジャッジ時間 5,200 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 5 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki837
n=int(input())
y=list(map(int,input().split()))
y.sort()
if y[0]==y[-1]:
 print(1)
 exit()
d=[0]*100000
temp=0
for i in range(n-1):
 temp+=y[i]-y[i//2]
 d[i]+=temp
temp=0
for i in range(n-2,-1,-1):
 temp+=y[n-(n-i)//2]-y[i+1]
 d[i]+=temp
m=1<<18
for i in range(n-1):
 m=min(m,d[i])
print(m)
0