# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
746345 | doowey | Brperm (RMI20_brperm) | C++17 | 3057 ms | 1976 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;
typedef long long ll;
typedef pair<int, int> pii;
#define fi first
#define se second
#define mp make_pair
vector<char> S;
void init(int n, const char s[]) {
for(int i = 0 ; i < n; i ++ ){
S.push_back(s[i]);
}
}
int query(int i, int k) {
int sz = (1 << k);
if(i + sz - 1 >= S.size()) return 0;
vector<char> A(sz), B(sz);
for(int j = 0 ; j < sz; j ++ ){
A[j] = S[i + j];
int f = 0;
for(int p = 0; p < k ; p ++ ){
if((j & (1 << p))){
f |= (1 << (k - p - 1));
}
}
B[f] = S[i + j];
}
return (A == B);
}
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... |