結果

問題 No.2373 wa, wo, n
ユーザー meruuu61779999meruuu61779999
提出日時 2023-07-07 21:50:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 91,028 KB
最終ジャッジ日時 2023-09-28 22:57:24
合計ジャッジ時間 6,510 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,792 KB
testcase_01 AC 87 ms
71,928 KB
testcase_02 AC 93 ms
71,732 KB
testcase_03 AC 90 ms
71,488 KB
testcase_04 AC 90 ms
71,732 KB
testcase_05 AC 90 ms
71,480 KB
testcase_06 AC 92 ms
71,672 KB
testcase_07 AC 92 ms
71,480 KB
testcase_08 AC 91 ms
71,864 KB
testcase_09 AC 90 ms
71,652 KB
testcase_10 AC 90 ms
71,484 KB
testcase_11 AC 88 ms
71,860 KB
testcase_12 AC 90 ms
71,624 KB
testcase_13 AC 90 ms
71,568 KB
testcase_14 AC 129 ms
82,928 KB
testcase_15 AC 109 ms
77,644 KB
testcase_16 AC 137 ms
86,852 KB
testcase_17 AC 110 ms
77,596 KB
testcase_18 AC 100 ms
77,680 KB
testcase_19 AC 93 ms
76,916 KB
testcase_20 AC 96 ms
77,024 KB
testcase_21 AC 95 ms
77,224 KB
testcase_22 AC 96 ms
76,900 KB
testcase_23 AC 101 ms
77,180 KB
testcase_24 AC 89 ms
71,700 KB
testcase_25 AC 87 ms
71,768 KB
testcase_26 AC 88 ms
71,620 KB
testcase_27 AC 89 ms
71,624 KB
testcase_28 AC 88 ms
71,816 KB
testcase_29 AC 88 ms
71,648 KB
testcase_30 AC 88 ms
71,684 KB
testcase_31 AC 88 ms
71,660 KB
testcase_32 AC 144 ms
91,028 KB
testcase_33 AC 98 ms
77,192 KB
testcase_34 AC 104 ms
77,400 KB
testcase_35 AC 97 ms
77,040 KB
testcase_36 AC 118 ms
79,752 KB
testcase_37 AC 104 ms
77,552 KB
testcase_38 AC 105 ms
77,472 KB
testcase_39 AC 101 ms
77,412 KB
testcase_40 AC 151 ms
89,972 KB
testcase_41 AC 137 ms
90,240 KB
testcase_42 AC 107 ms
77,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

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

que = deque()
for s in S:
    que.append(s)

while que:
    el = que.popleft()
    if el == 'n':
        continue
    if el == 'w':
        if que and que[0] in ('?', 'a', 'o'):
            que.popleft()
            continue
        else:
            print("No")
            exit()
    if el == '?':
        if que and que[0] in ('a', 'o'):
            que.popleft()
        continue
    print("No")
    exit()
print("Yes")
0