제출 #173379

#제출 시각아이디문제언어결과실행 시간메모리
173379FieryPhoenix콤보 (IOI18_combo)C++11
100 / 100
76 ms676 KiB
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <cstdio> #include <map> #include <queue> #include <set> #include <iomanip> #include <deque> #include <cassert> #include <ctime> #include <cstring> #include <cstdlib> #include <chrono> #include <ctime> #include <random> #include <stack> #include <unordered_set> #include <unordered_map> #include "combo.h" #include <iterator> #include <climits> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); typedef long long ll; typedef long double ld; #define INF 2001001001 #define MOD 1000000007 string guess_sequence(int N){ string ans=""; vector<char>v; v.push_back('A'); v.push_back('B'); v.push_back('X'); v.push_back('Y'); int AB=press("AB"); if (AB>0){ int A=press("A"); if (A==1){ ans+='A'; v.erase(v.begin()); } else{ ans+='B'; v.erase(v.begin()+1); } } else{ int X=press("X"); if (X==1){ ans+='X'; v.erase(v.begin()+2); } else{ ans+='Y'; v.erase(v.begin()+3); } } if (N==1) return ans; while ((int)ans.size()+2<=N){ int res=press(ans+v[0]+v[0]+ans+v[0]+v[1]+ans+v[0]+v[2]+ans+v[1]); if (res==(int)ans.size()+2) ans+=v[0]; else if (res==(int)ans.size()+1) ans+=v[1]; else ans+=v[2]; } int res=press(ans+v[0]+ans+v[1]); if (res==(int)ans.size()) return ans+v[2]; else{ int res2=press(ans+v[0]); if (res2==res) return ans+v[0]; else return ans+v[1]; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...