제출 #787165

#제출 시각아이디문제언어결과실행 시간메모리
787165resolve100콤보 (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;

char chars[] = {'A', 'B', 'X', 'Y'};

string guess_sequence(int N){

    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;
}

int main(){
    read_file;
    int t; cin >> t;
    while (t--){
        solve();
    }
    return 0;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:19: error: 'press' was not declared in this scope
   17 |         int num = press(to_string(chars[i]));
      |                   ^~~~~
combo.cpp:28:23: error: 'press' was not declared in this scope
   28 |             int num = press(out+chars[j]);
      |                       ^~~~~
combo.cpp: In function 'int main()':
combo.cpp:40:5: error: 'read_file' was not declared in this scope
   40 |     read_file;
      |     ^~~~~~~~~
combo.cpp:43:9: error: 'solve' was not declared in this scope
   43 |         solve();
      |         ^~~~~