結果

問題 No.380 悪の台本
ユーザー 小指が強い人小指が強い人
提出日時 2016-06-19 16:51:37
言語 Ruby
(3.3.0)
結果
AC  
実行時間 287 ms / 1,000 ms
コード長 510 bytes
コンパイル時間 47 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-24 14:34:31
合計ジャッジ時間 1,855 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

c=["digi","petit","rabi","gema","piyo"]
norm=[/[nN][yY][oO][^a-zA-Z0-9]{0,3}$/, \
      /[nN][yY][uU][^a-zA-Z0-9]{0,3}$/, \
      /[a-zA-Z0-9]+/, \
      /[gG][eE][mM][aA][^a-zA-Z0-9]{0,3}$/, \
      /[pP][yY][oO][^a-zA-Z0-9]{0,3}$/]
while (g=gets)!=nil do
    cr,tt,st=g.chomp.partition(" ")
    j=0
    while j<c.length&&cr!=c[j] do
        j+=1
    end
    if j>=c.length
        puts "WRONG!"
        next
    end
    if st=~norm[j]
        puts "CORRECT (maybe)"
    else
        puts "WRONG!"
    end
end
0