結果
| 問題 | No.2373 wa, wo, n |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-06 19:49:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 1,791 bytes |
| 記録 | |
| コンパイル時間 | 4,172 ms |
| コンパイル使用メモリ | 238,884 KB |
| 実行使用メモリ | 813,952 KB |
| 最終ジャッジ日時 | 2024-09-29 18:33:45 |
| 合計ジャッジ時間 | 6,428 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 MLE * 1 -- * 28 |
コンパイルメッセージ
main.cpp: In function 'void in(T& ...)':
main.cpp:15:53: warning: fold-expressions only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
15 | template<class... T>void in(T&... a){(cin >> ... >> a);}
| ^
main.cpp: In function 'void out(const T&, const Ts& ...)':
main.cpp:16:100: warning: fold-expressions only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
16 | template<class T, class... Ts>void out(const T& a, const Ts&... b){cout << a;((cout << ' ' << b), ...);cout << '\n';}
| ^~~
ソースコード
#include<bits/stdc++.h>
#include <atcoder/all>
using namespace std;using namespace atcoder;using vst = vector<string>;using ll = long long;
using ld = long double;using pll = pair<ll,ll>;using vll = vector<ll>;using vvll = vector<vll>;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repp(i,k,n) for (ll i = k; i < n; i++)
#define per(i,s,e) for(ll i = s; i >= e; i--)
#define all(v) v.begin(),v.end()
#define no() {cout << "No" << endl; return 0;}
#define yes() {cout << "Yes" << endl;return 0;}
#define CHECK(a) a ? cout << "Yes" << endl : cout << "No" << endl
#define UNOmap unordered_map
#define UNOset unordered_set
#define ASC(T) T,vector<T>,greater<T>
template<class... T>void in(T&... a){(cin >> ... >> a);}
template<class T, class... Ts>void out(const T& a, const Ts&... b){cout << a;((cout << ' ' << b), ...);cout << '\n';}
void vin(vll &v){for(ll i = 0; i < (ll)v.size(); i++)in(v[i]);}
void vout(vll &v){for(ll i = 0; i < (ll)v.size(); i++) cout << v[i] << ' ';}
ll INF = 1LL << 62;ll MODD = 998244353;ll MOD = 1000000007;
// using mint = modint998244353;
// using mint = modint1000000007;
//using mint = modint;
//----------------------------------------------
map<string,bool> memo;
bool dfs(string s){
if(memo.count(s)) return memo[s];
if(s == "") return true;
bool res = false;
if(s.substr(0,2) == "wa" or s.substr(0,2) == "?a" or s.substr(0,2) == "w?"){
string t = s;
t.erase(0,2);
res = res or dfs(t);
}
if(s.substr(0,2) == "wo" or s.substr(0,2) == "?o" or s.substr(0,2) == "w?"){
string t = s;
t.erase(0,2);
res = res or dfs(t);
}
if(s[0] == 'n' or s[0] == '?'){
string t = s;
t.erase(0,1);
res = res or dfs(t);
}
memo[s] = res;
return res;
}
int main(){
ll N; string s;
in(N,s);
CHECK(dfs(s));
}