QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#199615#7345. Circular ShiftSolitaryDream#AC ✓142ms146536kbC++201.4kb2023-10-04 13:19:532023-10-04 13:19:53

Judging History

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

  • [2023-10-04 13:19:53]
  • 评测
  • 测评结果:AC
  • 用时:142ms
  • 内存:146536kb
  • [2023-10-04 13:19:53]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,s,t) for(int i=(s),_t=(t); i<=_t; ++i)
typedef long long ll;
const int N=6e5+50;
int pos[N];
int ch[N][26],Len[N],par[N];
int tot,End;
void Extend(int c) {
    int p=End;End=++tot;Len[End]=Len[p]+1;pos[End]=Len[End];
    for(; p && !ch[p][c]; p=par[p]) ch[p][c]=End;
    if(!p) par[End]=1;
    else {
        int x=ch[p][c];
        if(Len[p]+1==Len[x]) par[End]=x;
        else {
            int y=++tot;Len[y]=Len[p]+1;
            memcpy(ch[y],ch[x],sizeof(ch[x]));
            par[y]=par[x];par[End]=par[x]=y;
            for(; ch[p][c]==x; p=par[p]) ch[p][c]=y;
        }
    }
}
char str[N];
int sum[N][26];
vector<int> E[N];
ll res;
void dfs(int x) {
    for(auto y: E[x]) dfs(y),pos[x]=pos[y];
    if(x==1) return ;
    // cerr << x << ' ' << pos[x] << endl;
    FOR(i,0,25) {
        if(ch[x][i]) res+=sum[pos[x]-Len[par[x]]-1][i]-sum[pos[x]-Len[x]][i];
        if(ch[par[x]][i]) res+=sum[pos[x]-Len[par[x]]][i]-sum[pos[x]-Len[par[x]]-1][i];
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    tot=End=1;
    for(auto c: s) {
        Extend(c-'a');
    }
    int n=s.size();
    FOR(i,1,n) {
        FOR(j,0,25) sum[i][j]=sum[i-1][j];
        sum[i][s[i-1]-'a']++;
    }
    FOR(i,2,tot) E[par[i]].push_back(i);
    dfs(1);
    cout << res << '\n';
    return 0;
}

詳細信息

Test #1:

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

input:

abaac

output:

7

result:

ok 1 number(s): "7"

Test #2:

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

input:

aaa

output:

3

result:

ok 1 number(s): "3"

Test #3:

score: 0
Accepted
time: 5ms
memory: 22824kb

input:

a

output:

1

result:

ok 1 number(s): "1"

Test #4:

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

input:

z

output:

1

result:

ok 1 number(s): "1"

Test #5:

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

input:

aa

output:

2

result:

ok 1 number(s): "2"

Test #6:

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

input:

az

output:

2

result:

ok 1 number(s): "2"

Test #7:

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

input:

za

output:

2

result:

ok 1 number(s): "2"

Test #8:

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

input:

zz

output:

2

result:

ok 1 number(s): "2"

Test #9:

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

input:

abc

output:

3

result:

ok 1 number(s): "3"

Test #10:

score: 0
Accepted
time: 5ms
memory: 21948kb

input:

aab

output:

3

result:

ok 1 number(s): "3"

Test #11:

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

input:

baa

output:

3

result:

ok 1 number(s): "3"

Test #12:

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

input:

dbda

output:

5

result:

ok 1 number(s): "5"

Test #13:

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

input:

dacc

output:

4

result:

ok 1 number(s): "4"

Test #14:

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

input:

cdaca

output:

6

result:

ok 1 number(s): "6"

Test #15:

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

input:

cddcc

output:

8

result:

ok 1 number(s): "8"

Test #16:

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

input:

adcbdb

output:

7

result:

ok 1 number(s): "7"

Test #17:

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

input:

cccccc

output:

6

result:

ok 1 number(s): "6"

Test #18:

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

input:

ccdcabb

output:

9

result:

ok 1 number(s): "9"

Test #19:

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

input:

bcbddca

output:

8

result:

ok 1 number(s): "8"

Test #20:

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

input:

cadababb

output:

11

result:

ok 1 number(s): "11"

Test #21:

score: 0
Accepted
time: 5ms
memory: 23408kb

input:

bdddcbbc

output:

11

result:

ok 1 number(s): "11"

Test #22:

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

input:

acdaabcdb

output:

10

result:

ok 1 number(s): "10"

Test #23:

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

input:

abcabdcad

output:

11

result:

ok 1 number(s): "11"

Test #24:

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

input:

bccbccccda

output:

17

result:

ok 1 number(s): "17"

Test #25:

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

input:

bbdddadcab

output:

14

result:

ok 1 number(s): "14"

Test #26:

score: 0
Accepted
time: 24ms
memory: 115340kb

input:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

300000

result:

ok 1 number(s): "300000"

Test #27:

score: 0
Accepted
time: 30ms
memory: 114024kb

input:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

300000

result:

ok 1 number(s): "300000"

Test #28:

score: 0
Accepted
time: 36ms
memory: 146536kb

input:

yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

300000

result:

ok 1 number(s): "300000"

Test #29:

score: 0
Accepted
time: 47ms
memory: 98512kb

input:

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn...

output:

299988

result:

ok 1 number(s): "299988"

Test #30:

score: 0
Accepted
time: 34ms
memory: 118716kb

input:

cacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacaca...

output:

5625225001

result:

ok 1 number(s): "5625225001"

Test #31:

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

input:

acaacacbcacabbaaabbbbcbaabcccabbbabaabbbccaabcbbbcaabbbbcbbcaacabaccbbacbaccacbbbabaccbaabbbccaaccbcbbaabbccccca

output:

2024

result:

ok 1 number(s): "2024"

Test #32:

score: 0
Accepted
time: 14ms
memory: 37788kb

input:

babbaccacaaababacacbaccabcaaacbcacaaababaababbbcbccbcccabcabbbacbbbbccccbcaccbbccbbaaacacaacbbabccccaabcbbabaabbaaccababaccaacabcacbccacccbaaabaacbcabbcabacbaacbabcaabcbcabacbaacacaabccbabbabbabacbacaccaccccacbcbcbbabbbaabcaabacbbacacbbccccaaaaacaacbccbbacbacabcaccccccbcacaacccccbcbcbbaacaabcaabbbcb...

output:

365780747

result:

ok 1 number(s): "365780747"

Test #33:

score: 0
Accepted
time: 30ms
memory: 53640kb

input:

abbcbcaabaaaabacbcbbcabababaabcbbbacbbabcbcccbacaaaaacaccaabcbcccababbaabccaaabbcaaccccbbbbcbaccabcabcbbcacaacababbcbacbccacccababbabacbcacccbcbbbbacbbabaaabaabcaaccbbcabbbccabbcbabaaaccabbaccabaccbbaacbaabbbacaaacabaaccabcabbbabaaaacabababbaaabcaacbbbbbcabccaccabaacbcbaaaaaabbbbcacabccabacacbbacbba...

output:

1252345802

result:

ok 1 number(s): "1252345802"

Test #34:

score: 0
Accepted
time: 32ms
memory: 52540kb

input:

bcccccbcacaccccccbcaaccaacccabbbbbbaaacccacbccbbabaacbabbaaabbcbcababcbaacbacbababccabbaccabcccbbacabaaccacccbcaacaccccaacccaaccccacbbaaaabcbbcbcabbbbbabbabacbbcacbccabaacbacbaaccbbbacccccbcbaabcccabbccbcbbaccacbcabbcacbbbccbbcabcacccaacaacccbabbbabccabacaabbaaabcccaabccaaaacbccbabbcbacbbbcbcabcbacc...

output:

1554129143

result:

ok 1 number(s): "1554129143"

Test #35:

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

input:

abcccabcbcaccbaacbbcacbabbababaabcabbbbbccacbcaacabccabcaabbbcaaaaabcccaacabbbbcbabccbbbbccbabccaaacacbabbbbbababcacbabbacbccbbababcabbcabccaaacccbbcabbcaabbcbacabbcbaacacbbbcbcbbbbccbccbcbaabaaccbcccbbcabcaababbababcacbbaabbbcccbcbabbcacabbccbcacaabcabacbabcbaacbcaaaccccaccbccbabaabbccbcbacaababbbb...

output:

3010750398

result:

ok 1 number(s): "3010750398"

Test #36:

score: 0
Accepted
time: 71ms
memory: 77368kb

input:

bcccaabcabaaacbbbcacbccbaccccaabaaaacccacccaabbaabacbaaacbccabcaccaccaccbacabbcaccccaacabccabaaacbbcaacacbccaccccccababcabbaaacbabbccbcbbcaabccbabbcbccbccccacbaacbbccaaababcbcabccaaccbbbbaccbcbbacbcbccaaaaaccaccacbccbaccaaaacacabaabcbcacccaaaccccaaccbcaaccccbabbccbbbbcacaaaabacabbbacaaabccbcbbbbcbbc...

output:

4888615152

result:

ok 1 number(s): "4888615152"

Test #37:

score: 0
Accepted
time: 91ms
memory: 82828kb

input:

caccbbbcbbaacccbbbabacabbabcacabbcbcbcaacbabcbbbacbcaaabaaaccbaaaacaaacabaabacaabbbacaabbcabaaaccaacaaaaaccababbabbacccbacbaabcbcaaccccaabbaabbccacbabcbaacabbbaaabcccacaabccbcbcbaacaabcbccccbbabcbbbcbabbbbcbacaaacbbaaaaaabacaaabaccbbbcabbabcaccbacabbcabbbacaccacbaabbacccbcacbaaacaababacababbabbcaaab...

output:

5976402426

result:

ok 1 number(s): "5976402426"

Test #38:

score: 0
Accepted
time: 106ms
memory: 92272kb

input:

bcbaccacccbbabbaccbabcabacbabacbcbbcccacccbaccbababbbbcaabcbaaabcbcbbacbbaaababbbbcbcacbacbbaaaabbccbbbcaabbaaacbbccbbaaaccacaabcaccbacaacccbabaaababbaabbcabbcaabcbbbcaccacccacaacabcbbbaabcabbbccbbbbaaccaabcbbbbcbbcacbbcbbaabcbccbbaacbbbcacabacaacbcbbabbacbbaccbabccaacaaccbbcbaabbaacaacbbaccbbabbbcb...

output:

7791334008

result:

ok 1 number(s): "7791334008"

Test #39:

score: 0
Accepted
time: 124ms
memory: 104264kb

input:

bbacaaababcaabacbbbbcbcbbacacabaabcbaaaabbcacaaaabbaccbaabbacbacbabbaccacbccccccacbbccacbbccbabbaacccbaabbaabbabbccccaaacbaccbccacbcbcbabbcccccbbcbcaaaacbbbaccbabacbbbaabaccbccbccaccbbbacaacabbccaabcbcacbbccaaabacabababcccaaabccaacbbbbbaaccaaccbacaabbbbcbbacbaccbcabccccbababbacbabcbcaaacaacacccccbac...

output:

10385658005

result:

ok 1 number(s): "10385658005"

Test #40:

score: 0
Accepted
time: 132ms
memory: 113460kb

input:

cabcabacaccbbccbaabbabbaaaababcbbbcbcaaaabccabccacbcbcbacccbbccbbcbccbaacacbbccaabcbabaaccbcbacccccbabccacbbcbacbabccbbcccabcbacbcaaababcaaaabcccaaccacbccccccccbcbbccabbabcbaabacacaaaaacbbbccbcbbacabaaababaccbcbcccabcaacbbccbaccaabccbcacbacccaabcbccabbbbcaacccacaaaacababcbbbcacccacaacbbcabaacccbbcca...

output:

13185061526

result:

ok 1 number(s): "13185061526"

Test #41:

score: 0
Accepted
time: 139ms
memory: 120604kb

input:

cbcabaabcabcabbabcaaababccabcacbaccbacaaacbbaaabaaaabacccbcaacccaabababaccbcbbabbbabcbbbcbaaccaababaccababbacaacabbccbbcbcccbabaacacaabaccbcbbbacbbaaaaccaaabcabacabcbbacbacbbcccbcbcbacaacbacabbcaacbbbacaaaabababcbbcbbbbbcccabccbbbbbbccbaaabcaaababbbcaabcabaaccbacccaacbaababbbacacacbccacabaacabaaccaa...

output:

14999060148

result:

ok 1 number(s): "14999060148"

Test #42:

score: 0
Accepted
time: 6ms
memory: 30052kb

input:

hheggdefeghbecgebacfegbecgfhfcgbdhgedchffaffbfceagagfddhfdgabhggecafdghhbhhchbebhgfcbcfcdgadheagbhfbfffaggeedffchfbdbceafffahhdfgdhhaeaabgbdgcdfbggdheaagdacffgbfdebaehheefhdbgbhbedfhfgbhabdhfahcabadhdgaebfaaagaggbeahacdhdfgchbggbgddbgcfchcghgdcdbddhfeahbfbhhhhbehfagdgdgehggaccheggeeeagcfeaagedcdbgga...

output:

30153449

result:

ok 1 number(s): "30153449"

Test #43:

score: 0
Accepted
time: 17ms
memory: 43556kb

input:

aagafaffcecgeeechbdhgafdaffadedeefghaacdegccabhhhfabcfachbeabcehbcfddgcebbhbehhhcgbhbgaecghfgdaaadhdfbeadfdhggeecedhdfbeaechhcgcbefhhcbdhgfcdgaccfgceegggccgfhaddfhgggdhaddbccbafaahbbaebaeeddfabbcchbbddcebgagbgahbadecgdbhhbgcdddfehefebghacehecgdabbbaabdbfbeabhgeffgafaehcebgddeeegfhcccafchhagbadadhdbb...

output:

203976827

result:

ok 1 number(s): "203976827"

Test #44:

score: 0
Accepted
time: 32ms
memory: 52344kb

input:

dbbddcdahdabdgfdcfbbcfgdcabgcedfeagedgddbefhhghhafdaaddfaaabebcbcdbdbgfbeebdccbafaffhdeecgdahbfdbhggcdaeahdgaehhdfcbadhfhegccbeahadcfcabhaggabgbdfgebhhadeddeabaeefehfabhebehbfbeabadaaddcfbaadfcbbhhgachaabgcgcbcfahdeffbbghgdfchghhedadhgffhadgdcedggggbfaghceecfdhbhadafaabdfaebecdhhcdceaaebdabbagbchfha...

output:

501171381

result:

ok 1 number(s): "501171381"

Test #45:

score: 0
Accepted
time: 39ms
memory: 56732kb

input:

ecdfghcdcfddgehbhaehggfbfgechhaadebbbhhedheehabceebabeddabbdabcaebfbghafcbgedahbbdgfbefagadcecbaedaccchfaacdchedhdgchahecbbhffafbaechhcagdagaeacfahbbgfbebfbfgdeghdaghhfcebbcfehgcagfbdbfhefhhcccfbagaaeahbfcgecbdgebhgfafhgafadggbegeeffeebcgdfegbgbadhfghfcfffaefbgbefgfahbbfdchdaccgeadfghhggadchahddabbb...

output:

737411855

result:

ok 1 number(s): "737411855"

Test #46:

score: 0
Accepted
time: 47ms
memory: 56856kb

input:

hbddbbhefahedgdadechegfdcahaaffechedfbghfhfefeeedegghhacfecahaedahgeghbaahbcefhafbbhegcahaeacchgdcghchfacdghcbadbfbadbachcefadffgcdcfhacgfhbbcdhehhgefhfdfbeeecehdacdgfhecfgddcfcgfdfggafeebfecddffhfefcgghbhdcahahbefbcdcchbebdaaccaghcgceebbbhgdhbcdfgahadfhadachhgfbahbhfcdghddfgahdhafabecebgfgbhheccgaa...

output:

911249835

result:

ok 1 number(s): "911249835"

Test #47:

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

input:

hbfgdhhdghbbdbgfbgeaffaadehhfgbcbcgfcadafcgdgbfahbdbdbadbbahabfcaafhecdgagbdbacbffedcfdgcdghcabghdfgedbhdegehahbdadgbdbadbgegdaadggceagcgahgcaceahdfdcadchagdcfbdcabcbcdfcegacaeachadddhfddhdfebddgedhedgdebccfcgddhhegebgcgaegbddbbhfedfegedhgahggdechhbbbcbfchcfcbfegbbabdbadddhfdfbgccebhfbdgaaafhaehbaeh...

output:

1640841656

result:

ok 1 number(s): "1640841656"

Test #48:

score: 0
Accepted
time: 94ms
memory: 79432kb

input:

bghggchdfcdhffffccdfdbfffdffcacaccbcdgdfcfdacaedhabeahdgggdbgcceegbhffdcbbbchghgebffhcaehgdfgffabgbcechhbgdefhfbebfdaebhbdbdaaacbffchfbcfcdgafeegdhdcegddadfbaaedhgaadehdcgdfcaeafhcdeagcghehaahcadhebhbbaeedchbaehheahcchhcbcagbhafacaabdecgahfdegchefacagheggeccfdeggebhbhdddhebdhfcedgdbchehhdehhfhfffhed...

output:

2707534869

result:

ok 1 number(s): "2707534869"

Test #49:

score: 0
Accepted
time: 98ms
memory: 82676kb

input:

aecgdbadegdbhdafeeefagaccehdfcbgghfggfhbfeacggchhegcdcdfcddfcheeggddfaaebeagfbbgaeahdachfcdhfcfhhbfghcghgecbedghdccfgdhfdaebgehebhcbhafabcadacefacdbbacggbcbfgfaefeacghahgabdccbcfbhgacdachgdccfagddgfcgfehhgfccbbgdebfgfgbgdfdabcfdhchfbdbhdhgafghhhfecgahchdhahghdabfddhdfhfdachadgcacchfcgeffbcdahaaggbba...

output:

2884360929

result:

ok 1 number(s): "2884360929"

Test #50:

score: 0
Accepted
time: 121ms
memory: 96820kb

input:

fbbaebheghacgdehgcbgcefechdhdhgaeahebhcbefcfdbfccagffheefacfhgabegaafafgeageccgahbbdfhbcdhbeggcbdhgabffgaffdgahcaeehhbadhabgbabfdgedaaefaggbgdgbbbacdheedbbhcdgebgbcfdadhhbdahhgaedhcfcggcchchaedafgehcfcebdgfhdhefgcdfdfagfhdgfdabhddcfabbdbhhfchhbbeaaacaegfeefaddagbbfehgfdefafehceecahhdgghddbcfhhccfbdd...

output:

4038141890

result:

ok 1 number(s): "4038141890"

Test #51:

score: 0
Accepted
time: 131ms
memory: 103072kb

input:

degfdbfaghagdhcggcbeeefeaeebbacbaaeggbhfeehfghheeacbedghhhfcbefahgfcehghddaaeedfhgdgcbdhfafchfheacbheebbchgdhghbebedggfchcgabaecebbdggheggcecfbghagehabhbhggheaacdbhddhbhhcbbfgffhcchcedheeedfaagdahddgcbcbfdcegbfhdbgcfcdcgfcbcffcccadfdeacgabcgebcdbagaceagacbcacgbedgddahfhadcchgfhddaghbggbfaaahhgchcddg...

output:

5052356122

result:

ok 1 number(s): "5052356122"

Test #52:

score: 0
Accepted
time: 135ms
memory: 106976kb

input:

egeacacfhbbgfcbfegggfcbcfdbfhdgadgahaggfagghcheedafgdadbdbbgeccgagaeggbccfggaebcaecceaefeffahgfhabhhabafgadcaafgdedfhfcdhhafhhcdahhhdgdgeeagcdadeedaecfdgbdaccacghdhddcachbgaacgfffbbeahfhaachcaccfdefbbachahfebccccdheghcfgcafeebhahfegghedaghdbbdhabgahdfcbaccgbdeehbgfcdahffecbhchcdbbhdaefbfbaedebgfhdcd...

output:

5625012518

result:

ok 1 number(s): "5625012518"

Test #53:

score: 0
Accepted
time: 9ms
memory: 30352kb

input:

ptjlikjjjoiootlnnnqqplimrslttmisooqomkkqlprkktoqqtmoprolmsillikkjptisnrnnqtoopqkmnsminmoommptospipnppltqiqoqrlkikpsrjooktipinrorsommnpqslqjnlmtqstmpsikokjikjpnjqlstslojppsnmitqtomqtsnpqlqjntiokkiliomtiktpjmpmstojmkrtmtinsinrtitonipmrqrrqikkttrsopjmprsrjmqmqnrkmrrslkqjlrnijjpotrokjqtkjsqriqlqrjoprtrq...

output:

25612936

result:

ok 1 number(s): "25612936"

Test #54:

score: 0
Accepted
time: 8ms
memory: 36752kb

input:

rmomrinpqijntispkjokrnklttrjkotktoskjpjqmtrilkqjiikijmirinnlqpqmktpsppkrqnlrtsnqjqroksrjoqkrlijiktrpsqqrnokmonmporllkqspjksstntpisinmtprrqismsolstlisinomrrjiprnqmtjipirislnrkomkotllrmplsrpsjmjjrpjkqoqrqmlnminkkjrtrssprmjnisjmimloljtrrtpqmqtjksliiqsioimnpnkitsrqmkjpolrplprlirimkrqjjtsslqlsqqjmnmliqkk...

output:

64584265

result:

ok 1 number(s): "64584265"

Test #55:

score: 0
Accepted
time: 19ms
memory: 41476kb

input:

irippnmqtikjmqlspkoqjtqnqmiimpkrtijnlljkmqjrspoisqninisjkkjsmmltirsnkmkriqmrtqrmnomrqlsmnjpjtkokpjrltppntmkitproiijsmkikrslnsptilspioosjikrttirslsoiilpknlntlmqljknmqoolmqirkoomonjkmomosskorqonjqnjikrnpmloqnqqqlqqrqsmiomtimptprjjkllirqkljpkrsojpsnnnlkjrnmlrklimpjrnstrpskmrmjssljlnsrpnkpjlmpnrkmponjit...

output:

186972919

result:

ok 1 number(s): "186972919"

Test #56:

score: 0
Accepted
time: 36ms
memory: 56700kb

input:

pnktrrorlprjqiptqrmomqimrnnprsmprtmlsstllirqnskpsplrjsmntmnsoqjqjtinmljttlsnpomkknipqpmlkmipsrrqjilnjqpsqrmnksmnppljmjtjirtqisnijlmtsntkqrqnotjsoqnqpkjmnsrkkrrppmiottmonikpkkjnnjssprostipnkikkjsoqtmolpkrmlklnojnmjsklqoiojssmssmlpknmilkinttonkknmsjnporllpsokpknpirnskitljjjisptktltrskqtpppotnmposlqqtr...

output:

552643518

result:

ok 1 number(s): "552643518"

Test #57:

score: 0
Accepted
time: 48ms
memory: 63316kb

input:

rkjpqipjjporqmjtkqmmptmplrmomrmpisppiipkmsprpslilrikkppmitkirnsqlnrornqnmtjjtjojossptsrkqnmqjqlkprlrptmkrtltnsortknkptkrmmiislmrlmmrtnjlqopknqmjllkiplqmptlplkmtmmsnplokntlopqlrkinlrnnqoqrnlqlsrolrioqplqltqmpqtqjrkrmiisoomrjtpkintroqoqnjkpqqkriqtqnnsnnkrnsjjmjjsrillktnstponrqoknrppiqsontrimrktrkioisr...

output:

812284221

result:

ok 1 number(s): "812284221"

Test #58:

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

input:

stnsomiskjrlrnkkslkpjllipirpqslrqrjktmskkmilqkkonmoitjsrotsikrlontorkjlrorrknjpjjionmkokqtprijkqjsqnkttsoqtljkjpslisioiqpsmmtrqiqkimmpissnmmtsmjijolisitirkinjmrkknrpmqqjllmiipttopqpjnstqqmrotioikliolnjmjolisqonoooqioitjsmkmiosnqrslrijmqmktjplslijnktjljmimsinktjpssmnsrqlqjjqmqoolpilojjjpksiltnrqtttjn...

output:

1330293994

result:

ok 1 number(s): "1330293994"

Test #59:

score: 0
Accepted
time: 83ms
memory: 76728kb

input:

nlitktppjtjpoiqpqsksslqttqtillpiljjrmrnnttnoqssojtrikkrjpmlljqtilmpmstkmjitlpsilnpsrtqotllptpitqnkrqmnnrjjskmlrlnqjnmqrmjmkkmlsmjptrtqtpnlslkronoptnssqqpimkinkolnriptitppposioooqoploprolsrilmloolpssljisotsjknotmmtnpmprsjlitjipjtljrqilnojpotspqqrkqtirorsqrmtmqmlnoqpisqnormkokmjrkkknmmiptlqjopiqrsnlil...

output:

1723235581

result:

ok 1 number(s): "1723235581"

Test #60:

score: 0
Accepted
time: 87ms
memory: 79720kb

input:

tqkkrlqokpttlolqtolsopllqqjmmkrrrjksklplmiijrisqkjkmqntmrilmtsjktlqimitnnimirnmtomkkolmqtmtpnijqstssoiqirkrkpiqitststrlqtnntqlssrrtokolmskjnplsqiiijlpoojsjopltqsmkrmnqkkrknkjlkkjtponrmmilkotqksqnkktjrjsoqpsoorsomrpprnkojsrsnrooqrlmknooikopqioolsoispjqpjimqookkkrnlqnsktjlrikqrpqnkmqpsritprlnnqilkkssk...

output:

1860579178

result:

ok 1 number(s): "1860579178"

Test #61:

score: 0
Accepted
time: 105ms
memory: 92980kb

input:

psqrqmlrnnqkmslqskmrqpormqiiioprolqljmqnlpoimpmisikliilsrioskrpintqktmlqrojplrprimjlsqnjrmpomqlmsmtptmipmsinrsktskjtjskjiksnspjitikqrnpkllljnqtnkktrppiqmlpkjnpkljqmnlqrkjpqmpmmpikijkrmkptnnstionjtkromjqlmkmprkipjsmospkjssmpmmsoknptoinimskjnrojtqmlnomrkliikkokqntrilkjinoslnpiomtittommrqoiklnjpskklqtn...

output:

2751920446

result:

ok 1 number(s): "2751920446"

Test #62:

score: 0
Accepted
time: 117ms
memory: 102104kb

input:

iroiqrttopkrosssnlimqpiioplsptqqlqsiirtjrjjqpostsrmpsslmnjlrstppkpqskikpipnsjpqrojioollrtrmjlkqqlnlttqrnoslrsnnkmtlokkrlnmqsjqppplppitpnrkttimimmsitmljlsnrsprnjrnloqpjnsknnrmssqljqpsnilnjlsojjlsrtposqjlmkpkjjksqplpioqtjspritstllrkoojmkmniiitrpsmsprjijptlrtspksknkqlrkrppipstmskpikrqskriissskilnjrstps...

output:

3488028595

result:

ok 1 number(s): "3488028595"

Test #63:

score: 0
Accepted
time: 135ms
memory: 102944kb

input:

ooqkslptpknjlpmsjnpqonmirpjkltlijplrnnnmjpqsqoiqpiosqmnkjrontssrpnitsssiktspiosojpnooijqpmsknirionorklqojrknqllotnqpilokrttoqrrpqkslqtijikiqmnprjtrkpponnomrjnslpjoinirpkrjtlqoqllstprotkknopmtrnrijrnjpklilktlsnisnpjokistklnsmnkispnssktrqmilptpnnilnjolqqrojiorqolsrsrjjjsostkkitrljikmojiknjojskskojlost...

output:

3749951500

result:

ok 1 number(s): "3749951500"

Test #64:

score: 0
Accepted
time: 3ms
memory: 30284kb

input:

cspjtokhiqhudcgferqdcydsfepvytvwaatevhozykkkzcesevihelkvuvyqhbaxcaruhntjfuasnsltzmrzravqhcqouzqnaeywnyvfyfikoobykkjencsvzakgjxvgjpxtxtuutkfpyykbxlsewadunppfreamzviahkitjdrbvlriwlekhvutttydecdvoxowjfjsnnntxwqlidfccsynqmlkbqefwmsnlnbgoxivwbxihsjjubmuyadjcyoqyeqferyphniyjwjndtillzbrlfhduiveaobpavreceav...

output:

8404372

result:

ok 1 number(s): "8404372"

Test #65:

score: 0
Accepted
time: 8ms
memory: 31460kb

input:

rwqjauogesdbygmyskfqagwmqcoqqdfeeguythelvazcbobrtfvoansrfhslmepzxrvclquurcjctnyetcunzauejrzsmjkkvcnrjqpusolvxysatpnnwpfhsllhxqecaaobgfxnewrjfumsmblifsijsknmafmsnudqdcpbvrqknrqbgaudraarlgrneosvdmqwijgzsdxwhutzyuemdozamhtwplowoxpferszjajvjtqfjaboveeffckhmgbeimibepmawnknsfkbtgrxajgjyxymuhoyyanchtjohlcw...

output:

26124260

result:

ok 1 number(s): "26124260"

Test #66:

score: 0
Accepted
time: 25ms
memory: 39936kb

input:

xtlngwojmsktiklwyootvxjcdewpoayvhbkiigmwegwcxqxuevphgzxidnlsebmsiuiciiokupxuudqnbbeesxvafjyipesfykrtpklmbtardevscceevfhfaeghcuqrzkrxhhqkgqvpisdfrhjpbfuxjawhqncvipysmaiaqgetniizwurwyutjqlvzpmiszvwnfilewdafekmxoccfaicyaafrloybkzhlaobxxkfpdxayaqconimbhzapqtauagzouvbwqhscgcfwvzjfzysvyirkeodvrsakxckwqoem...

output:

81719497

result:

ok 1 number(s): "81719497"

Test #67:

score: 0
Accepted
time: 39ms
memory: 51064kb

input:

xzoijlxrcneobtzxsrftwpxszsjgwtwmkfvhlbcacqtmibtlikbojlmmlvisscponnlhliqdsqykrqjzhxutjxdtrsrfzggdsowiwigmyqclzkkrplacfpywbokbmtxelaemmfbkhiutdzkzibcerxfxfsugacspckmjloehinglaxihbqlgrmbkpemtxrjcrgrpkhrnpwzafioxvrtcwgnzebaiqbuexomuggplfmanmfkgehvphtbaixrvbbufkcfiihuzpmlhqqtwfyskhddwzixoxbxofwklmycnxuqy...

output:

258645715

result:

ok 1 number(s): "258645715"

Test #68:

score: 0
Accepted
time: 58ms
memory: 63484kb

input:

mripdormghtfqhjrdtolswppdqvevrvcuuudagmcczlzdwslyymdnhoubuqyzmaszlgwdhiqljjbohgmgagjhwysfcekvpoxwbtulybkoihjpkktshfdnzgkyamhnguaymlesmnptcwgmukbppgxjcmefoxhaydarkqvckeubyccbjsmnzrvvexxqjqezhpzjjdgyycndmazeftjxfvbwbxohzuqkbzizaosgajxpnqbsypzuzcbgbucdukdpwormrxpyitltehbgyveckfevfeadzafllieoixithkgknsx...

output:

400906876

result:

ok 1 number(s): "400906876"

Test #69:

score: 0
Accepted
time: 51ms
memory: 60260kb

input:

ilzdqmlwwaezxsypsrpzdxokyneowbrlmuqfhllkrkumzyqozenwrchcjdrqgzpobdgziczyivijuiylqsykufpcomkkbcnrsfwvkcbbygdwupgqmnhywmekcrcriguzzfrewddznaugbqknbcpmkzugncwnmhewpebdjrqudwsyalwfsvabmkpetosbettiivgpoyflurtmttsibwgwwlyxiemgscsjbrpksioicowbgrusymmfdmorkdrcdoltdunhbqspxhskejqafcnjbsgibokgrvcruzgdmsrnhfzk...

output:

449129670

result:

ok 1 number(s): "449129670"

Test #70:

score: 0
Accepted
time: 87ms
memory: 76060kb

input:

dcowxeuzvojnckdbwutdazoitvsmdsehsmgmfytqvuelurdkgxsrpikkgfkzyrehvqjlpsgryoyomxstnzogmoxoznolxogmpcjpqijcypnpedvimqpmvyqckrefrktekgijhbfpatvtckirexrussmgtkaioyyhwrisgzosdoksskojlgboorbzhoqpqtemqthmdidkvmahycrsznfnmqxeyionkevlsgotbjayiifvmfcgfmmgupjbkewoljuwbzngtdeaimoftfurbeymnagdwagtebntksjxfjerucgw...

output:

842920551

result:

ok 1 number(s): "842920551"

Test #71:

score: 0
Accepted
time: 85ms
memory: 76968kb

input:

nfiykjdlphvipvcqkghwncbsbjxpzxvrgpgepbyyomfuynyyfxdjdgtrdhwzcgjuxzjenrxjnxmgdcdzlwxdtwxgxygxebsfvxkolresweohvdhnmaifjjsrynklpcqellblsjxzpreqsmckndnajavcymhsxcrzkjihpwshxpjqsljivvwoljforlteoviuifchhkfvkhykrlgdhhobmvwwxrtowhlzgjzfkhjtpxmxxjxpiyaacgjwynoerhmupipvlhzmamfcllniygitiojvxdorxtyjouaoeeufexrg...

output:

888008404

result:

ok 1 number(s): "888008404"

Test #72:

score: 0
Accepted
time: 117ms
memory: 85796kb

input:

sjjukizbibjtbauflblwyfojalcrofjbpxzudxxtgowfcemimkdsfyzliybwlfbsmwkszspvzrfhflvgfcgxvpepgvievlyfeabtdflpuburjchoicjtktqpvbtmdnihcqvcpwvdsprkddopipytgtufwgtstpwwmhvttzynodeolwrjfnvgodsrkatzvciridvaytgziqsnrovnrurvfjifupirvyeyeqqmslbzlpbamkmylaeytgppdfebbwvjbrtrajghqurgmqeezactpazxakicygrmstosxnpnodja...

output:

1200839973

result:

ok 1 number(s): "1200839973"

Test #73:

score: 0
Accepted
time: 142ms
memory: 95200kb

input:

hagqpwqpggozvvhkaipeufecoblbdgfuuivutvgvpqifliskqdpyysacvkgacqixifhxambcxnbqmqmigubgegkupooomeltpbmkhocrtcmhlobwcffbdsfrrsmoimefbgcbojibzsdajhvjcbmuxozkhtulbkqegewuspayhrsfyjtahratopbevbezmqipateryrhitlsipggkjsvkouufigvhcoylidnoqkfklovdzxxhlzgiapsfzvlctazbwybjzpdwwxbonpqagtdozgodkmscobzmizwcgemrwzcb...

output:

1624365762

result:

ok 1 number(s): "1624365762"

Test #74:

score: 0
Accepted
time: 132ms
memory: 100296kb

input:

dyevsfmqfewmwkdtpvuydljawyxmnapgiyjuoiyohddrrdifhgrzffjzhmpirzwovixdgpuhbfqxwazaieevczvzrlsyrdlsseinhbknqqrqawfbqojfflwvyovowmsnjjrarzgwuxenabpshetfwwcvwvgipyxjkuynzrwhnkvfldtrjsxkylkelsrnjbxhtdzcacfodjugnxuzztyfdedefyhblebfvqzqkqrzkjahrwgdddcggpbcszahujgwwbmgjnfytxugueyltqykftbonwpvesrqutiuixtzidwj...

output:

1730786929

result:

ok 1 number(s): "1730786929"

Test #75:

score: 0
Accepted
time: 82ms
memory: 98044kb

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

13063858895

result:

ok 1 number(s): "13063858895"