#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 2137
#endif
const int LOG = 12;
vector<vector<int>> devise_strategy(int n) {
vector<vector<int>> a(40, vector<int>(n + 1));
for (int i = 0; i <= LOG; i++) {
a[i][0] = 0;
for (int j = 1; j <= n; j++) {
int b = (j >> (LOG - i)) & 1;
a[i][j] = 13 + 2 * i + b;
}
}
for (int i = 0; i <= LOG; i++) {
for (int p = 0; p < 2; p++) {
a[13 + 2 * i + p][0] = 1;
for (int j = 1; j <= n; j++) {
int q = (j >> (LOG - i)) & 1;
a[13 + 2 * i + p][j] = p == 1 && q == 0 ? -2 : (p == 0 && q == 1 ? -1 : i + 1);
}
}
}
return a;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
3 ms |
540 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
2 ms |
348 KB |
Output is correct |
9 |
Correct |
2 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
344 KB |
Output is correct |
5 |
Correct |
2 ms |
568 KB |
Output is correct |
6 |
Correct |
3 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
2 ms |
532 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 |
860 KB |
Output is partially correct |
5 |
Partially correct |
12 ms |
1468 KB |
Output is partially correct |
6 |
Partially correct |
15 ms |
1768 KB |
Output is partially correct |
7 |
Partially correct |
15 ms |
1628 KB |
Output is partially correct |
8 |
Partially correct |
1 ms |
344 KB |
Output is partially correct |
9 |
Partially correct |
1 ms |
348 KB |
Output is partially correct |
10 |
Partially correct |
2 ms |
604 KB |
Output is partially correct |
11 |
Partially correct |
11 ms |
1012 KB |
Output is partially correct |
12 |
Partially correct |
12 ms |
1372 KB |
Output is partially correct |