結果
問題 | No.2648 [Cherry 6th Tune D] 一次元の馬 |
ユーザー |
|
提出日時 | 2024-02-23 21:28:43 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 662 ms / 2,000 ms |
コード長 | 744 bytes |
コンパイル時間 | 149 ms |
コンパイル使用メモリ | 82,464 KB |
実行使用メモリ | 185,828 KB |
最終ジャッジ日時 | 2024-09-29 05:31:44 |
合計ジャッジ時間 | 11,737 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random #sys.setrecursionlimit(10**9) #sys.set_int_max_str_digits(0) input = sys.stdin.readline t = int(input()) #alist = list(map(int,input().split())) #alist = [] #s = input() #n,m = map(int,input().split()) #for i in range(n): # alist.append(list(map(int,input().split()))) for i in range(t): n = int(input()) a = list(map(int,input().split())) l,r = 0,10**10 for j in range(42): m = (l+r)//2 b = [a[k] + (k+1)*m for k in range(n)] cnt = 0 for k in range(n-1): if b[k] < b[k+1]: cnt += 1 if cnt == n-1: r = m else: l = m print(r)