# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
831376 | Mularstyle | Combo (IOI18_combo) | C++14 | 1 ms | 208 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"
#include<bits/stdc++.h>
using namespace std;
std::string guess_sequence(int n) {
string S;
string a;
///FIRST DIGIT
if(press("AB")==1){
if(press("A")==1)
S="A",a="BXY";
else
S="B",a="AXY";
}
else{
if(press("X")==1)
S="X",a="ABY";
else
S="Y",a="ABX";
}
if(n==1)
return S;
///MIDDLE
int cur=1;
while(S.length()<n-1)
{
int t=press(S+a[0]+S+a[1]+a[0]+S+a[1]+a[1]+S+a[1]+a[2]);
if(t==cur+1)
S+=a[0];
else if(t==cur+2)
S+=a[1];
else
S+=a[2];
cur++;
}
///FIND LAST DIGIT
if(press(S+"A"+S+"B")==n)
{
if(press(S+"A")==n)
S+="A";
else
S+="B";
}
else
{
if(press(S+"X")==n)
S+="X";
else
S+="Y";
}
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |