結果

問題 No.2373 wa, wo, n
ユーザー 21kazu1321kazu13
提出日時 2023-07-07 21:46:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 1,369 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 84,244 KB
最終ジャッジ日時 2023-09-28 22:50:03
合計ジャッジ時間 8,244 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
78,264 KB
testcase_01 AC 144 ms
78,164 KB
testcase_02 AC 140 ms
78,164 KB
testcase_03 AC 142 ms
78,204 KB
testcase_04 AC 142 ms
78,264 KB
testcase_05 AC 138 ms
78,136 KB
testcase_06 AC 141 ms
78,152 KB
testcase_07 AC 147 ms
78,428 KB
testcase_08 AC 140 ms
78,332 KB
testcase_09 AC 140 ms
78,164 KB
testcase_10 AC 141 ms
78,168 KB
testcase_11 AC 138 ms
78,120 KB
testcase_12 AC 143 ms
78,228 KB
testcase_13 AC 140 ms
78,120 KB
testcase_14 AC 157 ms
83,152 KB
testcase_15 AC 140 ms
78,684 KB
testcase_16 AC 156 ms
83,520 KB
testcase_17 AC 154 ms
80,292 KB
testcase_18 AC 146 ms
79,360 KB
testcase_19 AC 143 ms
79,256 KB
testcase_20 AC 143 ms
81,028 KB
testcase_21 AC 144 ms
79,216 KB
testcase_22 AC 142 ms
79,832 KB
testcase_23 AC 142 ms
81,284 KB
testcase_24 AC 143 ms
78,024 KB
testcase_25 AC 141 ms
78,308 KB
testcase_26 AC 141 ms
78,168 KB
testcase_27 AC 140 ms
78,224 KB
testcase_28 AC 145 ms
78,316 KB
testcase_29 AC 143 ms
78,264 KB
testcase_30 AC 145 ms
78,308 KB
testcase_31 AC 144 ms
78,124 KB
testcase_32 AC 160 ms
84,244 KB
testcase_33 AC 147 ms
81,676 KB
testcase_34 AC 156 ms
84,132 KB
testcase_35 AC 150 ms
81,648 KB
testcase_36 AC 156 ms
83,880 KB
testcase_37 AC 151 ms
84,184 KB
testcase_38 AC 151 ms
84,096 KB
testcase_39 AC 151 ms
84,184 KB
testcase_40 AC 164 ms
84,056 KB
testcase_41 AC 163 ms
83,924 KB
testcase_42 AC 160 ms
84,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
from bisect import bisect_left, bisect_right, insort_left, insort_right  # type: ignore
from collections import Counter, defaultdict, deque  # type: ignore
from math import gcd, sqrt, ceil  # type: ignore
from heapq import heapify, heappop, heappush, heappushpop, heapreplace, merge  # type: ignore
from itertools import accumulate, combinations, permutations, product  # type: ignore
from string import ascii_lowercase, ascii_uppercase # type: ignore

def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode("utf-8").split()
def S(): return sys.stdin.buffer.readline().rstrip().decode("utf-8")
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
def SRL(n): return [list(S()) for _ in range(n)]

N = I()
l = list(S())
while l:
    n = len(l)
    if l[-1]=='n':
        l.pop()
    elif l[-1] in 'ao':
        if n>1 and l[-2] in ('?w'):
            l.pop()
            l.pop()
        else:
            break
    elif l[-1]=='?':
        if n>1 and l[-2]=='w':
            l.pop()
            l.pop()
        else:
            l.pop()
    else:
        break
print('Yes' if not l else 'No')
0