結果

問題 No.2373 wa, wo, n
ユーザー karinohitokarinohito
提出日時 2023-07-07 21:59:25
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 703 bytes
コンパイル時間 2,329 ms
コンパイル使用メモリ 204,928 KB
実行使用メモリ 17,520 KB
最終ジャッジ日時 2023-09-28 23:12:56
合計ジャッジ時間 4,080 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 22 ms
14,672 KB
testcase_15 AC 6 ms
5,016 KB
testcase_16 AC 23 ms
15,616 KB
testcase_17 AC 8 ms
6,476 KB
testcase_18 AC 3 ms
4,376 KB
testcase_19 AC 9 ms
7,780 KB
testcase_20 AC 19 ms
14,368 KB
testcase_21 AC 10 ms
7,664 KB
testcase_22 AC 14 ms
10,420 KB
testcase_23 AC 22 ms
16,264 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 25 ms
17,520 KB
testcase_33 AC 24 ms
17,276 KB
testcase_34 AC 24 ms
17,408 KB
testcase_35 AC 23 ms
17,252 KB
testcase_36 AC 25 ms
17,408 KB
testcase_37 AC 24 ms
17,336 KB
testcase_38 AC 23 ms
17,248 KB
testcase_39 AC 24 ms
17,268 KB
testcase_40 AC 25 ms
17,192 KB
testcase_41 AC 25 ms
17,260 KB
testcase_42 AC 24 ms
17,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vll =vector<ll>;
using vvll =vector<vll>;
#define rep(i,n) for(ll i=(ll)(0); i<(ll(n)); ++i)
#define all(x) (x).begin(), (x).end()

int main(){
    ll N;
    string S;
    cin>>N>>S;
    vector<vector<bool>> DP(N+1,vector<bool>(2));
    DP[0][0]=1;
    rep(i,N){
        if(DP[i][0]){
            if(S[i]=='?'||S[i]=='n'){
                DP[i+1][0]=1;
            }
            if(S[i]=='?'||S[i]=='w'){
                DP[i+1][1]=1;
            }
        }
        if(DP[i][1]){
            if(S[i]=='?'||S[i]=='a'||S[i]=='o'){
                DP[i+1][0]=1;
            }
        }
    }
    cout<<(DP[N][0]?"Yes":"No")<<endl;
}
0