結果

問題 No.380 悪の台本
ユーザー nebukuro09
提出日時 2016-10-06 11:43:02
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 781 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-06 23:15:22
合計ジャッジ時間 889 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 3 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for line in fileinput.input():
    a = line.rstrip('\n').split(' ', 1)
    if len(a) < 2:
        print 'WRONG!'
        continue
    name, line = a
    line = line.lower()
    if not name in C:
        print 'WRONG!'
    if name == 'digi' and re.search('nyo\W{0,3}$', line):
        print 'CORRECT (maybe)'
    elif name == 'petit' and re.search('nyu\W{0,3}$', line):
        print 'CORRECT (maybe)'
    elif name == 'rabi' and re.search('\w', line):
        print 'CORRECT (maybe)'
    elif name == 'gema' and re.search('gema\W{0,3}$', line):
        print 'CORRECT (maybe)'
    elif name == 'digi' and re.search('pyo\W{0,3}$', line):
        print 'CORRECT (maybe)'
    else:
        print 'WRONG!'
0