結果

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

テストケース

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

ソースコード

diff #

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

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

not_kigou_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)) :
            flg = True
            #print "chara:",chara,"gobi:",gobi
            #print "line:" ,line
            #print "usiro:" ,line[:3+len(gobi)]
            if(chara == "rabi") :
                if(not_kigou_re.search(line[4:]) == None):
                    print wrong
                else:
                    print correct
            else :
                flg2 = False
                for x in range(3):
                    if(gobi == line[(len(gobi))*-1:].lower()):
                        flg2 = True
                        print correct
                        break
                    else:
                        if(not_kigou_re.match(line[-1:]) == None):
                            line = line[:-1]
                        else :
                            break
                if(not flg2):
                    print wrong
    if(not flg):
        print wrong
0