Submission #892674

#TimeUsernameProblemLanguageResultExecution timeMemory
892674Trisanu_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(32, vector<int>(N + 1, 0)); vector<int> pw(10, 1); for(int i = 1; i < 10; i++) pw[i] = pw[i - 1] * 3; for(int i = 0; i < 32; i++){ int x = i / 8; if(x == 0) ans[i][0] = 0; else ans[i][0] = 1; for(int j = 1; j <= N; j++){ int idx = 7 - (i % 8); int b = (j % pw[idx + 1]) / pw[idx]; if(x == 0) ans[i][j] = (7 - idx) + (b + 1)*8; else if(b > x - 1) ans[i][j] = -1; else if(b < x - 1) ans[i][j] = -2; else ans[i][j] = 8 - pos; } } return ans; }

Compilation message (stderr)

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:18:34: error: 'pos' was not declared in this scope; did you mean 'pow'?
   18 |             else ans[i][j] = 8 - pos;
      |                                  ^~~
      |                                  pow