結果
問題 |
No.2168 双頭ヒドラゲーム
|
ユーザー |
👑 ![]() |
提出日時 | 2022-12-20 01:11:47 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,019 bytes |
コンパイル時間 | 2,824 ms |
コンパイル使用メモリ | 119,356 KB |
最終ジャッジ日時 | 2025-02-09 17:17:54 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 10 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <utility> #include <array> #include <atcoder/modint> using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(int)(n); i++) const i64 INF = 1001001001001001001; using Modint = atcoder::static_modint<998244353>; string refine_2(string s, int& p){ if(p == (int)s.size()) return ""; if(s[p] != '(') return ""; vector<string> res; p++; res.push_back(refine_2(s, p)); p++; res.push_back(refine_2(s, p)); p++; res.push_back(refine_2(s, p)); res.push_back("D" + res[0] + "C" + res[1] + "B" + res[2] + "A"); return *max_element(res.begin(), res.end()); } string refine(string s){ int p = 0; return refine_2(s, p); } int main(){ string chars = ")|("; string T0, T1; cin >> T0 >> T1; T0 = refine(T0); T1 = refine(T1); if(T0 < T1) cout << "1\n"; else cout << "0\n"; return 0; }