Submission #411595

#TimeUsernameProblemLanguageResultExecution timeMemory
411595nichkeCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int press(string p); string guess_sequence(int N) { string but = "AB"; string res = ""; if (!press(but)) but = "XY"; char ff = but[0]; if (!press(but.substr(0, 1))) ff = but[1]; but = "ABXY"; string bt = ""; for (char c : but) { if (c == ff) continue; bt += c; } res += ff; if (n <= 1) { return res; } for (int i = 1; i < n; i++) { res += bt[press(res + bt[1] + res + bt[2] + bt[0] + res + bt[2] + bt[1] + res + bt[2] + bt[2]) - res.size()]; } return res; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:19:6: error: 'n' was not declared in this scope
   19 |  if (n <= 1) {
      |      ^
combo.cpp:22:22: error: 'n' was not declared in this scope
   22 |  for (int i = 1; i < n; i++) {
      |                      ^