#include "bits/stdc++.h"
#define debug(...) 42
using namespace std;
#ifndef LOCAL
#include "floppy.h"
#else
void init(int n, const char s[]);
int query(int i, int k);
#endif
string s;
void init(int N, const char S[]) {
s = string(S, S + N);
}
int query(int i, int k) {
for (int j = 0; j < (1 << k); j++) {
auto t = bitset<32>(j).to_string();
reverse(t.begin(), t.end());
swap(t[0], t[k - 1]);
reverse(t.begin(), t.end());
int k = bitset<32>(t).to_ulong();
debug(j, k);
debug(s);
debug(i + j);
debug(i + k);
debug(s[i + j], s[i + k]);
if (s[i + j] != s[i + k]) {
return false;
}
}
return true;
}
#ifdef LOCAL
char __s[(int)5e5 + 10] = {};
int main() {
cin >> __s;
init(strlen(__s), __s);
int __x, __y;
while (cin >> __x >> __y)
cout << query(__x, __y) << '\n';
return 0;
}
#endif
Compilation message
brperm.cpp:6:10: fatal error: floppy.h: No such file or directory
6 | #include "floppy.h"
| ^~~~~~~~~~
compilation terminated.