Submission #1142368

#TimeUsernameProblemLanguageResultExecution timeMemory
1142368FZ_LaabidiCombo (IOI18_combo)C++20
0 / 100
0 ms412 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string P = ""; set<char> tr = {'A', 'B', 'X', 'Y'}; int c = press("AB"); if(c>=1) { c = press("A"); if (c==1)P+="A"; else P+="B"; } else if (c==0) { c = press("X"); if (c==1)P+="X"; else P+="Y"; } tr.erase(P[0]); char B, X, Y; c=0; for (auto x: tr) { if (c==0)B = x; if (c==1)X = x; if (c==2)Y = x; c++; } for (int i=1; i<=N-2; i++) { string ty = P + X + P + B + X + P + B + Y + P + B + B; c = press(ty); if (c==1)P+=X; else if (c==2)P+=B; else P+=Y; } string ty= P+X+P+B; c = press(ty); if (c==1) { c = press(P+X); if (c==1)P+=X; else P+=B; } else P+=Y; return P; } //Cbx-2bx=0 // bx=0;
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...