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;
char a, b, c;
string guess_sequence(int N) {
string ans;
if(press("AB")){
if(press("A"))
ans = "A", a = 'B', b = 'X', c = 'Y';
else
ans = "B", a = 'A', b = 'X', c = 'Y';
} else {
if(press("X"))
ans = "X", a = 'A', b = 'B', c = 'Y';
else
ans = "Y", a = 'A', b = 'B', c = 'X';
}
int now = 1;
for(int i = 1; i < N - 1; i ++){
int ret = press(ans + a + a + ans + a + b + ans + a + c + ans + b);
if(ret == 0 + now)
ans += c;
if(ret == 1 + now)
ans += b;
if(ret == 2 + now)
ans += a;
now ++;
}
if(N > 1){
if(press(ans + a + ans + b) == N){
if(press(ans + a) == N)
ans += a;
else
ans += b;
} else
ans += c;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |