結果

問題 No.2373 wa, wo, n
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-07-07 23:05:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 653 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 77,976 KB
最終ジャッジ日時 2023-09-29 00:44:12
合計ジャッジ時間 7,282 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,160 KB
testcase_01 AC 73 ms
71,452 KB
testcase_02 AC 72 ms
71,208 KB
testcase_03 AC 74 ms
71,464 KB
testcase_04 AC 71 ms
71,164 KB
testcase_05 AC 70 ms
71,288 KB
testcase_06 AC 72 ms
71,312 KB
testcase_07 AC 71 ms
71,096 KB
testcase_08 WA -
testcase_09 AC 72 ms
71,308 KB
testcase_10 AC 72 ms
71,064 KB
testcase_11 AC 72 ms
71,460 KB
testcase_12 AC 69 ms
71,384 KB
testcase_13 AC 71 ms
71,320 KB
testcase_14 AC 146 ms
77,652 KB
testcase_15 AC 122 ms
77,240 KB
testcase_16 AC 135 ms
77,452 KB
testcase_17 AC 122 ms
77,440 KB
testcase_18 AC 95 ms
76,308 KB
testcase_19 AC 79 ms
75,780 KB
testcase_20 AC 80 ms
76,540 KB
testcase_21 AC 77 ms
75,812 KB
testcase_22 AC 78 ms
75,680 KB
testcase_23 AC 80 ms
76,660 KB
testcase_24 AC 72 ms
71,308 KB
testcase_25 AC 72 ms
71,396 KB
testcase_26 AC 73 ms
71,316 KB
testcase_27 AC 72 ms
71,412 KB
testcase_28 AC 71 ms
71,444 KB
testcase_29 AC 73 ms
71,436 KB
testcase_30 AC 74 ms
71,376 KB
testcase_31 AC 73 ms
71,244 KB
testcase_32 AC 146 ms
77,828 KB
testcase_33 AC 82 ms
76,756 KB
testcase_34 AC 133 ms
77,284 KB
testcase_35 AC 80 ms
76,848 KB
testcase_36 AC 111 ms
77,244 KB
testcase_37 AC 96 ms
77,444 KB
testcase_38 AC 98 ms
77,456 KB
testcase_39 AC 90 ms
77,356 KB
testcase_40 AC 140 ms
77,976 KB
testcase_41 AC 139 ms
77,836 KB
testcase_42 AC 110 ms
77,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = input()

l = ["wa","wo","n"]

dp = set()
if S[0] == "w":
    dp.add(S[0])
elif S[0] == "n":
    dp.add(S[0])

elif S[0] == "?":
    dp.add("w")
    dp.add("n")


for s in S[1:]:

    ndp = set()

    for x in dp:
        if x == "n" or x == "a" or x == "o":
            if s == "n" or s == "w":
                ndp.add(s)
            elif s == "?":
                ndp.add("n")
                ndp.add("w")
        elif x == "w":
            if s == "a" or s == "o":
                ndp.add(s)
            elif s == "?":
                ndp.add("a")
                ndp.add("o")

    dp = ndp

print("Yes" if dp else "No")
        
0