Submission #154058

#TimeUsernameProblemLanguageResultExecution timeMemory
154058nthoang콤보 (IOI18_combo)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

#ifdef LOCAL
#include "/Users/nth842002/Library/debug.h"
int press(string p);
int main();
#endif

using namespace std;

const char moves[] = {'A', 'B', 'X', 'Y'};

string guess_sequence(int n) {
  for (int mask = 0; mask < (1 << (n + n)); mask++) {
    string s;
    s.resize(n);
    for (int i = 0, t = mask; i < n; i++) {
      s[i] = moves[t % 4];
      t /= 4;
    }
    if (press(s) == n) {
      return s;
    }
  }
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:21:9: error: 'press' was not declared in this scope
   21 |     if (press(s) == n) {
      |         ^~~~~
combo.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^