結果

問題 No.380 悪の台本
ユーザー ともきともき
提出日時 2016-06-17 23:01:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,012 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-24 14:17:45
合計ジャッジ時間 968 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

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


for line in sys.stdin:
    sp = line.split(" ")
    who  = sp[0]
    what = " ".join(sp[1:]).strip()


    print(who, what)
    d = {
        "digi" : for_digi,
        "petit": for_petit,
        "rabi" : for_rabi,
        "gema" : for_gema,
        "piyo" : for_piyo,
    }
    print(ans(d[who](what)))

0