結果

問題 No.380 悪の台本
ユーザー nebukuro09nebukuro09
提出日時 2016-10-06 11:56:09
言語 Python2
(2.7.18)
結果
AC  
実行時間 150 ms / 1,000 ms
コード長 896 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-04-24 14:49:17
合計ジャッジ時間 902 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,272 KB
testcase_01 AC 11 ms
6,144 KB
testcase_02 AC 11 ms
6,272 KB
testcase_03 AC 11 ms
6,144 KB
testcase_04 AC 17 ms
6,144 KB
testcase_05 AC 40 ms
6,272 KB
testcase_06 AC 32 ms
6,144 KB
testcase_07 AC 150 ms
6,144 KB
testcase_08 AC 11 ms
6,528 KB
testcase_09 AC 18 ms
6,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import re
import fileinput
C = set(['digi', 'petit', 'rabi', 'gema', 'piyo'])


for i, line in enumerate(fileinput.input()):
    if i != 0:
        print ans
    a = line.rstrip('\n').split(' ', 1)
    ans = a
    if len(a) < 2:
        ans = 'WRONG!'
        continue
    name, line = a
    line = line.lower()
    if not name in C:
        ans = 'WRONG!'
    if name == 'digi' and re.search('nyo[\W_]{0,3}$', line):
        ans = 'CORRECT (maybe)'
    elif name == 'petit' and re.search('nyu[\W_]{0,3}$', line):
        ans = 'CORRECT (maybe)'
    elif name == 'rabi' and re.search('[A-Za-z0-9]', line):
        ans = 'CORRECT (maybe)'
    elif name == 'gema' and re.search('gema[\W_]{0,3}$', line):
        ans = 'CORRECT (maybe)'
    elif name == 'piyo' and re.search('pyo[\W_]{0,3}$', line):
        ans = 'CORRECT (maybe)'
    else:
        ans = 'WRONG!'
    
if line != '':
    print ans
0