結果
問題 |
No.380 悪の台本
|
ユーザー |
![]() |
提出日時 | 2019-02-08 11:48:22 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 639 bytes |
コンパイル時間 | 110 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,520 KB |
最終ジャッジ日時 | 2024-06-27 16:04:23 |
合計ジャッジ時間 | 1,690 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 4 RE * 4 |
ソースコード
import sys import re suffix = {"digi": "nyo", "petit": "nyu", "rabi": "", "gema": "gema", "piyo": "pyo"} for line in sys.stdin: converted = "" chara = line.split(" ")[0] line = line[len(chara)+1:-1] for c, kc in zip(line.lower(), (ord(c) for c in line)): if not (48 <= kc <= 57 or 65 <= kc <= 90 or 97 <= kc <= 122): c = "!" converted += c if chara in suffix and\ chara == "rabi" and len(converted) != converted.count("!") or\ chara != "rabi" and re.search("%s!{0,3}$" % suffix[chara], converted): print("CORRECT (maybe)") else: print("WRONG!")