結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー tomerun
提出日時 2024-02-23 21:25:57
言語 Crystal
(1.14.0)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 180 bytes
コンパイル時間 17,363 ms
コンパイル使用メモリ 307,092 KB
実行使用メモリ 17,196 KB
最終ジャッジ日時 2025-06-20 01:59:26
合計ジャッジ時間 15,198 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

read_line.to_i.times do
  puts solve()
end

def solve
  n = read_line.to_i
  a = read_line.split.map(&.to_i)
  return (n - 1).times.max_of { |i| {0, a[i] + 1 - a[i + 1]}.max }
end
0