제출 #282775

#제출 시각아이디문제언어결과실행 시간메모리
282775fvdqyxm콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include <string> using namespace std; /* int press(string p){ */ /* int ans; */ /* cin >> ans; */ /* return ans; */ /* cout.flush(); */ /* } */ string guess_sequence(int N) { string cur = ""; string options = "ABXY"; string ans = ""; for(int i = 1; i <= N; i++) { for(int j = 0; j < 4; j++){ cur += options[j]; cout << cur << endl; int ans = press(cur); if(ans == i) { ans += options[j]; break; } else{ cur.pop_back(); } } } return ans; } /* int main () { */ /* int N; */ /* cin >> N; */ /* cout << guess_sequence(N) << '\n'; */ /* } */

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:23: error: 'press' was not declared in this scope
   20 |             int ans = press(cur);
      |                       ^~~~~