Submission #572095

#TimeUsernameProblemLanguageResultExecution timeMemory
572095srlabib콤보 (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
string guess_sequence(int n)
{
    string a = {'A','B','X','Y'};
    
    string ans,gues = "a";
    char ff = 'z';
    int l = 0,c = 0;
    for(int i  = 0; i<n; i++){
        for(int j = 0; j<4; j++)
        {
            if(a[j]==ff)continue;
            gues.pop_back();
            gues.push_back(a[j]);
            c = press(gues);
            if(i == 0){
                if(c>l)ff = a[j];
            }
            if(c>l){
                ans.push_back(a[j]);
                gues.push_back('a');
                continue;
            }
        }
    }

    return ans;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:17: error: 'press' was not declared in this scope
   16 |             c = press(gues);
      |                 ^~~~~