結果

問題 No.380 悪の台本
ユーザー ともきともき
提出日時 2016-06-17 23:40:24
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 1,018 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 10,632 KB
最終ジャッジ日時 2023-08-06 19:40:59
合計ジャッジ時間 1,236 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
9,048 KB
testcase_01 WA -
testcase_02 AC 28 ms
9,172 KB
testcase_03 AC 27 ms
9,116 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 139 ms
9,124 KB
testcase_08 AC 32 ms
10,632 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import string
import sys

def ans(b):
    if(b):
        return "CORRECT (maybe)"
    else:
        return "WRONG!"

def is_kigou(s):
    return all([(not s in k) for k in [string.digits, string.ascii_lowercase, string.ascii_uppercase]])

def gobi(s, k):
    for i in range(4):
        tail = s[-(i+len(k)):]
        nyo = tail[0:3]
        kig = tail[3:]

        if nyo.lower() == k and all([is_kigou(c) for c in kig]):
            return True
    return False

def for_petit(s):
    return gobi(s, "nyu")

def for_digi(s):
    return gobi(s, "nyo")

def for_rabi(s):
    return any([not is_kigou(c) for c in s])

def for_gema(s):
    return gobi(s, "gema")

def for_piyo(s):
    return gobi(s, "pyo")


d = {
    "digi" : for_digi,
    "petit": for_petit,
    "rabi" : for_rabi,
    "gema" : for_gema,
    "piyo" : for_piyo,
}
for line in sys.stdin:
    sp = line.split(" ")
    who  = sp[0]
    what = " ".join(sp[1:]).strip()
    if who in d:
        print(ans(d[who](what)))
    else:
        print(ans(False))

0