Submission #342195

#TimeUsernameProblemLanguageResultExecution timeMemory
342195DoxenoCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define mp make_pair
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;

string guess_sequence(int N){
    string s;
    s.resize(1);
    if(press ("XY") > 0){
        if(press("X") > 0)s[0] = 'X';
        else s[0] = 'Y';
    }else{
        if(press("A") > 0)s[0] = 'A';
        else s[0] = 'B';
    }
    vector<char> k = {'A','B','X','Y'};
    for(int i = 1; i < 4; i++)if(k[i] == s[0]) swap(k[0],k[i]);
    for(int i = 1; i < N-1; i++){
        string q = s;
        q+=k[1];
        q+=s+k[2]+k[1];
        q+=s+k[2]+k[2];
        q+=s+k[2]+k[3];
        int kek = press(q);
        if(kek == i){
            s.pb(k[3]);
        }else if(kek == i+1){
            s.pb(k[1]);
        }else{
            s.pb(k[2]);
        }
    }
    if(press(s+k[1]) == N){
        s.pb(k[1]);
    }else if(press(s+k[2]) == N){
        s.pb(k[2]);
    }else{
        s.pb(k[3]);
    }
    return s;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:8: error: 'press' was not declared in this scope
   16 |     if(press ("XY") > 0){
      |        ^~~~~
combo.cpp:31:19: error: 'press' was not declared in this scope
   31 |         int kek = press(q);
      |                   ^~~~~
combo.cpp:40:8: error: 'press' was not declared in this scope
   40 |     if(press(s+k[1]) == N){
      |        ^~~~~