結果

問題 No.2373 wa, wo, n
ユーザー ohana
提出日時 2023-10-20 10:14:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 75,392 KB
最終ジャッジ日時 2024-09-20 05:43:59
合計ジャッジ時間 3,833 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()


i = 0

while i < n:
    if (
        i + 1 < n
        and s[i] in {"?", "w"}
        and s[i + 1] in {"?", "a", "o"}
        and s[i] != s[i + 1]
    ):
        i += 2
    elif s[i] in {"n", "?"}:
        i += 1
    else:
        # print(i, s[i], s[i + 1])
        print("No")
        exit()
print("Yes")
0