Submission #256854

#TimeUsernameProblemLanguageResultExecution timeMemory
256854lani1akeaCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { int x; string s; char ch[] = {'A', 'B', 'X', 'Y'}; if (press("AB")) x = press("A") != 1; else x = 2 + (press("X") < 1); s += ch[x]; swap(ch[x], ch[3]); for (int i = 1; i < N - 1; ++i) { x = press(s + ch[0] + ch[0] + s + ch[0] + ch[1] + s + ch[0] + ch[2] + s + c[2]); if (x == i + 2) s += ch[0]; else if (x == i + 1) s += ch[2]; else s += ch[1]; } if (press(s + ch[0] + s + ch[1]) == N) { if (press(s + ch[0]) == N) s + ch[0]; else s += ch[1]; } else s += ch[2]; return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:15:79: error: 'c' was not declared in this scope
   15 |     x = press(s + ch[0] + ch[0] + s + ch[0] + ch[1] + s + ch[0] + ch[2] + s + c[2]);
      |                                                                               ^