結果

問題 No.1478 Simple Sugoroku
ユーザー 👑 timitimi
提出日時 2021-05-20 10:32:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 293 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 82,468 KB
実行使用メモリ 89,216 KB
最終ジャッジ日時 2024-04-18 14:00:16
合計ジャッジ時間 5,109 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,968 KB
testcase_01 AC 41 ms
51,712 KB
testcase_02 AC 42 ms
51,968 KB
testcase_03 AC 41 ms
52,224 KB
testcase_04 WA -
testcase_05 AC 41 ms
51,968 KB
testcase_06 AC 41 ms
52,352 KB
testcase_07 AC 43 ms
52,096 KB
testcase_08 AC 42 ms
51,968 KB
testcase_09 AC 42 ms
52,096 KB
testcase_10 AC 43 ms
52,096 KB
testcase_11 AC 41 ms
52,096 KB
testcase_12 AC 42 ms
51,968 KB
testcase_13 AC 78 ms
88,832 KB
testcase_14 AC 74 ms
88,192 KB
testcase_15 AC 76 ms
89,016 KB
testcase_16 AC 78 ms
88,696 KB
testcase_17 AC 77 ms
89,088 KB
testcase_18 AC 77 ms
88,320 KB
testcase_19 AC 76 ms
88,704 KB
testcase_20 AC 77 ms
89,216 KB
testcase_21 AC 77 ms
88,576 KB
testcase_22 AC 77 ms
88,576 KB
testcase_23 AC 78 ms
89,216 KB
testcase_24 AC 77 ms
88,576 KB
testcase_25 AC 79 ms
88,576 KB
testcase_26 AC 77 ms
88,704 KB
testcase_27 AC 78 ms
88,960 KB
testcase_28 AC 73 ms
85,504 KB
testcase_29 AC 74 ms
86,528 KB
testcase_30 AC 75 ms
86,656 KB
testcase_31 AC 75 ms
86,144 KB
testcase_32 AC 73 ms
86,144 KB
testcase_33 AC 76 ms
87,040 KB
testcase_34 AC 80 ms
86,528 KB
testcase_35 AC 79 ms
87,040 KB
testcase_36 AC 80 ms
87,168 KB
testcase_37 AC 80 ms
87,936 KB
testcase_38 AC 76 ms
88,320 KB
testcase_39 AC 76 ms
87,936 KB
testcase_40 AC 76 ms
88,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int, input().split())
A=list(map(int, input().split()))
if M==1:
  print(N-1)
  exit()
b=A[0]-1+(N-A[-1])
cnt=M
ans=N-1
def f(a,r):
  d=a/(1-r)
  return d 
e=0
cnt=1
ans=N
for i in range(M-1,0,-1):
  r=i/M
  g=f(1,r)
  e+=A[-1]-A[i]
  ff=g+e/cnt
  cnt+=1
  ans=min(ans,b+ff)
print(ans)
0