# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
173378 | FieryPhoenix | 콤보 (IOI18_combo) | C++11 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 <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];
}
}