結果

問題 No.380 悪の台本
ユーザー mkawa2mkawa2
提出日時 2020-08-13 23:29:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 1,000 ms
コード長 1,806 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 79,576 KB
最終ジャッジ日時 2024-04-18 01:55:05
合計ジャッジ時間 1,257 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,532 KB
testcase_01 AC 35 ms
54,176 KB
testcase_02 AC 38 ms
53,012 KB
testcase_03 AC 39 ms
53,012 KB
testcase_04 AC 60 ms
70,412 KB
testcase_05 AC 120 ms
77,764 KB
testcase_06 AC 87 ms
76,768 KB
testcase_07 AC 64 ms
79,576 KB
testcase_08 AC 41 ms
62,152 KB
testcase_09 AC 62 ms
68,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    def ok(line):
        n=len(line)
        if n>=8 and line[:5]=="digi ":
            for _ in range(3):
                if line[-1].isalnum():break
                line=line[:-1]
            if line[-3:].lower()!="nyo":return False
        elif n>=9 and line[:6] == "petit ":
            for _ in range(3):
                if line[-1].isalnum():break
                line=line[:-1]
            if line[-3:].lower()!="nyu":return False
        elif n>=6 and line[:5]=="rabi ":
            for c in line[5:]:
                if c.isalnum():return True
            return False
        elif n>=8 and line[:5]=="gema ":
            for _ in range(3):
                if line[-1].isalnum():break
                line=line[:-1]
            if line[-4:].lower()!="gema":return False
        elif n>=8 and line[:5]=="piyo ":
            for _ in range(3):
                if line[-1].isalnum():break
                line=line[:-1]
            if line[-3:].lower()!="pyo":return False
        else:return False
        return True

    s=sys.stdin.read()[:-1]
    s=s.split("\n")
    for line in s:
        if ok(line):print("CORRECT (maybe)")
        else:print("WRONG!")

main()
0