Submission #839597

#TimeUsernameProblemLanguageResultExecution timeMemory
839597sleepntsheep콤보 (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <string>
#include <vector>
using namespace std;

#define BUT "ABXY"

string guess_sequence(int N)
{
    string ans(2005, 0);
    int j = 0;
    vector<int> non(2005, 0);

    for (int i = 0; i < 4; ++i)
    {
        ans[0] = BUT[i];
        ans[1] = 'A';
        int k = press(ans);
        if (k >= 1) ++j, non[1] |= 1;
        if (k == 2) ++j;
    }

    for (int i = j; i < N;)
    {
        int nxt = i + 1;
        for (int j = 0; j < 4; j++)
        {
            if (non[i] & (1 << j)) continue;
            ans[i] = BUT[j];
            ans[i+1] = 'A';
            int k = press(ans);
            if (k >= i + 1) { non[i+1] |= 1; }
            if (k == i + 2) { nxt = i + 2; }
            if (k >= i + 1) goto FND;
        }
FND:;
    i = nxt;
    }
    return ans;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:17: error: 'press' was not declared in this scope
   17 |         int k = press(ans);
      |                 ^~~~~
combo.cpp:30:21: error: 'press' was not declared in this scope
   30 |             int k = press(ans);
      |                     ^~~~~