제출 #503675

#제출 시각아이디문제언어결과실행 시간메모리
503675cristi_a콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { vector<string> letters = {"A", "B", "X", "Y"}; string rez = ""; for(vector<string>::iterator i=letters.begin(); i!=letters.end(); i++) if(press(*i)) { rez = rez + *i; letters.erase(i); break; } for(int i=1; i<N; i++) { //cout << rez + letters[0] << " " << press(rez+letters[0]) << "\n"; //cout << rez + letters[1] << " " << press(rez+letters[1]) << "\n"; //cout << rez + letters[2] << " " << press(rez+letters[2]) << "\n\n"; if(press(rez+letters[0])==i+1) rez = rez + letters[0]; else if(press(rez+letters[1])==i+1) rez = rez + letters[1]; else rez = rez + letters[2]; } return rez; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:12: error: 'press' was not declared in this scope
    8 |         if(press(*i)) {
      |            ^~~~~
combo.cpp:18:12: error: 'press' was not declared in this scope
   18 |         if(press(rez+letters[0])==i+1) rez = rez + letters[0];
      |            ^~~~~