Submission #1142370

#TimeUsernameProblemLanguageResultExecution timeMemory
1142370FZ_LaabidiCombo (IOI18_combo)C++20
Compilation error
0 ms0 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++; } int count =1; for (int i=0; i<=N-2; i++) { string ty = P + X + P + B + X + P + B + Y + P + B + B; c = press(ty); if (c==count)P+=X; else if (c==count)P+=B; else P+=Y; count++; } string ty= P+X+P+B; if (N>1) { c = press(ty); if (c==N) { c = press(P+X); if (c==N)P+=X; else P+=B } else P+=Y; } return P; } //Cbx-2bx=0 // bx=0;

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:45:22: error: expected ';' before '}' token
   45 |             else P+=B
      |                      ^
      |                      ;
   46 |         }
      |         ~