제출 #154058

#제출 시각아이디문제언어결과실행 시간메모리
154058nthoangCombo (IOI18_combo)C++11
컴파일 에러
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;
    }
  }
}

컴파일 시 표준 에러 (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 | }
      | ^