제출 #1355406

#제출 시각아이디문제언어결과실행 시간메모리
1355406seasonz콤보 (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
string find_first()
{
  if (press("AB"))
  {
    if (press("A")) return "A";
    else return "B";
  }
  else
  {
    if (press("X")) return "X";
    else return "Y";
  }
}
void add_next(string &cur, vector<string> &avail, int &now, int N)
{
  if (cur.size() == N) return;
  string ttry = cur + avail[0] + avail[0] + cur + avail[0] + avail[1] + cur + avail[1];
  int out = press(ttry);
  if (out - now == 2) cur += avail[0];
  else if (out - now == 1) cur += avail[1];
  else cur += avail[2];
  now++;
  add_next(cur, avail, now, N);
}
string guess_sequence(int N) {
  vector<string> vv = {"A", "B", "X", "Y"};
  vector<string> avail;
  string first = find_first();
  for (string ch : vv) if (ch != first) avail.push_back(ch);
  string cur = "" + first;
  int now = 0;
  add_next(cur, avail, now, Nd);
  return cur;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:35:29: error: 'Nd' was not declared in this scope; did you mean 'N'?
   35 |   add_next(cur, avail, now, Nd);
      |                             ^~
      |                             N