이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// 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... |