This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// moreflags=grader.cpp
// 8
#include "combo.h"
#include<algorithm>
#include<array>
std::string guess_sequence(int N) {
std::array<char, 4> characters; std::copy_n("YXBA", 4, characters.begin());
std::swap(characters[(bool)press("AB")*2+(bool)press("AX")], characters[0]);
std::string known; known.reserve(N); known+=characters[0];
while((int)known.size()<N-1){
known+=characters[press(known+characters[2]+
known+characters[3]+characters[1]+
known+characters[3]+characters[2]+
known+characters[3]+characters[3])-(int)known.size()+1];
}
if((int)known.size()==N-1){
known+=press(known+characters[1])==N ? characters[1]: press(known+characters[2])==N ?
characters[2]: characters[3];
}
return known;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |