제출 #90808

#제출 시각아이디문제언어결과실행 시간메모리
90808tpoppo콤보 (IOI18_combo)C++14
컴파일 에러
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; }

컴파일 시 표준 에러 (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")){
      |        ^~~~~