結果

問題 No.2373 wa, wo, n
ユーザー Ekiben542Ekiben542
提出日時 2023-07-07 21:43:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 861 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 78,260 KB
最終ジャッジ日時 2023-09-28 22:46:23
合計ジャッジ時間 5,432 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,444 KB
testcase_01 AC 71 ms
71,536 KB
testcase_02 AC 72 ms
71,324 KB
testcase_03 AC 70 ms
71,164 KB
testcase_04 AC 70 ms
71,292 KB
testcase_05 AC 71 ms
71,432 KB
testcase_06 AC 71 ms
71,192 KB
testcase_07 AC 70 ms
71,524 KB
testcase_08 AC 71 ms
71,336 KB
testcase_09 AC 70 ms
71,032 KB
testcase_10 AC 73 ms
71,500 KB
testcase_11 AC 70 ms
71,304 KB
testcase_12 AC 72 ms
71,340 KB
testcase_13 AC 72 ms
71,148 KB
testcase_14 AC 99 ms
77,792 KB
testcase_15 AC 91 ms
76,716 KB
testcase_16 AC 98 ms
77,900 KB
testcase_17 AC 92 ms
76,552 KB
testcase_18 AC 84 ms
76,248 KB
testcase_19 AC 89 ms
76,868 KB
testcase_20 AC 96 ms
77,816 KB
testcase_21 AC 94 ms
76,768 KB
testcase_22 AC 93 ms
77,088 KB
testcase_23 AC 95 ms
78,072 KB
testcase_24 AC 70 ms
71,372 KB
testcase_25 AC 70 ms
71,356 KB
testcase_26 AC 69 ms
71,108 KB
testcase_27 AC 69 ms
71,412 KB
testcase_28 AC 68 ms
71,536 KB
testcase_29 AC 68 ms
71,368 KB
testcase_30 AC 71 ms
71,372 KB
testcase_31 AC 71 ms
71,144 KB
testcase_32 AC 102 ms
78,116 KB
testcase_33 AC 97 ms
78,144 KB
testcase_34 AC 85 ms
78,260 KB
testcase_35 AC 82 ms
78,228 KB
testcase_36 AC 87 ms
78,132 KB
testcase_37 AC 82 ms
78,020 KB
testcase_38 AC 82 ms
78,096 KB
testcase_39 AC 80 ms
77,888 KB
testcase_40 AC 99 ms
78,104 KB
testcase_41 AC 99 ms
78,084 KB
testcase_42 AC 85 ms
78,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = [False] * (N + 1)
dp[0] = True

for i in range(N):
    if S[i] == 'w' or S[i] == '?':
        if i + 2 <= N and (S[i + 1] == 'a' or S[i + 1] == 'o' or S[i + 1] == '?'):
            dp[i + 2] |= dp[i]
    if S[i] == 'n' or S[i] == '?':
        dp[i + 1] |= dp[i]

print('Yes' if dp[N] else 'No')
0