結果

問題 No.380 悪の台本
ユーザー 小指が強い人
提出日時 2016-06-19 16:51:37
言語 Ruby
(3.4.1)
結果
AC  
実行時間 291 ms / 1,000 ms
コード長 510 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-11-06 22:58:55
合計ジャッジ時間 1,927 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
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