結果

問題 No.2373 wa, wo, n
ユーザー titiatitia
提出日時 2023-07-10 07:58:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 572 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 9,976 KB
最終ジャッジ日時 2023-10-10 01:08:46
合計ジャッジ時間 4,640 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,884 KB
testcase_01 AC 16 ms
8,196 KB
testcase_02 AC 16 ms
7,816 KB
testcase_03 AC 16 ms
8,132 KB
testcase_04 AC 15 ms
7,816 KB
testcase_05 AC 16 ms
7,848 KB
testcase_06 AC 15 ms
8,076 KB
testcase_07 AC 16 ms
8,276 KB
testcase_08 AC 15 ms
8,220 KB
testcase_09 AC 15 ms
7,828 KB
testcase_10 AC 16 ms
7,860 KB
testcase_11 AC 16 ms
7,832 KB
testcase_12 AC 16 ms
8,144 KB
testcase_13 AC 16 ms
7,880 KB
testcase_14 AC 91 ms
9,496 KB
testcase_15 AC 28 ms
8,448 KB
testcase_16 AC 92 ms
9,868 KB
testcase_17 AC 37 ms
8,564 KB
testcase_18 AC 17 ms
8,188 KB
testcase_19 AC 24 ms
8,892 KB
testcase_20 AC 33 ms
9,480 KB
testcase_21 AC 22 ms
8,804 KB
testcase_22 AC 28 ms
9,272 KB
testcase_23 AC 37 ms
9,772 KB
testcase_24 AC 15 ms
8,088 KB
testcase_25 AC 15 ms
8,216 KB
testcase_26 AC 15 ms
8,252 KB
testcase_27 AC 15 ms
7,916 KB
testcase_28 AC 16 ms
7,736 KB
testcase_29 AC 16 ms
7,904 KB
testcase_30 AC 16 ms
7,912 KB
testcase_31 AC 15 ms
7,924 KB
testcase_32 AC 103 ms
9,920 KB
testcase_33 AC 37 ms
9,828 KB
testcase_34 AC 83 ms
9,920 KB
testcase_35 AC 19 ms
9,844 KB
testcase_36 AC 109 ms
9,908 KB
testcase_37 AC 114 ms
9,916 KB
testcase_38 AC 120 ms
9,864 KB
testcase_39 AC 87 ms
9,856 KB
testcase_40 AC 109 ms
9,860 KB
testcase_41 AC 109 ms
9,912 KB
testcase_42 AC 123 ms
9,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

WAON={"w","a","o","n","?"}

for s in S:
    if s in WAON:
        pass
    else:
        print("No")
        exit()

if S[-1]=="w":
    print("No")
    exit()

if S[0]=="a" or S[0]=="o":
    print("No")
    exit()

for i in range(N):
    if S[i]=="w":
        if S[i+1]=="w" or S[i+1]=="n":
            print("No")
            exit()

        if S[i+1]=="?":
            S[i+1]="a"
    if S[i]=="a" or S[i]=="o":
        if S[i-1]=="w" or S[i-1]=="?":
            pass
        else:
            print("No")
            exit()

print("Yes")
0