제출 #290552

#제출 시각아이디문제언어결과실행 시간메모리
290552user202729콤보 (IOI18_combo)C++17
100 / 100
41 ms624 KiB
// 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...