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>
using namespace std;
#define all(x) x.begin(),x.end()
int press(std::string p);
std::string guess_sequence(int N) {
string curr;
if(press("A")==1)curr="A";
else if(press("B")==1)curr="B";
else if(press("X")==1)curr="X";
else curr="Y";
vector<string> options;
if(curr[0]!='A')options.emplace_back("A");
if(curr[0]!='B')options.emplace_back("B");
if(curr[0]!='X')options.emplace_back("X");
if(curr[0]!='Y')options.emplace_back("Y");
for(int i=2;i<=N;i++){
if(press(curr+options[0])==i)curr+=options[0];
else if(press(curr+options[1])==i)curr+=options[1];
else curr+=options[2];
}
return curr;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |