Submission #90808

#TimeUsernameProblemLanguageResultExecution timeMemory
90808tpoppoCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #ifndef EVAL #include "combo.h" #endif // EVAL using namespace std; int n; string pref; vector<char> valid ={'A','B','X','Y'}; void get_next(){ if(press(pref + valid[0] + pref + valid[1]) == pref.size()+1){ if(press(pref + valid[0]) == pref.size()+1){ pref += valid[0]; }else{ pref += valid[1]; } }else{ pref += valid[2]; } } string guess_sequence(int N) { n = N; if(press("AB")){ if(press("A")){ pref = "A"; valid.erase(valid.begin()); }else{ pref = "B"; valid.erase(valid.begin()+1); } }else{ if(press("X")){ pref = "X"; valid.erase(valid.begin()+2); }else{ pref = "Y"; valid.erase(valid.begin()+3); } } for(int i=1;i<n;i++) get_next(); return pref; }

Compilation message (stderr)

combo.cpp: In function 'void get_next()':
combo.cpp:14:8: error: 'press' was not declared in this scope
   14 |     if(press(pref + valid[0] + pref + valid[1]) == pref.size()+1){
      |        ^~~~~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:27:8: error: 'press' was not declared in this scope
   27 |     if(press("AB")){
      |        ^~~~~