結果

問題 No.2373 wa, wo, n
ユーザー dangodango
提出日時 2023-07-07 21:27:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 617 bytes
コンパイル時間 451 ms
コンパイル使用メモリ 86,876 KB
実行使用メモリ 76,332 KB
最終ジャッジ日時 2023-09-28 22:23:12
合計ジャッジ時間 5,028 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,340 KB
testcase_01 AC 68 ms
71,408 KB
testcase_02 AC 69 ms
71,408 KB
testcase_03 AC 67 ms
71,132 KB
testcase_04 AC 73 ms
71,596 KB
testcase_05 AC 69 ms
71,112 KB
testcase_06 AC 70 ms
71,204 KB
testcase_07 AC 69 ms
71,320 KB
testcase_08 AC 68 ms
71,444 KB
testcase_09 AC 68 ms
71,572 KB
testcase_10 AC 68 ms
71,284 KB
testcase_11 AC 69 ms
71,440 KB
testcase_12 AC 68 ms
71,288 KB
testcase_13 AC 70 ms
71,444 KB
testcase_14 WA -
testcase_15 AC 68 ms
71,356 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 70 ms
71,112 KB
testcase_20 AC 78 ms
72,492 KB
testcase_21 AC 70 ms
71,280 KB
testcase_22 AC 71 ms
71,228 KB
testcase_23 AC 75 ms
72,484 KB
testcase_24 AC 70 ms
71,548 KB
testcase_25 AC 67 ms
71,128 KB
testcase_26 AC 67 ms
71,268 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 77 ms
72,560 KB
testcase_34 AC 80 ms
76,116 KB
testcase_35 AC 71 ms
71,996 KB
testcase_36 AC 80 ms
76,332 KB
testcase_37 AC 76 ms
75,964 KB
testcase_38 AC 75 ms
76,108 KB
testcase_39 AC 71 ms
75,604 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 79 ms
76,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def is_wawon_string(S):
    i = 0
    while i < len(S):
        if S[i] == "w":
            if i + 1 < len(S) and S[i + 1] in ["a", "o"]:
                i += 2
            else:
                return False
        elif S[i] == "n":
            i += 1
        else:
            return False
    return True

if "?" not in S:
    if is_wawon_string(S):
        print("Yes")
    else:
        print("No")
else:
    for c in ["a", "n", "o", "w"]:
        new_S = S.replace("?", c)
        if is_wawon_string(new_S):
            print("Yes")
            break
    else:
        print("No")
0