#include "prison.h"
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define en '\n'
#define all(a) a.begin() , a.end()
#define fi first
#define se second
using namespace std;
vector<vector<int>> devise_strategy(int N) {
vector<vector<int>> v(40, vector<int> (N + 1));
for(ll i = 0; i <= 39; ++i){
if(i < 10){
v[i][0] = 0;
}else v[i][0] = 1;
}
for(ll i = 0; i <= 39; ++i){
for(ll j = 1; j <= N; ++j){
int x = j;
int ind = i % 10;
int nd;
while(ind >= 0){
nd = x % 3;
x /= 3;
ind--;
}
ind = i % 10;
nd++;
if(i >= 10){
int pind = i / 10;
if(nd > pind) v[i][j] = -1;
else if(nd < pind) v[i][j] = -2;
else{
v[i][j] = ind + 1;
}
}else{
v[i][j] = nd * 10 + ind;
}
}
}
return v;
}
// int main(){
// int n; cin >> n;
// int a, b; cin >> a >> b;
// vector<vector<int>> v = devise_strategy(n);
// }
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |