제출 #1338901

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

#define boost() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define fo freopen((NAME+".INP").c_str(), "r", stdin), freopen((NAME+".OUT").c_str(), "w", stdout)
#define dd long double
#define pii pair<int , int>
#define pb push_back
#define pf push_front
#define ppf pop_front
#define ppb pop_back
#define in insert
#define lb lower_bound
#define ub upper_bound
#define FOR(i , l , r) for(int i = (l) ; i <= (r) ; i ++)
#define FOD(i , r , l) for(int i = (r) ; i >= (l) ; i --)
#define endl '\n'
#define all(x) x.begin() , x.end()
#define sz(a) (int)a.size()
#define fi first
#define se second
#define mp make_pair

using namespace std;

const string NAME = "";
vector<char> ss = {'X' , 'Y' , 'A' , 'B'};


string guess_sequence(int n) {
    string s = "";
    s = "AB";
    if(press(s) == 0){
        if(press("X") == 0) s = "Y";
        else s = "X";
    }
    else {
        if(press("A") == 0) s = "B";
        else s = "A";
    }
    if(n == 1) return s;
    for(auto v : ss) {
        if(v == s[0]) continue;
        int len = sz(s);
        if(len == n) break;
        if(pres(s + v) == len + 1) s += v;
    }

    return s;
}



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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:32:8: error: 'press' was not declared in this scope
   32 |     if(press(s) == 0){
      |        ^~~~~
combo.cpp:45:12: error: 'pres' was not declared in this scope
   45 |         if(pres(s + v) == len + 1) s += v;
      |            ^~~~