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 <bits/stdc++.h>
#define MAX 2500
void init(int n, const char s[]);
int query(int i, int k);
int inverte(int x,int k){
int ans=0;
for(int i=0;i!=k;++i){
int u = (k-1)-i;
if((1<<i)&x)ans+=1<<u;
}
return ans;
}
char vals[MAX];
void init(int n, const char s[]) {
for(int j=0;j!=n;++j){
vals[j]=s[j];
}
return;
}
int query(int i, int k) {
int sz = 1<<(k);
for(int j=0;j!=sz;++j){
int mirror = inverte(j,k);
if(vals[mirror+i]!=vals[j+i])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... |