#include <bits/stdc++.h>
#include "brperm.h"
#ifdef MINA
#include "grader.cpp"
#endif
using namespace std;
#define ll long long
int rev(int x, int k) {
int y = 0;
for (int i = 0; i < k; i++) {
y |= ((x >> (k - 1 - i)) & 1) << i;
}
return y;
}
char a[500'005];
int N;
void init(int n, const char s[]) {
for (int i = 0; i < n; i++) {
a[i] = s[i];
}
N = n;
}
int query(int i, int k) {
int ok = 1;
for (int j = i; j < i + (1 << k); j++) {
assert(rev(j - i, k) + i < N && j < N);
ok &= a[rev(j - i, k) + i] == a[j];
}
return ok;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
2396 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |