Submission #1084859

#TimeUsernameProblemLanguageResultExecution timeMemory
1084859AliyyiakbarCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" #include "combo.h" using namespace std; string guess_sequence(int n) { string res = ""; set<string>st = {"A","B","X","Y"}; string str = ""; if (press("A")) { res += "A"; str += "A"; st.erase("A"); } else if (press("B")) { res += "B"; str += "B"; st.erase("B"); } else if (press("X")) { res += "X"; str += "X"; st.erase("X"); } else { res += "Y"; str += "Y"; st.erase("Y"); } bool f = 0; for (int i = 2; i <= n; ++i) { f = 0; for (auto x : st) { if (press(res + x) > i-1) { res += x; f = 1; break } } if (!f) { res += str; } } return res; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:44:22: error: expected ';' before '}' token
   44 |                 break
      |                      ^
      |                      ;
   45 |             }
      |             ~