結果

問題 No.2373 wa, wo, n
ユーザー nouka28nouka28
提出日時 2023-07-07 21:39:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 697 ms
コンパイル使用メモリ 87,308 KB
実行使用メモリ 86,936 KB
最終ジャッジ日時 2023-09-28 22:40:47
合計ジャッジ時間 6,070 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,180 KB
testcase_01 AC 75 ms
71,580 KB
testcase_02 AC 78 ms
71,352 KB
testcase_03 AC 74 ms
71,348 KB
testcase_04 AC 74 ms
71,352 KB
testcase_05 AC 77 ms
71,180 KB
testcase_06 AC 75 ms
71,348 KB
testcase_07 AC 76 ms
71,360 KB
testcase_08 AC 77 ms
71,392 KB
testcase_09 AC 76 ms
71,428 KB
testcase_10 AC 76 ms
71,388 KB
testcase_11 AC 74 ms
71,428 KB
testcase_12 AC 76 ms
71,268 KB
testcase_13 AC 77 ms
71,388 KB
testcase_14 AC 123 ms
84,812 KB
testcase_15 AC 112 ms
78,300 KB
testcase_16 AC 132 ms
85,380 KB
testcase_17 AC 105 ms
78,692 KB
testcase_18 AC 92 ms
76,372 KB
testcase_19 AC 78 ms
72,084 KB
testcase_20 AC 79 ms
74,128 KB
testcase_21 AC 78 ms
72,432 KB
testcase_22 AC 82 ms
72,920 KB
testcase_23 AC 83 ms
74,584 KB
testcase_24 AC 75 ms
71,316 KB
testcase_25 AC 75 ms
71,340 KB
testcase_26 AC 74 ms
71,176 KB
testcase_27 AC 74 ms
71,544 KB
testcase_28 AC 76 ms
71,232 KB
testcase_29 AC 77 ms
71,296 KB
testcase_30 AC 77 ms
71,172 KB
testcase_31 AC 77 ms
71,052 KB
testcase_32 AC 136 ms
86,560 KB
testcase_33 AC 80 ms
74,612 KB
testcase_34 AC 121 ms
85,484 KB
testcase_35 AC 82 ms
74,664 KB
testcase_36 AC 118 ms
85,768 KB
testcase_37 AC 98 ms
83,728 KB
testcase_38 AC 103 ms
84,624 KB
testcase_39 AC 115 ms
84,796 KB
testcase_40 AC 135 ms
86,576 KB
testcase_41 AC 146 ms
86,936 KB
testcase_42 AC 108 ms
84,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
s=list(input())
s.reverse()
while len(s):
    if len(s)>1 and ("".join(s[len(s)-2:])=="aw" or "".join(s[len(s)-2:])=="ow" or "".join(s[len(s)-2:])=="?w"):
        for i in range(2):s.pop()
    elif s[-1]=="n":s.pop()
    elif s[-1]=="?":
        if len(s)>1 and (s[-2]=="o"or s[-2]=="a"):
            for i in range(2):s.pop()
        else:s.pop()
    else:
        print("No")
        exit()
print("Yes")
0