제출 #1314473

#제출 시각아이디문제언어결과실행 시간메모리
1314473eldorbek_008콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

string guess_sequence(int n) {
    string s = "";
    int c1 = guess("AB");
    int c2;
    if (c1 > 0) {
        c2 = press("A");
        if (c2 > 0) {
            s = "A";
        } else {
            s = "B";
        }
    } else {
        c2 = press("X");
        if (c2 > 0) {
            s = "X";
        } else {
            s = "Y";
        }
    }
    string p = s;
    string t = "ABXY";
    t.erase(t.find(p[0]));
    for (int i = 1; i <= n; i++) {
        string cur = s + t[0] + t[0] + s + t[0] + t[1] + s + t[0] + t[2] + s + t[1] + p;
        int c = press(cur);
        if (c == 0) {
            s += t[0];
        } else if (c == 1) {
            s += t[1];
        } else {
            s += t[2];
        }
    }
    return s;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:14: error: 'guess' was not declared in this scope
    7 |     int c1 = guess("AB");
      |              ^~~~~