This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "brperm.h"
#include <string.h>
#define N 500000
char cc[N + 1];
void init(int n, const char *cc_) {
memcpy(cc, cc_, n * sizeof *cc_);
}
int query(int i_, int k) {
int n_ = 1 << k;
for (int i = 0, j = 1; j < n_; j++) {
for (int m = n_ >> 1; ((i ^= m) & m) == 0; m >>= 1)
;
if (cc[i_ + i] != cc[i_ + j])
return 0;
}
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |