| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 534524 | Abdulmohsen1284 | 콤보 (IOI18_combo) | C++14 | 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 "combo.h"
std::string guess_sequence(int N) {
string g,s;
g="AB";
long long ans=press(g);
if(ans==1)
{
g="A";
ans=press(g);
if(ans==1)
s="A";
else
s="B";
}
else
{
g="X";
ans=press(g);
if(ans==1)
s="X";
else
s="Y";
}
char a[4];
long long cur=0;
string chek="ABXY";
for(int i=0;i<chek.size();i++)
{
if(s[0]!=chek[i])
{
a[cur]=chek[i];
cur++;
}
}
for(int i=1;i<N-1;i++)
{
string rn;
rn=s+chek[0];
for(int j=0;j<3;j++)
rn+=s+check[1]+chek[j];
ans=press(rn);
if(ans==s.size())
{
s+=chek[2];
}
if(ans==s.size()+1)
{
s+=chek[0];
}
if(ans==s.size()+2)
{
s+=chek[1];
}
}
if(N!=1)
{
string rn=s+"A"+s+"B";
ans=press(rn);
if(ans==s.size()+1)
{
rn=s+"A";
ans=press(rn);
if(ans==s.size()+1)
s+="A";
else
s+="B";
}
else
{
rn=s+"X";
ans=press(rn);
if(ans==s.size()+1)
s+="X";
else
s+="Y";
}
}
return s;
}
