Submission #899551

#TimeUsernameProblemLanguageResultExecution timeMemory
899551SuPythonyCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>

std::string guess_sequence(int n) {
    std::string ans="";
    if (press("A")) ans="A";
    else if (press("B")) ans="B";
    else if (press("X")) ans="X";
    else ans="Y";
    std::string f=ans;
    int l=1;
    while (l<n) {
        if (f!="A"&&press(ans+"A")>l) {
            ans+="A";
        } else if (f!="B"&&press(ans+"B")>l) {
            ans+="B";
        } else if (f!="X"&&press(ans+"X")>l) {
            ans+="X";
        } else {
            ans+="Y";
        }
        l++;
    }
    return ans;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:5:9: error: 'press' was not declared in this scope
    5 |     if (press("A")) ans="A";
      |         ^~~~~
combo.cpp:12:21: error: 'press' was not declared in this scope
   12 |         if (f!="A"&&press(ans+"A")>l) {
      |                     ^~~~~