Submission #1081538

#TimeUsernameProblemLanguageResultExecution timeMemory
1081538faricaPrisoner Challenge (IOI22_prison)C++17
Compilation error
0 ms0 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; std::vector<std::vector<int>> devise_strategy(int N) { vector<vector<int>>ans(25, vector<int>(N+1, 0)); for(int i=0; i<25; ++i) { s[i][0] = i%2; for(int j=1; j<=N; ++j) { if(i > 12) { int bit = i - 12; if((1LL<<bit) & j) { --bit; if(!bit) { if(j%2) s[i][j] = -(i%2); else s[i][j] = -((i+1)%2); } else { if((1LL<<bit) & j) s[i][j] = bit + 12; else s[i][j] = bit; } } else s[i][j] = -((i+1)%2); } else { if((1LL<<i) & j) s[i][j] = -(i%2); else { int bit = i - 1; if(!bit) { if(j%2) s[i][j] = -(i%2); else s[i][j] = -((i+1)%2); } else { if((1LL<<bit) & j) s[i][j] = bit + 12; else s[i][j] = bit; } } } } } return ans; }

Compilation message (stderr)

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:10:9: error: 's' was not declared in this scope
   10 |         s[i][0] = i%2;
      |         ^