結果

問題 No.2373 wa, wo, n
ユーザー june19312june19312
提出日時 2023-07-07 22:36:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 797 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 101,084 KB
最終ジャッジ日時 2023-09-29 00:07:28
合計ジャッジ時間 5,828 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,376 KB
testcase_01 AC 71 ms
71,540 KB
testcase_02 AC 69 ms
71,516 KB
testcase_03 AC 73 ms
71,568 KB
testcase_04 AC 71 ms
71,444 KB
testcase_05 AC 71 ms
71,424 KB
testcase_06 AC 71 ms
71,564 KB
testcase_07 AC 72 ms
71,140 KB
testcase_08 WA -
testcase_09 AC 74 ms
71,204 KB
testcase_10 AC 71 ms
71,284 KB
testcase_11 AC 71 ms
71,404 KB
testcase_12 AC 71 ms
71,456 KB
testcase_13 AC 72 ms
71,360 KB
testcase_14 AC 132 ms
100,940 KB
testcase_15 AC 89 ms
77,332 KB
testcase_16 AC 130 ms
100,792 KB
testcase_17 AC 91 ms
78,952 KB
testcase_18 AC 87 ms
76,372 KB
testcase_19 AC 79 ms
79,984 KB
testcase_20 AC 88 ms
86,752 KB
testcase_21 AC 78 ms
79,672 KB
testcase_22 AC 82 ms
82,240 KB
testcase_23 AC 113 ms
100,880 KB
testcase_24 AC 72 ms
71,568 KB
testcase_25 AC 71 ms
71,372 KB
testcase_26 AC 73 ms
71,144 KB
testcase_27 AC 73 ms
71,284 KB
testcase_28 AC 70 ms
71,504 KB
testcase_29 AC 72 ms
71,268 KB
testcase_30 AC 72 ms
71,148 KB
testcase_31 AC 75 ms
71,144 KB
testcase_32 AC 131 ms
100,916 KB
testcase_33 AC 113 ms
100,960 KB
testcase_34 AC 121 ms
100,984 KB
testcase_35 AC 114 ms
100,832 KB
testcase_36 AC 130 ms
100,916 KB
testcase_37 AC 123 ms
101,084 KB
testcase_38 AC 127 ms
100,872 KB
testcase_39 AC 120 ms
100,976 KB
testcase_40 AC 133 ms
101,060 KB
testcase_41 AC 132 ms
100,912 KB
testcase_42 AC 124 ms
100,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = []

for i in range(N+1):
    dp.append([False]*2)

dp[0][0] = True

#0 = a,o,n
#1 = w

for i,v in enumerate(S):
    if v == "w":
        if dp[i][0] == True:
            dp[i+1][1] = True
        else:
            print("No")
            exit()
    elif v == "a" or v == "o":
        if dp[i][1] == True:
            dp[i+1][0] = True
        else:
            print("No")
            exit()
    elif v == "n":
        if dp[i][0] == True:
            dp[i+1][0] = True
        else:
            print("No")
            exit()
    elif v == "?":
        if dp[i][0] == True:
            dp[i+1][0] = True
            dp[i+1][1] = True
        else:
            dp[i+1][0] = True
    else:
        print("No")
        exit()

print("Yes")

#print(*dp, sep = "\n")
0