Submission #1221872

#TimeUsernameProblemLanguageResultExecution timeMemory
1221872anonymous321Brperm (RMI20_brperm)C++20
50 / 100
3091 ms2020 KiB
#include "brperm.h" #include <bits/stdc++.h> using namespace std; string ss; int N; void init(int n, const char s[]) { ss = ""; N = n; for (int i = 0; i < n; i++) { ss += s[i]; } return; } int query(int i, int k) { if (i + (1 << k) > N) return false; bool b = true; for (int j = 0; j < (1 << k); j++) { int o = 0; for (int l = 0; l < k; l++) { if ((j >> l) & 1) o += 1 << (k - l - 1); } if (ss[j+i] != ss[o+i]) { b = false; return false; } } return true; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...