This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Bismillahirrahmanirrahim
#include "combo.h"
#include<bits/stdc++.h>
#define fori(A,B,C) for(int A=B; A<C; ++A)
#define ford(A,B,C) for(int A=B; A>=C; --A)
#define fi first
#define se second
#define pb push_back
#define pbp(A,B) pb({A,B})
#define pp(A,B) push({A,B})
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
const int maxn = 1e6 +7, inf = 1e9 +7, mod = 1e9 +7;
string guess_sequence(int N) {
int k;
string S,button,p;
k = press("AB");
if(k == 2)
S = "A", button = "BXY";
else if(k == 1) {
if(press("A") == 1)
S = "A", button = "BXY";
else
S = "B", button = "AXY";
}
else {
if(press("X") == 1)
S = "X", button = "ABY";
else
S = "Y", button = "ABX";
}
fori(i,1,N-1) {
p = (S + button[0]) + (S + button[1] + button[0]) + (S + button[1] + button[1]) + (S + button[1] + button[2]);
k = press(p);
if(k == i)
S += button[2];
else if(k == i+1)
S += button[0];
else
S += button[1];
}
if(N == 1)
return S;
if(press(S + button[0]) == N)
S += button[0];
else if (press(S + button[1]) == N)
S += button[1];
else
S += button[2];
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |