QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#199835 | #7345. Circular Shift | PlentyOfPenalty# | AC ✓ | 225ms | 99060kb | C++20 | 2.1kb | 2023-10-04 14:17:33 | 2023-10-04 14:17:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=3e5;
int n;
char S[N+10];
int M=26,sz,rk[N+10],ar[N+10],sa[N+10],nw,ba[N+10];
int he[20][N+10];
void Getsa(){
for(int i=1;i<=M;++i)ba[i]=0;
for(int i=1;i<=n;++i)++ba[rk[i]];
for(int i=2;i<=M;++i)ba[i]+=ba[i-1];
for(int i=n;i>=1;--i)sa[ba[rk[ar[i]]]--]=ar[i];
}
void SA(){
M=27;
for(int i=1;i<=n;++i)rk[i]=S[i]-'a'+1,ar[i]=i;
Getsa();
for(int i=1;i<=n;i<<=1){
sz=0;
for(int j=n-i+1;j<=n;++j)ar[++sz]=j;
for(int j=1;j<=n;++j)if(sa[j]>i)ar[++sz]=sa[j]-i;
Getsa();
for(int j=1;j<=n;++j)ar[j]=rk[j];
rk[sa[1]]=nw=1;
for(int j=2;j<=n;++j)rk[sa[j]]=(sa[j]+i<=n&&sa[j-1]+i<=n&&ar[sa[j]]==ar[sa[j-1]]&&ar[sa[j]+i]==ar[sa[j-1]+i]?nw:++nw);
M=nw;
}
}
void Getheight(){
int ls=0;
for(int i=1;i<=n;++i){
ls?--ls:0;
if(rk[i]==1)continue;
while(i+ls<=n&&sa[rk[i]-1]+ls<=n&&S[i+ls]==S[sa[rk[i]-1]+ls])++ls;
he[0][rk[i]]=ls;
}
}
int num[30][N+10],ls[30],nx[30][N+10],li,ri,lg[N+10];
long long ans;
int LCP(int l,int r){
if(!l||!r)return 0;
if(l==r)return n;
int k=lg[r-l];
return min(he[k][l+1],he[k][r-(1<<k)+1]);
}
int main(){
scanf("%s",S+1),n=strlen(S+1);
SA(),Getheight();
for(int i=1;(1<<i)<=n;++i)for(int j=2;j+(1<<i)-1<=n;++j)he[i][j]=min(he[i-1][j],he[i-1][j+(1<<i-1)]);
//for(int i=1;i<=n;++i)printf("%s\n",S+sa[i]);
for(int i=2;i<=n;++i)lg[i]=lg[i>>1]+1;
for(int i=n;i>=1;--i){
for(int j=0;j<26;++j)num[j][i]=num[j][i+1];
++num[S[i]-'a'][i];
}
for(int i=1;i<=n;++i){
for(int j=0;j<26;++j)nx[j][i]=nx[j][i-1];
if(sa[i]>1)nx[S[sa[i]-1]-'a'][i]=i;
}
for(int i=n;i>=1;--i){
//cout<<"---------------\nI="<<i<<"\n";
if(sa[i]>1)ls[S[sa[i]-1]-'a']=i;
for(int j=0;j<26;++j)if(ls[j]||nx[j][i]){
//cout<<"CHAR="<<(char)(j+'a')<<"\n";
li=max(2,he[0][i]+1),ri=min(n-sa[i]+1,max(LCP(nx[j][i],i),LCP(i,ls[j]))+1);
//cout<<"li="<<li<<" ri="<<ri<<"\n";
if(li<=ri)ans+=num[j][sa[i]+li-1]-num[j][sa[i]+ri];
//cout<<"ANS="<<ans<<"\n";
}
}
for(int i=0;i<26;++i)ans+=!!num[i][1];
printf("%lld",ans);
return 0;
}
//abcda
//abaac
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 14324kb
input:
abaac
output:
7
result:
ok 1 number(s): "7"
Test #2:
score: 0
Accepted
time: 2ms
memory: 12216kb
input:
aaa
output:
3
result:
ok 1 number(s): "3"
Test #3:
score: 0
Accepted
time: 0ms
memory: 10156kb
input:
a
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: 0
Accepted
time: 1ms
memory: 10224kb
input:
z
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: 0
Accepted
time: 2ms
memory: 10232kb
input:
aa
output:
2
result:
ok 1 number(s): "2"
Test #6:
score: 0
Accepted
time: 0ms
memory: 12296kb
input:
az
output:
2
result:
ok 1 number(s): "2"
Test #7:
score: 0
Accepted
time: 0ms
memory: 12284kb
input:
za
output:
2
result:
ok 1 number(s): "2"
Test #8:
score: 0
Accepted
time: 1ms
memory: 10240kb
input:
zz
output:
2
result:
ok 1 number(s): "2"
Test #9:
score: 0
Accepted
time: 1ms
memory: 12164kb
input:
abc
output:
3
result:
ok 1 number(s): "3"
Test #10:
score: 0
Accepted
time: 1ms
memory: 12204kb
input:
aab
output:
3
result:
ok 1 number(s): "3"
Test #11:
score: 0
Accepted
time: 1ms
memory: 10236kb
input:
baa
output:
3
result:
ok 1 number(s): "3"
Test #12:
score: 0
Accepted
time: 0ms
memory: 12360kb
input:
dbda
output:
5
result:
ok 1 number(s): "5"
Test #13:
score: 0
Accepted
time: 0ms
memory: 14264kb
input:
dacc
output:
4
result:
ok 1 number(s): "4"
Test #14:
score: 0
Accepted
time: 2ms
memory: 14340kb
input:
cdaca
output:
6
result:
ok 1 number(s): "6"
Test #15:
score: 0
Accepted
time: 0ms
memory: 14316kb
input:
cddcc
output:
8
result:
ok 1 number(s): "8"
Test #16:
score: 0
Accepted
time: 0ms
memory: 14320kb
input:
adcbdb
output:
7
result:
ok 1 number(s): "7"
Test #17:
score: 0
Accepted
time: 0ms
memory: 14328kb
input:
cccccc
output:
6
result:
ok 1 number(s): "6"
Test #18:
score: 0
Accepted
time: 2ms
memory: 14348kb
input:
ccdcabb
output:
9
result:
ok 1 number(s): "9"
Test #19:
score: 0
Accepted
time: 2ms
memory: 14208kb
input:
bcbddca
output:
8
result:
ok 1 number(s): "8"
Test #20:
score: 0
Accepted
time: 0ms
memory: 14212kb
input:
cadababb
output:
11
result:
ok 1 number(s): "11"
Test #21:
score: 0
Accepted
time: 0ms
memory: 12284kb
input:
bdddcbbc
output:
11
result:
ok 1 number(s): "11"
Test #22:
score: 0
Accepted
time: 2ms
memory: 16268kb
input:
acdaabcdb
output:
10
result:
ok 1 number(s): "10"
Test #23:
score: 0
Accepted
time: 1ms
memory: 12168kb
input:
abcabdcad
output:
11
result:
ok 1 number(s): "11"
Test #24:
score: 0
Accepted
time: 2ms
memory: 14252kb
input:
bccbccccda
output:
17
result:
ok 1 number(s): "17"
Test #25:
score: 0
Accepted
time: 1ms
memory: 12284kb
input:
bbdddadcab
output:
14
result:
ok 1 number(s): "14"
Test #26:
score: 0
Accepted
time: 49ms
memory: 98868kb
input:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
output:
300000
result:
ok 1 number(s): "300000"
Test #27:
score: 0
Accepted
time: 47ms
memory: 94768kb
input:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
output:
300000
result:
ok 1 number(s): "300000"
Test #28:
score: 0
Accepted
time: 48ms
memory: 98936kb
input:
yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
output:
300000
result:
ok 1 number(s): "300000"
Test #29:
score: 0
Accepted
time: 96ms
memory: 97308kb
input:
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn...
output:
299988
result:
ok 1 number(s): "299988"
Test #30:
score: 0
Accepted
time: 40ms
memory: 98780kb
input:
cacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacaca...
output:
5625225001
result:
ok 1 number(s): "5625225001"
Test #31:
score: 0
Accepted
time: 0ms
memory: 18404kb
input:
acaacacbcacabbaaabbbbcbaabcccabbbabaabbbccaabcbbbcaabbbbcbbcaacabaccbbacbaccacbbbabaccbaabbbccaaccbcbbaabbccccca
output:
2024
result:
ok 1 number(s): "2024"
Test #32:
score: 0
Accepted
time: 16ms
memory: 38428kb
input:
babbaccacaaababacacbaccabcaaacbcacaaababaababbbcbccbcccabcabbbacbbbbccccbcaccbbccbbaaacacaacbbabccccaabcbbabaabbaaccababaccaacabcacbccacccbaaabaacbcabbcabacbaacbabcaabcbcabacbaacacaabccbabbabbabacbacaccaccccacbcbcbbabbbaabcaabacbbacacbbccccaaaaacaacbccbbacbacabcaccccccbcacaacccccbcbcbbaacaabcaabbbcb...
output:
365780747
result:
ok 1 number(s): "365780747"
Test #33:
score: 0
Accepted
time: 24ms
memory: 49048kb
input:
abbcbcaabaaaabacbcbbcabababaabcbbbacbbabcbcccbacaaaaacaccaabcbcccababbaabccaaabbcaaccccbbbbcbaccabcabcbbcacaacababbcbacbccacccababbabacbcacccbcbbbbacbbabaaabaabcaaccbbcabbbccabbcbabaaaccabbaccabaccbbaacbaabbbacaaacabaaccabcabbbabaaaacabababbaaabcaacbbbbbcabccaccabaacbcbaaaaaabbbbcacabccabacacbbacbba...
output:
1252345802
result:
ok 1 number(s): "1252345802"
Test #34:
score: 0
Accepted
time: 29ms
memory: 50644kb
input:
bcccccbcacaccccccbcaaccaacccabbbbbbaaacccacbccbbabaacbabbaaabbcbcababcbaacbacbababccabbaccabcccbbacabaaccacccbcaacaccccaacccaaccccacbbaaaabcbbcbcabbbbbabbabacbbcacbccabaacbacbaaccbbbacccccbcbaabcccabbccbcbbaccacbcabbcacbbbccbbcabcacccaacaacccbabbbabccabacaabbaaabcccaabccaaaacbccbabbcbacbbbcbcabcbacc...
output:
1554129143
result:
ok 1 number(s): "1554129143"
Test #35:
score: 0
Accepted
time: 42ms
memory: 60752kb
input:
abcccabcbcaccbaacbbcacbabbababaabcabbbbbccacbcaacabccabcaabbbcaaaaabcccaacabbbbcbabccbbbbccbabccaaacacbabbbbbababcacbabbacbccbbababcabbcabccaaacccbbcabbcaabbcbacabbcbaacacbbbcbcbbbbccbccbcbaabaaccbcccbbcabcaababbababcacbbaabbbcccbcbabbcacabbccbcacaabcabacbabcbaacbcaaaccccaccbccbabaabbccbcbacaababbbb...
output:
3010750398
result:
ok 1 number(s): "3010750398"
Test #36:
score: 0
Accepted
time: 61ms
memory: 68296kb
input:
bcccaabcabaaacbbbcacbccbaccccaabaaaacccacccaabbaabacbaaacbccabcaccaccaccbacabbcaccccaacabccabaaacbbcaacacbccaccccccababcabbaaacbabbccbcbbcaabccbabbcbccbccccacbaacbbccaaababcbcabccaaccbbbbaccbcbbacbcbccaaaaaccaccacbccbaccaaaacacabaabcbcacccaaaccccaaccbcaaccccbabbccbbbbcacaaaabacabbbacaaabccbcbbbbcbbc...
output:
4888615152
result:
ok 1 number(s): "4888615152"
Test #37:
score: 0
Accepted
time: 61ms
memory: 72092kb
input:
caccbbbcbbaacccbbbabacabbabcacabbcbcbcaacbabcbbbacbcaaabaaaccbaaaacaaacabaabacaabbbacaabbcabaaaccaacaaaaaccababbabbacccbacbaabcbcaaccccaabbaabbccacbabcbaacabbbaaabcccacaabccbcbcbaacaabcbccccbbabcbbbcbabbbbcbacaaacbbaaaaaabacaaabaccbbbcabbabcaccbacabbcabbbacaccacbaabbacccbcacbaaacaababacababbabbcaaab...
output:
5976402426
result:
ok 1 number(s): "5976402426"
Test #38:
score: 0
Accepted
time: 65ms
memory: 79924kb
input:
bcbaccacccbbabbaccbabcabacbabacbcbbcccacccbaccbababbbbcaabcbaaabcbcbbacbbaaababbbbcbcacbacbbaaaabbccbbbcaabbaaacbbccbbaaaccacaabcaccbacaacccbabaaababbaabbcabbcaabcbbbcaccacccacaacabcbbbaabcabbbccbbbbaaccaabcbbbbcbbcacbbcbbaabcbccbbaacbbbcacabacaacbcbbabbacbbaccbabccaacaaccbbcbaabbaacaacbbaccbbabbbcb...
output:
7791334008
result:
ok 1 number(s): "7791334008"
Test #39:
score: 0
Accepted
time: 88ms
memory: 85464kb
input:
bbacaaababcaabacbbbbcbcbbacacabaabcbaaaabbcacaaaabbaccbaabbacbacbabbaccacbccccccacbbccacbbccbabbaacccbaabbaabbabbccccaaacbaccbccacbcbcbabbcccccbbcbcaaaacbbbaccbabacbbbaabaccbccbccaccbbbacaacabbccaabcbcacbbccaaabacabababcccaaabccaacbbbbbaaccaaccbacaabbbbcbbacbaccbcabccccbababbacbabcbcaaacaacacccccbac...
output:
10385658005
result:
ok 1 number(s): "10385658005"
Test #40:
score: 0
Accepted
time: 100ms
memory: 95080kb
input:
cabcabacaccbbccbaabbabbaaaababcbbbcbcaaaabccabccacbcbcbacccbbccbbcbccbaacacbbccaabcbabaaccbcbacccccbabccacbbcbacbabccbbcccabcbacbcaaababcaaaabcccaaccacbccccccccbcbbccabbabcbaabacacaaaaacbbbccbcbbacabaaababaccbcbcccabcaacbbccbaccaabccbcacbacccaabcbccabbbbcaacccacaaaacababcbbbcacccacaacbbcabaacccbbcca...
output:
13185061526
result:
ok 1 number(s): "13185061526"
Test #41:
score: 0
Accepted
time: 112ms
memory: 98628kb
input:
cbcabaabcabcabbabcaaababccabcacbaccbacaaacbbaaabaaaabacccbcaacccaabababaccbcbbabbbabcbbbcbaaccaababaccababbacaacabbccbbcbcccbabaacacaabaccbcbbbacbbaaaaccaaabcabacabcbbacbacbbcccbcbcbacaacbacabbcaacbbbacaaaabababcbbcbbbbbcccabccbbbbbbccbaaabcaaababbbcaabcabaaccbacccaacbaababbbacacacbccacabaacabaaccaa...
output:
14999060148
result:
ok 1 number(s): "14999060148"
Test #42:
score: 0
Accepted
time: 4ms
memory: 33280kb
input:
hheggdefeghbecgebacfegbecgfhfcgbdhgedchffaffbfceagagfddhfdgabhggecafdghhbhhchbebhgfcbcfcdgadheagbhfbfffaggeedffchfbdbceafffahhdfgdhhaeaabgbdgcdfbggdheaagdacffgbfdebaehheefhdbgbhbedfhfgbhabdhfahcabadhdgaebfaaagaggbeahacdhdfgchbggbgddbgcfchcghgdcdbddhfeahbfbhhhhbehfagdgdgehggaccheggeeeagcfeaagedcdbgga...
output:
30153449
result:
ok 1 number(s): "30153449"
Test #43:
score: 0
Accepted
time: 16ms
memory: 40564kb
input:
aagafaffcecgeeechbdhgafdaffadedeefghaacdegccabhhhfabcfachbeabcehbcfddgcebbhbehhhcgbhbgaecghfgdaaadhdfbeadfdhggeecedhdfbeaechhcgcbefhhcbdhgfcdgaccfgceegggccgfhaddfhgggdhaddbccbafaahbbaebaeeddfabbcchbbddcebgagbgahbadecgdbhhbgcdddfehefebghacehecgdabbbaabdbfbeabhgeffgafaehcebgddeeegfhcccafchhagbadadhdbb...
output:
203976827
result:
ok 1 number(s): "203976827"
Test #44:
score: 0
Accepted
time: 29ms
memory: 51200kb
input:
dbbddcdahdabdgfdcfbbcfgdcabgcedfeagedgddbefhhghhafdaaddfaaabebcbcdbdbgfbeebdccbafaffhdeecgdahbfdbhggcdaeahdgaehhdfcbadhfhegccbeahadcfcabhaggabgbdfgebhhadeddeabaeefehfabhebehbfbeabadaaddcfbaadfcbbhhgachaabgcgcbcfahdeffbbghgdfchghhedadhgffhadgdcedggggbfaghceecfdhbhadafaabdfaebecdhhcdceaaebdabbagbchfha...
output:
501171381
result:
ok 1 number(s): "501171381"
Test #45:
score: 0
Accepted
time: 28ms
memory: 52848kb
input:
ecdfghcdcfddgehbhaehggfbfgechhaadebbbhhedheehabceebabeddabbdabcaebfbghafcbgedahbbdgfbefagadcecbaedaccchfaacdchedhdgchahecbbhffafbaechhcagdagaeacfahbbgfbebfbfgdeghdaghhfcebbcfehgcagfbdbfhefhhcccfbagaaeahbfcgecbdgebhgfafhgafadggbegeeffeebcgdfegbgbadhfghfcfffaefbgbefgfahbbfdchdaccgeadfghhggadchahddabbb...
output:
737411855
result:
ok 1 number(s): "737411855"
Test #46:
score: 0
Accepted
time: 39ms
memory: 55740kb
input:
hbddbbhefahedgdadechegfdcahaaffechedfbghfhfefeeedegghhacfecahaedahgeghbaahbcefhafbbhegcahaeacchgdcghchfacdghcbadbfbadbachcefadffgcdcfhacgfhbbcdhehhgefhfdfbeeecehdacdgfhecfgddcfcgfdfggafeebfecddffhfefcgghbhdcahahbefbcdcchbebdaaccaghcgceebbbhgdhbcdfgahadfhadachhgfbahbhfcdghddfgahdhafabecebgfgbhheccgaa...
output:
911249835
result:
ok 1 number(s): "911249835"
Test #47:
score: 0
Accepted
time: 77ms
memory: 67828kb
input:
hbfgdhhdghbbdbgfbgeaffaadehhfgbcbcgfcadafcgdgbfahbdbdbadbbahabfcaafhecdgagbdbacbffedcfdgcdghcabghdfgedbhdegehahbdadgbdbadbgegdaadggceagcgahgcaceahdfdcadchagdcfbdcabcbcdfcegacaeachadddhfddhdfebddgedhedgdebccfcgddhhegebgcgaegbddbbhfedfegedhgahggdechhbbbcbfchcfcbfegbbabdbadddhfdfbgccebhfbdgaaafhaehbaeh...
output:
1640841656
result:
ok 1 number(s): "1640841656"
Test #48:
score: 0
Accepted
time: 92ms
memory: 76152kb
input:
bghggchdfcdhffffccdfdbfffdffcacaccbcdgdfcfdacaedhabeahdgggdbgcceegbhffdcbbbchghgebffhcaehgdfgffabgbcechhbgdefhfbebfdaebhbdbdaaacbffchfbcfcdgafeegdhdcegddadfbaaedhgaadehdcgdfcaeafhcdeagcghehaahcadhebhbbaeedchbaehheahcchhcbcagbhafacaabdecgahfdegchefacagheggeccfdeggebhbhdddhebdhfcedgdbchehhdehhfhfffhed...
output:
2707534869
result:
ok 1 number(s): "2707534869"
Test #49:
score: 0
Accepted
time: 88ms
memory: 78356kb
input:
aecgdbadegdbhdafeeefagaccehdfcbgghfggfhbfeacggchhegcdcdfcddfcheeggddfaaebeagfbbgaeahdachfcdhfcfhhbfghcghgecbedghdccfgdhfdaebgehebhcbhafabcadacefacdbbacggbcbfgfaefeacghahgabdccbcfbhgacdachgdccfagddgfcgfehhgfccbbgdebfgfgbgdfdabcfdhchfbdbhdhgafghhhfecgahchdhahghdabfddhdfhfdachadgcacchfcgeffbcdahaaggbba...
output:
2884360929
result:
ok 1 number(s): "2884360929"
Test #50:
score: 0
Accepted
time: 108ms
memory: 86924kb
input:
fbbaebheghacgdehgcbgcefechdhdhgaeahebhcbefcfdbfccagffheefacfhgabegaafafgeageccgahbbdfhbcdhbeggcbdhgabffgaffdgahcaeehhbadhabgbabfdgedaaefaggbgdgbbbacdheedbbhcdgebgbcfdadhhbdahhgaedhcfcggcchchaedafgehcfcebdgfhdhefgcdfdfagfhdgfdabhddcfabbdbhhfchhbbeaaacaegfeefaddagbbfehgfdefafehceecahhdgghddbcfhhccfbdd...
output:
4038141890
result:
ok 1 number(s): "4038141890"
Test #51:
score: 0
Accepted
time: 137ms
memory: 96016kb
input:
degfdbfaghagdhcggcbeeefeaeebbacbaaeggbhfeehfghheeacbedghhhfcbefahgfcehghddaaeedfhgdgcbdhfafchfheacbheebbchgdhghbebedggfchcgabaecebbdggheggcecfbghagehabhbhggheaacdbhddhbhhcbbfgffhcchcedheeedfaagdahddgcbcbfdcegbfhdbgcfcdcgfcbcffcccadfdeacgabcgebcdbagaceagacbcacgbedgddahfhadcchgfhddaghbggbfaaahhgchcddg...
output:
5052356122
result:
ok 1 number(s): "5052356122"
Test #52:
score: 0
Accepted
time: 131ms
memory: 95340kb
input:
egeacacfhbbgfcbfegggfcbcfdbfhdgadgahaggfagghcheedafgdadbdbbgeccgagaeggbccfggaebcaecceaefeffahgfhabhhabafgadcaafgdedfhfcdhhafhhcdahhhdgdgeeagcdadeedaecfdgbdaccacghdhddcachbgaacgfffbbeahfhaachcaccfdefbbachahfebccccdheghcfgcafeebhahfegghedaghdbbdhabgahdfcbaccgbdeehbgfcdahffecbhchcdbbhdaefbfbaedebgfhdcd...
output:
5625012518
result:
ok 1 number(s): "5625012518"
Test #53:
score: 0
Accepted
time: 3ms
memory: 33896kb
input:
ptjlikjjjoiootlnnnqqplimrslttmisooqomkkqlprkktoqqtmoprolmsillikkjptisnrnnqtoopqkmnsminmoommptospipnppltqiqoqrlkikpsrjooktipinrorsommnpqslqjnlmtqstmpsikokjikjpnjqlstslojppsnmitqtomqtsnpqlqjntiokkiliomtiktpjmpmstojmkrtmtinsinrtitonipmrqrrqikkttrsopjmprsrjmqmqnrkmrrslkqjlrnijjpotrokjqtkjsqriqlqrjoprtrq...
output:
25612936
result:
ok 1 number(s): "25612936"
Test #54:
score: 0
Accepted
time: 13ms
memory: 34980kb
input:
rmomrinpqijntispkjokrnklttrjkotktoskjpjqmtrilkqjiikijmirinnlqpqmktpsppkrqnlrtsnqjqroksrjoqkrlijiktrpsqqrnokmonmporllkqspjksstntpisinmtprrqismsolstlisinomrrjiprnqmtjipirislnrkomkotllrmplsrpsjmjjrpjkqoqrqmlnminkkjrtrssprmjnisjmimloljtrrtpqmqtjksliiqsioimnpnkitsrqmkjpolrplprlirimkrqjjtsslqlsqqjmnmliqkk...
output:
64584265
result:
ok 1 number(s): "64584265"
Test #55:
score: 0
Accepted
time: 15ms
memory: 44696kb
input:
irippnmqtikjmqlspkoqjtqnqmiimpkrtijnlljkmqjrspoisqninisjkkjsmmltirsnkmkriqmrtqrmnomrqlsmnjpjtkokpjrltppntmkitproiijsmkikrslnsptilspioosjikrttirslsoiilpknlntlmqljknmqoolmqirkoomonjkmomosskorqonjqnjikrnpmloqnqqqlqqrqsmiomtimptprjjkllirqkljpkrsojpsnnnlkjrnmlrklimpjrnstrpskmrmjssljlnsrpnkpjlmpnrkmponjit...
output:
186972919
result:
ok 1 number(s): "186972919"
Test #56:
score: 0
Accepted
time: 47ms
memory: 54632kb
input:
pnktrrorlprjqiptqrmomqimrnnprsmprtmlsstllirqnskpsplrjsmntmnsoqjqjtinmljttlsnpomkknipqpmlkmipsrrqjilnjqpsqrmnksmnppljmjtjirtqisnijlmtsntkqrqnotjsoqnqpkjmnsrkkrrppmiottmonikpkkjnnjssprostipnkikkjsoqtmolpkrmlklnojnmjsklqoiojssmssmlpknmilkinttonkknmsjnporllpsokpknpirnskitljjjisptktltrskqtpppotnmposlqqtr...
output:
552643518
result:
ok 1 number(s): "552643518"
Test #57:
score: 0
Accepted
time: 65ms
memory: 61840kb
input:
rkjpqipjjporqmjtkqmmptmplrmomrmpisppiipkmsprpslilrikkppmitkirnsqlnrornqnmtjjtjojossptsrkqnmqjqlkprlrptmkrtltnsortknkptkrmmiislmrlmmrtnjlqopknqmjllkiplqmptlplkmtmmsnplokntlopqlrkinlrnnqoqrnlqlsrolrioqplqltqmpqtqjrkrmiisoomrjtpkintroqoqnjkpqqkriqtqnnsnnkrnsjjmjjsrillktnstponrqoknrppiqsontrimrktrkioisr...
output:
812284221
result:
ok 1 number(s): "812284221"
Test #58:
score: 0
Accepted
time: 85ms
memory: 68276kb
input:
stnsomiskjrlrnkkslkpjllipirpqslrqrjktmskkmilqkkonmoitjsrotsikrlontorkjlrorrknjpjjionmkokqtprijkqjsqnkttsoqtljkjpslisioiqpsmmtrqiqkimmpissnmmtsmjijolisitirkinjmrkknrpmqqjllmiipttopqpjnstqqmrotioikliolnjmjolisqonoooqioitjsmkmiosnqrslrijmqmktjplslijnktjljmimsinktjpssmnsrqlqjjqmqoolpilojjjpksiltnrqtttjn...
output:
1330293994
result:
ok 1 number(s): "1330293994"
Test #59:
score: 0
Accepted
time: 101ms
memory: 74908kb
input:
nlitktppjtjpoiqpqsksslqttqtillpiljjrmrnnttnoqssojtrikkrjpmlljqtilmpmstkmjitlpsilnpsrtqotllptpitqnkrqmnnrjjskmlrlnqjnmqrmjmkkmlsmjptrtqtpnlslkronoptnssqqpimkinkolnriptitppposioooqoploprolsrilmloolpssljisotsjknotmmtnpmprsjlitjipjtljrqilnojpotspqqrkqtirorsqrmtmqmlnoqpisqnormkokmjrkkknmmiptlqjopiqrsnlil...
output:
1723235581
result:
ok 1 number(s): "1723235581"
Test #60:
score: 0
Accepted
time: 108ms
memory: 76616kb
input:
tqkkrlqokpttlolqtolsopllqqjmmkrrrjksklplmiijrisqkjkmqntmrilmtsjktlqimitnnimirnmtomkkolmqtmtpnijqstssoiqirkrkpiqitststrlqtnntqlssrrtokolmskjnplsqiiijlpoojsjopltqsmkrmnqkkrknkjlkkjtponrmmilkotqksqnkktjrjsoqpsoorsomrpprnkojsrsnrooqrlmknooikopqioolsoispjqpjimqookkkrnlqnsktjlrikqrpqnkmqpsritprlnnqilkkssk...
output:
1860579178
result:
ok 1 number(s): "1860579178"
Test #61:
score: 0
Accepted
time: 134ms
memory: 85992kb
input:
psqrqmlrnnqkmslqskmrqpormqiiioprolqljmqnlpoimpmisikliilsrioskrpintqktmlqrojplrprimjlsqnjrmpomqlmsmtptmipmsinrsktskjtjskjiksnspjitikqrnpkllljnqtnkktrppiqmlpkjnpkljqmnlqrkjpqmpmmpikijkrmkptnnstionjtkromjqlmkmprkipjsmospkjssmpmmsoknptoinimskjnrojtqmlnomrkliikkokqntrilkjinoslnpiomtittommrqoiklnjpskklqtn...
output:
2751920446
result:
ok 1 number(s): "2751920446"
Test #62:
score: 0
Accepted
time: 167ms
memory: 96712kb
input:
iroiqrttopkrosssnlimqpiioplsptqqlqsiirtjrjjqpostsrmpsslmnjlrstppkpqskikpipnsjpqrojioollrtrmjlkqqlnlttqrnoslrsnnkmtlokkrlnmqsjqppplppitpnrkttimimmsitmljlsnrsprnjrnloqpjnsknnrmssqljqpsnilnjlsojjlsrtposqjlmkpkjjksqplpioqtjspritstllrkoojmkmniiitrpsmsprjijptlrtspksknkqlrkrppipstmskpikrqskriissskilnjrstps...
output:
3488028595
result:
ok 1 number(s): "3488028595"
Test #63:
score: 0
Accepted
time: 161ms
memory: 99060kb
input:
ooqkslptpknjlpmsjnpqonmirpjkltlijplrnnnmjpqsqoiqpiosqmnkjrontssrpnitsssiktspiosojpnooijqpmsknirionorklqojrknqllotnqpilokrttoqrrpqkslqtijikiqmnprjtrkpponnomrjnslpjoinirpkrjtlqoqllstprotkknopmtrnrijrnjpklilktlsnisnpjokistklnsmnkispnssktrqmilptpnnilnjolqqrojiorqolsrsrjjjsostkkitrljikmojiknjojskskojlost...
output:
3749951500
result:
ok 1 number(s): "3749951500"
Test #64:
score: 0
Accepted
time: 8ms
memory: 33028kb
input:
cspjtokhiqhudcgferqdcydsfepvytvwaatevhozykkkzcesevihelkvuvyqhbaxcaruhntjfuasnsltzmrzravqhcqouzqnaeywnyvfyfikoobykkjencsvzakgjxvgjpxtxtuutkfpyykbxlsewadunppfreamzviahkitjdrbvlriwlekhvutttydecdvoxowjfjsnnntxwqlidfccsynqmlkbqefwmsnlnbgoxivwbxihsjjubmuyadjcyoqyeqferyphniyjwjndtillzbrlfhduiveaobpavreceav...
output:
8404372
result:
ok 1 number(s): "8404372"
Test #65:
score: 0
Accepted
time: 15ms
memory: 36252kb
input:
rwqjauogesdbygmyskfqagwmqcoqqdfeeguythelvazcbobrtfvoansrfhslmepzxrvclquurcjctnyetcunzauejrzsmjkkvcnrjqpusolvxysatpnnwpfhsllhxqecaaobgfxnewrjfumsmblifsijsknmafmsnudqdcpbvrqknrqbgaudraarlgrneosvdmqwijgzsdxwhutzyuemdozamhtwplowoxpferszjajvjtqfjaboveeffckhmgbeimibepmawnknsfkbtgrxajgjyxymuhoyyanchtjohlcw...
output:
26124260
result:
ok 1 number(s): "26124260"
Test #66:
score: 0
Accepted
time: 38ms
memory: 42228kb
input:
xtlngwojmsktiklwyootvxjcdewpoayvhbkiigmwegwcxqxuevphgzxidnlsebmsiuiciiokupxuudqnbbeesxvafjyipesfykrtpklmbtardevscceevfhfaeghcuqrzkrxhhqkgqvpisdfrhjpbfuxjawhqncvipysmaiaqgetniizwurwyutjqlvzpmiszvwnfilewdafekmxoccfaicyaafrloybkzhlaobxxkfpdxayaqconimbhzapqtauagzouvbwqhscgcfwvzjfzysvyirkeodvrsakxckwqoem...
output:
81719497
result:
ok 1 number(s): "81719497"
Test #67:
score: 0
Accepted
time: 62ms
memory: 58556kb
input:
xzoijlxrcneobtzxsrftwpxszsjgwtwmkfvhlbcacqtmibtlikbojlmmlvisscponnlhliqdsqykrqjzhxutjxdtrsrfzggdsowiwigmyqclzkkrplacfpywbokbmtxelaemmfbkhiutdzkzibcerxfxfsugacspckmjloehinglaxihbqlgrmbkpemtxrjcrgrpkhrnpwzafioxvrtcwgnzebaiqbuexomuggplfmanmfkgehvphtbaixrvbbufkcfiihuzpmlhqqtwfyskhddwzixoxbxofwklmycnxuqy...
output:
258645715
result:
ok 1 number(s): "258645715"
Test #68:
score: 0
Accepted
time: 92ms
memory: 62792kb
input:
mripdormghtfqhjrdtolswppdqvevrvcuuudagmcczlzdwslyymdnhoubuqyzmaszlgwdhiqljjbohgmgagjhwysfcekvpoxwbtulybkoihjpkktshfdnzgkyamhnguaymlesmnptcwgmukbppgxjcmefoxhaydarkqvckeubyccbjsmnzrvvexxqjqezhpzjjdgyycndmazeftjxfvbwbxohzuqkbzizaosgajxpnqbsypzuzcbgbucdukdpwormrxpyitltehbgyveckfevfeadzafllieoixithkgknsx...
output:
400906876
result:
ok 1 number(s): "400906876"
Test #69:
score: 0
Accepted
time: 89ms
memory: 63816kb
input:
ilzdqmlwwaezxsypsrpzdxokyneowbrlmuqfhllkrkumzyqozenwrchcjdrqgzpobdgziczyivijuiylqsykufpcomkkbcnrsfwvkcbbygdwupgqmnhywmekcrcriguzzfrewddznaugbqknbcpmkzugncwnmhewpebdjrqudwsyalwfsvabmkpetosbettiivgpoyflurtmttsibwgwwlyxiemgscsjbrpksioicowbgrusymmfdmorkdrcdoltdunhbqspxhskejqafcnjbsgibokgrvcruzgdmsrnhfzk...
output:
449129670
result:
ok 1 number(s): "449129670"
Test #70:
score: 0
Accepted
time: 141ms
memory: 76324kb
input:
dcowxeuzvojnckdbwutdazoitvsmdsehsmgmfytqvuelurdkgxsrpikkgfkzyrehvqjlpsgryoyomxstnzogmoxoznolxogmpcjpqijcypnpedvimqpmvyqckrefrktekgijhbfpatvtckirexrussmgtkaioyyhwrisgzosdoksskojlgboorbzhoqpqtemqthmdidkvmahycrsznfnmqxeyionkevlsgotbjayiifvmfcgfmmgupjbkewoljuwbzngtdeaimoftfurbeymnagdwagtebntksjxfjerucgw...
output:
842920551
result:
ok 1 number(s): "842920551"
Test #71:
score: 0
Accepted
time: 140ms
memory: 77180kb
input:
nfiykjdlphvipvcqkghwncbsbjxpzxvrgpgepbyyomfuynyyfxdjdgtrdhwzcgjuxzjenrxjnxmgdcdzlwxdtwxgxygxebsfvxkolresweohvdhnmaifjjsrynklpcqellblsjxzpreqsmckndnajavcymhsxcrzkjihpwshxpjqsljivvwoljforlteoviuifchhkfvkhykrlgdhhobmvwwxrtowhlzgjzfkhjtpxmxxjxpiyaacgjwynoerhmupipvlhzmamfcllniygitiojvxdorxtyjouaoeeufexrg...
output:
888008404
result:
ok 1 number(s): "888008404"
Test #72:
score: 0
Accepted
time: 182ms
memory: 84816kb
input:
sjjukizbibjtbauflblwyfojalcrofjbpxzudxxtgowfcemimkdsfyzliybwlfbsmwkszspvzrfhflvgfcgxvpepgvievlyfeabtdflpuburjchoicjtktqpvbtmdnihcqvcpwvdsprkddopipytgtufwgtstpwwmhvttzynodeolwrjfnvgodsrkatzvciridvaytgziqsnrovnrurvfjifupirvyeyeqqmslbzlpbamkmylaeytgppdfebbwvjbrtrajghqurgmqeezactpazxakicygrmstosxnpnodja...
output:
1200839973
result:
ok 1 number(s): "1200839973"
Test #73:
score: 0
Accepted
time: 222ms
memory: 93216kb
input:
hagqpwqpggozvvhkaipeufecoblbdgfuuivutvgvpqifliskqdpyysacvkgacqixifhxambcxnbqmqmigubgegkupooomeltpbmkhocrtcmhlobwcffbdsfrrsmoimefbgcbojibzsdajhvjcbmuxozkhtulbkqegewuspayhrsfyjtahratopbevbezmqipateryrhitlsipggkjsvkouufigvhcoylidnoqkfklovdzxxhlzgiapsfzvlctazbwybjzpdwwxbonpqagtdozgodkmscobzmizwcgemrwzcb...
output:
1624365762
result:
ok 1 number(s): "1624365762"
Test #74:
score: 0
Accepted
time: 225ms
memory: 96396kb
input:
dyevsfmqfewmwkdtpvuydljawyxmnapgiyjuoiyohddrrdifhgrzffjzhmpirzwovixdgpuhbfqxwazaieevczvzrlsyrdlsseinhbknqqrqawfbqojfflwvyovowmsnjjrarzgwuxenabpshetfwwcvwvgipyxjkuynzrwhnkvfldtrjsxkylkelsrnjbxhtdzcacfodjugnxuzztyfdedefyhblebfvqzqkqrzkjahrwgdddcggpbcszahujgwwbmgjnfytxugueyltqykftbonwpvesrqutiuixtzidwj...
output:
1730786929
result:
ok 1 number(s): "1730786929"
Test #75:
score: 0
Accepted
time: 61ms
memory: 87228kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...
output:
13063858895
result:
ok 1 number(s): "13063858895"