結果

問題 No.380 悪の台本
ユーザー mkawa2mkawa2
提出日時 2019-12-27 09:24:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 2,498 bytes
コンパイル時間 385 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 50,452 KB
最終ジャッジ日時 2024-10-07 05:28:35
合計ジャッジ時間 8,285 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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):
        if line[0]=="digi":
            e=line[-1]
            if len(e)<3:return False
            if e[0] not in ["N","n"]:return False
            if e[1] not in ["Y","y"]:return False
            if e[2] not in ["O","o"]:return False
            for c in e[3:]:
                if c.isalnum():return False
        elif line[0] == "petit":
            e=line[-1]
            if len(e)<3:return False
            if e[0] not in ["N","n"]:return False
            if e[1] not in ["Y","y"]:return False
            if e[2] not in ["U","u"]:return False
            for c in e[3:]:
                if c.isalnum():return False
        elif line[0]=="rabi":
            for word in line[1:]:
                for c in word:
                    if c.isalnum():return True
            return False
        elif line[0]=="gema":
            e=line[-1]
            if len(e)<4:return False
            if e[0] not in ["G","g"]:return False
            if e[1] not in ["E","e"]:return False
            if e[2] not in ["M","m"]:return False
            if e[3] not in ["A","a"]:return False
            for c in e[4:]:
                if c.isalnum():return False
        elif line[0]=="piyo":
            e=line[-1]
            if len(e)<3:return False
            if e[0] not in ["P","p"]:return False
            if e[1] not in ["Y","y"]:return False
            if e[2] not in ["O","o"]:return False
            for c in e[3:]:
                if c.isalnum():return False
        else:return False

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

main()
0