# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
642661 | 2022-09-20T10:31:57 Z | TimDee | Brperm (RMI20_brperm) | C++17 | 0 ms | 0 KB |
#include "brperm.h" #include <bits/stdc++.h> using namespace std; char s[(int)5e5 + 10] = {}; string S; void init(int n, string s) { S=s; } int query(int ind, int k) { for (int i=ind; i<ind+(1<<k); ++i) { int j=0; for (int b=k-1; b>=0; --b) { j+=(((i-ind)>>b)&1)<<(k-1-b); } if (S[i]!=S[ind+j]) return 0; } return 1; }