# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
755113 | Stickfish | Brperm (RMI20_brperm) | C++17 | 3063 ms | 1908 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 "brperm.h"
#include <iostream>
#include <vector>
using namespace std;
int rvs_pos(int i, int k) {
int ans = 0;
for (int bt = 0; bt < k; ++bt) if (i & (1 << bt)) {
ans += 1 << (k - bt - 1);
}
return ans;
}
string s;
void init(int n, const char s0[]) {
s = "";
for (int i = 0; i < n; ++i)
s.push_back(s0[i]);
}
int query(int l, int k) {
if (l + (1 << k) > s.size())
return 0;
vector<char> a(1 << k);
vector<char> b(1 << k);
for (int i = 0; i < (1 << k); ++i) {
//cout << rvs_pos(i, k) << "(" << s[l + i] << ' ' << s[l + rvs_pos(i, k)] << ") ";
if (s[l + i] != s[l + rvs_pos(i, k)]) {
return 0;
}
}
//cout << endl;
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... |