Submission #625591

#TimeUsernameProblemLanguageResultExecution timeMemory
625591gromperenPrisoner Challenge (IOI22_prison)C++17
Compilation error
0 ms0 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int N) { vector<vector<int>> s(N+1, vector<int>(N+1)); s[0][0] = 0; for (int i = 0; i <= n; ++i) { s[0][i] = i; } for (int i = 1; i <= n; ++i) { for (int j = 1; j <= n; ++j) { if (i < j) { s[i][j] = -1; } else { s[i][j] = -2; } } } return s; }

Compilation message (stderr)

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:10:23: error: 'n' was not declared in this scope
   10 |  for (int i = 0; i <= n; ++i) {
      |                       ^
prison.cpp:13:23: error: 'n' was not declared in this scope
   13 |  for (int i = 1; i <= n; ++i) {
      |                       ^