結果

問題 No.2373 wa, wo, n
ユーザー とろちゃとろちゃ
提出日時 2023-07-07 21:48:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,274 bytes
コンパイル時間 1,232 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 91,476 KB
最終ジャッジ日時 2023-09-28 22:54:25
合計ジャッジ時間 6,348 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,560 KB
testcase_01 AC 92 ms
71,628 KB
testcase_02 AC 94 ms
71,684 KB
testcase_03 AC 90 ms
71,516 KB
testcase_04 WA -
testcase_05 AC 89 ms
71,508 KB
testcase_06 AC 89 ms
71,648 KB
testcase_07 AC 89 ms
71,556 KB
testcase_08 AC 88 ms
71,476 KB
testcase_09 AC 90 ms
71,624 KB
testcase_10 AC 90 ms
71,624 KB
testcase_11 AC 91 ms
71,428 KB
testcase_12 AC 90 ms
71,788 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 109 ms
78,400 KB
testcase_16 AC 142 ms
88,308 KB
testcase_17 WA -
testcase_18 AC 105 ms
77,552 KB
testcase_19 AC 96 ms
72,920 KB
testcase_20 AC 106 ms
73,064 KB
testcase_21 AC 95 ms
72,908 KB
testcase_22 AC 96 ms
72,932 KB
testcase_23 AC 98 ms
72,800 KB
testcase_24 AC 89 ms
71,812 KB
testcase_25 AC 90 ms
71,448 KB
testcase_26 AC 88 ms
71,540 KB
testcase_27 AC 93 ms
71,620 KB
testcase_28 AC 92 ms
71,440 KB
testcase_29 AC 89 ms
71,604 KB
testcase_30 AC 89 ms
71,792 KB
testcase_31 AC 87 ms
71,676 KB
testcase_32 AC 151 ms
91,476 KB
testcase_33 AC 98 ms
72,848 KB
testcase_34 WA -
testcase_35 AC 98 ms
72,780 KB
testcase_36 AC 132 ms
87,068 KB
testcase_37 AC 113 ms
81,496 KB
testcase_38 AC 116 ms
82,232 KB
testcase_39 AC 106 ms
77,196 KB
testcase_40 AC 153 ms
90,532 KB
testcase_41 AC 147 ms
90,136 KB
testcase_42 AC 119 ms
82,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")
# from bisect import *
from collections import *

# from heapq import *
# from itertools import *
# from math import *
# from datetime import *
# from decimal import *  # PyPyだと遅い
# from string import ascii_lowercase,ascii_uppercase
# import numpy as np
import sys
import os

# sys.setrecursionlimit(10**6) # PyPyだと遅い
INF = 10**18
MOD = 998244353
# MOD = 10**9 + 7
isFile = os.path.exists("input.txt")
File = open("input.txt", "r", encoding="utf-8") if isFile else sys.stdin


def input():
    return File.readline()[:-1]


# ///////////////////////////////////////////////////////////////////////////


N = int(input())
S = deque(input())

for _ in range(INF):
    if len(S) == 0:
        break
    if len(S) == 1:
        if S[0] != "n":
            print("No")
            exit()

    if S[0] == "n":
        S.popleft()
        continue
    elif S[0] == "w":
        S.popleft()
        if S[0] not in ["a", "o", "?"]:
            print("No")
            exit()
        else:
            S.popleft()
    else:
        if S[0] != "?":
            print("No")
            exit()
        else:
            S.popleft()
            if S[0] in ["a", "o"]:
                S.popleft()

print("Yes")
0