Submission #645991

#TimeUsernameProblemLanguageResultExecution timeMemory
645991VanillaBrperm (RMI20_brperm)C++17
50 / 100
3049 ms2216 KiB
#include <bits/stdc++.h> #include "brperm.h" using namespace std; const int maxn = 1e5 + 2; int n; string s = ""; int rev (int x, int k) { int b = 0; for (int i = 0; i < k; i++){ if ((1 << (k - i - 1)) & x) b+=(1 << i); } return b; } void init(int N, const char S[]) { n = N; s = ""; for (int i = 0; i < n; i++){ s.push_back(S[i]); } return; } int query(int l, int k) { if (l + (1 << k) > n) return 0; bool f = 1; for (int i = l; i <= l + (1 << k) - 1; i++){ if (s[i] != s[rev(i - l, k) + l]) return 0; } return 1; }

Compilation message (stderr)

brperm.cpp: In function 'int query(int, int)':
brperm.cpp:27:8: warning: unused variable 'f' [-Wunused-variable]
   27 |   bool f = 1;
      |        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...