結果
問題 | No.380 悪の台本 |
ユーザー | mkawa2 |
提出日時 | 2019-12-27 09:58:07 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,825 bytes |
コンパイル時間 | 699 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 50,336 KB |
最終ジャッジ日時 | 2024-10-07 06:56:33 |
合計ジャッジ時間 | 7,858 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 518 ms
43,856 KB |
testcase_01 | WA | - |
testcase_02 | AC | 527 ms
44,212 KB |
testcase_03 | AC | 520 ms
43,884 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 620 ms
50,336 KB |
testcase_08 | AC | 531 ms
43,960 KB |
testcase_09 | WA | - |
ソースコード
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 len(line)==1:return False if line[0]=="digi": e=line[-1] n=len(e) if n<3:return False i=n-1 while not e[i].isalnum(): i-=1 if i<2 or n-1-i>3:return False if e[i-2] not in ["N","n"]:return False if e[i-1] not in ["Y","y"]:return False if e[i] not in ["O","o"]:return False elif line[0] == "petit": e=line[-1] n=len(e) if n<3:return False i=n-1 while not e[i].isalnum(): i-=1 if i<2 or n-1-i>3:return False if e[i-2] not in ["N","n"]:return False if e[i-1] not in ["Y","y"]:return False if e[i] not in ["U","u"]: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] n=len(e) if n<4:return False i=n-1 while not e[i].isalnum(): i-=1 if i<3 or n-1-i>3:return False if e[i-3] not in ["G","g"]:return False if e[i-2] not in ["E","e"]:return False if e[i-1] not in ["M","m"]:return False if e[i] not in ["A","a"]:return False elif line[0]=="piyo": e=line[-1] n=len(e) if n<3:return False i=n-1 while not e[i].isalnum(): i-=1 if i<2 or n-1-i>3:return False if e[i-2] not in ["P","p"]:return False if e[i-1] not in ["Y","y"]:return False if e[i] not in ["O","o"]:return False else:return False return True s=sys.stdin.read()[:-1] s=s.split("\n") s=[line.split(" ") for line in s] for line in s: if ok(line):print("CORRECT (maybe)") else:print("WRONG!") main()