結果

問題 No.2373 wa, wo, n
ユーザー MMMM
提出日時 2023-06-23 00:10:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 679 bytes
コンパイル時間 1,900 ms
コンパイル使用メモリ 177,112 KB
実行使用メモリ 17,336 KB
最終ジャッジ日時 2023-09-15 06:54:48
合計ジャッジ時間 3,592 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 22 ms
14,684 KB
testcase_15 AC 5 ms
4,960 KB
testcase_16 AC 24 ms
15,752 KB
testcase_17 AC 9 ms
6,532 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 10 ms
7,792 KB
testcase_20 AC 20 ms
14,432 KB
testcase_21 AC 10 ms
7,460 KB
testcase_22 AC 15 ms
10,388 KB
testcase_23 AC 23 ms
16,216 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 1 ms
4,384 KB
testcase_32 AC 26 ms
17,200 KB
testcase_33 AC 24 ms
17,336 KB
testcase_34 AC 26 ms
17,200 KB
testcase_35 AC 25 ms
17,336 KB
testcase_36 AC 26 ms
17,200 KB
testcase_37 AC 25 ms
17,252 KB
testcase_38 AC 25 ms
17,200 KB
testcase_39 AC 25 ms
17,216 KB
testcase_40 AC 26 ms
17,212 KB
testcase_41 AC 26 ms
17,268 KB
testcase_42 AC 25 ms
17,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N; string S;
  cin >> N >> S;
  vector<vector<bool>> dp(N+1, vector<bool>(4, false));
  map<char,int> M;
  M['w'] = 0; M['a'] = 1; M['o'] = 2; M['n'] = 3;
  dp[0][0] = dp[0][1] = dp[0][2] = dp[0][3] = true;
  for(int i = 0; i < N; i++){
    for(int j = 0; j < 4; j++){
      if(dp[i][j]){
        if(j==0){
          dp[i+1][1] = (S[i]=='a'||S[i] == '?');
          dp[i+1][2] = (S[i]=='o'||S[i] == '?');
        } else {
          dp[i+1][0] = (S[i]=='w'||S[i] == '?');
          dp[i+1][3] = (S[i]=='n'||S[i] == '?');
        }
      }
    }
  }
  cout << (dp[N][1] || dp[N][2] || dp[N][3] ? "Yes":"No") << endl;
}
0