結果

問題 No.2373 wa, wo, n
ユーザー 👑 rin204rin204
提出日時 2023-07-07 21:30:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 78,604 KB
最終ジャッジ日時 2023-09-28 22:27:01
合計ジャッジ時間 5,656 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,584 KB
testcase_01 AC 68 ms
71,480 KB
testcase_02 AC 66 ms
71,336 KB
testcase_03 AC 67 ms
71,312 KB
testcase_04 AC 72 ms
71,344 KB
testcase_05 AC 68 ms
71,340 KB
testcase_06 AC 68 ms
71,076 KB
testcase_07 AC 67 ms
71,348 KB
testcase_08 AC 67 ms
71,348 KB
testcase_09 AC 67 ms
71,288 KB
testcase_10 AC 67 ms
71,348 KB
testcase_11 AC 68 ms
71,452 KB
testcase_12 AC 66 ms
71,196 KB
testcase_13 AC 68 ms
71,400 KB
testcase_14 AC 94 ms
78,200 KB
testcase_15 AC 88 ms
76,676 KB
testcase_16 AC 93 ms
77,996 KB
testcase_17 AC 90 ms
77,036 KB
testcase_18 AC 80 ms
76,404 KB
testcase_19 AC 87 ms
76,776 KB
testcase_20 AC 93 ms
77,788 KB
testcase_21 AC 90 ms
77,056 KB
testcase_22 AC 92 ms
77,440 KB
testcase_23 AC 95 ms
78,448 KB
testcase_24 AC 68 ms
71,272 KB
testcase_25 AC 68 ms
71,072 KB
testcase_26 AC 68 ms
71,484 KB
testcase_27 AC 66 ms
71,320 KB
testcase_28 AC 67 ms
71,132 KB
testcase_29 AC 67 ms
71,192 KB
testcase_30 AC 66 ms
71,108 KB
testcase_31 AC 70 ms
71,076 KB
testcase_32 AC 102 ms
78,548 KB
testcase_33 AC 97 ms
78,592 KB
testcase_34 AC 86 ms
78,500 KB
testcase_35 AC 85 ms
78,352 KB
testcase_36 AC 90 ms
78,408 KB
testcase_37 AC 84 ms
78,384 KB
testcase_38 AC 82 ms
78,316 KB
testcase_39 AC 84 ms
78,400 KB
testcase_40 AC 100 ms
78,604 KB
testcase_41 AC 98 ms
78,436 KB
testcase_42 AC 86 ms
78,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = input()
dp = [False] * (n + 1)
dp[0] = True
for i in range(n):
    if S[i] in "n?":
        dp[i + 1] |= dp[i]
    if i >= 1 and (S[i - 1 : i + 1] in ["wa", "wo", "?a", "?o", "w?", "??"]):
        dp[i + 1] |= dp[i - 1]
if dp[-1]:
    print("Yes")
else:
    print("No")
0