結果

問題 No.380 悪の台本
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-06-18 00:08:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 729 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-24 14:26:23
合計ジャッジ時間 1,021 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import re
import sys


CORRECT = "CORRECT (maybe)"
WRONG = "WRONG!"
PATTERN_STRS = ["digi (.*)(?i)(nyo)[^A-Za-z0-9]{,3}",
                "petit (.*)(?i)(nyu)[^A-Za-z0-9]{,3}",
                "rabi (.*)[A-Za-z0-9](.*)",
                "gema (.*)(?i)(gema)[^A-Za-z0-9]{,3}",
                "piyo (.*)(?i)(pyo)[^A-Za-z0-9]{,3}"]
PATTERNS = list(map(re.compile, PATTERN_STRS))


def judge_line(line):
    for pat in PATTERNS:
        if re.fullmatch(pat, line) is not None:
            return True
    else:
        return False


def main():
    for line in sys.stdin:
        if judge_line(line):
            print(CORRECT)
        else:
            print(WRONG)


if __name__ == '__main__':
    main()
0