結果
問題 |
No.2922 Rose Garden
|
ユーザー |
|
提出日時 | 2024-11-03 19:57:12 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 409 ms / 3,000 ms |
コード長 | 368 bytes |
コンパイル時間 | 993 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 28,672 KB |
最終ジャッジ日時 | 2024-11-03 19:57:27 |
合計ジャッジ時間 | 14,782 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
コンパイルメッセージ
Syntax OK
ソースコード
module RoseGarden def solve(n, s, b, a) sb = s * b h = a[0] + sb (1...n).each do |i| if h >= a[i] h = [h, a[i] + sb].max else return :No end end :Yes end module_function :solve end n, s, b = gets.chomp.split(/\s+/).map(&:to_i) ah = gets.chomp.split(/\s+/).map(&:to_i) puts RoseGarden.solve(n, s, b, ah)