Submission #1369616

#TimeUsernameProblemLanguageResultExecution timeMemory
1369616hasan콤보 (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

vector<char> kk,k={'A','B','X','Y'};

string guess_sequence(int n){
    int cnt=0;
    string ans="";
    for(int i=0; i<n; i++){
        if(i==0){
            int j=0;
            ans.push_back(k[j]);
            while(j<3 && press(ans)!=ans.size()){
                j++;
                cnt++;
                ans.pop_back();
                ans.push_back(k[j]);
            }
            for(int r=0; r<4; r++)
                if(j!=r) kk.push_back(k[r]);
        }
        else{
            int j=0;
            ans.push_back(kk[j]);
            while(j<2 && press(ans)!=ans.size()){
                j++;
                cnt++;
                ans.pop_back();
                ans.push_back(kk[j]);
            }
        }
    }
    return ans;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:13:26: error: 'press' was not declared in this scope
   13 |             while(j<3 && press(ans)!=ans.size()){
      |                          ^~~~~
combo.cpp:25:26: error: 'press' was not declared in this scope
   25 |             while(j<2 && press(ans)!=ans.size()){
      |                          ^~~~~