結果

問題 No.380 悪の台本
ユーザー xkumiyu
提出日時 2018-06-15 21:30:37
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 612 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-06-30 14:57:14
合計ジャッジ時間 1,481 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 WA * 4 RE * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.py:6: SyntaxWarning: invalid escape sequence '\w'
  'rabi': re.compile('\w'),

ソースコード

diff #

import re

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


def check(s):
    s = s.split()
    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