#include "prison.h"
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> devise_strategy(int N)
{
vector<vector<int>> p(13 * 3 - 2, vector<int>(N+1, 1));
int bit = 13;
for (int i = 0; i < 13 * 3 - 2; i++)
{
if (i % 3 == 0)
{
p[i][0] = 0;
bit--;
for (int j = 1; j <= N; j++)
{
if (j & (1 << bit))
p[i][j] = i + 2;
else
p[i][j] = i + 1;
}
}
else if (i % 3 == 1)
{
for (int j = 1; j <= N; j++)
{
if (j & (1 << bit))
p[i][j] = -1;
else
p[i][j] = i + 2;
}
}
else
{
for (int j = 1; j <= N; j++)
{
if (j & (1 << bit))
p[i][j] = i + 1;
else
p[i][j] = -2;
}
}
}
for (int i = 1; i <= N; i++)
{
if (p.back()[i] == 37)
p.back()[i] = -1;
else
p.back()[i] = -2;
}
return p;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 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 |
2 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
2 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 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 |
6 ms |
968 KB |
Output is partially correct |
5 |
Partially correct |
11 ms |
1368 KB |
Output is partially correct |
6 |
Partially correct |
12 ms |
1628 KB |
Output is partially correct |
7 |
Partially correct |
17 ms |
1624 KB |
Output is partially correct |
8 |
Partially correct |
0 ms |
348 KB |
Output is partially correct |
9 |
Partially correct |
1 ms |
348 KB |
Output is partially correct |
10 |
Partially correct |
3 ms |
596 KB |
Output is partially correct |
11 |
Partially correct |
9 ms |
860 KB |
Output is partially correct |
12 |
Partially correct |
13 ms |
1372 KB |
Output is partially correct |