結果

問題 No.653 E869120 and Lucky Numbers
ユーザー simansiman
提出日時 2023-01-12 19:25:59
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 564 bytes
コンパイル時間 748 ms
コンパイル使用メモリ 11,208 KB
実行使用メモリ 15,900 KB
最終ジャッジ日時 2023-08-25 01:05:03
合計ジャッジ時間 5,761 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,344 KB
testcase_01 AC 82 ms
15,112 KB
testcase_02 AC 82 ms
15,032 KB
testcase_03 AC 82 ms
15,128 KB
testcase_04 AC 80 ms
15,148 KB
testcase_05 AC 81 ms
15,272 KB
testcase_06 AC 82 ms
15,264 KB
testcase_07 AC 80 ms
15,256 KB
testcase_08 AC 83 ms
15,276 KB
testcase_09 AC 81 ms
15,092 KB
testcase_10 AC 80 ms
15,340 KB
testcase_11 AC 80 ms
15,048 KB
testcase_12 AC 79 ms
15,212 KB
testcase_13 AC 78 ms
15,036 KB
testcase_14 AC 79 ms
15,000 KB
testcase_15 AC 79 ms
15,300 KB
testcase_16 AC 79 ms
15,108 KB
testcase_17 AC 80 ms
15,112 KB
testcase_18 AC 79 ms
15,184 KB
testcase_19 AC 79 ms
15,124 KB
testcase_20 AC 79 ms
15,268 KB
testcase_21 AC 79 ms
15,176 KB
testcase_22 AC 80 ms
15,144 KB
testcase_23 AC 78 ms
15,168 KB
testcase_24 AC 79 ms
15,144 KB
testcase_25 AC 80 ms
15,032 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 90 ms
15,876 KB
testcase_29 AC 91 ms
15,848 KB
testcase_30 AC 88 ms
15,900 KB
testcase_31 AC 80 ms
15,004 KB
testcase_32 AC 79 ms
15,268 KB
testcase_33 AC 80 ms
15,000 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

P = gets.chomp.chars.map(&:to_i)

single_flg = false
its_over = false

P.reverse_each.with_index do |v, idx|
  if idx == 0
    if (2..4).cover?(v)
    else
      puts "No"
      exit
    end
  elsif its_over
    puts "No"
    exit
  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
      elsif v == 1
        its_over = true
      else
        puts "No"
        exit
      end
    end
  end
end

puts "Yes"
0