QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#138982 | #148. Brperm | bashkort# | 0 | 0ms | 0kb | C++20 | 706b | 2023-08-12 15:28:53 | 2024-07-04 01:38:19 |
answer
#include "brperm.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
namespace {
string st;
vector<int> rev;
}
void init(int n, const char s[]) {
st.resize(n);
for (int i = 0; i < n; ++i) {
st[i] = s[i];
}
return;
}
int query(int x, int k) {
assert(x + (1 << k) <= size(st));
int n = 1 << k;
rev.resize(n);
for (int i = 1; i < n; ++i) {
rev[i] = (rev[i >> 1] >> 1) + (i & 1) * n / 2;
}
for (int i = 0; i < n; ++i) {
if (x + rev[i] >= size(st)) {
return 0;
}
if (st[x + i] != st[x + rev[i]]) {
return 0;
}
}
return 1;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Runtime Error
Test #1:
score: 0
Runtime Error
input:
ykkubxafnylfriivjjqphltuagfkfcoigfcukuisdgufezomndodalbusgesraatkgnskdsiedfysodmsemmtjuoiezoaqljdodegogedjfpfwntljpgdhswtmqtwtpnbaawfumskuiwjodtsrlhblpunzqjkrzaakamjzyumkzfdjxwdkadgbwffjmldsfbhaltfnykbmvnxdkpfzsswpnmyyqpalsalaeqmqqivzqyhjgiiwfugmpxxsmkkgecuvrnlkujbyllhecpjsneluvsyckueeexhbtuhikfzuvw...
output:
result:
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Runtime Error
Test #6:
score: 0
Runtime Error
input:
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...
output:
result:
Subtask #4:
score: 0
Skipped
Dependency #1:
0%