結果
問題 |
No.380 悪の台本
|
ユーザー |
|
提出日時 | 2016-10-06 11:53:55 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 887 bytes |
コンパイル時間 | 55 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,528 KB |
最終ジャッジ日時 | 2024-11-06 23:15:26 |
合計ジャッジ時間 | 919 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 WA * 1 |
ソースコード
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('\w', 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