結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー yupoohyupooh
提出日時 2024-02-23 21:30:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 472 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 105,316 KB
最終ジャッジ日時 2024-02-23 21:30:22
合計ジャッジ時間 6,075 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 207 ms
76,536 KB
testcase_02 AC 103 ms
75,740 KB
testcase_03 AC 102 ms
75,976 KB
testcase_04 AC 107 ms
96,768 KB
testcase_05 AC 108 ms
102,316 KB
testcase_06 AC 97 ms
89,984 KB
testcase_07 AC 107 ms
102,200 KB
testcase_08 AC 96 ms
90,152 KB
testcase_09 AC 113 ms
105,316 KB
testcase_10 AC 111 ms
102,340 KB
testcase_11 AC 104 ms
95,312 KB
testcase_12 AC 107 ms
96,612 KB
testcase_13 AC 103 ms
102,184 KB
testcase_14 AC 109 ms
99,792 KB
testcase_15 AC 108 ms
99,792 KB
testcase_16 AC 116 ms
99,792 KB
testcase_17 AC 115 ms
99,792 KB
testcase_18 AC 114 ms
99,792 KB
testcase_19 AC 112 ms
99,792 KB
testcase_20 AC 108 ms
99,792 KB
testcase_21 AC 113 ms
99,792 KB
testcase_22 AC 117 ms
99,792 KB
testcase_23 AC 107 ms
99,792 KB
testcase_24 AC 90 ms
99,792 KB
testcase_25 AC 76 ms
87,000 KB
testcase_26 AC 120 ms
99,792 KB
testcase_27 AC 116 ms
95,856 KB
testcase_28 AC 123 ms
99,840 KB
testcase_29 AC 121 ms
102,248 KB
testcase_30 AC 119 ms
99,840 KB
testcase_31 AC 122 ms
99,840 KB
testcase_32 AC 118 ms
99,840 KB
testcase_33 AC 121 ms
99,580 KB
testcase_34 AC 122 ms
99,840 KB
testcase_35 AC 154 ms
76,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0