結果
問題 | No.2648 [Cherry 6th Tune D] 一次元の馬 |
ユーザー |
![]() |
提出日時 | 2024-02-23 21:30:05 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 238 ms / 2,000 ms |
コード長 | 472 bytes |
コンパイル時間 | 192 ms |
コンパイル使用メモリ | 81,844 KB |
実行使用メモリ | 105,728 KB |
最終ジャッジ日時 | 2025-06-20 02:00:44 |
合計ジャッジ時間 | 6,660 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
ソースコード
import sys input = sys.stdin.readline t=int(input()) for _ in range(t): n=int(input()) a=list(map(int,input().split())) flg=True for i in range(n-1): if a[i]>=a[i+1]: flg=False break if flg: print(0) continue ok=10**9+10 ng=0 while ok-ng>1: mid=(ok+ng)//2 flg=True for i in range(n-1): if a[i]+mid*(i+1)>=a[i+1]+mid*(i+2): flg=False break if flg: ok=mid else: ng=mid print(ok)