Submission #892680

#TimeUsernameProblemLanguageResultExecution timeMemory
892680Trisanu_DasPrisoner Challenge (IOI22_prison)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; vector<vector<int> > devise_strategy(int N) { vector<vector<int> > ans(27, vector<int> (N + 1)); for(int i = 0; i < 27; i++) ans[i][0] = ((i + 1) >> 1) & 1; for(int i = 0; i < 27; i++) { for(int i = 1; i <= N; i++) { int ex = (i + 1) >> 1, case_ = i & 1; if((j & (1 << (13 - ex))) ^ case_) ans[i][j] = (case_ ^ (ex & 1)) ? -1 : -2; else ans[i][j] = min(2 * (ex + 1) - (j & (1 << (13 - ex - 1))), 26); } } return ans; }

Compilation message (stderr)

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:10:11: error: 'j' was not declared in this scope
   10 |       if((j & (1 << (13 - ex))) ^ case_) ans[i][j] = (case_ ^ (ex & 1)) ? -1 : -2;
      |           ^