結果
問題 |
No.380 悪の台本
|
ユーザー |
![]() |
提出日時 | 2017-05-01 05:01:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 114 ms / 1,000 ms |
コード長 | 1,363 bytes |
コンパイル時間 | 244 ms |
コンパイル使用メモリ | 12,928 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-11-06 23:23:09 |
合計ジャッジ時間 | 1,304 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 |
ソースコード
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]') for serif in input_line: if serif == "" or serif[0] == " ": 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[5:]) if obj: print('CORRECT (maybe)') else: print('WRONG!') else: print('WRONG!')