結果

問題 No.380 悪の台本
ユーザー zombietanzombietan
提出日時 2016-06-19 01:11:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,371 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-04-24 14:33:12
合計ジャッジ時間 1,031 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 28 ms
10,880 KB
testcase_02 AC 31 ms
10,880 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 36 ms
11,136 KB
testcase_05 AC 50 ms
12,032 KB
testcase_06 AC 46 ms
12,032 KB
testcase_07 AC 110 ms
12,288 KB
testcase_08 AC 28 ms
11,008 KB
testcase_09 AC 32 ms
11,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import re
input_line =  sys.stdin.readlines()
input_line = [s.rstrip('\n') for s in input_line]

digi = re.compile(r'([nN][yY][oO])[^a-zA-Z0-9]{0,3}?$')
petit = re.compile(r'([nN][yY][uU])[^a-zA-Z0-9]{0,3}?$')
gema = re.compile(r'([gG][eE][mM][aA])[^a-zA-Z0-9]{0,3}?$')
piyo = re.compile(r'([pP][yY][oO])[^a-zA-Z0-9]{0,3}?$')
rabi = re.compile(r'[a-zA-Z0-9]')
space = re.compile(r'^\s')


for serif in input_line:
    if len(serif) <=5 or space.match(serif):
        print('WRONG!')
        continue
    character = serif.split()[0]
    if character == 'digi':
        obj = digi.search(serif)
        if obj:
            print('CORRECT (maybe)')
        else:
            print('WRONG!')
    elif character == 'petit':
        obj = petit.search(serif)
        if obj:
            print('CORRECT (maybe)')
        else:
            print('WRONG!')
    elif character == 'gema':
        obj = gema.search(serif)
        if obj:
            print('CORRECT (maybe)')
        else:
            print('WRONG!')
    elif character == 'piyo':
        obj = piyo.search(serif)
        if obj:
            print('CORRECT (maybe)')
        else:
            print('WRONG!')
    elif character == 'rabi':
        obj = rabi.search(serif[4:])
        if obj:
            print('CORRECT (maybe)')
        else:
            print('WRONG!')
    else:
        print('WRONG!')
0