結果

問題 No.2373 wa, wo, n
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-07-07 23:32:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 502 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 79,028 KB
最終ジャッジ日時 2023-09-29 01:17:25
合計ジャッジ時間 6,168 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,184 KB
testcase_01 AC 77 ms
71,216 KB
testcase_02 AC 77 ms
71,496 KB
testcase_03 AC 78 ms
71,092 KB
testcase_04 AC 74 ms
71,328 KB
testcase_05 AC 76 ms
71,016 KB
testcase_06 AC 77 ms
71,184 KB
testcase_07 AC 76 ms
71,196 KB
testcase_08 AC 76 ms
71,272 KB
testcase_09 AC 76 ms
71,188 KB
testcase_10 AC 77 ms
71,100 KB
testcase_11 AC 76 ms
71,140 KB
testcase_12 AC 77 ms
71,236 KB
testcase_13 AC 77 ms
71,188 KB
testcase_14 AC 116 ms
78,424 KB
testcase_15 AC 97 ms
76,704 KB
testcase_16 AC 117 ms
78,856 KB
testcase_17 AC 108 ms
77,272 KB
testcase_18 AC 97 ms
76,568 KB
testcase_19 AC 78 ms
76,144 KB
testcase_20 AC 81 ms
76,908 KB
testcase_21 AC 79 ms
76,164 KB
testcase_22 AC 82 ms
76,396 KB
testcase_23 AC 81 ms
77,344 KB
testcase_24 AC 77 ms
71,020 KB
testcase_25 AC 75 ms
71,116 KB
testcase_26 AC 75 ms
71,204 KB
testcase_27 AC 76 ms
71,236 KB
testcase_28 AC 75 ms
71,368 KB
testcase_29 AC 75 ms
71,216 KB
testcase_30 AC 75 ms
71,324 KB
testcase_31 AC 75 ms
71,068 KB
testcase_32 AC 120 ms
79,008 KB
testcase_33 AC 81 ms
77,632 KB
testcase_34 AC 118 ms
78,796 KB
testcase_35 AC 84 ms
77,484 KB
testcase_36 AC 109 ms
79,028 KB
testcase_37 AC 107 ms
78,820 KB
testcase_38 AC 106 ms
78,992 KB
testcase_39 AC 102 ms
78,988 KB
testcase_40 AC 114 ms
78,792 KB
testcase_41 AC 121 ms
78,996 KB
testcase_42 AC 103 ms
79,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = input()
dp = [0]*(n+1)
dp[0] = 1
l = ["wa","wo","n"]

for i in range(n):
    if dp[i] == 0:
        continue

    for x in l:
        if len(x) + i > n:
            continue
        ok = 1
        for j in range(len(x)):
            if x[j] == S[i+j] or S[i+j] == "?":
                ok = 1
            else:
                ok = 0
                break
        if ok:
            # print(i,x,i+len(x))
            dp[i+len(x)] = 1
    # print(dp)
print("Yes" if dp[-1] else "No")
0