結果
| 問題 | No.2373 wa, wo, n | 
| コンテスト | |
| ユーザー |  lllllll88938494 | 
| 提出日時 | 2023-07-07 21:46:03 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 83 ms / 2,000 ms | 
| コード長 | 913 bytes | 
| コンパイル時間 | 314 ms | 
| コンパイル使用メモリ | 82,092 KB | 
| 実行使用メモリ | 84,364 KB | 
| 最終ジャッジ日時 | 2024-07-21 17:34:42 | 
| 合計ジャッジ時間 | 3,517 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 39 | 
ソースコード
n=int(input())
s=list(input())
while True:
    if len(s) == 0:
        print('Yes')
        exit()
    if len(s) == 1:
        if s[0] == 'n' or s[0] == '?':
            print('Yes')
            exit()
        else:
            print('No')
            exit()
    else:
        f = 0
        if len(s) > 2 and s[-1] =='?' and s[-2] == '?' and s[-3] =='w':
            s.pop()
            s.pop()
            s.pop()
            f =1
        elif s[-1] == 'n':
            s.pop()
            f = 1
        elif (s[-1] == 'o' or s[-1] == '?') and (s[-2] == 'w' or s[-2] == '?'):
            s.pop()
            s.pop()
            f = 1
        elif (s[-1] == 'a' or s[-1] == '?') and (s[-2] == 'w' or s[-2] == '?'):
            s.pop()
            s.pop()
            f = 1
        elif s[-1] == '?':
            s.pop()
            f = 1
        if f == 0:
            print('No')
            exit()
        
            
            
            
        