結果

問題 No.380 悪の台本
ユーザー niyarinniyarin
提出日時 2016-07-05 18:52:24
言語 Python2
(2.7.18)
結果
AC  
実行時間 184 ms / 1,000 ms
コード長 834 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 6,752 KB
実行使用メモリ 7,548 KB
最終ジャッジ日時 2023-08-06 20:01:10
合計ジャッジ時間 1,160 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,008 KB
testcase_01 AC 12 ms
6,048 KB
testcase_02 AC 11 ms
5,892 KB
testcase_03 AC 12 ms
5,952 KB
testcase_04 AC 21 ms
6,000 KB
testcase_05 AC 53 ms
5,956 KB
testcase_06 AC 34 ms
6,008 KB
testcase_07 AC 184 ms
5,956 KB
testcase_08 AC 18 ms
7,548 KB
testcase_09 AC 23 ms
5,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import re

nyrn = {a:re.compile(".*"+b+"[^\t\n\r\f\va-zA-Z0-9]{0,3}\Z",re.IGNORECASE) 
        for a,b in [("digi","nyo"),("petit","nyu"),("gema","gema"),("piyo","pyo")]}

while 1:
    try:
        a = raw_input().split(" ")
        flag = True
        
        if (len(a)) < 2:
            flag = False
        elif not(a[0] in ["digi","petit","gema","piyo","rabi"]):
            flag = False
        else:
            x = a[0]
            y = a[1:]
            s = " ".join(y)
            if x == "rabi":
                if not (re.search("[a-zA-Z0-9]",s)):
                    flag = False
            else:
                rm = re.match(nyrn[x],s)
                if not(rm and rm.group() == s):
                    flag = False
        print "CORRECT (maybe)" if flag else "WRONG!"
    except:
        break

        



        
0