結果

問題 No.2373 wa, wo, n
ユーザー kpinkcat
提出日時 2023-10-02 23:47:43
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 694 bytes
コンパイル時間 1,808 ms
コンパイル使用メモリ 193,236 KB
最終ジャッジ日時 2025-02-17 04:03:18
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 38 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;

int main()
{
    int n, i = 0;
    string s;
    cin >> n >> s;
    while (i < n){
        if(s[i] == '?'){
            if (s[i+1] == 'o' || s[i+1] == 'a') i += 2;
            else i++;
        } else if(s[i] == 'w'){
            i++;
            if (s[i] == 'a' || s[i] == 'o' || s[i] == '?') i++;
        } else if (s[i] == 'n' || s[i] == '?') i++;
        else {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}

0