結果

問題 No.380 悪の台本
ユーザー maimai
提出日時 2016-06-18 06:29:40
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 1,138 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 19,456 KB
最終ジャッジ日時 2024-04-24 14:32:39
合計ジャッジ時間 1,839 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
12,160 KB
testcase_01 WA -
testcase_02 AC 92 ms
12,032 KB
testcase_03 AC 90 ms
12,160 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 216 ms
12,416 KB
testcase_08 AC 101 ms
19,456 KB
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: assigned but unused variable - f
Syntax OK

ソースコード

diff #

while cin=gets
    cin=cin.scan(/^(digi|petit|rabi|gema|piyo) (.+)/)
    if cin.size!=1
        puts "WRONG!"
        next
    end
    cin=cin[0]
    f=false
    case (cin[0])
        when "digi" then
            if !cin[-1].downcase.match(/nyo\W{0,3}$/)
                puts "WRONG!"
            else
                puts "CORRECT (maybe)"
            end
            
        when "petit" then
            if !cin[-1].downcase.match(/nyu\W{0,3}$/)
                puts "WRONG!"
            else
                puts "CORRECT (maybe)"
            end
        when "rabi" then
            if !cin[-1].downcase.match(/\w/)
                puts "WRONG!"
            else
                puts "CORRECT (maybe)"
            end
        when "gema" then
            if !cin[-1].downcase.match(/gema\W{0,3}$/)
                puts "WRONG!"
            else
                puts "CORRECT (maybe)"
            end
        when "piyo" then
            if !cin[-1].downcase.match(/pyo\W{0,3}$/)
                puts "WRONG!"
            else
                puts "CORRECT (maybe)"
            end
        else
            puts "WRONG!"
    end
end
0