結果
| 問題 | No.1478 Simple Sugoroku | 
| コンテスト | |
| ユーザー |  yuusanlondon | 
| 提出日時 | 2021-04-16 20:55:11 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 345 bytes | 
| コンパイル時間 | 461 ms | 
| コンパイル使用メモリ | 81,792 KB | 
| 実行使用メモリ | 88,576 KB | 
| 最終ジャッジ日時 | 2024-07-02 23:37:25 | 
| 合計ジャッジ時間 | 4,782 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 33 WA * 5 | 
ソースコード
import os,io,heapq
input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=[]
for i in range(m):
  b.append(n-a[i])
currsum=0
flag=0
for i in range(m-1,-1,-1):
  if (currsum+i+1)<=(m-i-1)*b[i]:
    print(a[0]-1+(currsum+m)/(m-i-1))
    exit()
  else:
    currsum+=b[i]
print(n-1)
            
            
            
        