結果

問題 No.2373 wa, wo, n
ユーザー yabityabit
提出日時 2023-07-11 09:51:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 629 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 79,268 KB
最終ジャッジ日時 2023-10-10 01:37:28
合計ジャッジ時間 5,488 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,652 KB
testcase_01 AC 70 ms
71,456 KB
testcase_02 AC 71 ms
71,408 KB
testcase_03 AC 71 ms
71,316 KB
testcase_04 AC 71 ms
71,456 KB
testcase_05 AC 72 ms
71,416 KB
testcase_06 AC 71 ms
71,324 KB
testcase_07 AC 69 ms
71,172 KB
testcase_08 AC 70 ms
71,452 KB
testcase_09 AC 71 ms
71,440 KB
testcase_10 AC 72 ms
71,420 KB
testcase_11 AC 71 ms
71,456 KB
testcase_12 AC 71 ms
71,652 KB
testcase_13 AC 72 ms
71,572 KB
testcase_14 AC 88 ms
78,508 KB
testcase_15 AC 82 ms
76,300 KB
testcase_16 AC 89 ms
78,828 KB
testcase_17 AC 88 ms
76,524 KB
testcase_18 AC 77 ms
75,812 KB
testcase_19 AC 73 ms
72,692 KB
testcase_20 AC 74 ms
74,312 KB
testcase_21 AC 73 ms
72,280 KB
testcase_22 AC 74 ms
73,164 KB
testcase_23 AC 76 ms
74,548 KB
testcase_24 AC 69 ms
71,416 KB
testcase_25 AC 70 ms
71,384 KB
testcase_26 AC 71 ms
71,476 KB
testcase_27 AC 69 ms
71,496 KB
testcase_28 AC 70 ms
71,384 KB
testcase_29 AC 70 ms
71,412 KB
testcase_30 AC 71 ms
71,280 KB
testcase_31 AC 69 ms
71,528 KB
testcase_32 AC 89 ms
79,268 KB
testcase_33 AC 74 ms
74,912 KB
testcase_34 AC 82 ms
79,076 KB
testcase_35 AC 77 ms
74,968 KB
testcase_36 AC 83 ms
79,216 KB
testcase_37 AC 78 ms
78,952 KB
testcase_38 AC 81 ms
78,900 KB
testcase_39 AC 79 ms
78,828 KB
testcase_40 AC 86 ms
79,224 KB
testcase_41 AC 87 ms
79,124 KB
testcase_42 AC 81 ms
78,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(input())
def hantei():
    i = 0
    while i < N:
        if S[i] == 'n':
            i += 1
        elif S[i] == 'w':
            if i == N-1:
                return False
            elif S[i+1] == 'a' or S[i+1] == 'o' or S[i+1] == '?':
                i += 2
            else:
                return False
        elif S[i] == '?':
            if i == N-1:
                i += 1
            elif S[i+1] == 'a' or S[i+1] == 'o':
                i += 2
            else:
                i += 1
        else:
            return False
    return True

if hantei():
    print('Yes')
else:
    print('No')
0