제출 #986838

#제출 시각아이디문제언어결과실행 시간메모리
986838TsaganaCombo (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include "combo.h"
#include<bits/stdc++.h>

#define all(x) x.begin(), x.end()
#define pq priority_queue
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define eb emplace_back
#define F first
#define S second

using namespace std;

string guess_sequence(int N) {
  string S;
  string o;

  if (press("A")) {S = "A"; o = "BXY";}
  if (press("B")) {S = "B"; o = "AXY";}
  if (press("X")) {S = "X"; o = "ABY";}
  if (press("Y")) {S = "Y"; o = "ABX";}

  for (int i = 1; i < N-1; i++) {
      string tmp = S + o[0] + o[0] + S + o[0] + o[1] + S + o[0] + o[2] + S + o[1];
      int ct = press(tmp);
      if (ct == i+2) S += o[0];
      else if (ct == i+1) S += o[1];
      else S += o[2];
  }
  if (press(S + o[0]) == N) S += opt[0];
  if (press(S + o[1]) == N) S += opt[1];
  if (press(S + o[2]) == N) S += opt[2];
  return S;
}

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:31:34: error: 'opt' was not declared in this scope
   31 |   if (press(S + o[0]) == N) S += opt[0];
      |                                  ^~~
combo.cpp:32:34: error: 'opt' was not declared in this scope
   32 |   if (press(S + o[1]) == N) S += opt[1];
      |                                  ^~~
combo.cpp:33:34: error: 'opt' was not declared in this scope
   33 |   if (press(S + o[2]) == N) S += opt[2];
      |                                  ^~~