結果

問題 No.779 Heisei
ユーザー rio-yuasario-yuasa
提出日時 2023-05-27 09:56:10
言語 Ruby
(3.3.0)
結果
AC  
実行時間 74 ms / 1,000 ms
コード長 684 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 11,264 KB
実行使用メモリ 15,344 KB
最終ジャッジ日時 2023-08-26 18:52:58
合計ジャッジ時間 2,915 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
15,216 KB
testcase_01 AC 73 ms
15,268 KB
testcase_02 AC 72 ms
15,228 KB
testcase_03 AC 70 ms
15,228 KB
testcase_04 AC 71 ms
15,212 KB
testcase_05 AC 72 ms
15,032 KB
testcase_06 AC 71 ms
15,164 KB
testcase_07 AC 72 ms
15,120 KB
testcase_08 AC 67 ms
15,112 KB
testcase_09 AC 68 ms
15,028 KB
testcase_10 AC 71 ms
15,164 KB
testcase_11 AC 69 ms
15,144 KB
testcase_12 AC 69 ms
15,212 KB
testcase_13 AC 68 ms
15,304 KB
testcase_14 AC 68 ms
15,068 KB
testcase_15 AC 70 ms
15,304 KB
testcase_16 AC 72 ms
15,344 KB
testcase_17 AC 71 ms
15,152 KB
testcase_18 AC 69 ms
15,312 KB
testcase_19 AC 69 ms
15,024 KB
testcase_20 AC 69 ms
15,116 KB
testcase_21 AC 71 ms
15,308 KB
testcase_22 AC 70 ms
15,272 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# `年 月 日` の情報を受け取る
input = gets(chomp: true)

# スペース区切りで配列に変換する
strs = input.split

# `年` `月` `日` でそれぞれ数値に変換して変数に代入する
year  = strs[0].to_i
month = strs[1].to_i
day   = strs[2].to_i

if 1989 <= year && year <= 2019
    if year == 1989
        if month == 1
            if day < 8
                puts "No"
            else
                puts "Yes"
            end
        else
            puts "Yes"
        end
    elsif year == 2019
        if month <= 4
            puts "Yes"
        else 
            puts "No"
        end
    else
        puts "Yes"
    end
else
    puts "No"
end
0