Submission #544561

#TimeUsernameProblemLanguageResultExecution timeMemory
544561LunaMemeCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> ii; typedef vector<pair<int, int>> vii; typedef vector<int> vi; typedef long long ll; #define PB push_back #define MP make_pair #define FOR(i, x, y) for (ll i = x; i < y ; i ++) string guess_sequence(int n){ string s; string l[] = {"A", "B", "X", "Y"}; string start; vector<string> m; FOR(i, 0, 4){ if (press(l[i])) s = l[i]; else m.PB(l[i]); } start = s; int num = 1; string check = start + m[0] + m[2] + start + m[1] + m[2]; while (num < n){ int guess = press(s + check); if (guess == 0){ s += m[2]; num ++; } else if (guess == 1){ if (press(s + m[0])) s += m[0]; else s += m[1]; if (press(s + m[0])) s += m[0]; else s += m[1]; num += 2; } else{ if (press(s + m[0])) s += (m[0] + m[2]); else s += (m[1] + m[2]); num += 2; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:13: error: 'press' was not declared in this scope
   17 |         if (press(l[i])) s = l[i];
      |             ^~~~~
combo.cpp:24:21: error: 'press' was not declared in this scope
   24 |         int guess = press(s + check);
      |                     ^~~~~