# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
501180 | Kripton | Combo (IOI18_combo) | C++14 | 37 ms | 592 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>
#include "combo.h"
using namespace std;
string guess_sequence(int n)
{
if(n==1)
{
if(press("A")==0)
{
if(press("B")==0)
{
if(press("X")==0)
return "Y";
return "X";
}
return "B";
}
return "A";
}
else
{
string s="";
if (press("AB") == 0)
{
if (press("X") == 0)
s+="Y";
else
s+="X";
}
else
{
if (press("A") == 0)
s+="B";
else
s+="A";
}
char a,b,c;
if(s[0]=='A')
{
a='B';
b='X';
c='Y';
}
if(s[0]=='B')
{
a='A';
b='X';
c='Y';
}
if(s[0]=='X')
{
a='B';
b='A';
c='Y';
}
if(s[0]=='Y')
{
a='B';
b='X';
c='A';
}
for(int i=2; i<n; i++)
{
int q=press(s+a+s+b+a+s+b+c+s+b+b);
if(q==i)
s+=a;
else if(q==i+1)
s+=b;
else
s+=c;
}
int q=press(s+c);
if(q==n)
s+=c;
else
{
q=press(s+a);
if(q==n)
s+=a;
else
s+=b;
}
return s;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |