結果

問題 No.380 悪の台本
ユーザー 小指が強い人小指が強い人
提出日時 2016-06-18 02:46:29
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 624 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 34,432 KB
最終ジャッジ日時 2024-04-24 14:31:42
合計ジャッジ時間 2,029 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
12,032 KB
testcase_01 AC 79 ms
12,160 KB
testcase_02 AC 78 ms
12,288 KB
testcase_03 AC 79 ms
12,160 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 404 ms
34,432 KB
testcase_08 AC 86 ms
19,584 KB
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a=[]
while (g=gets)!=nil do
    a.push(g.chomp.partition(/ +/))
end
c=["digi","petit","rabi","gema","piyo"]
norm=[/[nN][yY][oO][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/,/[nN][yY][uU][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/,/[a-zA-Z0-9]+/,/[gG][eE][mM][aA][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/,/[pO][yY][oO][^a-zA-Z0-9]?[^a-zA-Z0-9]?[^a-zA-Z0-9]?$/]

a.length.times do |i|
    cr=a[i][0]
    st=a[i][2]
    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