結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,028 KB
testcase_01 AC 76 ms
71,028 KB
testcase_02 AC 76 ms
70,896 KB
testcase_03 AC 75 ms
71,340 KB
testcase_04 AC 75 ms
71,336 KB
testcase_05 AC 76 ms
71,140 KB
testcase_06 AC 75 ms
71,136 KB
testcase_07 AC 76 ms
71,344 KB
testcase_08 AC 75 ms
71,228 KB
testcase_09 AC 76 ms
71,136 KB
testcase_10 AC 74 ms
71,332 KB
testcase_11 AC 76 ms
71,420 KB
testcase_12 AC 76 ms
71,140 KB
testcase_13 AC 76 ms
71,316 KB
testcase_14 AC 100 ms
76,516 KB
testcase_15 WA -
testcase_16 AC 101 ms
77,072 KB
testcase_17 AC 91 ms
75,824 KB
testcase_18 AC 87 ms
75,796 KB
testcase_19 AC 88 ms
75,664 KB
testcase_20 AC 93 ms
76,480 KB
testcase_21 AC 85 ms
75,556 KB
testcase_22 AC 87 ms
75,828 KB
testcase_23 AC 94 ms
76,800 KB
testcase_24 AC 76 ms
71,256 KB
testcase_25 AC 78 ms
71,136 KB
testcase_26 AC 77 ms
71,232 KB
testcase_27 AC 78 ms
71,108 KB
testcase_28 AC 77 ms
70,992 KB
testcase_29 AC 75 ms
71,052 KB
testcase_30 AC 74 ms
71,144 KB
testcase_31 AC 75 ms
71,012 KB
testcase_32 AC 100 ms
76,804 KB
testcase_33 AC 92 ms
76,696 KB
testcase_34 AC 89 ms
76,760 KB
testcase_35 AC 79 ms
71,560 KB
testcase_36 AC 90 ms
76,440 KB
testcase_37 AC 86 ms
76,136 KB
testcase_38 AC 85 ms
75,780 KB
testcase_39 AC 81 ms
75,828 KB
testcase_40 AC 98 ms
76,692 KB
testcase_41 AC 100 ms
76,508 KB
testcase_42 AC 97 ms
76,560 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 T[0]=='a' or T[-1]=='w':
    exit(print('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:
        assert c=='?'
        if buf=='w':
            buf = ''
        elif buf=='a':
            assert False
        else:
            buf = '?'
if buf=='?' or buf == '':
    print('Yes')
else:
    print('No')
0