QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#545569#7512. Almost Prefix ConcatenationLiangsheng666WA 853ms160564kbC++143.6kb2024-09-03 15:05:362024-09-03 15:05:39

Judging History

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

  • [2024-09-03 15:05:39]
  • 评测
  • 测评结果:WA
  • 用时:853ms
  • 内存:160564kb
  • [2024-09-03 15:05:36]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T read(){
    T x=0;char ch=getchar();bool fl=false;
    while(!isdigit(ch)){if(ch=='-')fl=true;ch=getchar();}
    while(isdigit(ch)){
        x=(x<<3)+(x<<1)+(ch^48);ch=getchar();
    }
    return fl?-x:x;
}
#define FASTIO ios::sync_with_stdio(false);cin.tie(0);
#define LL long long
#define read() read<int>()
const int maxn = 1e6 + 10;
const int P = 998244353;
inline void add(int &x,int y){
    x+=y;
    if(x>=P)x-=P;
}
struct Segment_Tree{
    struct tree{
        int l,r,val,tag;
    }t[maxn<<2];
    #define ls (p<<1)
    #define rs (p<<1|1)
    #define mid ((l+r)>>1)
    inline void pushup(int p){
        t[p].val=(t[ls].val+t[rs].val)%P;
    }
    inline void pushdown(int p){
        if(!t[p].tag)return ;
        int l=t[p].l,r=t[p].r;
        add(t[ls].tag,t[p].tag);add(t[rs].tag,t[p].tag);
        add(t[ls].val,1LL*(mid-l+1)*t[p].tag%P);
        add(t[rs].val,1LL*(r-mid)*t[p].tag%P);
        t[p].tag=0;
    }
    void build(int p,int l,int r){
        t[p].val=t[p].tag=0;
        t[p].l=l;t[p].r=r;
        if(l==r)return ;
        build(ls,l,mid);build(rs,mid+1,r);
    }
    void update(int p,int x,int y,int val){
        int l=t[p].l,r=t[p].r;
        if(x<=l && r<=y){
            add(t[p].tag,val);
            add(t[p].val,1LL*(r-l+1)*val%P);
            return ;
        }
        pushdown(p);
        if(x<=mid)update(ls,x,y,val);
        if(y>mid)update(rs,x,y,val);
        pushup(p);
    }
    int query(int p,int pos){
        int l=t[p].l,r=t[p].r;
        if(l==r)return t[p].val;
        pushdown(p);
        if(pos<=mid)return query(ls,pos);
        else return query(rs,pos);
    }
}T[3];
int n,m,r[maxn];
char s[maxn],t[maxn];
#define ull unsigned long long
#define Pair pair<ull,ull>
Pair h1[maxn],h2[maxn],power[maxn];
const ull Mod1 = 233;
const ull Mod2 = 998244353;
inline Pair has1(int l,int r){
    return make_pair(h1[r].first-h1[l-1].first*power[r-l+1].first,h1[r].second-h1[l-1].second*power[r-l+1].second);
}
inline Pair has2(int l,int r){
    return make_pair(h2[r].first-h2[l-1].first*power[r-l+1].first,h2[r].second-h2[l-1].second*power[r-l+1].second);
}
signed main(){
    FASTIO;
    cin>>s+1>>t+1;n=strlen(s+1);m=strlen(t+1);
    power[0].first=power[0].second=1;
    for(int i=1;i<=n;i++)power[i].first=power[i-1].first*Mod1,power[i].second=power[i-1].second*Mod2;
    for(int i=1;i<=n;i++)h1[i].first=h1[i-1].first*Mod1+(s[i]-'a'+1),h1[i].second=h1[i-1].second*Mod2+(s[i]-'a'+1);
    for(int i=1;i<=n;i++)h2[i].first=h2[i-1].first*Mod1+(t[i]-'a'+1),h2[i].second=h2[i-1].second*Mod2+(t[i]-'a'+1);
    for(int i=1;i<=n;i++){
        int L=i,R=min(n,i+m-1),res=i;
        while(L<=R){
            int Mid=(L+R)>>1;
            if(has1(i,Mid)==has2(1,Mid-i+1))res=Mid,L=Mid+1;
            else R=Mid-1;
        }
        if(s[res]==t[res-i+1] && res<n && res-i+1<m)res++;
        if(res==n || res-i+1==m)r[i]=res;
        else {
            r[i]=res;
            L=res+1,R=min(n,i+m-1);
            while(L<=R){
                int Mid=(L+R)>>1;
                if(has1(res+1,Mid)==has2(res-i+2,Mid-i+1))r[i]=Mid,L=Mid+1;
                else R=Mid-1;
            }
        }
        //cout<<i<<' '<<r[i]<<'\n';
    }
    for(int i=0;i<3;i++)T[i].build(1,0,n);
    T[0].update(1,0,0,1);
    for(int i=0;i<n;i++){
        int f0=T[0].query(1,i),f1=T[1].query(1,i),f2=T[2].query(1,i);
        T[0].update(1,i+1,r[i+1],f0%P);
        T[1].update(1,i+1,r[i+1],(f1+f0)%P);
        T[2].update(1,i+1,r[i+1],(1LL*f2+2LL*f1+1LL*f0)%P);
    }
    cout<<T[2].query(1,n)<<'\n';
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 13832kb

input:

ababaab
aba

output:

473

result:

ok 1 number(s): "473"

Test #2:

score: 0
Accepted
time: 2ms
memory: 13892kb

input:

ac
ccpc

output:

5

result:

ok 1 number(s): "5"

Test #3:

score: 0
Accepted
time: 0ms
memory: 13844kb

input:

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

output:

75038697

result:

ok 1 number(s): "75038697"

Test #4:

score: 0
Accepted
time: 2ms
memory: 13928kb

input:

lvvvllvllvllvllllllllvvvllvlllvvlvlvllvlvvlvvvvlvvllllllvvlvlvvlllvvlvlvllllllvlvvvvvvlllvvvllvlvvvlvvlllvvvvvvlvlllvvvvlvvvvvlvvlvvlllvvllvvllvlvlvlvlvllllvvllvvllvlllvvvllllvvlvvllvvvvlvlvvlvvlllvvvvvvvvlvvlvlllvllvvvvllvvvlvvvvvvlvlllvllllvllllllllvvllllllvlvvlvvvlvllllvllvlvvllllllvlvvvlvlvlvvvl...

output:

538419149

result:

ok 1 number(s): "538419149"

Test #5:

score: 0
Accepted
time: 0ms
memory: 13908kb

input:

fzztyyyfztzzfzyztftyfzyyzzzztyyfzttzttztyzztyyyfyyftyfyfzzffyzffytttzttyzzftyfyfyftyyfzyzffyfyyzztzyyttyfyztfyfzyfzfzyftttfyyfyytzyyzfyyyzztfttzyyytzzffytyzyyyyfzfftftzzztyfftfzfzytftfttytfyzfytzfzztttttzzyztyftzzzfzfzfffttyztzfftfftyfyffztzyffttyyfyfzytytyyttfzzfyyytzzftzyyfftftyytyffzffztfytfyyyty...

output:

867833603

result:

ok 1 number(s): "867833603"

Test #6:

score: 0
Accepted
time: 0ms
memory: 13848kb

input:

xauxlgtqbsianlzjzglalnbtlujfrkfdqgczpmididmtamzeablrbrbjgtsdkzzcfhvcpdawqkrgdsereirlxbizhbsxlcbtgwwshekbhatqonvgupswcowythifpoubxkuoxuuisnzolzwektdcaouxbkhofvdqzmjulmhgqjxwzhgrzmorhqkgekntbzsxgvjtehfbterrhhjhqggzrqiqmcshzwpfoburpyfoehqgtitesyaekhlzcvxzdqmunyrlrhbrjoigdjzpcgptyoiowwnmqrxucxixxydurbdh...

output:

301464023

result:

ok 1 number(s): "301464023"

Test #7:

score: 0
Accepted
time: 0ms
memory: 14084kb

input:

tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt...

output:

816920406

result:

ok 1 number(s): "816920406"

Test #8:

score: 0
Accepted
time: 0ms
memory: 14064kb

input:

cxccxccccxccxccxcxxxccxxcxcxcxcxxcccxcxccccccxccccxccxcxcxxcxxcxcxxxcxcccxcxxxxxccxxcccxxccxxxccxccxxxxcxxccccxccxxcccxcccxxxccccxcxcxccccxxxxccxxxxxcxxxxxxcxxccxxcxcxcxxxxxcxxccxcxxxcccxcxxxccccccccxxxcccxcxxcxxxxccxxxcccccxcccxccccccxxcccxxcccxxxccxxcxccxcccxxxccxccxxxccxcxxxxccxxcxcxxcxxccxxxcxcx...

output:

206627037

result:

ok 1 number(s): "206627037"

Test #9:

score: 0
Accepted
time: 4ms
memory: 14048kb

input:

vmqvvbbmvmmmqqvqvmmbbvqbqvbmmbqmvvbmmmqvqvbvqqmvbbmmvmvqbvmqqbqvqqvmvmmbqvvbvmvbqmqqbqqqbqqmvvmmbvvvbvvvbmqqvbqbmvvmvqqvbqbvvvqmvvvmvqqmvqbmbvmvmqmmbmqqqbbmvqbqbbqqbmmvmmqqqvvvqqqqqmmvvvvqmvmmmmvmqmqbbvbvvqmmmqbbmvqvmvmqbqbbbmqbqbqmqbqmqbmvvqmmvbmmbvbqqvmmmbbmbbmvmmvbmqmqbbqqbqqbbqmbmmmqbqbmvbmvmmmm...

output:

460659355

result:

ok 1 number(s): "460659355"

Test #10:

score: 0
Accepted
time: 0ms
memory: 14024kb

input:

xthikaxiescbqjzrpgtcpigqjsojlsxsiowkkzsdsgscoolhdtglvpgcoggzqnnjmocvanrogbzqjcmijoukjicadaakehxgjphjgnskjvfneoyaucfadilscsucjgweuzcdfapfnrfffdowxvzkvgqzmtszjldylvehzjlvmhproaehqhuwdoadenqdrqwrlxxfouzqolwbopmkpjshczocnnsxktxozahzwqpwbmvexguvjhbvbjwsdtgaitoqwsfzkwnzgeidkamgcfhzhitfxenunlcsbsesbczvmmbu...

output:

906223232

result:

ok 1 number(s): "906223232"

Test #11:

score: 0
Accepted
time: 62ms
memory: 33460kb

input:

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

39285513

result:

ok 1 number(s): "39285513"

Test #12:

score: 0
Accepted
time: 73ms
memory: 33584kb

input:

hghggghghhghhgghgggghhghhhgghggghghhhhghghgggghhggggghhgghggghhhghggghghghggghggghgghhhghgggghghghgggghhhhhgghhgghhhghhghhhghhhhhhghghhgggggghghgggghghhghhgghhghhhhhhghgghhghghgggghgggggghghhhhhghhhhhhhgghhggggghhgghhhhhhhhghggggggghhghhghhghhgghhghgghhhhgghghghhhhhghggghhhhhhhgggggghgghghhhhghhgggg...

output:

58618935

result:

ok 1 number(s): "58618935"

Test #13:

score: 0
Accepted
time: 64ms
memory: 33536kb

input:

nnttcybbmnrnsuybrkmkmtumcyuyrrmbtybutunsyrkmunmncmkuknttmmtkymtcybttrmyrtckscttcksbtymtyukbbynnnbukttncmbutscbrytbrutnuyuknmtymckkttrrnsbtrkbnnnkbrccrcyybmnnybbkkbcbbccycsrcytnuucbbyytckrycktsmkymruycksrscytkskscbtbccbrurmumrkbkbttkcynmymbbmbkrksmnusryumsmmyrcsmusumbrkkbmsbyytmmruubskccsusnntcuntrrt...

output:

46252951

result:

ok 1 number(s): "46252951"

Test #14:

score: 0
Accepted
time: 68ms
memory: 34280kb

input:

ittaztseqcdirziayobnnxuzipvteycmgjbupnlxuheulnmzsdeymctprlxvkvzjwrotsauxagyrqcwzuwqyodrqsupwpyrmbwjqlvfdsrocneigxvnjfiseotxmutzwacfutqlmzmxwuqgjugwkafnxvzutgbrweqrdshwneksgxzzinnmbbioqdvbmavukaegvkpwauuoysklelsqhytlikpdpymbwhmbdmrycaiywtwjjqtecwoofyjhbumjtipwyopkuralejvopitpjcdswcvsugimgbrlibrteaqtb...

output:

838361918

result:

ok 1 number(s): "838361918"

Test #15:

score: 0
Accepted
time: 850ms
memory: 159060kb

input:

llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll...

output:

774442405

result:

ok 1 number(s): "774442405"

Test #16:

score: 0
Accepted
time: 798ms
memory: 158808kb

input:

nnnddndnndnddddndnnddnddnndddndndnnndnndndndnnnddndndnddnnddnndndndnnnndndddndnndndnndddndnnddnndndnnddnnddnddndddnnnndnnndddnndnddnnnddndddnndnnndndndndnddnddnndddndddnnndddnnndnndnndnnnddnnddnndnnndnnnddnnddddnndnnddnndnnnddddnddnnndnnddddddndndnnnnndnnnndddddnddnnndddndnnddndnnnddddnndndnndndndnd...

output:

478212008

result:

ok 1 number(s): "478212008"

Test #17:

score: 0
Accepted
time: 788ms
memory: 158692kb

input:

ievnetxypatirsocqrmgmhfxnkgzrscclietylohbcshjjxfmqhlxvebythkwllhjxwjngxbjeivttdgjttmyqgxsqotxueuvzrslcqpranaucprjmfczshtoqggczmbuwixllhnlcjhrvfixisvqdlxxmevucbvzolweshgvxeocppggthqkljyiszeqkpnybogisosqzdasfqgpuzudnnabwoqtrpxllqkxlbwsexwduvutufncthrmywlsqlccetggdflmgewzvhsmpyznzsxcftkoyfhgmgvliwxbywi...

output:

702291108

result:

ok 1 number(s): "702291108"

Test #18:

score: 0
Accepted
time: 805ms
memory: 159184kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

301945039

result:

ok 1 number(s): "301945039"

Test #19:

score: 0
Accepted
time: 824ms
memory: 159488kb

input:

gggggcgcgggcgccgggcgcccgccccggcccgcggccccggcccccggccgccccccggcccgggcccgggggcccgggggcgggccgcccccccgcgcggggggggggcggggggcggccgcccggggccgccccgcgcgggcggggccgcgcggcggccgggccgccgcggcccgcccggcgccgccgggcgggggcggggccgccgcccccgccccccgggggcgcgcgccggccggcggcggggcgccggcgccccggccgggggccgccccccccgcggcgcggggggcgccc...

output:

602912498

result:

ok 1 number(s): "602912498"

Test #20:

score: 0
Accepted
time: 787ms
memory: 158808kb

input:

zdomsivxdzqlpexdauxxrjvembwqtchcxcpboqwmilagfpnrzyicztptfvdlqehajqoxcqvtoglsusgfioxtwheivlmgapepuoevghzmdadbkkkrdusnvxmansofunrgmppyktkxcottuiolirqlsflpnkghhxngutoovfzluiboooswqknpedyiaspikpveswjqnqitfbynjgiqymkrldekgmkavalduxlscjewmpoctbxjujtxlavpibkyerspcfchiticgjsvmzvtadhimnvacljbhmzikeabhjoszfig...

output:

435002470

result:

ok 1 number(s): "435002470"

Test #21:

score: 0
Accepted
time: 762ms
memory: 157768kb

input:

aabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaab...

output:

571187577

result:

ok 1 number(s): "571187577"

Test #22:

score: 0
Accepted
time: 739ms
memory: 159600kb

input:

abacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacab...

output:

785945100

result:

ok 1 number(s): "785945100"

Test #23:

score: 0
Accepted
time: 777ms
memory: 159896kb

input:

abaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaa...

output:

501555951

result:

ok 1 number(s): "501555951"

Test #24:

score: 0
Accepted
time: 785ms
memory: 160492kb

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

483421416

result:

ok 1 number(s): "483421416"

Test #25:

score: 0
Accepted
time: 774ms
memory: 158572kb

input:

abbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbcabbcabbcbcabbcabbcbcabbcbc...

output:

610522803

result:

ok 1 number(s): "610522803"

Test #26:

score: 0
Accepted
time: 778ms
memory: 159832kb

input:

bacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaabacabacaacabacaabacaacabacaabacabacaacabacaabacabacaabacaacabacaaba...

output:

688840647

result:

ok 1 number(s): "688840647"

Test #27:

score: 0
Accepted
time: 791ms
memory: 158268kb

input:

abbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaabbababbabaababbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaabbababbabaababbababbabaababbabaabbababbabaababbababbabaab...

output:

185974021

result:

ok 1 number(s): "185974021"

Test #28:

score: 0
Accepted
time: 777ms
memory: 159408kb

input:

abacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabahabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabaiabacabadabacabaeabacabadabacabafabacabadabac...

output:

881963869

result:

ok 1 number(s): "881963869"

Test #29:

score: 0
Accepted
time: 785ms
memory: 160564kb

input:

aabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaaffaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaaggaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaaffaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabbaaddaabbaaccaabbaahhaabbaaccaabbaaddaabbaaccaabbaaeeaabbaaccaabb...

output:

647864259

result:

ok 1 number(s): "647864259"

Test #30:

score: 0
Accepted
time: 721ms
memory: 159092kb

input:

ddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddrddrdddrddrdddrddrddrdddrddrdddrddrdddrddr...

output:

611194463

result:

ok 1 number(s): "611194463"

Test #31:

score: 0
Accepted
time: 752ms
memory: 159468kb

input:

hehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehehfhehhehfhehfhehhehfhehehfhehhehfhehhehfhehehfhehhehfhe...

output:

350121745

result:

ok 1 number(s): "350121745"

Test #32:

score: 0
Accepted
time: 764ms
memory: 159912kb

input:

nmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnmnnmnnmnmnnmnn...

output:

533553735

result:

ok 1 number(s): "533553735"

Test #33:

score: 0
Accepted
time: 725ms
memory: 158508kb

input:

joojojjoojjojoojojjojoojjoojojjoojjojoojjoojojjojoojojjoojjojoojojjojoojjoojojjojoojojjoojjojoojjoojojjoojjojoojojjojoojjoojojjoojjojoojjoojojjojoojojjoojjojoojjoojojjoojjojoojojjojoojjoojojjojoojojjoojjojoojojjojoojjoojojjoojjojoojjoojojjojoojojjoojjojoojojjojoojjoojojjojoojojjoojjojoojjoojojjoojjo...

output:

177198028

result:

ok 1 number(s): "177198028"

Test #34:

score: 0
Accepted
time: 780ms
memory: 158856kb

input:

qddhdhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdhqddhqddhdhqddhqddhdhqddhdh...

output:

101237979

result:

ok 1 number(s): "101237979"

Test #35:

score: 0
Accepted
time: 763ms
memory: 159972kb

input:

dqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqqvqdqvqqdqvqdqvqqvqdqvqqdqvqdqvqqdqvqqvqdqvqqdq...

output:

292588879

result:

ok 1 number(s): "292588879"

Test #36:

score: 0
Accepted
time: 731ms
memory: 159660kb

input:

axxaxaxxaxaaxaxxaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaaxaxxaxaaxxaxaxxaxaaxaxxaxaxxaxaax...

output:

663737748

result:

ok 1 number(s): "663737748"

Test #37:

score: 0
Accepted
time: 723ms
memory: 158712kb

input:

pgpepgpwpgpepgpopgpepgpwpgpepgptpgpepgpwpgpepgpopgpepgpwpgpepgpdpgpepgpwpgpepgpopgpepgpwpgpepgptpgpepgpwpgpepgpopgpepgpwpgpepgphpgpepgpwpgpepgpopgpepgpwpgpepgptpgpepgpwpgpepgpopgpepgpwpgpepgpdpgpepgpwpgpepgpopgpepgpwpgpepgptpgpepgpwpgpepgpopgpepgpwpgpepgpypgpepgpwpgpepgpopgpepgpwpgpepgptpgpepgpwpgpe...

output:

488572018

result:

ok 1 number(s): "488572018"

Test #38:

score: 0
Accepted
time: 757ms
memory: 160160kb

input:

rrwwrraarrwwrrssrrwwrraarrwwrrjjrrwwrraarrwwrrssrrwwrraarrwwrriirrwwrraarrwwrrssrrwwrraarrwwrrjjrrwwrraarrwwrrssrrwwrraarrwwrrggrrwwrraarrwwrrssrrwwrraarrwwrrjjrrwwrraarrwwrrssrrwwrraarrwwrriirrwwrraarrwwrrssrrwwrraarrwwrrjjrrwwrraarrwwrrssrrwwrraarrwwrrddrrwwrraarrwwrrssrrwwrraarrwwrrjjrrwwrraarrww...

output:

686260254

result:

ok 1 number(s): "686260254"

Test #39:

score: 0
Accepted
time: 760ms
memory: 159008kb

input:

jmgfgawmrduominxypmrqdincccsmkfkkoqrzzmpnfnbtyxetgmfvyjugkvjvlfkjikyakiwuwjepviiwfgbenzycnqndaukmyknehgmlizltmebgvgmoebwijqvtwngbmojualcabcbafifsbmbtidqsjhxwyqautkjqztkhmusuixxanobxuaqlrmtmkprqpofxtkqviqqjgqcwrkbgdomrdtvjrjduuocsaxftjjulzpexmeigvmoxksccoepcjqdtcbbthjgdnsmnwklfrvlhazvcrbmkegnmmvdpcap...

output:

293683143

result:

ok 1 number(s): "293683143"

Test #40:

score: 0
Accepted
time: 779ms
memory: 160484kb

input:

dfddeeadfbgfcadcbbaaefgcchdhfcbagaedgdhafdhbffggfechccdhadbcchgeaeagfaaagfbeabffdaeefaaabbggffghbgfhbcahhdfdgccgegdgdhafhcdgbebcbbggegcachhefhcgfgcaececacagedaacfbcdgecghfedffchhaeabfbeehfeeddfecfefahbfaghbhbhdgddfgcdbfbeaahbcdhfdbeebhfbehggcfbabbfchggchhahehgfgbhaeebafbdacccffdfgfbhecebgfeeebdacaaa...

output:

896912463

result:

ok 1 number(s): "896912463"

Test #41:

score: 0
Accepted
time: 746ms
memory: 159132kb

input:

djkdjdlkbamfcmacgaekgbgmimadajicdbgmiejaacggablfgejfgmafmhbcifaehamkadfcglbmhhblgalklhglicmhakfjaafidjmihmghgbhdhjfdllmaekkeklccadieaibeiddjefjleaiegkllmeglgedeleabgghdaidgehdacemkbaddalkamgiffgdcbhhckhmacimaeamehiigfggmglccidaffjcjijafmbehlgglcmacifjgmdfcdahfljdhfjkijcdebkkhgbdlijcabjbgefchjdbfigbi...

output:

866183470

result:

ok 1 number(s): "866183470"

Test #42:

score: 0
Accepted
time: 757ms
memory: 159572kb

input:

akejekgcbkkajhbmklibdmdfmllhgheagfjjbbifdjeglcmmbhmglebljhfmdidckdjebldeffdelakbfckhdmlmickdfedimjjmjdhlmikgabblgifdcbacgkchmfkhflgggakalkihlllakglmaeldhjljfhegalcmgkhleahciagicfljkkkdajbdkhelfmlmcgmdegkaekdmckbfhgjdmhgbkihahbgmgbiadkidijecgdambchefefjklfhdhjamhkeefedffjlckfhjdfkimelbfjliamccfkaljck...

output:

490416632

result:

ok 1 number(s): "490416632"

Test #43:

score: 0
Accepted
time: 791ms
memory: 159748kb

input:

dccfccebfcbbabcddeecfeaecfdbbbdfadcdafbfbbeeefgceegabdbbdeacbafdbdgaegadfddeaegcbcgcdggeefffecfaadabdbeaeebfbagdggfbbfeddgedcfgfafecedgffadeagggeababdfdbcbdeafabdggaccaaacedccegccaadebdebdfabaffcbdcbcfcdgabcabdcebfcbgecgdddcedaaeeefgfbgbdbbfeffadbecddffedddffadbeeaegaacegegcagefcffababbdaafdfgegfdbb...

output:

885724660

result:

ok 1 number(s): "885724660"

Test #44:

score: 0
Accepted
time: 783ms
memory: 159964kb

input:

aehhddeelhbahadgalifaklhccaefgcbhglheiaeahgffkblkafhcfdebggdkdhdjgkjaekhflfehlkdcbejagigdlcabkblijfecgdbikehhekhihehhebalgjfjcehkdajcakehbiedbcjdfhacdhcckhdjbfjdllaajdckhjaglbdaalbihbjlheklkiaabkfjbhchjlkealbdlgkdahihgigcfdjflfdhejbedgajbfbhlkhgcglkdhclcelgkldegkgfekajdljfiaagbkkdbfdafdkcfgjhlfjdidd...

output:

421010120

result:

ok 1 number(s): "421010120"

Test #45:

score: 0
Accepted
time: 759ms
memory: 159844kb

input:

ikiajgmoobiibgmncbfmmabkagcegdloelekkeaebjcemcklemhiiomiabiihmccignhfifmdccmgdljhdlglbamfaafgddehngkimkflcdijdclhjookhnkdjkooalhchiikgjcemmigkhbkoafnglokmdkmcmmdgdfngcgfcglbkifnhaflfgdmdchdbaofhnhiadfoocoljghnbdfcohgeimonabgbjiekfdogkbdlfaiomkclaklnbeolnfhamekgdkmbfmjfofkkkoknlifehgaeimbaaahfdhekkbb...

output:

249065158

result:

ok 1 number(s): "249065158"

Test #46:

score: 0
Accepted
time: 787ms
memory: 159540kb

input:

bbidjtskemfoqflkgitiksamhiskmkdbieeethgsisgruqdjrbepunqfrorcmgaomlrntjjcrgobhmkjsfjqbschsfamsjsgcqishmaanbkhaechktgejonmnoltjgsunjpjicuplglpsgeiqtfrpbrmrbajenmeceikhgndkigrbubjdnlmpikpnpcsprmefffpmmmrcbmhghpjaanksmldikhobiajjpgfbnjnqgibdelmhhtqeshlmhsbunjcahmnjgpfphhcrfkinleassgogqjlecefedhfsicioksi...

output:

696887551

result:

ok 1 number(s): "696887551"

Test #47:

score: 0
Accepted
time: 778ms
memory: 159704kb

input:

amdhpchjhekifhphbcmhhhdiomjnbogojfqaknelnpjqlioflclmobhpofqfafnnogjblabnnignbclfcmhgooaeiohadbeihmbpgollbkaiipaaoophogjmodiqmjagjoqlnbkagfgpfiedbijagqhmfbigekqppielgcdfkennghqelpmelfepfgelqehnogggaobqclnamimfcooikpcliiglolhjcnoekqqfkhbnjafdfipjdlphcpidlbchdapjblaebchmamlhgllbipgqhlbhpfcnnjodgjdfcqmp...

output:

243281615

result:

ok 1 number(s): "243281615"

Test #48:

score: 0
Accepted
time: 732ms
memory: 157632kb

input:

dbeafaheacadbefjhabeegbaicejbbdgjbeghjbhdhddachigjffakkdkeahciadejkfkfaccdgjkfkdkkgcbggibagikedhejecahhchhkcebbidihjbkjegaakikdfihfhebbccfikhacdedaiaffhfkecagbcbjgbbffafdacfeeibdjhjjddjhkdkihhdhgijdjfdcjagjfafdahfjgkkjachjcdicaieeafhdfjfhchahiidhhfkaghbegbgcfefkijhdebejjjidcadkchgigdeiecfjhfjkefiekk...

output:

678667698

result:

ok 1 number(s): "678667698"

Test #49:

score: 0
Accepted
time: 746ms
memory: 158640kb

input:

deoojpgcgpkoholhlcfddeohkqoihkcalfngpkcabbkimgpkccaqapjcciehchiqbjqjpkbenflbbmqlgogkkqlaoaenoahilflhjrkibcjpndignjkjdilkfjcgonlhfhqokdkqfcooddnqraffljggmefpjaqgdqbhgfkpcionmhnkieocrokobhgnpkkqamjdalqjnefhofndmgialqhmfjnkjnqhmcjnddbkmdnbfokfmbihnnobcakhjmnfmrfganfhicdlmlgqfdqrcnidldqpkpniojdkabeorrci...

output:

640377934

result:

ok 1 number(s): "640377934"

Test #50:

score: 0
Accepted
time: 736ms
memory: 159332kb

input:

rcplswkqluujkpofiplijbkfamjnpmwbetfaolnjlwjeklpmqnuduqdlbvohfebccbdgsmlumlsbmepaqcsdhsdiqmcgmrtmkneoqitmiiamfkcakoqivniqkarnptorecjpnhjrilbhqlqsiiqcaoequooccldcicgjgvesjkothbqrkmwqjmgpiviesqdsbvcvwbkewqkdjathbpodcwbcaapijiwmdalphlerftsvpctpgilajbthfclwhnpaqrmpulnkouchahefqhuodqudvvlkhuqjbfirnbomnblm...

output:

66403201

result:

ok 1 number(s): "66403201"

Test #51:

score: 0
Accepted
time: 788ms
memory: 159612kb

input:

kcelopohpkauakpqbkkffonjqopuccmehqsssbscqgkmbkmrhccdriukchfjhooedrpidupnhrruqjhlcolrtsjehqqtpknjqsgklfjpirsnqfjlhscetstgrlilmdicgaafhasapptemkeaonlohgrtnoqtaghbbmaskprseerhsdrsacrscpgkbrlqeesgdhabhklbapimgnbidlskjhacqbfgbbgjhbqqjmksatqqcrfpqplttotunndmlmcifiqkdfkbeoofkueargstanfpoqjcgipqbhqsisqqupua...

output:

674574764

result:

ok 1 number(s): "674574764"

Test #52:

score: 0
Accepted
time: 792ms
memory: 158712kb

input:

lokefigibdllifnkjkhnimgelligecajbonifkiahfaglcabobfnjiaffhkjebdcmflhimlfdofookcmmoaehhhjiiolglcdemjlmiimjelihecabcecbehmlefaackglgkelkihnlbgnhhodeeejnokhknomgibjjiglacgkanjmeiejagggbledmhgaaekimngheheihggogbjfldlbfoelngooilkenmkmlbliejdfhgalhbfihkicbnckjlfnfmcfcgojmcnnifkhfafmhohohkfchibbbmmbhhanhbc...

output:

102969525

result:

ok 1 number(s): "102969525"

Test #53:

score: 0
Accepted
time: 726ms
memory: 158852kb

input:

jhuuccdtstliggpntpafkqniscpsoprtdoekmrrdilfcgfjmjmmdtfblsabqnubkufsmscrbosqpsbidqfjtgaaaiafmkjqjkhqaqrtooaujonhdjebsfakbhqnitrgjlgaiknktoktjsdiktcotccnrpefcbnqnhmlapoiamukspsufbumacjikgpehhhbnkirtnmtamckhfhcuhbflosfhhlqipupjkhcdbgakqpcjrpfmlmtkrtibuhrndkrurjgpqlglsggtetiathbtnckdqgofakuiumsfqmchppao...

output:

305160976

result:

ok 1 number(s): "305160976"

Test #54:

score: 0
Accepted
time: 741ms
memory: 158772kb

input:

pghtgnactijlrpguqmmclmonmvptpqlcrnuktgdvephiiklfdrrtrhnejnqceimfjuinqeuhhqkauvktipashuvjthvcgdlqsorggmrlemsncuqbjmjkahmhmhhjbjsgbbhsrpttdkhfcbdjemovvbmeaifrneritlqvurjdjmjjvppitgckjmdtldoimosvrdlqqqvnsurlilhecbsdnvncsdqbvddodohpofabdpcekvokkgtbppoapfliiriaouldpbrsfhnagsjojejcuithqsjoelpqsjnaurulpsar...

output:

564861703

result:

ok 1 number(s): "564861703"

Test #55:

score: 0
Accepted
time: 788ms
memory: 159924kb

input:

oihhieeoadhlkggfalmodcmedfmdbfedcflnlbfjjcbgccifnmieinnbkcfjegkdmcaoenbjhgihdgodoamklmklhgcoiemjahgnmaamdkjnafmdegfdhaefggjbonegcmmkldjlhgdofhfbaloiljelongglooakkccbgholfbooobjfocekldinlokadkdonkibanjomeonialbhhokaniadhijldmnilcmebabohaeeicimjemlajcbkojoonenhlabobhfajenedjdoniejlkincbdjifbajkcakgmnl...

output:

487389185

result:

ok 1 number(s): "487389185"

Test #56:

score: 0
Accepted
time: 729ms
memory: 159220kb

input:

mbecsnmaqpqeehmgmfdoaobhqkpmgqariegclsokjnosbbbgdgggcelaamnjoqbqglbsqhafppihnocmalqanasodafckknjpajdabinmgicqionaffaajppfdfibanfjhdforpikceonnaciharfmmsnesknfchhnorkkminlmhkcsijaescaqjbckgicsffecdchbdieomkbsqalncjllhpiphmprsehrlqfjaedbbojqblaaprsoldfjqqckesbomjdgqokdmrpoffhjfbeckkcofmcphbmqeokflmjrq...

output:

429687603

result:

ok 1 number(s): "429687603"

Test #57:

score: 0
Accepted
time: 845ms
memory: 158160kb

input:

aabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaabaabaaabaabaaabaabaabaaabaabaaabaabaaabaab...

output:

394014419

result:

ok 1 number(s): "394014419"

Test #58:

score: 0
Accepted
time: 853ms
memory: 159064kb

input:

abacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacabacabaabacababacabaabacababacabaabacabacabaabacababacabaabacabaabacababacabaabacab...

output:

142112521

result:

ok 1 number(s): "142112521"

Test #59:

score: 0
Accepted
time: 827ms
memory: 159020kb

input:

abaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaa...

output:

610603128

result:

ok 1 number(s): "610603128"

Test #60:

score: -100
Wrong Answer
time: 840ms
memory: 159632kb

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

320203590

result:

wrong answer 1st numbers differ - expected: '918562310', found: '320203590'