This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prison.h"
#include <vector>
using namespace std;
vector<vector<int>> devise_strategy(int N) {
vector<vector<int>> s(N+1, vector<int>(N+1));
s[0][0] = 0; // inspect bag A
for (int i = 1; i <= N; i++)
s[0][i] = i; // write i on board
for (int i = 1; i <= N; i++) {
// when sees i on board
s[i][0] = 1; // inspect bag B
for (int j = 1; j <= N; j++) {
// j in bag B
s[i][j] = i < j ? -1 : -2;
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |