結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー tomeruntomerun
提出日時 2024-02-23 21:25:57
言語 Crystal
(1.14.0)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 180 bytes
コンパイル時間 13,609 ms
コンパイル使用メモリ 296,716 KB
実行使用メモリ 16,712 KB
最終ジャッジ日時 2024-09-29 05:26:42
合計ジャッジ時間 15,675 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

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