#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> devise_strategy(int N){
vector<vector<int>> s(40, vector<int>(N+1));
s[0][0]=0;
for (int i = 3; i-2 < 40; i++){
if(i%3==2) s[i-2][0]=0;
else s[i-2][0]=1;
}
for (int j = 1; j <= N; j++){
s[0][j]=1+((j&(1<<12))!=0);
}
for (int i = 3; i-2 < 40; i+=3){
for (int j = 1; j <= N; j++){
if(j&(1<<(12-(i/3-1)))) s[i-2][j]=-1;
else s[i-2][j]=i;
}
}
for (int i = 4; i-2 < 40; i+=3){
for (int j = 1; j <= N; j++){
if((j&(1<<(12-(i/3-1))))==0) s[i-2][j]=-2;
else s[i-2][j]=i-1;
}
}
for (int i = 5; i-2 < 40; i+=3){
for (int j = 1; j <= N; j++){
s[i-2][j]=min(39, i-1+((j&(1<<(12-(i/3))))!=0));
}
}
return s;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
600 KB |
Output is correct |
8 |
Correct |
2 ms |
348 KB |
Output is correct |
9 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Partially correct |
0 ms |
348 KB |
Output is partially correct |
3 |
Partially correct |
0 ms |
348 KB |
Output is partially correct |
4 |
Partially correct |
7 ms |
992 KB |
Output is partially correct |
5 |
Partially correct |
13 ms |
1368 KB |
Output is partially correct |
6 |
Partially correct |
16 ms |
1628 KB |
Output is partially correct |
7 |
Partially correct |
16 ms |
1624 KB |
Output is partially correct |
8 |
Partially correct |
1 ms |
348 KB |
Output is partially correct |
9 |
Partially correct |
2 ms |
348 KB |
Output is partially correct |
10 |
Partially correct |
2 ms |
604 KB |
Output is partially correct |
11 |
Partially correct |
6 ms |
860 KB |
Output is partially correct |
12 |
Partially correct |
13 ms |
1372 KB |
Output is partially correct |