제출 #699498

#제출 시각아이디문제언어결과실행 시간메모리
699498khshg콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; string guess_sequence(int N) { vector<string> v = {"X", "Y", "A", "B"}; string ans; if(press(v[0] + v[1])) { if(press(v[0])) { ans = v[0]; } else { ans = v[1]; } } else { if(press(v[2])) { ans = v[2]; } else { ans = v[3]; } } v.erase(find(begin(v), end(v), ans)); for(int i = 2; i < N; ++i) { ans += v[i + 1 - press(ans + v[0] + v[0] + ans + v[0] + v[1] + ans + v[0] + v[2] + ans + v[1])]; } if(press(ans + v[0] + ans + v[1]) == N) { if(press(ans + v[0]) == N) { ans += v[0]; } else { ans += v[1]; } } else { ans += v[2]; } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:5: error: 'press' was not declared in this scope
    7 |  if(press(v[0] + v[1])) {
      |     ^~~~~
combo.cpp:22:20: error: 'press' was not declared in this scope
   22 |   ans += v[i + 1 - press(ans + v[0] + v[0] + ans + v[0] + v[1] + ans + v[0] + v[2] + ans + v[1])];
      |                    ^~~~~
combo.cpp:24:5: error: 'press' was not declared in this scope
   24 |  if(press(ans + v[0] + ans + v[1]) == N) {
      |     ^~~~~