# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
645991 | Vanilla | Brperm (RMI20_brperm) | C++17 | 3049 ms | 2216 KiB |
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>
#include "brperm.h"
using namespace std;
const int maxn = 1e5 + 2;
int n;
string s = "";
int rev (int x, int k) {
int b = 0;
for (int i = 0; i < k; i++){
if ((1 << (k - i - 1)) & x) b+=(1 << i);
}
return b;
}
void init(int N, const char S[]) {
n = N;
s = "";
for (int i = 0; i < n; i++){
s.push_back(S[i]);
}
return;
}
int query(int l, int k) {
if (l + (1 << k) > n) return 0;
bool f = 1;
for (int i = l; i <= l + (1 << k) - 1; i++){
if (s[i] != s[rev(i - l, k) + l]) return 0;
}
return 1;
}
Compilation message (stderr)
# | 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... |