結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,260 KB
testcase_01 AC 73 ms
71,072 KB
testcase_02 AC 75 ms
71,492 KB
testcase_03 AC 74 ms
71,176 KB
testcase_04 AC 75 ms
71,268 KB
testcase_05 AC 74 ms
71,432 KB
testcase_06 AC 72 ms
71,272 KB
testcase_07 AC 73 ms
71,004 KB
testcase_08 AC 73 ms
71,208 KB
testcase_09 AC 74 ms
71,312 KB
testcase_10 AC 73 ms
71,052 KB
testcase_11 AC 72 ms
71,088 KB
testcase_12 AC 73 ms
71,116 KB
testcase_13 AC 73 ms
71,328 KB
testcase_14 AC 95 ms
76,668 KB
testcase_15 WA -
testcase_16 AC 97 ms
77,328 KB
testcase_17 AC 89 ms
75,836 KB
testcase_18 AC 83 ms
75,860 KB
testcase_19 AC 81 ms
75,952 KB
testcase_20 AC 91 ms
76,428 KB
testcase_21 AC 83 ms
75,624 KB
testcase_22 AC 84 ms
75,664 KB
testcase_23 AC 93 ms
76,916 KB
testcase_24 AC 73 ms
71,224 KB
testcase_25 AC 73 ms
71,312 KB
testcase_26 AC 74 ms
71,112 KB
testcase_27 AC 74 ms
71,052 KB
testcase_28 AC 74 ms
71,060 KB
testcase_29 AC 73 ms
71,528 KB
testcase_30 AC 74 ms
71,272 KB
testcase_31 AC 74 ms
71,380 KB
testcase_32 AC 100 ms
76,776 KB
testcase_33 AC 94 ms
76,660 KB
testcase_34 AC 90 ms
76,832 KB
testcase_35 AC 75 ms
71,884 KB
testcase_36 AC 89 ms
76,580 KB
testcase_37 AC 84 ms
75,824 KB
testcase_38 AC 84 ms
75,944 KB
testcase_39 AC 81 ms
76,060 KB
testcase_40 AC 98 ms
76,728 KB
testcase_41 AC 98 ms
76,704 KB
testcase_42 AC 94 ms
76,596 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=='w':
    print('No')
else:
    print('Yes')
0