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<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=5e5+7;
char T[LIM];
int n;
void init(int _n, const char s[]) {
n=_n;
rep(i, n) T[i]=s[i];
}
int odw(int x, int k) {
int y=0;
rep(i, k) if(x&(1<<i)) y+=1<<(k-i-1);
return y;
}
int query(int i, int k) {
if(i+(1<<k)>n) return 0;
rep(j, 1<<k) if(T[i+j]!=T[i+odw(j, k)]) 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... |