結果

問題 No.380 悪の台本
コンテスト
ユーザー titia
提出日時 2026-02-12 06:03:42
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
結果
WA  
実行時間 -
コード長 2,083 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 756 ms
コンパイル使用メモリ 20,956 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2026-02-12 06:03:47
合計ジャッジ時間 4,256 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

D=dict()
D["digi"]="nyo"
D["petit"]="nyu"
D["rabi"]=""
D["gema"]="gema"
D["piyo"]="pyo"

ALPHA="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

while True:
    try:
        S=input()
    except:
        break

    #print(S)
    flag=0

    if S[:5]=="digi ":
        flag=0

        if S[-3:].lower()=="nyo":
            flag=1
        if S[-4:-1].lower()=="nyo" and S[-1] not in ALPHA:
            flag=1
        if S[-5:-2].lower()=="nyo" and S[-1] not in ALPHA and S[-2] not in ALPHA:
            flag=1
        if S[-6:-3].lower()=="nyo" and S[-1] not in ALPHA and S[-2] not in ALPHA and S[-3] not in ALPHA:
            flag=1

    elif S[:6]=="petit ":
        if S[-3:].lower()=="nyu":
            flag=1
        if S[-4:-1].lower()=="nyu" and S[-1] not in ALPHA:
            flag=1
        if S[-5:-2].lower()=="nyu" and S[-1] not in ALPHA and S[-2] not in ALPHA:
            flag=1
        if S[-6:-3].lower()=="nyu" and S[-1] not in ALPHA and S[-2] not in ALPHA and S[-3] not in ALPHA:
            flag=1

    elif S[:5]=="gema ":
        if S[-4:].lower()=="gema":
            flag=1
        if S[-5:-1].lower()=="gema" and S[-1] not in ALPHA:
            flag=1
        if S[-6:-2].lower()=="gema" and S[-1] not in ALPHA and S[-2] not in ALPHA:
            flag=1
        if S[-7:-3].lower()=="gema" and S[-1] not in ALPHA and S[-2] not in ALPHA and S[-3] not in ALPHA:
            flag=1

    elif S[:5]=="piyo ":
        if S[-3:].lower()=="pyo":
            flag=1
        if S[-4:-1].lower()=="pyo" and S[-1] not in ALPHA:
            flag=1
        if S[-5:-2].lower()=="pyo" and S[-1] not in ALPHA and S[-2] not in ALPHA:
            flag=1
        if S[-6:-3].lower()=="pyo" and S[-1] not in ALPHA and S[-2] not in ALPHA and S[-3] not in ALPHA:
            flag=1

    elif S[:5]=="rabi ":
        flag=0
        for i in range(5,len(S)):
            if S[i] in ALPHA:
                flag=1
    else:
        flag=0

    #print(flag,S)

    if flag==1:
        print("CORRECT (maybe)")
    else:
        print("WRONG!")
        
        
        
0