Submission #756141

#TimeUsernameProblemLanguageResultExecution timeMemory
756141thinknoexitCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h" std::string guess_sequence(int N) { std::string ans = ""; char c[4] = { 'A','B','X','Y' }; for (int i = 1;i < N;i++) { int mx = 0, idx = 0; for (int j = 0;j < 4;j++) { std::string p = ""; for (int k = 0;k < 4;k++) { p += c[k] + ans + c[j]; } int t = press(p); if (t > mx) { mx = t; idx = j; } } ans += c[idx]; } for (int i = 0;i < 4;i++) { if (guess(c[i] + ans) == N) { return c[i] + ans; } } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:22:9: error: 'guess' was not declared in this scope
   22 |     if (guess(c[i] + ans) == N) {
      |         ^~~~~
combo.cpp:4:21: warning: control reaches end of non-void function [-Wreturn-type]
    4 |   std::string ans = "";
      |                     ^~