結果

問題 No.380 悪の台本
ユーザー mkawa2mkawa2
提出日時 2019-12-27 10:23:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 597 ms / 1,000 ms
コード長 1,956 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 13,056 KB
実行使用メモリ 79,444 KB
最終ジャッジ日時 2024-04-16 16:51:48
合計ジャッジ時間 8,372 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 546 ms
43,964 KB
testcase_01 AC 532 ms
44,476 KB
testcase_02 AC 516 ms
43,832 KB
testcase_03 AC 530 ms
44,092 KB
testcase_04 AC 531 ms
44,224 KB
testcase_05 AC 556 ms
43,840 KB
testcase_06 AC 540 ms
44,220 KB
testcase_07 AC 597 ms
44,096 KB
testcase_08 AC 527 ms
44,216 KB
testcase_09 AC 526 ms
79,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *
from bisect import *
from math import *
from collections import *
from heapq import *
from random import *
import numpy as np
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