結果

問題 No.2836 Comment Out
ユーザー suzuishi
提出日時 2024-08-09 21:50:12
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 157 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 27,776 KB
最終ジャッジ日時 2024-08-09 21:50:22
合計ジャッジ時間 8,822 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29 WA * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

def solve(a)
  return a.each_with_index.all? {|i, j| i <= j + 1}
end
n = gets.to_i
a = gets.split.map &:to_i
puts solve(a) || solve(a.reverse) ? "Yes" : "No"
0