# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
924190 | Camillus | Floppy (RMI20_floppy) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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