結果
| 問題 |
No.380 悪の台本
|
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2017-01-31 22:36:19 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,011 bytes |
| コンパイル時間 | 181 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-11-06 23:22:00 |
| 合計ジャッジ時間 | 1,146 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 3 WA * 5 |
ソースコード
import sys
import re
di = re.compile(r'.*(n|N)(y|Y)(o|O)[^a-zA-Z0-9]{0,3}$')
pe = re.compile(r'.*(n|N)(y|Y)(u|U)[^a-zA-Z0-9]{0,3}$')
ra = re.compile(r'.*[a-zA-Z0-9]+')
ge = re.compile(r'.*(g|G)(e|E)(m|M)(a|A)[^a-zA-Z0-9]{0,3}$')
pi = re.compile(r'.*(p|P)(y|Y)(o|O)[^a-zA-Z0-9]{0,3}$')
AC='CORRECT (maybe)'
WA='WRONG!'
def solve(pattern,s):
if re.match(pattern,s):
return True
return False
for s in sys.stdin:
if s=='\n':
print(WA)
continue
words = s.split()
flag = False
if words[0]=='digi':
if solve(di,words[-1]):
flag=True
elif words[0]=='petit':
if solve(pe,words[-1]):
flag=True
elif words[0]=='rabi':
if solve(ra,words[-1]):
flag=True
elif words[0]=='gema':
if solve(ge,words[-1]):
flag=True
elif words[0]=='piyo':
if solve(pi,words[-1]):
flag=True
if flag:
print(AC)
else:
print(WA)
kurenai3110