結果

問題 No.380 悪の台本
ユーザー TatamoTatamo
提出日時 2016-07-05 18:16:44
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 959 bytes
コンパイル時間 46 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 7,040 KB
最終ジャッジ日時 2024-04-24 14:39:12
合計ジャッジ時間 931 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 11 ms
6,016 KB
testcase_03 AC 11 ms
6,144 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 210 ms
7,040 KB
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import re
script = sys.stdin.readlines()

rule = {
    "digi":  "nyo",
    "petit": "nyu",
    "rabi": "",
    "gema": "gema",
    "piyo": "pyo"
}

rabi_re = re.compile("[0-9a-zA-Z]")

wrong = "WRONG!"
correct = "CORRECT (maybe)"

for line in script :
    line = line.rstrip("\n")
    flg = False
    for chara in rule :
        gobi = rule[chara]
        if(line.startswith(chara)) :
            #print "chara:",chara,"gobi:",gobi
            #print "line:" ,line
            #print "usiro:" ,line[:3+len(gobi)]
            if(chara == "rabi") :
                flg = True
                if(rabi_re.match(line[4:]) == None):
                    print wrong
                else:
                    print correct
            else :
                flg = True
                if(gobi in line[(3+len(gobi))*-1:].lower()):
                    print correct
                else :
                    print wrong
    if(not flg):
        print wrong
0