結果

問題 No.2373 wa, wo, n
ユーザー ryohei22ryohei22
提出日時 2023-07-07 22:03:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 2,295 ms
コンパイル使用メモリ 86,776 KB
実行使用メモリ 76,468 KB
最終ジャッジ日時 2023-09-28 23:20:32
合計ジャッジ時間 5,744 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,412 KB
testcase_01 AC 73 ms
71,360 KB
testcase_02 AC 71 ms
71,472 KB
testcase_03 AC 69 ms
71,160 KB
testcase_04 AC 74 ms
71,412 KB
testcase_05 AC 70 ms
71,148 KB
testcase_06 AC 70 ms
71,500 KB
testcase_07 AC 70 ms
71,184 KB
testcase_08 AC 71 ms
71,140 KB
testcase_09 AC 70 ms
71,288 KB
testcase_10 AC 68 ms
71,484 KB
testcase_11 AC 68 ms
71,148 KB
testcase_12 AC 70 ms
71,476 KB
testcase_13 AC 70 ms
71,544 KB
testcase_14 AC 86 ms
76,280 KB
testcase_15 AC 85 ms
75,852 KB
testcase_16 AC 88 ms
76,312 KB
testcase_17 AC 85 ms
75,716 KB
testcase_18 AC 80 ms
75,952 KB
testcase_19 AC 68 ms
71,220 KB
testcase_20 AC 71 ms
71,784 KB
testcase_21 AC 70 ms
71,532 KB
testcase_22 AC 70 ms
71,328 KB
testcase_23 AC 70 ms
71,540 KB
testcase_24 AC 69 ms
71,544 KB
testcase_25 AC 74 ms
71,572 KB
testcase_26 AC 67 ms
71,536 KB
testcase_27 AC 68 ms
71,552 KB
testcase_28 AC 68 ms
71,252 KB
testcase_29 AC 69 ms
71,480 KB
testcase_30 AC 69 ms
71,540 KB
testcase_31 AC 71 ms
71,296 KB
testcase_32 AC 85 ms
76,468 KB
testcase_33 AC 72 ms
71,512 KB
testcase_34 AC 79 ms
76,244 KB
testcase_35 AC 77 ms
71,612 KB
testcase_36 AC 80 ms
76,424 KB
testcase_37 AC 74 ms
76,032 KB
testcase_38 AC 76 ms
76,124 KB
testcase_39 AC 73 ms
75,956 KB
testcase_40 AC 85 ms
76,316 KB
testcase_41 AC 85 ms
76,300 KB
testcase_42 AC 76 ms
76,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

i = 0
while i < N:
    if S[i] == 'n':
        i += 1
    elif S[i] == 'w':
        if i == N - 1 or S[i+1] not in ['a', 'o' ,'?']:
            print('No')
            exit()
        else:
            i += 2
    elif S[i] == '?':
        if i != N - 1 and S[i+1] in ['a', 'o']:
            i += 2
        else:
            i += 1
    else:
        print('No')
        exit()
print('Yes')
0