結果
| 問題 |
No.2373 wa, wo, n
|
| コンテスト | |
| ユーザー |
kaityo_17
|
| 提出日時 | 2023-07-07 21:53:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,917 bytes |
| コンパイル時間 | 1,778 ms |
| コンパイル使用メモリ | 169,808 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-21 17:46:57 |
| 合計ジャッジ時間 | 3,051 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 31 WA * 8 |
ソースコード
#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;
}
kaityo_17