結果
| 問題 |
No.380 悪の台本
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-07-05 18:40:42 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 825 bytes |
| コンパイル時間 | 58 ms |
| コンパイル使用メモリ | 6,948 KB |
| 実行使用メモリ | 7,808 KB |
| 最終ジャッジ日時 | 2024-11-06 23:04:59 |
| 合計ジャッジ時間 | 1,020 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 3 WA * 5 |
ソースコード
import re
nyrn = {a:re.compile(".*"+b+"[!-/:-@[-`{-~ ]{0,3}\Z",re.IGNORECASE)
for a,b in [("digi","nyo"),("petit","nyu"),("gema","gema"),("piyo","pyo")]}
while 1:
try:
a = raw_input().split(" ")
flag = True
if (len(a)) < 2:
flag = False
elif not(a[0] in ["digi","petit","gema","piyo","rabi"]):
flag = False
else:
x = a[0]
y = a[1:]
s = "".join(y)
if x == "rabi":
if not (re.match("[a-zA-Z0-9]",s)):
flag = False
else:
rm = re.match(nyrn[x],s)
if not(rm and rm.group() == s):
flag = False
print "CORRECT (maybe)" if flag else "WRONG!"
except:
break