QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#221018 | #148. Brperm | Ahmed57# | 50 | 20ms | 36612kb | C++23 | 704b | 2023-10-21 02:07:46 | 2024-07-04 02:21:10 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#include "brperm.h"
string str;int lol[20][500001];
void init(int n, const char s[]){
for(int i = 0;i<n;i++){
str+=s[i];
}
for(int k = 0;(1<<k)<=n;k++){
for(int i = 0;i<(1<<k);i++){
for(int j = 0;j<k;j++){
if(i&(1<<j)){
lol[k][i]|=(1<<(k-j-1));
}
}
}
}
}
int query(int i,int k){
if(i+(1<<k)-1>str.size())return 0;
if(k==0)return 1;
int r =i+(1<<k);
for(int l = i;l<r;l++){
if(str[l]!=str[lol[k][l-i]+i]){
return 0;
}
}
return 1;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 13
Accepted
Test #1:
score: 13
Accepted
time: 0ms
memory: 22064kb
input:
ykkubxafnylfriivjjqphltuagfkfcoigfcukuisdgufezomndodalbusgesraatkgnskdsiedfysodmsemmtjuoiezoaqljdodegogedjfpfwntljpgdhswtmqtwtpnbaawfumskuiwjodtsrlhblpunzqjkrzaakamjzyumkzfdjxwdkadgbwffjmldsfbhaltfnykbmvnxdkpfzsswpnmyyqpalsalaeqmqqivzqyhjgiiwfugmpxxsmkkgecuvrnlkujbyllhecpjsneluvsyckueeexhbtuhikfzuvw...
output:
0 1 0 1 1 0 1 1 1 0 0 1 1 0 0 1 0 0 0 1 0 1 1 1 1 0 1 0 0 0 1 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1 1 0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 1 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0 0 0 0 1 0 0 1 1 1 1 1 0 ...
result:
ok 1000 lines
Test #2:
score: 0
Accepted
time: 3ms
memory: 19944kb
input:
qytnjgmxfvhrgflrfktkttxvrftktiffaimtwsuflrvflacgltptqwyhvtytpmtlcftxyudiogevzswhhzplvdrvjhvileplggptfgmgdvehzodzazxgmyzsdowekeldhyngdxaoidkjydlhyabgthtzyzdlwkovtmlfedeeketvdwypbxlplnqwldypolfrtzqmeaezhefeiekhsfykkikslcwehplfobxalbqioelvalobhnalvnilbibnloeinzjxcmbvltcrdvdcjrlbebjdecqlflejadfeizhvsylp...
output:
0 1 0 1 1 1 1 1 0 1 0 1 1 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 1 0 0 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 0 1 1 0 0 1 0 0 1 1 1 0 0 1 1 0 1 0 0 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 0 0 0 1 0 0 1 1 0 1 1 0 ...
result:
ok 1000 lines
Subtask #2:
score: 37
Accepted
Dependency #1:
100%
Accepted
Test #3:
score: 37
Accepted
time: 19ms
memory: 36564kb
input:
rsufzafbpxjkrmubvscneqiybldroqajxbazpqccqthkdqgsiukjicklhvisezmlrkofmplwgrpanulsknxxzuiovforkarjqwfqdsqmitupfumbsisykznbpvhvntpkfrzajusffhmopgxgrxtisguptwnkftwryxqzeifbyvrieczlfvpzfbxdpryejqmykjaehxmylarbpjgkxrumngzsmapsneinpczjoiaepikvgvvpnsoexvwnfimqarnmxnkcsfddmhgfylrepscljvyrnoprauklhbqxbslivtsr...
output:
0 1 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 1 1 0 1 0 1 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 1 0 1 0 0 1 1 1 1 1 1 1 1 0 0 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 1 1 0 1 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 1 1 0 1 0 0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 ...
result:
ok 100000 lines
Test #4:
score: 0
Accepted
time: 20ms
memory: 36612kb
input:
gqecxoexyofzehscrttbsvrrffnonisgyqzjraxdeesuffbylrmfutnfwezoazvwdjyekgxtivifkuzknisgzkwdtzbzcetbjilaanpotjzhmbkjmjmrrkaglhqcgrbrlzlzdqujehrzqhiyzkgixcxxchqjvftjlrzwiwamynidjiccupftpmfojtfwyuiazwhwvdgavibfjzbmfmbrafkhdixqztgsckzkoexacdbabhkgblulpbkvvbsmjnftnelwajkwlktjsmpzrrujjkfjlvdripsclprqcxrdzood...
output:
1 0 1 1 1 0 0 0 1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 0 0 0 1 1 1 1 1 0 0 1 1 1 1 0 1 0 1 0 0 0 1 0 0 0 1 0 0 1 1 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 1 1 0 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 1 0 0 1 0 0 1 1 0 0 1 1 1 1 0 1 1 1 0 0 0 ...
result:
ok 100000 lines
Test #5:
score: 0
Accepted
time: 16ms
memory: 34632kb
input:
wszieltjkpvmfwmgjtxjzamhomyinzeejaslmbhiphzlkjgdgkjmnskyfdwumsnkdlesdslhejnrqvszyjvnrbjgvmyfyhxaeilsyhwwgnldnqzvgcdvaxlqcoitsiwwzmhchufvbqlitqiewntfkvufhkvnpcqmrehqdahbcx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1 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 0 1 1 1 1 0 ...
result:
Subtask #4:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
0%