結果

問題 No.2373 wa, wo, n
ユーザー prd_xxxprd_xxx
提出日時 2023-07-07 22:06:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 718 bytes
コンパイル時間 1,183 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 77,084 KB
最終ジャッジ日時 2023-09-28 23:24:40
合計ジャッジ時間 5,430 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,064 KB
testcase_01 AC 73 ms
71,320 KB
testcase_02 AC 74 ms
70,976 KB
testcase_03 AC 77 ms
71,376 KB
testcase_04 AC 74 ms
71,140 KB
testcase_05 AC 73 ms
71,092 KB
testcase_06 AC 74 ms
71,216 KB
testcase_07 AC 74 ms
71,196 KB
testcase_08 AC 73 ms
71,240 KB
testcase_09 AC 74 ms
71,276 KB
testcase_10 AC 73 ms
71,392 KB
testcase_11 AC 73 ms
71,136 KB
testcase_12 AC 73 ms
71,240 KB
testcase_13 AC 73 ms
71,220 KB
testcase_14 AC 97 ms
76,584 KB
testcase_15 WA -
testcase_16 AC 97 ms
77,012 KB
testcase_17 AC 90 ms
75,732 KB
testcase_18 AC 83 ms
75,852 KB
testcase_19 AC 83 ms
75,896 KB
testcase_20 AC 89 ms
76,512 KB
testcase_21 AC 82 ms
75,832 KB
testcase_22 AC 83 ms
75,796 KB
testcase_23 AC 91 ms
77,084 KB
testcase_24 AC 73 ms
71,128 KB
testcase_25 AC 74 ms
71,100 KB
testcase_26 AC 73 ms
71,188 KB
testcase_27 AC 74 ms
70,972 KB
testcase_28 AC 73 ms
71,192 KB
testcase_29 AC 74 ms
71,196 KB
testcase_30 AC 73 ms
71,244 KB
testcase_31 AC 72 ms
71,200 KB
testcase_32 AC 98 ms
76,940 KB
testcase_33 AC 92 ms
76,536 KB
testcase_34 AC 88 ms
76,692 KB
testcase_35 AC 74 ms
71,728 KB
testcase_36 AC 87 ms
76,444 KB
testcase_37 AC 83 ms
75,740 KB
testcase_38 AC 83 ms
75,944 KB
testcase_39 AC 81 ms
76,000 KB
testcase_40 AC 96 ms
76,588 KB
testcase_41 AC 97 ms
76,652 KB
testcase_42 AC 94 ms
76,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
for c in S:
    if c not in 'waon?':
        exit(print('No'))

T = S.replace('n','').replace('wa','').replace('wo','')
if T=='':
    exit(print('Yes'))

T = T.replace('o','a')
assert all(c in 'wa?' for c in T)

if len(T) == 1:
    exit(print('Yes' if T=='?' else 'No'))

buf = ''
for c in T:
    if c == 'w':
        if buf=='w' or buf=='a':
            exit(print('No'))
        buf = 'w'
    elif c == 'a':
        if buf=='a' or buf=='':
            exit(print('No'))
        buf = ''
    else:
        if buf=='w':
            buf = ''
        elif buf=='a':
            assert False
        else:
            buf = '?'
if buf=='?' or buf == '':
    print('Yes')
else:
    print('No')
0