Submission #892668

#TimeUsernameProblemLanguageResultExecution timeMemory
892668Trisanu_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(40, vector<int>(N + 1)); ans[0][0] = 0; for (int i = 3; i < 42; i++){ if(i % 3 == 2) ans[i - 2][0] = 0; else s[i - 2][0]=1; } for (int j = 1; j <= N; j++) ans[0][j] = 1 + ((j & (1 << 12)) != 0); for (int i = 3; i < 42; i += 3){ for (int j = 1; j <= N; j++){ if(j & (1 << (12 - (i / 3 - 1)))) ans[i - 2][j] = -1; else ans[i - 2][j] = i; } } for (int i = 4; i < 42; i += 3){ for (int j = 1; j <= N; j++){ if((j & (1 << (12 - (i / 3 - 1)))) == 0) ans[i - 2][j]= -2; else ans[i - 2][j] = i - 1; } } for (int i = 5; i < 42; i += 3) for (int j = 1; j <= N; j++) ans[i - 2][j] = min(39, i - 1 + ((j & (1 << (12 - (i / 3)))) != 0)); return ans; }

Compilation message (stderr)

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