| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1283891 | hoangnoobpro | Combo (IOI18_combo) | C++20 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define nmax 1000007
#define fi first
#define se second
#define ll int
ll t=1,n,m,i,j,d=0,x=0,k=0,y,z,a[nmax],f[nmax];
string S,s1;
vector<char>v;
char t1,t2,t3,t4;
string guess_sequence(int N)
{
S="AB";
x=press(S);
if(x==1)
{
S="A";
y=press(S);
if(y==1)t1='A';
else t1='B';
}
else
{
S="X";
y=press(S);
if(y==1)t1='X';
else t1='Y';
}
S="";
S+=t1;
for(i='A';i<='Z';++i)
{
if(i=='A'||i=='B'||i=='X'||i=='Y')
{
if(i!=t1)
{
v.push_back(char(i));
}
}
}
for(i=2;i<=N;++i)
{
s1=S;
s1+=v[0];
s1+=S;s1+=v[1];s1+=v[0];
s1+=S;s1+=v[1];s1+=v[1];
s1+=S;s1+=v[1];s1+=v[2];
x=press(s1);
if(x==S.size()+1)
{
S+=v[0];
continue;
}
if(x==S.size())
{
S+=v[2];
continue;
}
S+=v[1];
continue;
}
return S;
}
