結果
問題 | No.653 E869120 and Lucky Numbers |
ユーザー | siman |
提出日時 | 2023-01-12 19:31:37 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 107 ms / 2,000 ms |
コード長 | 697 bytes |
コンパイル時間 | 476 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 13,056 KB |
最終ジャッジ日時 | 2024-12-23 12:50:29 |
合計ジャッジ時間 | 5,002 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
コンパイルメッセージ
Syntax OK
ソースコード
P = gets.chomp.chars.map(&:to_i) N = P.size single_flg = false P.reverse_each.with_index do |v, idx| if idx == 0 if (2..4).cover?(v) else puts "No" exit end elsif idx == N - 1 if single_flg if (6..7).cover?(v) else puts "No" exit end else if v == 1 || v == 7 || v == 8 else puts "No" exit end end else if single_flg if (6..7).cover?(v) else puts "No" exit end else if (3..5).cover?(v) # next elsif (7..8).cover?(v) single_flg = true else puts "No" exit end end end end puts "Yes"