# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
439406 | MrCriminal | 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 "bits/stdc++.h"
std::string guess_sequence(int N)
{
std::string p;
int len = N;
std::string c = "ABXY";
int cur = 0;
for(int i=0;i<4;i++)
{
p += c[i];
cur = press(p);
if(cur==N)
{
return p;
}
else if(cur==1)
{
break ;
}
else p.pop_back();
}
for(int i=1;i<N;i++)
{
for(int j=0;j<4;j++)
{
if(p[0]==c[j]) continue;
p += c[j];
cur = press(p);
if(cur==N)
{
return p;
}
else if(cur==i+1)
{
break;
}
else p.pop_back();
}
}
return p;
}