#include "prison.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define mp make_pair
#define pb push_back
using namespace std;
ll set_on(int n, int k){
return (n |= 1 << k);
}
ll set_off(int n, int k){
return (n &= ~(1UL << k));
}
bool check_bit(int n, int k){
int bit = (n >> k) & 1U;
if(bit == 1)
return true;
return false;
}
vector<vector<int>> devise_strategy(int N) {
vector<vector<int> > s(25, vector<int>(N+1));
s[0][0] = 0;
for(int i = 1; i <= N; i++){
for(int bit = 12; bit >= 0; bit--){
if(check_bit(i, bit)){
s[0][i] = bit+1; // od levo kon desno
break;
}
else
continue;
}
}
for(int i = 1; i <= 12; i++){
s[i][0] = 1;
for(int j = 1; j <= N; j++){
if(check_bit(j, i-1)){
for(int bit = i-2; bit >= 0; bit--){
if(check_bit(j, bit)){
s[i][j] = bit+13;
break;
}
}
}
else{
s[i][j]=-1;
}
}
}
for(int i = 13; i <= 24; i++){
s[i][0] = 0;
int x = i - 12;
for(int j = 1; j <= N; j++){
if(check_bit(j, x-1)){
for(int bit = x-2; bit >= 0; bit--){
if(check_bit(j, bit)){
s[i][j] = bit+1;
break;
}
}
}
else
s[i][j]=-2;
}
}
return s;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Strategy failed for N=2, A=2, B=1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Strategy failed for N=2, A=2, B=1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Strategy failed for N=3, A=2, B=1 |
2 |
Halted |
0 ms |
0 KB |
- |