# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
642727 | TimDee | Brperm (RMI20_brperm) | C++17 | 124 ms | 6512 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 <bits/stdc++.h>
using namespace std;
string S;
void init(int n, const char s[]) {
for (int i=0; i<n; ++i) S.push_back(s[i]);
}
int query(int ind, int k) {
//++k;
for (int i=ind; i<ind+(1ll<<k); ++i) {
int j=0;
for (int b=0; b<k; ++b) {
j+=(((i-ind)>>b)&1)<<(k-1-b);
}
//cout<<i<<' '<<j<<'\n';
if ((j+ind>=S.length()) || (i>>S.length())) return 0;
if (S[i]!=S[j+ind]) return false;
}
return true;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int a, int b) {
return a+(rng()%(b-a+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... |