제출 #231717

#제출 시각아이디문제언어결과실행 시간메모리
231717Amy313콤보 (IOI18_combo)C++14
100 / 100
41 ms648 KiB
#include "combo.h" std::string guess_sequence(int N) { std::string a = "AB"; std::string s = ""; std::string m = ""; std::string n = ""; if(press("AB")>0) { if(press("A")>0) { s = "A"; m = "BXY"; } else { s = "B"; m = "AXY"; } } else { if(press("X")>0) { s = "X"; m = "ABY"; } else { s = "Y"; m = "ABX"; } } int d = 1; while(d<N-1) { n = s+m[0]+m[1]+s+m[0]+m[2]+s+m[0]+m[0]+s+m[1]; int num = press(n); if(num>=d+2) { s = s+m[0]; } if(num==d+1) { s = s+m[1]; } if(num==d) { s = s+m[2]; } n = ""; d++; } if(N==1) { return s; } if(press(s+m[0])>d) { s = s+m[0]; d++; } else { if(press(s+m[1])>d) { s = s+m[1]; } else { s = s+m[2]; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...