結果

問題 No.380 悪の台本
ユーザー xkumiyuxkumiyu
提出日時 2018-06-15 21:41:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 672 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 9,408 KB
最終ジャッジ日時 2023-09-13 04:45:11
合計ジャッジ時間 1,666 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
9,076 KB
testcase_01 WA -
testcase_02 AC 26 ms
9,072 KB
testcase_03 AC 25 ms
9,220 KB
testcase_04 AC 36 ms
9,060 KB
testcase_05 AC 75 ms
9,224 KB
testcase_06 AC 70 ms
9,128 KB
testcase_07 AC 469 ms
9,160 KB
testcase_08 AC 27 ms
9,408 KB
testcase_09 AC 41 ms
9,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import re

ptn = {
    'digi': re.compile('(n|N)(y|Y)(o|O)([!-/:-@[-`{-~]|\s){0,3}$'),
    'petit': re.compile('(n|N)(y|Y)(u|U)([!-/:-@[-`{-~]|\s){0,3}$'),
    'rabi': re.compile('\w'),
    'gema': re.compile('(g|G)(e|E)(m|M)(a|A)([!-/:-@[-`{-~]|\s){0,3}$'),
    'piyo': re.compile('(p|P)(y|Y)(o|O)([!-/:-@[-`{-~]|\s){0,3}$')
}


def check(s):
    s = s.split()
    if len(s) < 2:
        return False
    if s[0] in ptn.keys() and ptn[s[0]].search(' '.join(s[1:])):
        return True
    else:
        return False


try:
    while True:
        if check(input()):
            print('CORRECT (maybe)')
        else:
            print('WRONG!')
except EOFError:
    pass
0