結果

問題 No.380 悪の台本
コンテスト
ユーザー xkumiyu
提出日時 2018-06-15 21:30:37
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 612 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 876 ms
コンパイル使用メモリ 21,084 KB
実行使用メモリ 20,828 KB
最終ジャッジ日時 2026-03-20 17:50:58
合計ジャッジ時間 4,424 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 WA * 4 RE * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.py:6: SyntaxWarning: "\w" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\w"? A raw string is also an option.
  'rabi': re.compile('\w'),

ソースコード

diff #
raw source code

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