제출 #1263461

#제출 시각아이디문제언어결과실행 시간메모리
1263461piolk콤보 (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

vector<char> buttons={'A','B','X','Y'};

string guess_sequence(int N){
    string soFar;
    for (int i=0;i<4;i++){
        string b=string(1,buttons[i]);
        if (press(b)==1){
            soFar=b;
            break;
        }
    }

    while (soFar.size()<N){
        for (int i=0;i<4;i++){
            if (buttons[i]==soFar[0]) continue;

            if (press(soFar+buttons[i])>soFar.size()){
                soFar.push_back(buttons[i]);
                break;
            }
        }
    }
    return soFar;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:13: error: 'press' was not declared in this scope
   10 |         if (press(b)==1){
      |             ^~~~~
combo.cpp:20:17: error: 'press' was not declared in this scope
   20 |             if (press(soFar+buttons[i])>soFar.size()){
      |                 ^~~~~