제출 #787166

#제출 시각아이디문제언어결과실행 시간메모리
787166resolve100콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define pb push_back
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)

using namespace std;

string guess_sequence(int N){
  
  	char chars[] = {'A', 'B', 'X', 'Y'};
    bool used[4]; for (int i = 0; i < 4; i++) used[i] = false;

    string out;
    for (int i = 0; i < 4; i++){
        int num = press(to_string(chars[i]));
        if (num){
            out.pb(chars[i]);
            used[i] = true;
            break;
        }
    }

    for (int i = 1; i < N; i++){
        for (int j = 0; j < 4; i++){
            if (used[j]) continue;
            int num = press(out+chars[j]);
            if (num > i){
                out.pb(chars[j]);
                break;
            }
        }
    }

    return out;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:19: error: 'press' was not declared in this scope
   16 |         int num = press(to_string(chars[i]));
      |                   ^~~~~
combo.cpp:27:23: error: 'press' was not declared in this scope
   27 |             int num = press(out+chars[j]);
      |                       ^~~~~