結果

問題 No.2373 wa, wo, n
ユーザー ニックネームニックネーム
提出日時 2023-07-07 21:52:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-07-21 17:45:39
合計ジャッジ時間 4,158 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input()); s = input()
i = 0; ans = "Yes"
while i<n:
    if i==n-1 and s[i]=="?": i += 1
    elif s[i]=="n" or s[i:i+2] in {"??","?n","?w"}: i += 1
    elif s[i:i+2] in {"wa","wo","w?","?a","?o"}: i += 2
    else: ans = "No"; i += 1
print(ans)
0