# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
876550 | 2023-11-21T23:39:25 Z | MinaRagy06 | Brperm (RMI20_brperm) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "brperm.h" #include "grader.cpp" using namespace std; #define ll long long int rev(int x, int k) { int y = 0; for (int i = 0; i < k; i++) { y |= ((x >> (k - 1 - i)) & 1) << i; } return y; } char a[500'005]; void init(int n, const char s[]) { for (int i = 0; i < n; i++) { a[i] = s[i]; } } int query(int i, int k) { int ok = 1; for (int j = i; j < i + (1 << k); j++) { ok &= a[rev(j - i, k) + i] == a[j]; } return ok; } // int main() { // ios_base::sync_with_stdio(0), cin.tie(0); // int k; // cin >> k; // for (int i = 0; i < (1 << k); i++) { // cout << rev(i, k) << '\n'; // } // return 0; // } //