結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,584 KB
testcase_01 AC 47 ms
51,968 KB
testcase_02 AC 44 ms
52,352 KB
testcase_03 AC 43 ms
51,584 KB
testcase_04 AC 42 ms
51,712 KB
testcase_05 AC 43 ms
51,968 KB
testcase_06 AC 42 ms
52,096 KB
testcase_07 AC 42 ms
52,352 KB
testcase_08 AC 43 ms
52,352 KB
testcase_09 AC 42 ms
52,096 KB
testcase_10 AC 42 ms
52,096 KB
testcase_11 AC 43 ms
52,224 KB
testcase_12 AC 43 ms
51,840 KB
testcase_13 AC 77 ms
88,960 KB
testcase_14 AC 77 ms
88,576 KB
testcase_15 AC 77 ms
89,216 KB
testcase_16 AC 77 ms
88,576 KB
testcase_17 AC 76 ms
88,660 KB
testcase_18 AC 77 ms
88,704 KB
testcase_19 AC 78 ms
89,088 KB
testcase_20 AC 77 ms
89,216 KB
testcase_21 AC 78 ms
88,448 KB
testcase_22 AC 78 ms
88,960 KB
testcase_23 AC 77 ms
88,832 KB
testcase_24 AC 82 ms
88,576 KB
testcase_25 AC 78 ms
88,576 KB
testcase_26 AC 77 ms
89,216 KB
testcase_27 AC 78 ms
88,900 KB
testcase_28 AC 76 ms
85,504 KB
testcase_29 AC 75 ms
86,656 KB
testcase_30 AC 75 ms
86,528 KB
testcase_31 AC 75 ms
86,400 KB
testcase_32 AC 76 ms
86,144 KB
testcase_33 AC 76 ms
86,912 KB
testcase_34 AC 75 ms
86,528 KB
testcase_35 AC 77 ms
87,168 KB
testcase_36 AC 75 ms
86,528 KB
testcase_37 AC 77 ms
88,192 KB
testcase_38 AC 76 ms
87,936 KB
testcase_39 AC 77 ms
88,064 KB
testcase_40 AC 76 ms
87,936 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
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