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;
using LL = long long;
const int INF = (int)1e9 + 7;
const int NS = (int)2e3 + 4;
std::string guess_sequence(int N) {
string ans, can;
if(press("AB")){
if(press("A")) ans += "A", can = "BXY";
else ans += "B", can = "AXY";
}
else{
if(press("X")) ans += "X", can = "ABY";
else ans += "Y", can = "ABX";
}
for(int i = 2; i <= N; ++i){
if(i < N){
int rv = press(ans + can[0] + ans + can[1] + can[0] + ans + can[1] + can[1] + ans + can[1] + can[2]);
if(rv == i) ans += can[0];
else if(rv == i + 1) ans += can[1];
else ans += can[2];
}
else{
int rv = press(ans + can[0]);
if(rv == i) ans += can[0];
else{
rv = press(ans + can[1]);
if(rv == i) ans += can[1];
else ans += can[2];
}
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |