Submission #484805

#TimeUsernameProblemLanguageResultExecution timeMemory
484805MohamedFaresNebiliCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")
/// #include "combo.h"

        using namespace std;

        using ll  = long long;
        using vi  = vector<int>;

        #define pb push_back
        #define ff first
        #define ss second
        #define lb lower_bound
        #define all(x) (x).begin() , (x).end()

        string guess_sequence(int N) {
            string lett = "ABXY";
            string p = ""; int first;
            for(int l = 0; l < 4; l++) {
              	p = "";
                for (int i = 0; i < N; ++i) p += lett[l];
                if(press(p)) {
                    first = l;
                    break;
                }
            }
            for(int i = 1; i < N; i++) {
                bool found = 0;
                for(int l = 0; l < 3; l++) {
                    if(l == first) continue;
                    p[i] = lett[l];
                    if(press(p) == i+1) { found = 1; break; }
                }
                if(!found) p[i] = lett[3];
            }
            return p;
        }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:23:20: error: 'press' was not declared in this scope
   23 |                 if(press(p)) {
      |                    ^~~~~
combo.cpp:33:24: error: 'press' was not declared in this scope
   33 |                     if(press(p) == i+1) { found = 1; break; }
      |                        ^~~~~