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>
using namespace std;
vector<vector<int> > devise_strategy(int n) {
vector<vector<int> > ans(n);
for(int i = 0; i < n; i++) {
if(i == 0)
ans[i].push_back(0);
else
ans[i].push_back(1);
for(int j = 1; j <= n; j++) {
if(i == 0) {
if(j == 1)
ans[i].push_back(-1);
else if(j == n)
ans[i].push_back(-2);
else
ans[i].push_back(j);
} else if(i == 1) {
if(j == 1)
ans[i].push_back(-2);
else if(j == n)
ans[i].push_back(-1);
else
ans[i].push_back(0);
} else {
if(i > j)
ans[i].push_back(-2);
else if(i == j)
ans[i].push_back(0);
else
ans[i].push_back(-1);
}
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |