結果

問題 No.380 悪の台本
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-06-18 00:51:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 224 ms / 1,000 ms
コード長 742 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 78,464 KB
最終ジャッジ日時 2024-04-24 14:28:58
合計ジャッジ時間 1,748 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
63,488 KB
testcase_01 AC 60 ms
63,744 KB
testcase_02 AC 58 ms
63,488 KB
testcase_03 AC 57 ms
63,360 KB
testcase_04 AC 114 ms
78,080 KB
testcase_05 AC 155 ms
78,336 KB
testcase_06 AC 130 ms
78,464 KB
testcase_07 AC 224 ms
78,208 KB
testcase_08 AC 59 ms
63,616 KB
testcase_09 AC 114 ms
78,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3

import re
import sys


CORRECT = "CORRECT (maybe)"
WRONG = "WRONG!"
PATTERN_STRS = ["digi (.*)([Nn][Yy][Oo])[^A-Za-z0-9]{,3}$",
                "petit (.*)([Nn][Yy][Uu])[^A-Za-z0-9]{,3}$",
                "rabi (.*)[A-Za-z0-9]",
                "gema (.*)[Gg][Ee][Mm][Aa][^A-Za-z0-9]{,3}$",
                "piyo (.*)[Pp][Yy][Oo][^A-Za-z0-9]{,3}$"]
PATTERNS = list(map(re.compile, PATTERN_STRS))


def judge_line(line):
    for pat in PATTERNS:
        if re.match(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