結果

問題 No.2373 wa, wo, n
ユーザー kaityo_17kaityo_17
提出日時 2023-07-07 21:53:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,917 bytes
コンパイル時間 1,577 ms
コンパイル使用メモリ 168,776 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-28 23:03:26
合計ジャッジ時間 3,193 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 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,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 7 ms
4,376 KB
testcase_15 AC 2 ms
4,384 KB
testcase_16 AC 8 ms
4,376 KB
testcase_17 AC 3 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 4 ms
4,376 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 9 ms
4,376 KB
testcase_33 WA -
testcase_34 AC 7 ms
4,380 KB
testcase_35 AC 6 ms
4,376 KB
testcase_36 AC 9 ms
4,380 KB
testcase_37 AC 7 ms
4,376 KB
testcase_38 AC 7 ms
4,376 KB
testcase_39 AC 5 ms
4,376 KB
testcase_40 AC 9 ms
4,380 KB
testcase_41 AC 9 ms
4,376 KB
testcase_42 AC 8 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,a,n) for(int i = a; i < n; i++)
#define yes (cout << "Yes" << endl)
#define YES (cout << "YES" << endl)
#define no (cout << "No" << endl)
#define NO (cout << "NO" << endl)
#define pb push_back
#define pf push_front
#define mp make_pair
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vs = vector<string>;
using Graph = vector<vector<int>>;
const int mod = 998244353;
const int MOD = 1000000007;
int dight_sum(int t) {
    int ans = 0;
    while(t >= 10) {
        ans += t % 10;
        t /= 10;
    }
    ans += t;
    return ans;
}
vector<bool> seen;
void dfs(const Graph &G, int v) {
    seen[v] = true; // v を訪問済にする

    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v); // 再帰的に探索
    }
}

int main () {
    int n;
    cin >> n;
    string s;
    cin >> s;
    string t;
    rep(i,0,n) {
        if(s[i] != 'n') {
            t += s[i];
        }
    }
    rep(i,0,t.size()) {
        if(t[i] == 'a' || t[i] == 'o' || t[i] == 'w' || t[i] == '?') {
            t += "";
        }
        else {
            no;
            return 0;
        }
    }
    rep(i,0,t.size()) {
        if(t[i] == 'a' || t[i] == 'o') {
            if(i == 0) {
                no;
                return 0;
            }
            else {
                if(t[i - 1] != 'w' && t[i - 1] != '?' ){
                    no;
                    return 0;
                }
            }
        }
        if(t[i] == 'w') {
            if(i == n - 1) {
                no;
                return 0;
            }
            else if(t[i + 1] == 'w') {
                no;
                return 0;
            }
        }
    }
    yes;
}






0