QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#200585 | #7345. Circular Shift | S_Explosion# | AC ✓ | 171ms | 177984kb | C++20 | 2.3kb | 2023-10-04 17:42:20 | 2023-10-04 17:42:20 |
Judging History
answer
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <map>
#include <cmath>
#include <cstring>
#include <vector>
#include <bitset>
template <typename Tp>
inline void read(Tp &x) {
x = 0;
bool f = true; char ch = getchar();
for ( ; ch < '0' || ch > '9'; ch = getchar()) f ^= ch == '-';
for ( ; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + (ch ^ 48);
x = f ? x : -x;
}
const int N = 6e5;
char s[N + 5];
int p, q, np = 1, nq, ch[N + 5][26], ds = 1, cd, len[N + 5], fa[N + 5], id[N + 5], n;
std::vector<int> Vec[N + 5];
int sum[N + 5][26], pos[N + 5];
bool vis[N + 5][26];
long long ans;
void ins(int zf) {
p = np, len[np = ++ds] = ++cd;
id[np] = cd;
while (!ch[p][zf] && p) {
ch[p][zf] = np;
p = fa[p];
}
if (!p) {
fa[np] = 1;
return;
}
q = ch[p][zf];
if (len[q] == len[p] + 1) {
fa[np] = q;
return;
}
len[nq = ++ds] = len[p] + 1;
memcpy(ch[nq], ch[q], sizeof(ch[q]));
fa[nq] = fa[q];
fa[np] = fa[q] = nq;
ch[p][zf] = nq;
while (ch[p = fa[p]][zf] == q) ch[p][zf] = nq;
}
void dfs(int u) {
if (id[u]) {
pos[u] = id[u];
if (id[u] < n) vis[u][s[id[u] + 1] - 'a'] = true;
}
for (int v : Vec[u]) {
dfs(v);
for (int i = 0; i < 26; ++i) vis[u][i] |= vis[v][i];
if (!pos[u]) pos[u] = pos[v];
}
if (u > 1) {
int l = len[fa[u]] + 1, r = len[u];
for (int i = 0; i < 26; ++i) {
if (sum[pos[u] - l][i] - sum[pos[u] - r][i] > 0 && vis[u][i]) ans += sum[pos[u] - l][i] - sum[pos[u] - r][i];
}
for (int v : Vec[u]) {
if (vis[u][s[pos[v] - len[u]] - 'a']) ++ans;
}
}
// printf("%d %lld\n", u, ans);
}
int main() {
scanf("%s", s + 1);
n = strlen(s + 1);
for (int i = 1; i <= n; ++i) {
ins(s[i] - 'a');
for (int j = 0; j < 26; ++j) sum[i][j] = sum[i - 1][j];
++sum[i][s[i] - 'a'];
}
// for (int i = 2; i <= ds; ++i) printf("%d\n", fa[i]);
for (int i = 2; i <= ds; ++i) Vec[fa[i]].push_back(i);
dfs(1);
for (int i = 0; i < 26; ++i)
if (sum[n][i]) ++ans;
printf("%lld\n", ans);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 26148kb
input:
abaac
output:
7
result:
ok 1 number(s): "7"
Test #2:
score: 0
Accepted
time: 0ms
memory: 22148kb
input:
aaa
output:
3
result:
ok 1 number(s): "3"
Test #3:
score: 0
Accepted
time: 2ms
memory: 24132kb
input:
a
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: 0
Accepted
time: 0ms
memory: 26148kb
input:
z
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: 0
Accepted
time: 0ms
memory: 26156kb
input:
aa
output:
2
result:
ok 1 number(s): "2"
Test #6:
score: 0
Accepted
time: 2ms
memory: 24192kb
input:
az
output:
2
result:
ok 1 number(s): "2"
Test #7:
score: 0
Accepted
time: 3ms
memory: 26392kb
input:
za
output:
2
result:
ok 1 number(s): "2"
Test #8:
score: 0
Accepted
time: 0ms
memory: 26144kb
input:
zz
output:
2
result:
ok 1 number(s): "2"
Test #9:
score: 0
Accepted
time: 3ms
memory: 26120kb
input:
abc
output:
3
result:
ok 1 number(s): "3"
Test #10:
score: 0
Accepted
time: 0ms
memory: 24108kb
input:
aab
output:
3
result:
ok 1 number(s): "3"
Test #11:
score: 0
Accepted
time: 2ms
memory: 24336kb
input:
baa
output:
3
result:
ok 1 number(s): "3"
Test #12:
score: 0
Accepted
time: 5ms
memory: 22084kb
input:
dbda
output:
5
result:
ok 1 number(s): "5"
Test #13:
score: 0
Accepted
time: 2ms
memory: 24044kb
input:
dacc
output:
4
result:
ok 1 number(s): "4"
Test #14:
score: 0
Accepted
time: 5ms
memory: 26152kb
input:
cdaca
output:
6
result:
ok 1 number(s): "6"
Test #15:
score: 0
Accepted
time: 5ms
memory: 26168kb
input:
cddcc
output:
8
result:
ok 1 number(s): "8"
Test #16:
score: 0
Accepted
time: 0ms
memory: 26088kb
input:
adcbdb
output:
7
result:
ok 1 number(s): "7"
Test #17:
score: 0
Accepted
time: 3ms
memory: 24340kb
input:
cccccc
output:
6
result:
ok 1 number(s): "6"
Test #18:
score: 0
Accepted
time: 0ms
memory: 24076kb
input:
ccdcabb
output:
9
result:
ok 1 number(s): "9"
Test #19:
score: 0
Accepted
time: 0ms
memory: 26140kb
input:
bcbddca
output:
8
result:
ok 1 number(s): "8"
Test #20:
score: 0
Accepted
time: 3ms
memory: 26232kb
input:
cadababb
output:
11
result:
ok 1 number(s): "11"
Test #21:
score: 0
Accepted
time: 0ms
memory: 22132kb
input:
bdddcbbc
output:
11
result:
ok 1 number(s): "11"
Test #22:
score: 0
Accepted
time: 0ms
memory: 26380kb
input:
acdaabcdb
output:
10
result:
ok 1 number(s): "10"
Test #23:
score: 0
Accepted
time: 0ms
memory: 26144kb
input:
abcabdcad
output:
11
result:
ok 1 number(s): "11"
Test #24:
score: 0
Accepted
time: 0ms
memory: 26352kb
input:
bccbccccda
output:
17
result:
ok 1 number(s): "17"
Test #25:
score: 0
Accepted
time: 0ms
memory: 22056kb
input:
bbdddadcab
output:
14
result:
ok 1 number(s): "14"
Test #26:
score: 0
Accepted
time: 27ms
memory: 143524kb
input:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
output:
300000
result:
ok 1 number(s): "300000"
Test #27:
score: 0
Accepted
time: 40ms
memory: 138232kb
input:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
output:
300000
result:
ok 1 number(s): "300000"
Test #28:
score: 0
Accepted
time: 32ms
memory: 177984kb
input:
yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
output:
300000
result:
ok 1 number(s): "300000"
Test #29:
score: 0
Accepted
time: 42ms
memory: 106588kb
input:
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn...
output:
299988
result:
ok 1 number(s): "299988"
Test #30:
score: 0
Accepted
time: 36ms
memory: 138064kb
input:
cacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacaca...
output:
5625225001
result:
ok 1 number(s): "5625225001"
Test #31:
score: 0
Accepted
time: 5ms
memory: 22096kb
input:
acaacacbcacabbaaabbbbcbaabcccabbbabaabbbccaabcbbbcaabbbbcbbcaacabaccbbacbaccacbbbabaccbaabbbccaaccbcbbaabbccccca
output:
2024
result:
ok 1 number(s): "2024"
Test #32:
score: 0
Accepted
time: 12ms
memory: 42500kb
input:
babbaccacaaababacacbaccabcaaacbcacaaababaababbbcbccbcccabcabbbacbbbbccccbcaccbbccbbaaacacaacbbabccccaabcbbabaabbaaccababaccaacabcacbccacccbaaabaacbcabbcabacbaacbabcaabcbcabacbaacacaabccbabbabbabacbacaccaccccacbcbcbbabbbaabcaabacbbacacbbccccaaaaacaacbccbbacbacabcaccccccbcacaacccccbcbcbbaacaabcaabbbcb...
output:
365780747
result:
ok 1 number(s): "365780747"
Test #33:
score: 0
Accepted
time: 31ms
memory: 60736kb
input:
abbcbcaabaaaabacbcbbcabababaabcbbbacbbabcbcccbacaaaaacaccaabcbcccababbaabccaaabbcaaccccbbbbcbaccabcabcbbcacaacababbcbacbccacccababbabacbcacccbcbbbbacbbabaaabaabcaaccbbcabbbccabbcbabaaaccabbaccabaccbbaacbaabbbacaaacabaaccabcabbbabaaaacabababbaaabcaacbbbbbcabccaccabaacbcbaaaaaabbbbcacabccabacacbbacbba...
output:
1252345802
result:
ok 1 number(s): "1252345802"
Test #34:
score: 0
Accepted
time: 37ms
memory: 60860kb
input:
bcccccbcacaccccccbcaaccaacccabbbbbbaaacccacbccbbabaacbabbaaabbcbcababcbaacbacbababccabbaccabcccbbacabaaccacccbcaacaccccaacccaaccccacbbaaaabcbbcbcabbbbbabbabacbbcacbccabaacbacbaaccbbbacccccbcbaabcccabbccbcbbaccacbcabbcacbbbccbbcabcacccaacaacccbabbbabccabacaabbaaabcccaabccaaaacbccbabbcbacbbbcbcabcbacc...
output:
1554129143
result:
ok 1 number(s): "1554129143"
Test #35:
score: 0
Accepted
time: 53ms
memory: 74676kb
input:
abcccabcbcaccbaacbbcacbabbababaabcabbbbbccacbcaacabccabcaabbbcaaaaabcccaacabbbbcbabccbbbbccbabccaaacacbabbbbbababcacbabbacbccbbababcabbcabccaaacccbbcabbcaabbcbacabbcbaacacbbbcbcbbbbccbccbcbaabaaccbcccbbcabcaababbababcacbbaabbbcccbcbabbcacabbccbcacaabcabacbabcbaacbcaaaccccaccbccbabaabbccbcbacaababbbb...
output:
3010750398
result:
ok 1 number(s): "3010750398"
Test #36:
score: 0
Accepted
time: 62ms
memory: 87492kb
input:
bcccaabcabaaacbbbcacbccbaccccaabaaaacccacccaabbaabacbaaacbccabcaccaccaccbacabbcaccccaacabccabaaacbbcaacacbccaccccccababcabbaaacbabbccbcbbcaabccbabbcbccbccccacbaacbbccaaababcbcabccaaccbbbbaccbcbbacbcbccaaaaaccaccacbccbaccaaaacacabaabcbcacccaaaccccaaccbcaaccccbabbccbbbbcacaaaabacabbbacaaabccbcbbbbcbbc...
output:
4888615152
result:
ok 1 number(s): "4888615152"
Test #37:
score: 0
Accepted
time: 87ms
memory: 93832kb
input:
caccbbbcbbaacccbbbabacabbabcacabbcbcbcaacbabcbbbacbcaaabaaaccbaaaacaaacabaabacaabbbacaabbcabaaaccaacaaaaaccababbabbacccbacbaabcbcaaccccaabbaabbccacbabcbaacabbbaaabcccacaabccbcbcbaacaabcbccccbbabcbbbcbabbbbcbacaaacbbaaaaaabacaaabaccbbbcabbabcaccbacabbcabbbacaccacbaabbacccbcacbaaacaababacababbabbcaaab...
output:
5976402426
result:
ok 1 number(s): "5976402426"
Test #38:
score: 0
Accepted
time: 103ms
memory: 107436kb
input:
bcbaccacccbbabbaccbabcabacbabacbcbbcccacccbaccbababbbbcaabcbaaabcbcbbacbbaaababbbbcbcacbacbbaaaabbccbbbcaabbaaacbbccbbaaaccacaabcaccbacaacccbabaaababbaabbcabbcaabcbbbcaccacccacaacabcbbbaabcabbbccbbbbaaccaabcbbbbcbbcacbbcbbaabcbccbbaacbbbcacabacaacbcbbabbacbbaccbabccaacaaccbbcbaabbaacaacbbaccbbabbbcb...
output:
7791334008
result:
ok 1 number(s): "7791334008"
Test #39:
score: 0
Accepted
time: 132ms
memory: 117000kb
input:
bbacaaababcaabacbbbbcbcbbacacabaabcbaaaabbcacaaaabbaccbaabbacbacbabbaccacbccccccacbbccacbbccbabbaacccbaabbaabbabbccccaaacbaccbccacbcbcbabbcccccbbcbcaaaacbbbaccbabacbbbaabaccbccbccaccbbbacaacabbccaabcbcacbbccaaabacabababcccaaabccaacbbbbbaaccaaccbacaabbbbcbbacbaccbcabccccbababbacbabcbcaaacaacacccccbac...
output:
10385658005
result:
ok 1 number(s): "10385658005"
Test #40:
score: 0
Accepted
time: 156ms
memory: 125976kb
input:
cabcabacaccbbccbaabbabbaaaababcbbbcbcaaaabccabccacbcbcbacccbbccbbcbccbaacacbbccaabcbabaaccbcbacccccbabccacbbcbacbabccbbcccabcbacbcaaababcaaaabcccaaccacbccccccccbcbbccabbabcbaabacacaaaaacbbbccbcbbacabaaababaccbcbcccabcaacbbccbaccaabccbcacbacccaabcbccabbbbcaacccacaaaacababcbbbcacccacaacbbcabaacccbbcca...
output:
13185061526
result:
ok 1 number(s): "13185061526"
Test #41:
score: 0
Accepted
time: 171ms
memory: 132484kb
input:
cbcabaabcabcabbabcaaababccabcacbaccbacaaacbbaaabaaaabacccbcaacccaabababaccbcbbabbbabcbbbcbaaccaababaccababbacaacabbccbbcbcccbabaacacaabaccbcbbbacbbaaaaccaaabcabacabcbbacbacbbcccbcbcbacaacbacabbcaacbbbacaaaabababcbbcbbbbbcccabccbbbbbbccbaaabcaaababbbcaabcabaaccbacccaacbaababbbacacacbccacabaacabaaccaa...
output:
14999060148
result:
ok 1 number(s): "14999060148"
Test #42:
score: 0
Accepted
time: 11ms
memory: 35088kb
input:
hheggdefeghbecgebacfegbecgfhfcgbdhgedchffaffbfceagagfddhfdgabhggecafdghhbhhchbebhgfcbcfcdgadheagbhfbfffaggeedffchfbdbceafffahhdfgdhhaeaabgbdgcdfbggdheaagdacffgbfdebaehheefhdbgbhbedfhfgbhabdhfahcabadhdgaebfaaagaggbeahacdhdfgchbggbgddbgcfchcghgdcdbddhfeahbfbhhhhbehfagdgdgehggaccheggeeeagcfeaagedcdbgga...
output:
30153449
result:
ok 1 number(s): "30153449"
Test #43:
score: 0
Accepted
time: 19ms
memory: 42800kb
input:
aagafaffcecgeeechbdhgafdaffadedeefghaacdegccabhhhfabcfachbeabcehbcfddgcebbhbehhhcgbhbgaecghfgdaaadhdfbeadfdhggeecedhdfbeaechhcgcbefhhcbdhgfcdgaccfgceegggccgfhaddfhgggdhaddbccbafaahbbaebaeeddfabbcchbbddcebgagbgahbadecgdbhhbgcdddfehefebghacehecgdabbbaabdbfbeabhgeffgafaehcebgddeeegfhcccafchhagbadadhdbb...
output:
203976827
result:
ok 1 number(s): "203976827"
Test #44:
score: 0
Accepted
time: 31ms
memory: 54756kb
input:
dbbddcdahdabdgfdcfbbcfgdcabgcedfeagedgddbefhhghhafdaaddfaaabebcbcdbdbgfbeebdccbafaffhdeecgdahbfdbhggcdaeahdgaehhdfcbadhfhegccbeahadcfcabhaggabgbdfgebhhadeddeabaeefehfabhebehbfbeabadaaddcfbaadfcbbhhgachaabgcgcbcfahdeffbbghgdfchghhedadhgffhadgdcedggggbfaghceecfdhbhadafaabdfaebecdhhcdceaaebdabbagbchfha...
output:
501171381
result:
ok 1 number(s): "501171381"
Test #45:
score: 0
Accepted
time: 35ms
memory: 59196kb
input:
ecdfghcdcfddgehbhaehggfbfgechhaadebbbhhedheehabceebabeddabbdabcaebfbghafcbgedahbbdgfbefagadcecbaedaccchfaacdchedhdgchahecbbhffafbaechhcagdagaeacfahbbgfbebfbfgdeghdaghhfcebbcfehgcagfbdbfhefhhcccfbagaaeahbfcgecbdgebhgfafhgafadggbegeeffeebcgdfegbgbadhfghfcfffaefbgbefgfahbbfdchdaccgeadfghhggadchahddabbb...
output:
737411855
result:
ok 1 number(s): "737411855"
Test #46:
score: 0
Accepted
time: 51ms
memory: 64968kb
input:
hbddbbhefahedgdadechegfdcahaaffechedfbghfhfefeeedegghhacfecahaedahgeghbaahbcefhafbbhegcahaeacchgdcghchfacdghcbadbfbadbachcefadffgcdcfhacgfhbbcdhehhgefhfdfbeeecehdacdgfhecfgddcfcgfdfggafeebfecddffhfefcgghbhdcahahbefbcdcchbebdaaccaghcgceebbbhgdhbcdfgahadfhadachhgfbahbhfcdghddfgahdhafabecebgfgbhheccgaa...
output:
911249835
result:
ok 1 number(s): "911249835"
Test #47:
score: 0
Accepted
time: 71ms
memory: 78432kb
input:
hbfgdhhdghbbdbgfbgeaffaadehhfgbcbcgfcadafcgdgbfahbdbdbadbbahabfcaafhecdgagbdbacbffedcfdgcdghcabghdfgedbhdegehahbdadgbdbadbgegdaadggceagcgahgcaceahdfdcadchagdcfbdcabcbcdfcegacaeachadddhfddhdfebddgedhedgdebccfcgddhhegebgcgaegbddbbhfedfegedhgahggdechhbbbcbfchcfcbfegbbabdbadddhfdfbgccebhfbdgaaafhaehbaeh...
output:
1640841656
result:
ok 1 number(s): "1640841656"
Test #48:
score: 0
Accepted
time: 80ms
memory: 89104kb
input:
bghggchdfcdhffffccdfdbfffdffcacaccbcdgdfcfdacaedhabeahdgggdbgcceegbhffdcbbbchghgebffhcaehgdfgffabgbcechhbgdefhfbebfdaebhbdbdaaacbffchfbcfcdgafeegdhdcegddadfbaaedhgaadehdcgdfcaeafhcdeagcghehaahcadhebhbbaeedchbaehheahcchhcbcagbhafacaabdecgahfdegchefacagheggeccfdeggebhbhdddhebdhfcedgdbchehhdehhfhfffhed...
output:
2707534869
result:
ok 1 number(s): "2707534869"
Test #49:
score: 0
Accepted
time: 83ms
memory: 91868kb
input:
aecgdbadegdbhdafeeefagaccehdfcbgghfggfhbfeacggchhegcdcdfcddfcheeggddfaaebeagfbbgaeahdachfcdhfcfhhbfghcghgecbedghdccfgdhfdaebgehebhcbhafabcadacefacdbbacggbcbfgfaefeacghahgabdccbcfbhgacdachgdccfagddgfcgfehhgfccbbgdebfgfgbgdfdabcfdhchfbdbhdhgafghhhfecgahchdhahghdabfddhdfhfdachadgcacchfcgeffbcdahaaggbba...
output:
2884360929
result:
ok 1 number(s): "2884360929"
Test #50:
score: 0
Accepted
time: 104ms
memory: 105160kb
input:
fbbaebheghacgdehgcbgcefechdhdhgaeahebhcbefcfdbfccagffheefacfhgabegaafafgeageccgahbbdfhbcdhbeggcbdhgabffgaffdgahcaeehhbadhabgbabfdgedaaefaggbgdgbbbacdheedbbhcdgebgbcfdadhhbdahhgaedhcfcggcchchaedafgehcfcebdgfhdhefgcdfdfagfhdgfdabhddcfabbdbhhfchhbbeaaacaegfeefaddagbbfehgfdefafehceecahhdgghddbcfhhccfbdd...
output:
4038141890
result:
ok 1 number(s): "4038141890"
Test #51:
score: 0
Accepted
time: 103ms
memory: 113396kb
input:
degfdbfaghagdhcggcbeeefeaeebbacbaaeggbhfeehfghheeacbedghhhfcbefahgfcehghddaaeedfhgdgcbdhfafchfheacbheebbchgdhghbebedggfchcgabaecebbdggheggcecfbghagehabhbhggheaacdbhddhbhhcbbfgffhcchcedheeedfaagdahddgcbcbfdcegbfhdbgcfcdcgfcbcffcccadfdeacgabcgebcdbagaceagacbcacgbedgddahfhadcchgfhddaghbggbfaaahhgchcddg...
output:
5052356122
result:
ok 1 number(s): "5052356122"
Test #52:
score: 0
Accepted
time: 143ms
memory: 123604kb
input:
egeacacfhbbgfcbfegggfcbcfdbfhdgadgahaggfagghcheedafgdadbdbbgeccgagaeggbccfggaebcaecceaefeffahgfhabhhabafgadcaafgdedfhfcdhhafhhcdahhhdgdgeeagcdadeedaecfdgbdaccacghdhddcachbgaacgfffbbeahfhaachcaccfdefbbachahfebccccdheghcfgcafeebhahfegghedaghdbbdhabgahdfcbaccgbdeehbgfcdahffecbhchcdbbhdaefbfbaedebgfhdcd...
output:
5625012518
result:
ok 1 number(s): "5625012518"
Test #53:
score: 0
Accepted
time: 5ms
memory: 35048kb
input:
ptjlikjjjoiootlnnnqqplimrslttmisooqomkkqlprkktoqqtmoprolmsillikkjptisnrnnqtoopqkmnsminmoommptospipnppltqiqoqrlkikpsrjooktipinrorsommnpqslqjnlmtqstmpsikokjikjpnjqlstslojppsnmitqtomqtsnpqlqjntiokkiliomtiktpjmpmstojmkrtmtinsinrtitonipmrqrrqikkttrsopjmprsrjmqmqnrkmrrslkqjlrnijjpotrokjqtkjsqriqlqrjoprtrq...
output:
25612936
result:
ok 1 number(s): "25612936"
Test #54:
score: 0
Accepted
time: 18ms
memory: 42340kb
input:
rmomrinpqijntispkjokrnklttrjkotktoskjpjqmtrilkqjiikijmirinnlqpqmktpsppkrqnlrtsnqjqroksrjoqkrlijiktrpsqqrnokmonmporllkqspjksstntpisinmtprrqismsolstlisinomrrjiprnqmtjipirislnrkomkotllrmplsrpsjmjjrpjkqoqrqmlnminkkjrtrssprmjnisjmimloljtrrtpqmqtjksliiqsioimnpnkitsrqmkjpolrplprlirimkrqjjtsslqlsqqjmnmliqkk...
output:
64584265
result:
ok 1 number(s): "64584265"
Test #55:
score: 0
Accepted
time: 25ms
memory: 48980kb
input:
irippnmqtikjmqlspkoqjtqnqmiimpkrtijnlljkmqjrspoisqninisjkkjsmmltirsnkmkriqmrtqrmnomrqlsmnjpjtkokpjrltppntmkitproiijsmkikrslnsptilspioosjikrttirslsoiilpknlntlmqljknmqoolmqirkoomonjkmomosskorqonjqnjikrnpmloqnqqqlqqrqsmiomtimptprjjkllirqkljpkrsojpsnnnlkjrnmlrklimpjrnstrpskmrmjssljlnsrpnkpjlmpnrkmponjit...
output:
186972919
result:
ok 1 number(s): "186972919"
Test #56:
score: 0
Accepted
time: 47ms
memory: 65660kb
input:
pnktrrorlprjqiptqrmomqimrnnprsmprtmlsstllirqnskpsplrjsmntmnsoqjqjtinmljttlsnpomkknipqpmlkmipsrrqjilnjqpsqrmnksmnppljmjtjirtqisnijlmtsntkqrqnotjsoqnqpkjmnsrkkrrppmiottmonikpkkjnnjssprostipnkikkjsoqtmolpkrmlklnojnmjsklqoiojssmssmlpknmilkinttonkknmsjnporllpsokpknpirnskitljjjisptktltrskqtpppotnmposlqqtr...
output:
552643518
result:
ok 1 number(s): "552643518"
Test #57:
score: 0
Accepted
time: 39ms
memory: 72728kb
input:
rkjpqipjjporqmjtkqmmptmplrmomrmpisppiipkmsprpslilrikkppmitkirnsqlnrornqnmtjjtjojossptsrkqnmqjqlkprlrptmkrtltnsortknkptkrmmiislmrlmmrtnjlqopknqmjllkiplqmptlplkmtmmsnplokntlopqlrkinlrnnqoqrnlqlsrolrioqplqltqmpqtqjrkrmiisoomrjtpkintroqoqnjkpqqkriqtqnnsnnkrnsjjmjjsrillktnstponrqoknrppiqsontrimrktrkioisr...
output:
812284221
result:
ok 1 number(s): "812284221"
Test #58:
score: 0
Accepted
time: 58ms
memory: 81756kb
input:
stnsomiskjrlrnkkslkpjllipirpqslrqrjktmskkmilqkkonmoitjsrotsikrlontorkjlrorrknjpjjionmkokqtprijkqjsqnkttsoqtljkjpslisioiqpsmmtrqiqkimmpissnmmtsmjijolisitirkinjmrkknrpmqqjllmiipttopqpjnstqqmrotioikliolnjmjolisqonoooqioitjsmkmiosnqrslrijmqmktjplslijnktjljmimsinktjpssmnsrqlqjjqmqoolpilojjjpksiltnrqtttjn...
output:
1330293994
result:
ok 1 number(s): "1330293994"
Test #59:
score: 0
Accepted
time: 59ms
memory: 89408kb
input:
nlitktppjtjpoiqpqsksslqttqtillpiljjrmrnnttnoqssojtrikkrjpmlljqtilmpmstkmjitlpsilnpsrtqotllptpitqnkrqmnnrjjskmlrlnqjnmqrmjmkkmlsmjptrtqtpnlslkronoptnssqqpimkinkolnriptitppposioooqoploprolsrilmloolpssljisotsjknotmmtnpmprsjlitjipjtljrqilnojpotspqqrkqtirorsqrmtmqmlnoqpisqnormkokmjrkkknmmiptlqjopiqrsnlil...
output:
1723235581
result:
ok 1 number(s): "1723235581"
Test #60:
score: 0
Accepted
time: 67ms
memory: 93916kb
input:
tqkkrlqokpttlolqtolsopllqqjmmkrrrjksklplmiijrisqkjkmqntmrilmtsjktlqimitnnimirnmtomkkolmqtmtpnijqstssoiqirkrkpiqitststrlqtnntqlssrrtokolmskjnplsqiiijlpoojsjopltqsmkrmnqkkrknkjlkkjtponrmmilkotqksqnkktjrjsoqpsoorsomrpprnkojsrsnrooqrlmknooikopqioolsoispjqpjimqookkkrnlqnsktjlrikqrpqnkmqpsritprlnnqilkkssk...
output:
1860579178
result:
ok 1 number(s): "1860579178"
Test #61:
score: 0
Accepted
time: 99ms
memory: 108004kb
input:
psqrqmlrnnqkmslqskmrqpormqiiioprolqljmqnlpoimpmisikliilsrioskrpintqktmlqrojplrprimjlsqnjrmpomqlmsmtptmipmsinrsktskjtjskjiksnspjitikqrnpkllljnqtnkktrppiqmlpkjnpkljqmnlqrkjpqmpmmpikijkrmkptnnstionjtkromjqlmkmprkipjsmospkjssmpmmsoknptoinimskjnrojtqmlnomrkliikkokqntrilkjinoslnpiomtittommrqoiklnjpskklqtn...
output:
2751920446
result:
ok 1 number(s): "2751920446"
Test #62:
score: 0
Accepted
time: 100ms
memory: 117260kb
input:
iroiqrttopkrosssnlimqpiioplsptqqlqsiirtjrjjqpostsrmpsslmnjlrstppkpqskikpipnsjpqrojioollrtrmjlkqqlnlttqrnoslrsnnkmtlokkrlnmqsjqppplppitpnrkttimimmsitmljlsnrsprnjrnloqpjnsknnrmssqljqpsnilnjlsojjlsrtposqjlmkpkjjksqplpioqtjspritstllrkoojmkmniiitrpsmsprjijptlrtspksknkqlrkrppipstmskpikrqskriissskilnjrstps...
output:
3488028595
result:
ok 1 number(s): "3488028595"
Test #63:
score: 0
Accepted
time: 116ms
memory: 118436kb
input:
ooqkslptpknjlpmsjnpqonmirpjkltlijplrnnnmjpqsqoiqpiosqmnkjrontssrpnitsssiktspiosojpnooijqpmsknirionorklqojrknqllotnqpilokrttoqrrpqkslqtijikiqmnprjtrkpponnomrjnslpjoinirpkrjtlqoqllstprotkknopmtrnrijrnjpklilktlsnisnpjokistklnsmnkispnssktrqmilptpnnilnjolqqrojiorqolsrsrjjjsostkkitrljikmojiknjojskskojlost...
output:
3749951500
result:
ok 1 number(s): "3749951500"
Test #64:
score: 0
Accepted
time: 4ms
memory: 32600kb
input:
cspjtokhiqhudcgferqdcydsfepvytvwaatevhozykkkzcesevihelkvuvyqhbaxcaruhntjfuasnsltzmrzravqhcqouzqnaeywnyvfyfikoobykkjencsvzakgjxvgjpxtxtuutkfpyykbxlsewadunppfreamzviahkitjdrbvlriwlekhvutttydecdvoxowjfjsnnntxwqlidfccsynqmlkbqefwmsnlnbgoxivwbxihsjjubmuyadjcyoqyeqferyphniyjwjndtillzbrlfhduiveaobpavreceav...
output:
8404372
result:
ok 1 number(s): "8404372"
Test #65:
score: 0
Accepted
time: 9ms
memory: 36164kb
input:
rwqjauogesdbygmyskfqagwmqcoqqdfeeguythelvazcbobrtfvoansrfhslmepzxrvclquurcjctnyetcunzauejrzsmjkkvcnrjqpusolvxysatpnnwpfhsllhxqecaaobgfxnewrjfumsmblifsijsknmafmsnudqdcpbvrqknrqbgaudraarlgrneosvdmqwijgzsdxwhutzyuemdozamhtwplowoxpferszjajvjtqfjaboveeffckhmgbeimibepmawnknsfkbtgrxajgjyxymuhoyyanchtjohlcw...
output:
26124260
result:
ok 1 number(s): "26124260"
Test #66:
score: 0
Accepted
time: 14ms
memory: 45084kb
input:
xtlngwojmsktiklwyootvxjcdewpoayvhbkiigmwegwcxqxuevphgzxidnlsebmsiuiciiokupxuudqnbbeesxvafjyipesfykrtpklmbtardevscceevfhfaeghcuqrzkrxhhqkgqvpisdfrhjpbfuxjawhqncvipysmaiaqgetniizwurwyutjqlvzpmiszvwnfilewdafekmxoccfaicyaafrloybkzhlaobxxkfpdxayaqconimbhzapqtauagzouvbwqhscgcfwvzjfzysvyirkeodvrsakxckwqoem...
output:
81719497
result:
ok 1 number(s): "81719497"
Test #67:
score: 0
Accepted
time: 35ms
memory: 58584kb
input:
xzoijlxrcneobtzxsrftwpxszsjgwtwmkfvhlbcacqtmibtlikbojlmmlvisscponnlhliqdsqykrqjzhxutjxdtrsrfzggdsowiwigmyqclzkkrplacfpywbokbmtxelaemmfbkhiutdzkzibcerxfxfsugacspckmjloehinglaxihbqlgrmbkpemtxrjcrgrpkhrnpwzafioxvrtcwgnzebaiqbuexomuggplfmanmfkgehvphtbaixrvbbufkcfiihuzpmlhqqtwfyskhddwzixoxbxofwklmycnxuqy...
output:
258645715
result:
ok 1 number(s): "258645715"
Test #68:
score: 0
Accepted
time: 46ms
memory: 66712kb
input:
mripdormghtfqhjrdtolswppdqvevrvcuuudagmcczlzdwslyymdnhoubuqyzmaszlgwdhiqljjbohgmgagjhwysfcekvpoxwbtulybkoihjpkktshfdnzgkyamhnguaymlesmnptcwgmukbppgxjcmefoxhaydarkqvckeubyccbjsmnzrvvexxqjqezhpzjjdgyycndmazeftjxfvbwbxohzuqkbzizaosgajxpnqbsypzuzcbgbucdukdpwormrxpyitltehbgyveckfevfeadzafllieoixithkgknsx...
output:
400906876
result:
ok 1 number(s): "400906876"
Test #69:
score: 0
Accepted
time: 27ms
memory: 70580kb
input:
ilzdqmlwwaezxsypsrpzdxokyneowbrlmuqfhllkrkumzyqozenwrchcjdrqgzpobdgziczyivijuiylqsykufpcomkkbcnrsfwvkcbbygdwupgqmnhywmekcrcriguzzfrewddznaugbqknbcpmkzugncwnmhewpebdjrqudwsyalwfsvabmkpetosbettiivgpoyflurtmttsibwgwwlyxiemgscsjbrpksioicowbgrusymmfdmorkdrcdoltdunhbqspxhskejqafcnjbsgibokgrvcruzgdmsrnhfzk...
output:
449129670
result:
ok 1 number(s): "449129670"
Test #70:
score: 0
Accepted
time: 67ms
memory: 89696kb
input:
dcowxeuzvojnckdbwutdazoitvsmdsehsmgmfytqvuelurdkgxsrpikkgfkzyrehvqjlpsgryoyomxstnzogmoxoznolxogmpcjpqijcypnpedvimqpmvyqckrefrktekgijhbfpatvtckirexrussmgtkaioyyhwrisgzosdoksskojlgboorbzhoqpqtemqthmdidkvmahycrsznfnmqxeyionkevlsgotbjayiifvmfcgfmmgupjbkewoljuwbzngtdeaimoftfurbeymnagdwagtebntksjxfjerucgw...
output:
842920551
result:
ok 1 number(s): "842920551"
Test #71:
score: 0
Accepted
time: 69ms
memory: 88444kb
input:
nfiykjdlphvipvcqkghwncbsbjxpzxvrgpgepbyyomfuynyyfxdjdgtrdhwzcgjuxzjenrxjnxmgdcdzlwxdtwxgxygxebsfvxkolresweohvdhnmaifjjsrynklpcqellblsjxzpreqsmckndnajavcymhsxcrzkjihpwshxpjqsljivvwoljforlteoviuifchhkfvkhykrlgdhhobmvwwxrtowhlzgjzfkhjtpxmxxjxpiyaacgjwynoerhmupipvlhzmamfcllniygitiojvxdorxtyjouaoeeufexrg...
output:
888008404
result:
ok 1 number(s): "888008404"
Test #72:
score: 0
Accepted
time: 67ms
memory: 96904kb
input:
sjjukizbibjtbauflblwyfojalcrofjbpxzudxxtgowfcemimkdsfyzliybwlfbsmwkszspvzrfhflvgfcgxvpepgvievlyfeabtdflpuburjchoicjtktqpvbtmdnihcqvcpwvdsprkddopipytgtufwgtstpwwmhvttzynodeolwrjfnvgodsrkatzvciridvaytgziqsnrovnrurvfjifupirvyeyeqqmslbzlpbamkmylaeytgppdfebbwvjbrtrajghqurgmqeezactpazxakicygrmstosxnpnodja...
output:
1200839973
result:
ok 1 number(s): "1200839973"
Test #73:
score: 0
Accepted
time: 103ms
memory: 110836kb
input:
hagqpwqpggozvvhkaipeufecoblbdgfuuivutvgvpqifliskqdpyysacvkgacqixifhxambcxnbqmqmigubgegkupooomeltpbmkhocrtcmhlobwcffbdsfrrsmoimefbgcbojibzsdajhvjcbmuxozkhtulbkqegewuspayhrsfyjtahratopbevbezmqipateryrhitlsipggkjsvkouufigvhcoylidnoqkfklovdzxxhlzgiapsfzvlctazbwybjzpdwwxbonpqagtdozgodkmscobzmizwcgemrwzcb...
output:
1624365762
result:
ok 1 number(s): "1624365762"
Test #74:
score: 0
Accepted
time: 97ms
memory: 111864kb
input:
dyevsfmqfewmwkdtpvuydljawyxmnapgiyjuoiyohddrrdifhgrzffjzhmpirzwovixdgpuhbfqxwazaieevczvzrlsyrdlsseinhbknqqrqawfbqojfflwvyovowmsnjjrarzgwuxenabpshetfwwcvwvgipyxjkuynzrwhnkvfldtrjsxkylkelsrnjbxhtdzcacfodjugnxuzztyfdedefyhblebfvqzqkqrzkjahrwgdddcggpbcszahujgwwbmgjnfytxugueyltqykftbonwpvesrqutiuixtzidwj...
output:
1730786929
result:
ok 1 number(s): "1730786929"
Test #75:
score: 0
Accepted
time: 102ms
memory: 110032kb
input:
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...
output:
13063858895
result:
ok 1 number(s): "13063858895"