結果

問題 No.2373 wa, wo, n
ユーザー minimumminimum
提出日時 2023-07-07 21:29:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 88,128 KB
最終ジャッジ日時 2023-09-28 22:26:09
合計ジャッジ時間 5,880 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,328 KB
testcase_01 AC 78 ms
71,424 KB
testcase_02 AC 76 ms
71,152 KB
testcase_03 AC 77 ms
71,460 KB
testcase_04 AC 78 ms
71,296 KB
testcase_05 AC 77 ms
71,500 KB
testcase_06 AC 77 ms
71,428 KB
testcase_07 AC 78 ms
71,304 KB
testcase_08 AC 77 ms
71,520 KB
testcase_09 AC 78 ms
71,368 KB
testcase_10 AC 77 ms
71,316 KB
testcase_11 AC 77 ms
71,148 KB
testcase_12 AC 77 ms
71,352 KB
testcase_13 AC 77 ms
71,296 KB
testcase_14 AC 121 ms
86,032 KB
testcase_15 AC 111 ms
78,272 KB
testcase_16 AC 123 ms
86,680 KB
testcase_17 AC 107 ms
79,780 KB
testcase_18 AC 94 ms
76,256 KB
testcase_19 AC 110 ms
80,376 KB
testcase_20 AC 120 ms
85,352 KB
testcase_21 AC 111 ms
80,280 KB
testcase_22 AC 114 ms
82,196 KB
testcase_23 AC 125 ms
87,180 KB
testcase_24 AC 76 ms
71,220 KB
testcase_25 AC 75 ms
71,304 KB
testcase_26 AC 74 ms
71,300 KB
testcase_27 AC 76 ms
71,300 KB
testcase_28 AC 76 ms
71,212 KB
testcase_29 AC 75 ms
71,232 KB
testcase_30 AC 76 ms
71,304 KB
testcase_31 AC 76 ms
71,300 KB
testcase_32 AC 125 ms
87,740 KB
testcase_33 AC 124 ms
87,992 KB
testcase_34 AC 93 ms
81,208 KB
testcase_35 AC 94 ms
81,384 KB
testcase_36 AC 100 ms
81,336 KB
testcase_37 AC 93 ms
81,196 KB
testcase_38 AC 95 ms
81,472 KB
testcase_39 AC 91 ms
81,388 KB
testcase_40 AC 123 ms
88,128 KB
testcase_41 AC 122 ms
87,968 KB
testcase_42 AC 101 ms
81,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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

if dp[-1]:
    print("Yes")
else:
    print("No")
0