QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#221023#148. BrpermAhmed57#50 1787ms41264kbC++23727b2023-10-21 02:16:202024-07-04 02:50:25

Judging History

你现在查看的是最新测评结果

  • [2024-07-04 02:50:25]
  • 评测
  • 测评结果:50
  • 用时:1787ms
  • 内存:41264kb
  • [2023-10-21 02:16:20]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#include "brperm.h"
string str;int lol[20][500001];
mt19937 rng;
void init(int n, const char s[]){
    rng.seed(time(0));
    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;
    for(int e = 0;e<1000;e++){
    int l = rng()%(1<<k);
        if(str[l+i]!=str[lol[k][l]+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: 22112kb

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: 22132kb

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: 210ms
memory: 36712kb

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: 203ms
memory: 34660kb

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: 208ms
memory: 34632kb

input:

wszieltjkpvmfwmgjtxjzamhomyinzeejaslmbhiphzlkjgdgkjmnskyfdwumsnkdlesdslhejnrqvszyjvnrbjgvmyfyhxaeilsyhwwgnldnqzvgcdvaxlqcoitsiwwzmhchufvbqlitqiewntfkvufhkvnpcqmrehqdahbcxeuzwcjvkkptiymqpbakjeyekhupyaehjekeekcuiyczbwbnrrfzqwgapqjaqpzedeeayswxhmginefjozxkaefitrbkxwoczmvjuqyuxlqnvbojqrwvtsncvbukbcyneyp...

output:

0
1
1
0
1
0
1
0
1
0
0
1
1
0
1
0
0
0
1
0
0
0
1
1
0
1
1
0
1
0
1
0
1
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
1
1
0
1
1
1
0
1
1
0
1
0
0
1
1
0
1
0
1
1
1
1
1
1
0
1
1
1
1
0
0
1
1
0
0
0
1
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
0
0
0
1
1
0
1
0
0
0
1
0
1
0
0
0
0
1
0
1
1
1
0
0
0
0
1
0
0
1
0
1
0
1
1
1
1
1
0
0
1
0
1
1
1
1
0
1
1
...

result:

ok 100000 lines

Subtask #3:

score: 0
Wrong Answer

Test #6:

score: 0
Wrong Answer
time: 1787ms
memory: 41264kb

input:

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

0
0
1
0
1
1
0
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
0
1
1
0
0
0
0
1
1
0
1
1
1
1
1
1
0
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
0
1
0
1
0
1
1
1
1
1
1
1
1
1
1
0
1
1
0
1
1
1
1
0
1
1
1
1
1
1
0
1
1
0
1
1
0
1
1
0
1
1
1
1
0
1
1
1
1
0
0
1
1
1
1
1
1
1
0
1
0
1
0
1
1
1
1
1
1
0
1
1
0
1
1
1
1
1
1
1
0
...

result:

wrong answer 5th lines differ - expected: '0', found: '1'

Subtask #4:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%