結果

問題 No.2373 wa, wo, n
ユーザー prd_xxxprd_xxx
提出日時 2023-07-07 21:58:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 671 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 76,888 KB
最終ジャッジ日時 2023-09-28 23:11:24
合計ジャッジ時間 5,498 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
70,972 KB
testcase_01 AC 74 ms
70,900 KB
testcase_02 AC 74 ms
71,064 KB
testcase_03 AC 77 ms
71,252 KB
testcase_04 AC 72 ms
71,012 KB
testcase_05 AC 75 ms
71,256 KB
testcase_06 AC 74 ms
71,268 KB
testcase_07 AC 74 ms
71,028 KB
testcase_08 AC 74 ms
71,068 KB
testcase_09 AC 72 ms
71,252 KB
testcase_10 AC 73 ms
71,232 KB
testcase_11 AC 74 ms
71,216 KB
testcase_12 AC 74 ms
71,036 KB
testcase_13 AC 74 ms
71,252 KB
testcase_14 AC 98 ms
76,632 KB
testcase_15 WA -
testcase_16 AC 99 ms
76,888 KB
testcase_17 AC 89 ms
75,540 KB
testcase_18 AC 84 ms
75,600 KB
testcase_19 AC 84 ms
75,836 KB
testcase_20 AC 94 ms
76,308 KB
testcase_21 AC 83 ms
75,608 KB
testcase_22 AC 86 ms
75,808 KB
testcase_23 AC 91 ms
76,880 KB
testcase_24 AC 73 ms
71,268 KB
testcase_25 AC 72 ms
71,024 KB
testcase_26 AC 73 ms
71,224 KB
testcase_27 AC 74 ms
70,896 KB
testcase_28 AC 74 ms
71,364 KB
testcase_29 AC 73 ms
71,188 KB
testcase_30 AC 73 ms
71,252 KB
testcase_31 AC 73 ms
70,908 KB
testcase_32 AC 99 ms
76,580 KB
testcase_33 AC 93 ms
76,456 KB
testcase_34 AC 87 ms
76,888 KB
testcase_35 AC 74 ms
71,464 KB
testcase_36 AC 86 ms
76,644 KB
testcase_37 AC 82 ms
75,996 KB
testcase_38 AC 84 ms
75,852 KB
testcase_39 AC 81 ms
75,580 KB
testcase_40 AC 99 ms
76,384 KB
testcase_41 AC 95 ms
76,472 KB
testcase_42 AC 93 ms
76,328 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':
            exit(print('No'))
        else:
            buf = '?'
print('Yes')
0