Submission #670666

#TimeUsernameProblemLanguageResultExecution timeMemory
670666Essa2006콤보 (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define endl '\n'
#define FF first
#define SS second
#define all(a) a.begin(), a.end()
#define mod (ll)(1000000007)

string ans="";
string guess_sequence(int n){
    string a="ABXY";
    char c;
    for(int i=0;i<4;i++){
        if(press(a[i]))
            ans.push_back(a[i]), c=a[i];
    }
    string b=a;
    a="";
    for(int i=0;i<4;i++){
        if(b[i]!=c)
            a.push_back(b[i]);
    }
    for(int i=1;i<n;i++){
        for(int j=0;j<3;j++){
            if(press(ans+b[j])==i+1){
                ans.push_back(b[j]);
                break;
            }
        }
    }
    return ans;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:15:12: error: 'press' was not declared in this scope
   15 |         if(press(a[i]))
      |            ^~~~~
combo.cpp:26:16: error: 'press' was not declared in this scope
   26 |             if(press(ans+b[j])==i+1){
      |                ^~~~~