# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
197706 | kshitij_sodani | Combo (IOI18_combo) | C++17 | 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 <bits/stdc++.h>
using namespace std;
typedef long long int llo;
#define mp make_pair
#define pb push_back
int press(string p){};
string guess_sequence(int n){
string s="";
int aa;
aa=press(s+"A");
if(aa==1){
s+="A";}
else{
aa=press(s+"B");
if(aa==1){
s+="B";
}
else{
aa=press(s+"X");
if(aa==1){
s+="X";
}
else{
s+="Y";
}
}
}
string b="B";
string x="X";
string y="Y";
if(s=="B"){
b="A";
}
else if(s=="X"){
x="A";
}
else if(s=="Y"){
y="A";
}
for(int co=1;co<n;co++){
aa=press(s+b+s+x+y+s+x+x+s+x+b);
if(aa==co){
s+=y;
}
else if(aa==co+1){
s+=b;
}
else{
s+=x;
}
}
aa=press(s+b);
if(aa==n){
s+=b;
}
else{
aa=press(s+x);
if(aa==n){
s+=x;
}
else{
s+=y;
}
}
return s;
}
int main(){
return 0;
}