結果
| 問題 |
No.2373 wa, wo, n
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-07 21:46:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 84 ms / 2,000 ms |
| コード長 | 1,369 bytes |
| コンパイル時間 | 240 ms |
| コンパイル使用メモリ | 82,604 KB |
| 実行使用メモリ | 86,784 KB |
| 最終ジャッジ日時 | 2024-07-21 17:34:58 |
| 合計ジャッジ時間 | 3,944 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 39 |
ソースコード
#!/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')