Submission #1017074

#TimeUsernameProblemLanguageResultExecution timeMemory
1017074eldorbek_008Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define len(x) (int)(x).size() std::string guess_sequence(int N) { string a; int x = press("AB"); if (x > 0) { x = press("B"); if (x > 0) { a = "B"; } else { a = "A"; } } else { x = press("Y"); if (x > 0) { a = "Y"; } else { a = "X"; } } string r = ""; string l = "ABXY"; for (int i = 0; i < 4; i++) { if (l[i] != a[0]) { r += l[i]; } } for (int i = 0; i < N - 2; i++) { string cur = a + r[1] + a + r[0] + r[1] + a + r[0] + r[0] + a + r[0] + r[2]; int y = press(cur); if (y == len(a) + 1) { a += r[1]; // only a + r[1] can make len(a) + 1 } else if (y == len(a) + 2) { a += r[0]; // next char must be r[0] } else { a += r[2]; // last choice } } string last = a + r[0] + a + r[1]; x = guess(last); if (x == len(a) + 1) { last = a + r[0]; x = guess(last); if (x == len(a)) { a += r[1]; } else { a += r[0]; } } else { a += r[2]; } return a; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:45:7: error: 'guess' was not declared in this scope
   45 |   x = guess(last);
      |       ^~~~~