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 <bits/stdc++.h>
#define ll long long
using namespace std;
std::vector<std::vector<int>> devise_strategy(int N) {
int n = N;
vector<vector<int>>s(n, vector<int>(n + 1, 0));
for(int i = 0; i <= n; ++i){
if(i == 0) s[0][i] = 0;
else if(i == 1 || i == n){
s[0][i] = (i == 1) ? -1 : -2;
}else{
s[0][i] = i - 1;
}
}
for(int i = 1; i < n; ++i){ // values of x
for(int j = 0; j <= n; ++j){
if(j == 0) s[i][j] = 1;
else if(j == 1 || j == n){
s[i][j] = (j == 1) ? -2 : -1;
}else{
s[i][j] = (j <= i) ? -2 : -1;
}
}
}
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... |