Submission #668431

#TimeUsernameProblemLanguageResultExecution timeMemory
668431allin27xCombo (IOI18_combo)C++14
100 / 100
29 ms640 KiB
#include <iostream> using namespace std; int press(string p); string guess_sequence(int N){ string S = ""; if (press("AB")){ if (press("A")) S = "A"; else S = "B"; } else { if (press("X")) S = "X"; else S = "Y"; } if (N==1) return S; char A = 'A', B='B', C = 'X'; if (S=="A") A = 'Y'; else if (S=="B") B='Y'; else if (S=="X") C = 'Y'; int res; while ((int)S.size() < N-1){ res = press(S+A+S+B+A+S+B+B+S+B+C); if (res == (int)S.size()){ S+=C; } else if (res == (int)S.size()+1){ S+=A; } else { S+=B; } } if (press(S+A+S+B)==N){ if (press(S+A)==N) S+=A; else S+=B; } else { S+=C; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...