Submission #1201969

#TimeUsernameProblemLanguageResultExecution timeMemory
1201969bynixPrisoner Challenge (IOI22_prison)C++20
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" #include "prison.h" using namespace std; vector<vector<int>> devise_strategy(int N){ vector<vector<int>> strategy; for (int i = 0; i <= 24; i++) { vector<int> J(N + 1); if (i == 0){ J[0] = 1; for (int j = 1; j <= N; j++) J[j] = encode(j, 8); } else { auto [p, pos] = decode(i); J[0] = pos & 1; for (int j = 1; j <= N; j++){ int c = b3(j, pos); if (c < p) J[j] = -1 - pos % 2; else if (c > p) J[j] = pos % 2 - 2; else J[j] = encode(j, pos - 1); } } strategy.push_back(J); } return strategy; }

Compilation message (stderr)

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:11:43: error: 'encode' was not declared in this scope
   11 |       for (int j = 1; j <= N; j++) J[j] = encode(j, 8);
      |                                           ^~~~~~
prison.cpp:13:23: error: 'decode' was not declared in this scope
   13 |       auto [p, pos] = decode(i);
      |                       ^~~~~~
prison.cpp:16:17: error: 'b3' was not declared in this scope
   16 |         int c = b3(j, pos);
      |                 ^~
prison.cpp:19:21: error: 'encode' was not declared in this scope
   19 |         else J[j] = encode(j, pos - 1);
      |                     ^~~~~~