Submission #1314469

#TimeUsernameProblemLanguageResultExecution timeMemory
1314469eldorbek_008Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

string guess_sequence(int n) {
    string s = "";
    int c1 = guess("AB");
    int c2;
    if (c1 > 0) {
        c2 = guess("A");
        if (c2 > 0) {
            s = "A";
        } else {
            s = "B";
        }
    } else {
        c2 = guess("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 = guess(cur);
        if (c == 0) {
            s += t[0];
        } else if (c == 1) {
            s += t[1];
        } else {
            s += t[2];
        }
    }
    return s;
}

Compilation message (stderr)

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