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;
char V[4] = {'A', 'B', 'X', 'Y'};
char Stiva[30];
int T;
string Sol;
static inline void Go (int Level, int N)
{
if((int)(Sol.size()))
return;
if(Level > 4 * N)
return;
if(Level)
{
string ans;
for(int i = 1; i < Level; ++i)
ans.push_back(Stiva[i]);
if(press(ans) == N)
{
Sol = ans;
return;
}
}
for(int i = 0; i < 4; ++i)
if(T != i)
{
Stiva[Level] = V[i];
Go(Level + 1, N);
}
return;
}
string guess_sequence (int N)
{
if(N == 3)
{
for(int i = 0; i < 4; ++i)
{
T = i;
Stiva[1] = V[i];
Go(2, N);
}
return Sol;
}
else
{
}
return "A";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |