結果

問題 No.380 悪の台本
ユーザー しらっ亭しらっ亭
提出日時 2016-06-18 00:37:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 664 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-24 14:28:03
合計ジャッジ時間 859 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import re
import sys

re_digi = r'nyo[^a-z]{0,3}$'
re_petit = r'nyu[^a-z]{0,3}$'
re_rabi = r'[a-z]'
re_gema = r'gema[^a-z]{0,3}$'
re_piyo = r'pyo[^a-z]{0,3}$'

name_re = {'digi': re_digi, 'petit': re_petit, 'rabi': re_rabi, 'gema': re_piyo, 'piyo': re_piyo}


def check(text):
    text = text.lower()
    name = text.split()[0]
    if name.lower() not in name_re:
        return False
    pat = name_re[name]
    serif = text[len(name):]
    return re.search(pat, serif)


def solve():
    for l in sys.stdin:
        if check(l.rstrip('\n')):
            print('CORRECT (maybe)')
        else:
            print('WRONG!')


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