結果

問題 No.380 悪の台本
ユーザー htkbhtkb
提出日時 2019-02-08 11:48:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 639 bytes
コンパイル時間 672 ms
コンパイル使用メモリ 10,772 KB
実行使用メモリ 10,124 KB
最終ジャッジ日時 2023-09-09 23:39:09
合計ジャッジ時間 1,963 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,076 KB
testcase_01 RE -
testcase_02 AC 28 ms
9,076 KB
testcase_03 AC 26 ms
9,180 KB
testcase_04 AC 69 ms
9,100 KB
testcase_05 AC 75 ms
9,284 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 228 ms
10,124 KB
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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!")
0