結果

問題 No.2373 wa, wo, n
ユーザー MMMM
提出日時 2023-06-23 00:03:33
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 684 bytes
コンパイル時間 2,744 ms
コンパイル使用メモリ 211,272 KB
実行使用メモリ 17,352 KB
最終ジャッジ日時 2023-09-15 06:54:45
合計ジャッジ時間 4,060 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 23 ms
14,784 KB
testcase_15 AC 6 ms
4,896 KB
testcase_16 AC 25 ms
15,692 KB
testcase_17 AC 9 ms
6,500 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 11 ms
7,872 KB
testcase_20 AC 19 ms
14,376 KB
testcase_21 AC 10 ms
7,600 KB
testcase_22 AC 15 ms
10,652 KB
testcase_23 AC 23 ms
16,224 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 27 ms
17,200 KB
testcase_33 AC 25 ms
17,340 KB
testcase_34 AC 27 ms
17,288 KB
testcase_35 AC 25 ms
17,320 KB
testcase_36 AC 26 ms
17,344 KB
testcase_37 AC 25 ms
17,268 KB
testcase_38 AC 25 ms
17,288 KB
testcase_39 AC 25 ms
17,268 KB
testcase_40 AC 26 ms
17,352 KB
testcase_41 AC 27 ms
17,276 KB
testcase_42 AC 25 ms
17,268 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][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] == '?');
        }
      }
    }
  bool can = 0;
  for(int i = 0; i < 4; i++)
    can = can | dp[N][i];
  cout << (can ? "Yes":"No") << endl;
}
0