結果

問題 No.2373 wa, wo, n
ユーザー lllllll88938494lllllll88938494
提出日時 2023-07-07 21:46:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 913 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 85,736 KB
最終ジャッジ日時 2023-09-28 22:49:49
合計ジャッジ時間 5,309 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,320 KB
testcase_01 AC 72 ms
71,320 KB
testcase_02 AC 71 ms
71,292 KB
testcase_03 AC 73 ms
71,144 KB
testcase_04 AC 71 ms
71,268 KB
testcase_05 AC 72 ms
71,292 KB
testcase_06 AC 70 ms
71,440 KB
testcase_07 AC 71 ms
71,152 KB
testcase_08 AC 70 ms
71,292 KB
testcase_09 AC 69 ms
71,636 KB
testcase_10 AC 70 ms
71,544 KB
testcase_11 AC 71 ms
71,316 KB
testcase_12 AC 73 ms
71,304 KB
testcase_13 AC 74 ms
71,156 KB
testcase_14 AC 109 ms
84,128 KB
testcase_15 AC 73 ms
71,964 KB
testcase_16 AC 110 ms
84,848 KB
testcase_17 AC 94 ms
77,216 KB
testcase_18 AC 83 ms
76,056 KB
testcase_19 AC 72 ms
72,184 KB
testcase_20 AC 72 ms
74,064 KB
testcase_21 AC 73 ms
72,516 KB
testcase_22 AC 72 ms
72,856 KB
testcase_23 AC 77 ms
74,536 KB
testcase_24 AC 71 ms
71,152 KB
testcase_25 AC 73 ms
71,444 KB
testcase_26 AC 69 ms
71,412 KB
testcase_27 AC 73 ms
71,304 KB
testcase_28 AC 70 ms
71,356 KB
testcase_29 AC 72 ms
71,360 KB
testcase_30 AC 71 ms
71,252 KB
testcase_31 AC 71 ms
71,276 KB
testcase_32 AC 113 ms
85,736 KB
testcase_33 AC 79 ms
74,656 KB
testcase_34 AC 83 ms
81,044 KB
testcase_35 AC 75 ms
74,812 KB
testcase_36 AC 90 ms
81,004 KB
testcase_37 AC 85 ms
81,036 KB
testcase_38 AC 84 ms
80,964 KB
testcase_39 AC 85 ms
80,840 KB
testcase_40 AC 107 ms
84,312 KB
testcase_41 AC 110 ms
85,048 KB
testcase_42 AC 85 ms
80,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
s=list(input())

while True:
    if len(s) == 0:
        print('Yes')
        exit()
    if len(s) == 1:
        if s[0] == 'n' or s[0] == '?':
            print('Yes')
            exit()
        else:
            print('No')
            exit()

    else:
        f = 0
        if len(s) > 2 and s[-1] =='?' and s[-2] == '?' and s[-3] =='w':
            s.pop()
            s.pop()
            s.pop()
            f =1
        elif s[-1] == 'n':
            s.pop()
            f = 1
        elif (s[-1] == 'o' or s[-1] == '?') and (s[-2] == 'w' or s[-2] == '?'):
            s.pop()
            s.pop()
            f = 1
        elif (s[-1] == 'a' or s[-1] == '?') and (s[-2] == 'w' or s[-2] == '?'):
            s.pop()
            s.pop()
            f = 1

        elif s[-1] == '?':
            s.pop()
            f = 1
        if f == 0:
            print('No')
            exit()
        

0