結果

問題 No.380 悪の台本
ユーザー finefine
提出日時 2016-06-17 22:52:33
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 995 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-24 14:15:59
合計ジャッジ時間 1,584 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
12,160 KB
testcase_01 RE -
testcase_02 AC 76 ms
12,160 KB
testcase_03 AC 76 ms
12,160 KB
testcase_04 AC 85 ms
12,416 KB
testcase_05 AC 98 ms
12,288 KB
testcase_06 AC 93 ms
12,416 KB
testcase_07 AC 211 ms
12,160 KB
testcase_08 AC 78 ms
12,288 KB
testcase_09 AC 83 ms
12,416 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

while s = gets
    s = s.chomp
    idx = s.index(' ')
    case s[0...idx]
    when "digi"
        s = s[(idx+1)..-1].downcase
        if s =~ /nyo[^a-zA-Z0-9]{,3}$/
            puts "CORRECT (maybe)"
        else
            puts "WRONG!"
        end
    when "petit"
        s = s[(idx+1)..-1].downcase
        if s =~ /nyu[^a-zA-Z0-9]{,3}$/
            puts "CORRECT (maybe)"
        else
            puts "WRONG!"
        end
    when "rabi"
        s = s[(idx+1)..-1].downcase
        if s =~ /[a-zA-Z0-9]+/
            puts "CORRECT (maybe)"
        else
            puts "WRONG!"
        end
    when "gema"
        s = s[(idx+1)..-1].downcase
        if s =~ /gema[^a-zA-Z0-9]{,3}$/
            puts "CORRECT (maybe)"
        else
            puts "WRONG!"
        end
    when "piyo"
        s = s[(idx+1)..-1].downcase
        if s =~ /pyo[^a-zA-Z0-9]{,3}$/
            puts "CORRECT (maybe)"
        else
            puts "WRONG!"
        end
    else
        puts "WRONG!"
    end
end
0