QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#200475#7345. Circular ShiftRd_rainydays#AC ✓55ms115160kbC++203.1kb2023-10-04 17:04:532023-10-04 17:04:54

Judging History

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

  • [2023-10-04 17:04:54]
  • 评测
  • 测评结果:AC
  • 用时:55ms
  • 内存:115160kb
  • [2023-10-04 17:04:53]
  • 提交

answer

#include <bits/stdc++.h>

#define link sbsbsbs

const int N = 6e5 + 5;
const int S = 26;
char s[N];
int n;

/*
int sa[N], rk[N];
void suffixSort() {
  static int cnt[N], id[N], rk2[N], key[N];

  int m = S - 1;
  auto radixSort = [&]() {
    memset(cnt + 1, 0, m << 2);
    for (int i = 1; i <= n; i++) ++cnt[key[i]];
    for (int i = 1; i <= m; i++) cnt[i] += cnt[i - 1];
    for (int i = n; i >= 1; i--) sa[cnt[key[i]]--] = id[i];
  };
  
  for (int i = 1; i <= n; i++)
    id[i] = i, key[i] = rk[i] = s[i] - 'a';
  radixSort();

  for (int w = 1; ; w <<= 1) {
    int p = 0;
    for (int i = n; i > n - w; i--) id[++p] = i;
    for (int i = 1; i <= n; i++) if (sa[i] > w) id[++p] = sa[i] - w;
    for (int i = 1; i <= n; i++) key[i] = rk[id[i]];
    radixSort();

    auto cmp = [&](int a, int b) {
      return rk2[a] == rk2[b] && rk2[a + w] == rk2[b + w];
    };
    memcpy(rk2 + 1, rk + 1, n << 2);
    p = 1;
    rk[sa[1]] = 1;
    for (int i = 2; i <= n; i++)
      rk[sa[i]] = cmp(sa[i], sa[i - 1]) ? p : ++p;
    m = p;
    if (p == n) break;
  }
}

int height[N];
void getHeight() {
  for (int i = 1, k = 0; i <= n; i++) {
    if (rk[i] == 1) continue;
    if (k) --k;
    while (s[i + k] == s[sa[rk[i] - 1] + k]) ++k;
    height[rk[i]] = k;
  }
}
*/

int ch[N][S], link[N], len[N], epos[N], tag[N];
int total = 1, last = 1;
void extend(int c, int i) {
  int p = last, np = last = ++total;
  len[np] = len[p] + 1, epos[np] = i;
  for (; p && !ch[p][c]; p = link[p]) ch[p][c] = np;
  if (!p) { link[np] = 1; return; }
  int q = ch[p][c];
  if (len[p] + 1 == len[q]) { link[np] = q; return; }
  int nq = ++total;
  epos[nq] = epos[q];
  memcpy(ch[nq], ch[q], S << 2), link[nq] = link[q];
  len[nq] = len[p] + 1, link[np] = link[q] = nq;
  for (; p && ch[p][c] == q; p = link[p]) ch[p][c] = nq;
}

int ord[N], buc[N];
void init() {
  for (int i = 1; i <= total; i++) ++buc[len[i]];
  for (int i = 2; i <= total; i++) buc[i] += buc[i - 1];
  for (int i = 1; i <= total; i++) ord[buc[len[i]]--] = i;

  for (int i = 2; i <= total; i++) {
    int x = ord[i];
    tag[link[x]] |= (1 << (s[epos[x] - len[link[x]]] - 'a'));
  }
}

int cnt[S][N];
long long ans = 0;

int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) {
    extend(s[i] - 'a', i);
    cnt[s[i] - 'a'][i] = 1;
  }
  for (int c = 0; c < S; c++)
    for (int i = 1; i <= n; i++)
      cnt[c][i] += cnt[c][i - 1];
  init();
  // printf("> %d\n", tag[ch[1][0]]);
  for (int i = 2; i <= total; i++) {
    for (int c = 0; c < S; c++) {
      if (ch[i][c] == 0) continue;

      int l = epos[i] - len[i] + 1;
      int r = epos[i] - len[link[i]] - 1;
      ans += cnt[c][r] - cnt[c][l - 1];
      if (tag[i] >> c & 1) ans += 1;
    }
  }

  // length = 1
  for (int c = 0; c < S; c++)
    ans += (cnt[c][n] > 0);
  // length = 2
  // std::set<std::pair<char, char>> s2;
  // for (int i = 2; i <= n; i++)
  //   s2.emplace(s[i - 1], s[i]);
  // for (auto it : s2) {
  //   std::swap(it.first, it.second);
  //   if (s2.count(it)) ++ans;
  // }

  printf("%lld\n", ans);
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

abaac

output:

7

result:

ok 1 number(s): "7"

Test #2:

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

input:

aaa

output:

3

result:

ok 1 number(s): "3"

Test #3:

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

input:

a

output:

1

result:

ok 1 number(s): "1"

Test #4:

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

input:

z

output:

1

result:

ok 1 number(s): "1"

Test #5:

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

input:

aa

output:

2

result:

ok 1 number(s): "2"

Test #6:

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

input:

az

output:

2

result:

ok 1 number(s): "2"

Test #7:

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

input:

za

output:

2

result:

ok 1 number(s): "2"

Test #8:

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

input:

zz

output:

2

result:

ok 1 number(s): "2"

Test #9:

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

input:

abc

output:

3

result:

ok 1 number(s): "3"

Test #10:

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

input:

aab

output:

3

result:

ok 1 number(s): "3"

Test #11:

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

input:

baa

output:

3

result:

ok 1 number(s): "3"

Test #12:

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

input:

dbda

output:

5

result:

ok 1 number(s): "5"

Test #13:

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

input:

dacc

output:

4

result:

ok 1 number(s): "4"

Test #14:

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

input:

cdaca

output:

6

result:

ok 1 number(s): "6"

Test #15:

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

input:

cddcc

output:

8

result:

ok 1 number(s): "8"

Test #16:

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

input:

adcbdb

output:

7

result:

ok 1 number(s): "7"

Test #17:

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

input:

cccccc

output:

6

result:

ok 1 number(s): "6"

Test #18:

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

input:

ccdcabb

output:

9

result:

ok 1 number(s): "9"

Test #19:

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

input:

bcbddca

output:

8

result:

ok 1 number(s): "8"

Test #20:

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

input:

cadababb

output:

11

result:

ok 1 number(s): "11"

Test #21:

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

input:

bdddcbbc

output:

11

result:

ok 1 number(s): "11"

Test #22:

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

input:

acdaabcdb

output:

10

result:

ok 1 number(s): "10"

Test #23:

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

input:

abcabdcad

output:

11

result:

ok 1 number(s): "11"

Test #24:

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

input:

bccbccccda

output:

17

result:

ok 1 number(s): "17"

Test #25:

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

input:

bbdddadcab

output:

14

result:

ok 1 number(s): "14"

Test #26:

score: 0
Accepted
time: 12ms
memory: 76840kb

input:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

300000

result:

ok 1 number(s): "300000"

Test #27:

score: 0
Accepted
time: 11ms
memory: 78220kb

input:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

300000

result:

ok 1 number(s): "300000"

Test #28:

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

input:

yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

300000

result:

ok 1 number(s): "300000"

Test #29:

score: 0
Accepted
time: 11ms
memory: 105420kb

input:

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn...

output:

299988

result:

ok 1 number(s): "299988"

Test #30:

score: 0
Accepted
time: 12ms
memory: 99208kb

input:

cacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacaca...

output:

5625225001

result:

ok 1 number(s): "5625225001"

Test #31:

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

input:

acaacacbcacabbaaabbbbcbaabcccabbbabaabbbccaabcbbbcaabbbbcbbcaacabaccbbacbaccacbbbabaccbaabbbccaaccbcbbaabbccccca

output:

2024

result:

ok 1 number(s): "2024"

Test #32:

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

input:

babbaccacaaababacacbaccabcaaacbcacaaababaababbbcbccbcccabcabbbacbbbbccccbcaccbbccbbaaacacaacbbabccccaabcbbabaabbaaccababaccaacabcacbccacccbaaabaacbcabbcabacbaacbabcaabcbcabacbaacacaabccbabbabbabacbacaccaccccacbcbcbbabbbaabcaabacbbacacbbccccaaaaacaacbccbbacbacabcaccccccbcacaacccccbcbcbbaacaabcaabbbcb...

output:

365780747

result:

ok 1 number(s): "365780747"

Test #33:

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

input:

abbcbcaabaaaabacbcbbcabababaabcbbbacbbabcbcccbacaaaaacaccaabcbcccababbaabccaaabbcaaccccbbbbcbaccabcabcbbcacaacababbcbacbccacccababbabacbcacccbcbbbbacbbabaaabaabcaaccbbcabbbccabbcbabaaaccabbaccabaccbbaacbaabbbacaaacabaaccabcabbbabaaaacabababbaaabcaacbbbbbcabccaccabaacbcbaaaaaabbbbcacabccabacacbbacbba...

output:

1252345802

result:

ok 1 number(s): "1252345802"

Test #34:

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

input:

bcccccbcacaccccccbcaaccaacccabbbbbbaaacccacbccbbabaacbabbaaabbcbcababcbaacbacbababccabbaccabcccbbacabaaccacccbcaacaccccaacccaaccccacbbaaaabcbbcbcabbbbbabbabacbbcacbccabaacbacbaaccbbbacccccbcbaabcccabbccbcbbaccacbcabbcacbbbccbbcabcacccaacaacccbabbbabccabacaabbaaabcccaabccaaaacbccbabbcbacbbbcbcabcbacc...

output:

1554129143

result:

ok 1 number(s): "1554129143"

Test #35:

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

input:

abcccabcbcaccbaacbbcacbabbababaabcabbbbbccacbcaacabccabcaabbbcaaaaabcccaacabbbbcbabccbbbbccbabccaaacacbabbbbbababcacbabbacbccbbababcabbcabccaaacccbbcabbcaabbcbacabbcbaacacbbbcbcbbbbccbccbcbaabaaccbcccbbcabcaababbababcacbbaabbbcccbcbabbcacabbccbcacaabcabacbabcbaacbcaaaccccaccbccbabaabbccbcbacaababbbb...

output:

3010750398

result:

ok 1 number(s): "3010750398"

Test #36:

score: 0
Accepted
time: 16ms
memory: 69424kb

input:

bcccaabcabaaacbbbcacbccbaccccaabaaaacccacccaabbaabacbaaacbccabcaccaccaccbacabbcaccccaacabccabaaacbbcaacacbccaccccccababcabbaaacbabbccbcbbcaabccbabbcbccbccccacbaacbbccaaababcbcabccaaccbbbbaccbcbbacbcbccaaaaaccaccacbccbaccaaaacacabaabcbcacccaaaccccaaccbcaaccccbabbccbbbbcacaaaabacabbbacaaabccbcbbbbcbbc...

output:

4888615152

result:

ok 1 number(s): "4888615152"

Test #37:

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

input:

caccbbbcbbaacccbbbabacabbabcacabbcbcbcaacbabcbbbacbcaaabaaaccbaaaacaaacabaabacaabbbacaabbcabaaaccaacaaaaaccababbabbacccbacbaabcbcaaccccaabbaabbccacbabcbaacabbbaaabcccacaabccbcbcbaacaabcbccccbbabcbbbcbabbbbcbacaaacbbaaaaaabacaaabaccbbbcabbabcaccbacabbcabbbacaccacbaabbacccbcacbaaacaababacababbabbcaaab...

output:

5976402426

result:

ok 1 number(s): "5976402426"

Test #38:

score: 0
Accepted
time: 20ms
memory: 82360kb

input:

bcbaccacccbbabbaccbabcabacbabacbcbbcccacccbaccbababbbbcaabcbaaabcbcbbacbbaaababbbbcbcacbacbbaaaabbccbbbcaabbaaacbbccbbaaaccacaabcaccbacaacccbabaaababbaabbcabbcaabcbbbcaccacccacaacabcbbbaabcabbbccbbbbaaccaabcbbbbcbbcacbbcbbaabcbccbbaacbbbcacabacaacbcbbabbacbbaccbabccaacaaccbbcbaabbaacaacbbaccbbabbbcb...

output:

7791334008

result:

ok 1 number(s): "7791334008"

Test #39:

score: 0
Accepted
time: 23ms
memory: 89144kb

input:

bbacaaababcaabacbbbbcbcbbacacabaabcbaaaabbcacaaaabbaccbaabbacbacbabbaccacbccccccacbbccacbbccbabbaacccbaabbaabbabbccccaaacbaccbccacbcbcbabbcccccbbcbcaaaacbbbaccbabacbbbaabaccbccbccaccbbbacaacabbccaabcbcacbbccaaabacabababcccaaabccaacbbbbbaaccaaccbacaabbbbcbbacbaccbcabccccbababbacbabcbcaaacaacacccccbac...

output:

10385658005

result:

ok 1 number(s): "10385658005"

Test #40:

score: 0
Accepted
time: 40ms
memory: 100024kb

input:

cabcabacaccbbccbaabbabbaaaababcbbbcbcaaaabccabccacbcbcbacccbbccbbcbccbaacacbbccaabcbabaaccbcbacccccbabccacbbcbacbabccbbcccabcbacbcaaababcaaaabcccaaccacbccccccccbcbbccabbabcbaabacacaaaaacbbbccbcbbacabaaababaccbcbcccabcaacbbccbaccaabccbcacbacccaabcbccabbbbcaacccacaaaacababcbbbcacccacaacbbcabaacccbbcca...

output:

13185061526

result:

ok 1 number(s): "13185061526"

Test #41:

score: 0
Accepted
time: 55ms
memory: 105976kb

input:

cbcabaabcabcabbabcaaababccabcacbaccbacaaacbbaaabaaaabacccbcaacccaabababaccbcbbabbbabcbbbcbaaccaababaccababbacaacabbccbbcbcccbabaacacaabaccbcbbbacbbaaaaccaaabcabacabcbbacbacbbcccbcbcbacaacbacabbcaacbbbacaaaabababcbbcbbbbbcccabccbbbbbbccbaaabcaaababbbcaabcabaaccbacccaacbaababbbacacacbccacabaacabaaccaa...

output:

14999060148

result:

ok 1 number(s): "14999060148"

Test #42:

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

input:

hheggdefeghbecgebacfegbecgfhfcgbdhgedchffaffbfceagagfddhfdgabhggecafdghhbhhchbebhgfcbcfcdgadheagbhfbfffaggeedffchfbdbceafffahhdfgdhhaeaabgbdgcdfbggdheaagdacffgbfdebaehheefhdbgbhbedfhfgbhabdhfahcabadhdgaebfaaagaggbeahacdhdfgchbggbgddbgcfchcghgdcdbddhfeahbfbhhhhbehfagdgdgehggaccheggeeeagcfeaagedcdbgga...

output:

30153449

result:

ok 1 number(s): "30153449"

Test #43:

score: 0
Accepted
time: 10ms
memory: 42088kb

input:

aagafaffcecgeeechbdhgafdaffadedeefghaacdegccabhhhfabcfachbeabcehbcfddgcebbhbehhhcgbhbgaecghfgdaaadhdfbeadfdhggeecedhdfbeaechhcgcbefhhcbdhgfcdgaccfgceegggccgfhaddfhgggdhaddbccbafaahbbaebaeeddfabbcchbbddcebgagbgahbadecgdbhhbgcdddfehefebghacehecgdabbbaabdbfbeabhgeffgafaehcebgddeeegfhcccafchhagbadadhdbb...

output:

203976827

result:

ok 1 number(s): "203976827"

Test #44:

score: 0
Accepted
time: 15ms
memory: 53732kb

input:

dbbddcdahdabdgfdcfbbcfgdcabgcedfeagedgddbefhhghhafdaaddfaaabebcbcdbdbgfbeebdccbafaffhdeecgdahbfdbhggcdaeahdgaehhdfcbadhfhegccbeahadcfcabhaggabgbdfgebhhadeddeabaeefehfabhebehbfbeabadaaddcfbaadfcbbhhgachaabgcgcbcfahdeffbbghgdfchghhedadhgffhadgdcedggggbfaghceecfdhbhadafaabdfaebecdhhcdceaaebdabbagbchfha...

output:

501171381

result:

ok 1 number(s): "501171381"

Test #45:

score: 0
Accepted
time: 7ms
memory: 54488kb

input:

ecdfghcdcfddgehbhaehggfbfgechhaadebbbhhedheehabceebabeddabbdabcaebfbghafcbgedahbbdgfbefagadcecbaedaccchfaacdchedhdgchahecbbhffafbaechhcagdagaeacfahbbgfbebfbfgdeghdaghhfcebbcfehgcagfbdbfhefhhcccfbagaaeahbfcgecbdgebhgfafhgafadggbegeeffeebcgdfegbgbadhfghfcfffaefbgbefgfahbbfdchdaccgeadfghhggadchahddabbb...

output:

737411855

result:

ok 1 number(s): "737411855"

Test #46:

score: 0
Accepted
time: 16ms
memory: 60692kb

input:

hbddbbhefahedgdadechegfdcahaaffechedfbghfhfefeeedegghhacfecahaedahgeghbaahbcefhafbbhegcahaeacchgdcghchfacdghcbadbfbadbachcefadffgcdcfhacgfhbbcdhehhgefhfdfbeeecehdacdgfhecfgddcfcgfdfggafeebfecddffhfefcgghbhdcahahbefbcdcchbebdaaccaghcgceebbbhgdhbcdfgahadfhadachhgfbahbhfcdghddfgahdhafabecebgfgbhheccgaa...

output:

911249835

result:

ok 1 number(s): "911249835"

Test #47:

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

input:

hbfgdhhdghbbdbgfbgeaffaadehhfgbcbcgfcadafcgdgbfahbdbdbadbbahabfcaafhecdgagbdbacbffedcfdgcdghcabghdfgedbhdegehahbdadgbdbadbgegdaadggceagcgahgcaceahdfdcadchagdcfbdcabcbcdfcegacaeachadddhfddhdfebddgedhedgdebccfcgddhhegebgcgaegbddbbhfedfegedhgahggdechhbbbcbfchcfcbfegbbabdbadddhfdfbgccebhfbdgaaafhaehbaeh...

output:

1640841656

result:

ok 1 number(s): "1640841656"

Test #48:

score: 0
Accepted
time: 26ms
memory: 77392kb

input:

bghggchdfcdhffffccdfdbfffdffcacaccbcdgdfcfdacaedhabeahdgggdbgcceegbhffdcbbbchghgebffhcaehgdfgffabgbcechhbgdefhfbebfdaebhbdbdaaacbffchfbcfcdgafeegdhdcegddadfbaaedhgaadehdcgdfcaeafhcdeagcghehaahcadhebhbbaeedchbaehheahcchhcbcagbhafacaabdecgahfdegchefacagheggeccfdeggebhbhdddhebdhfcedgdbchehhdehhfhfffhed...

output:

2707534869

result:

ok 1 number(s): "2707534869"

Test #49:

score: 0
Accepted
time: 33ms
memory: 81932kb

input:

aecgdbadegdbhdafeeefagaccehdfcbgghfggfhbfeacggchhegcdcdfcddfcheeggddfaaebeagfbbgaeahdachfcdhfcfhhbfghcghgecbedghdccfgdhfdaebgehebhcbhafabcadacefacdbbacggbcbfgfaefeacghahgabdccbcfbhgacdachgdccfagddgfcgfehhgfccbbgdebfgfgbgdfdabcfdhchfbdbhdhgafghhhfecgahchdhahghdabfddhdfhfdachadgcacchfcgeffbcdahaaggbba...

output:

2884360929

result:

ok 1 number(s): "2884360929"

Test #50:

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

input:

fbbaebheghacgdehgcbgcefechdhdhgaeahebhcbefcfdbfccagffheefacfhgabegaafafgeageccgahbbdfhbcdhbeggcbdhgabffgaffdgahcaeehhbadhabgbabfdgedaaefaggbgdgbbbacdheedbbhcdgebgbcfdadhhbdahhgaedhcfcggcchchaedafgehcfcebdgfhdhefgcdfdfagfhdgfdabhddcfabbdbhhfchhbbeaaacaegfeefaddagbbfehgfdefafehceecahhdgghddbcfhhccfbdd...

output:

4038141890

result:

ok 1 number(s): "4038141890"

Test #51:

score: 0
Accepted
time: 27ms
memory: 98276kb

input:

degfdbfaghagdhcggcbeeefeaeebbacbaaeggbhfeehfghheeacbedghhhfcbefahgfcehghddaaeedfhgdgcbdhfafchfheacbheebbchgdhghbebedggfchcgabaecebbdggheggcecfbghagehabhbhggheaacdbhddhbhhcbbfgffhcchcedheeedfaagdahddgcbcbfdcegbfhdbgcfcdcgfcbcffcccadfdeacgabcgebcdbagaceagacbcacgbedgddahfhadcchgfhddaghbggbfaaahhgchcddg...

output:

5052356122

result:

ok 1 number(s): "5052356122"

Test #52:

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

input:

egeacacfhbbgfcbfegggfcbcfdbfhdgadgahaggfagghcheedafgdadbdbbgeccgagaeggbccfggaebcaecceaefeffahgfhabhhabafgadcaafgdedfhfcdhhafhhcdahhhdgdgeeagcdadeedaecfdgbdaccacghdhddcachbgaacgfffbbeahfhaachcaccfdefbbachahfebccccdheghcfgcafeebhahfegghedaghdbbdhabgahdfcbaccgbdeehbgfcdahffecbhchcdbbhdaefbfbaedebgfhdcd...

output:

5625012518

result:

ok 1 number(s): "5625012518"

Test #53:

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

input:

ptjlikjjjoiootlnnnqqplimrslttmisooqomkkqlprkktoqqtmoprolmsillikkjptisnrnnqtoopqkmnsminmoommptospipnppltqiqoqrlkikpsrjooktipinrorsommnpqslqjnlmtqstmpsikokjikjpnjqlstslojppsnmitqtomqtsnpqlqjntiokkiliomtiktpjmpmstojmkrtmtinsinrtitonipmrqrrqikkttrsopjmprsrjmqmqnrkmrrslkqjlrnijjpotrokjqtkjsqriqlqrjoprtrq...

output:

25612936

result:

ok 1 number(s): "25612936"

Test #54:

score: 0
Accepted
time: 7ms
memory: 50856kb

input:

rmomrinpqijntispkjokrnklttrjkotktoskjpjqmtrilkqjiikijmirinnlqpqmktpsppkrqnlrtsnqjqroksrjoqkrlijiktrpsqqrnokmonmporllkqspjksstntpisinmtprrqismsolstlisinomrrjiprnqmtjipirislnrkomkotllrmplsrpsjmjjrpjkqoqrqmlnminkkjrtrssprmjnisjmimloljtrrtpqmqtjksliiqsioimnpnkitsrqmkjpolrplprlirimkrqjjtsslqlsqqjmnmliqkk...

output:

64584265

result:

ok 1 number(s): "64584265"

Test #55:

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

input:

irippnmqtikjmqlspkoqjtqnqmiimpkrtijnlljkmqjrspoisqninisjkkjsmmltirsnkmkriqmrtqrmnomrqlsmnjpjtkokpjrltppntmkitproiijsmkikrslnsptilspioosjikrttirslsoiilpknlntlmqljknmqoolmqirkoomonjkmomosskorqonjqnjikrnpmloqnqqqlqqrqsmiomtimptprjjkllirqkljpkrsojpsnnnlkjrnmlrklimpjrnstrpskmrmjssljlnsrpnkpjlmpnrkmponjit...

output:

186972919

result:

ok 1 number(s): "186972919"

Test #56:

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

input:

pnktrrorlprjqiptqrmomqimrnnprsmprtmlsstllirqnskpsplrjsmntmnsoqjqjtinmljttlsnpomkknipqpmlkmipsrrqjilnjqpsqrmnksmnppljmjtjirtqisnijlmtsntkqrqnotjsoqnqpkjmnsrkkrrppmiottmonikpkkjnnjssprostipnkikkjsoqtmolpkrmlklnojnmjsklqoiojssmssmlpknmilkinttonkknmsjnporllpsokpknpirnskitljjjisptktltrskqtpppotnmposlqqtr...

output:

552643518

result:

ok 1 number(s): "552643518"

Test #57:

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

input:

rkjpqipjjporqmjtkqmmptmplrmomrmpisppiipkmsprpslilrikkppmitkirnsqlnrornqnmtjjtjojossptsrkqnmqjqlkprlrptmkrtltnsortknkptkrmmiislmrlmmrtnjlqopknqmjllkiplqmptlplkmtmmsnplokntlopqlrkinlrnnqoqrnlqlsrolrioqplqltqmpqtqjrkrmiisoomrjtpkintroqoqnjkpqqkriqtqnnsnnkrnsjjmjjsrillktnstponrqoknrppiqsontrimrktrkioisr...

output:

812284221

result:

ok 1 number(s): "812284221"

Test #58:

score: 0
Accepted
time: 31ms
memory: 80156kb

input:

stnsomiskjrlrnkkslkpjllipirpqslrqrjktmskkmilqkkonmoitjsrotsikrlontorkjlrorrknjpjjionmkokqtprijkqjsqnkttsoqtljkjpslisioiqpsmmtrqiqkimmpissnmmtsmjijolisitirkinjmrkknrpmqqjllmiipttopqpjnstqqmrotioikliolnjmjolisqonoooqioitjsmkmiosnqrslrijmqmktjplslijnktjljmimsinktjpssmnsrqlqjjqmqoolpilojjjpksiltnrqtttjn...

output:

1330293994

result:

ok 1 number(s): "1330293994"

Test #59:

score: 0
Accepted
time: 27ms
memory: 82416kb

input:

nlitktppjtjpoiqpqsksslqttqtillpiljjrmrnnttnoqssojtrikkrjpmlljqtilmpmstkmjitlpsilnpsrtqotllptpitqnkrqmnnrjjskmlrlnqjnmqrmjmkkmlsmjptrtqtpnlslkronoptnssqqpimkinkolnriptitppposioooqoploprolsrilmloolpssljisotsjknotmmtnpmprsjlitjipjtljrqilnojpotspqqrkqtirorsqrmtmqmlnoqpisqnormkokmjrkkknmmiptlqjopiqrsnlil...

output:

1723235581

result:

ok 1 number(s): "1723235581"

Test #60:

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

input:

tqkkrlqokpttlolqtolsopllqqjmmkrrrjksklplmiijrisqkjkmqntmrilmtsjktlqimitnnimirnmtomkkolmqtmtpnijqstssoiqirkrkpiqitststrlqtnntqlssrrtokolmskjnplsqiiijlpoojsjopltqsmkrmnqkkrknkjlkkjtponrmmilkotqksqnkktjrjsoqpsoorsomrpprnkojsrsnrooqrlmknooikopqioolsoispjqpjimqookkkrnlqnsktjlrikqrpqnkmqpsritprlnnqilkkssk...

output:

1860579178

result:

ok 1 number(s): "1860579178"

Test #61:

score: 0
Accepted
time: 35ms
memory: 97588kb

input:

psqrqmlrnnqkmslqskmrqpormqiiioprolqljmqnlpoimpmisikliilsrioskrpintqktmlqrojplrprimjlsqnjrmpomqlmsmtptmipmsinrsktskjtjskjiksnspjitikqrnpkllljnqtnkktrppiqmlpkjnpkljqmnlqrkjpqmpmmpikijkrmkptnnstionjtkromjqlmkmprkipjsmospkjssmpmmsoknptoinimskjnrojtqmlnomrkliikkokqntrilkjinoslnpiomtittommrqoiklnjpskklqtn...

output:

2751920446

result:

ok 1 number(s): "2751920446"

Test #62:

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

input:

iroiqrttopkrosssnlimqpiioplsptqqlqsiirtjrjjqpostsrmpsslmnjlrstppkpqskikpipnsjpqrojioollrtrmjlkqqlnlttqrnoslrsnnkmtlokkrlnmqsjqppplppitpnrkttimimmsitmljlsnrsprnjrnloqpjnsknnrmssqljqpsnilnjlsojjlsrtposqjlmkpkjjksqplpioqtjspritstllrkoojmkmniiitrpsmsprjijptlrtspksknkqlrkrppipstmskpikrqskriissskilnjrstps...

output:

3488028595

result:

ok 1 number(s): "3488028595"

Test #63:

score: 0
Accepted
time: 41ms
memory: 103344kb

input:

ooqkslptpknjlpmsjnpqonmirpjkltlijplrnnnmjpqsqoiqpiosqmnkjrontssrpnitsssiktspiosojpnooijqpmsknirionorklqojrknqllotnqpilokrttoqrrpqkslqtijikiqmnprjtrkpponnomrjnslpjoinirpkrjtlqoqllstprotkknopmtrnrijrnjpklilktlsnisnpjokistklnsmnkispnssktrqmilptpnnilnjolqqrojiorqolsrsrjjjsostkkitrljikmojiknjojskskojlost...

output:

3749951500

result:

ok 1 number(s): "3749951500"

Test #64:

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

input:

cspjtokhiqhudcgferqdcydsfepvytvwaatevhozykkkzcesevihelkvuvyqhbaxcaruhntjfuasnsltzmrzravqhcqouzqnaeywnyvfyfikoobykkjencsvzakgjxvgjpxtxtuutkfpyykbxlsewadunppfreamzviahkitjdrbvlriwlekhvutttydecdvoxowjfjsnnntxwqlidfccsynqmlkbqefwmsnlnbgoxivwbxihsjjubmuyadjcyoqyeqferyphniyjwjndtillzbrlfhduiveaobpavreceav...

output:

8404372

result:

ok 1 number(s): "8404372"

Test #65:

score: 0
Accepted
time: 7ms
memory: 76112kb

input:

rwqjauogesdbygmyskfqagwmqcoqqdfeeguythelvazcbobrtfvoansrfhslmepzxrvclquurcjctnyetcunzauejrzsmjkkvcnrjqpusolvxysatpnnwpfhsllhxqecaaobgfxnewrjfumsmblifsijsknmafmsnudqdcpbvrqknrqbgaudraarlgrneosvdmqwijgzsdxwhutzyuemdozamhtwplowoxpferszjajvjtqfjaboveeffckhmgbeimibepmawnknsfkbtgrxajgjyxymuhoyyanchtjohlcw...

output:

26124260

result:

ok 1 number(s): "26124260"

Test #66:

score: 0
Accepted
time: 11ms
memory: 86140kb

input:

xtlngwojmsktiklwyootvxjcdewpoayvhbkiigmwegwcxqxuevphgzxidnlsebmsiuiciiokupxuudqnbbeesxvafjyipesfykrtpklmbtardevscceevfhfaeghcuqrzkrxhhqkgqvpisdfrhjpbfuxjawhqncvipysmaiaqgetniizwurwyutjqlvzpmiszvwnfilewdafekmxoccfaicyaafrloybkzhlaobxxkfpdxayaqconimbhzapqtauagzouvbwqhscgcfwvzjfzysvyirkeodvrsakxckwqoem...

output:

81719497

result:

ok 1 number(s): "81719497"

Test #67:

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

input:

xzoijlxrcneobtzxsrftwpxszsjgwtwmkfvhlbcacqtmibtlikbojlmmlvisscponnlhliqdsqykrqjzhxutjxdtrsrfzggdsowiwigmyqclzkkrplacfpywbokbmtxelaemmfbkhiutdzkzibcerxfxfsugacspckmjloehinglaxihbqlgrmbkpemtxrjcrgrpkhrnpwzafioxvrtcwgnzebaiqbuexomuggplfmanmfkgehvphtbaixrvbbufkcfiihuzpmlhqqtwfyskhddwzixoxbxofwklmycnxuqy...

output:

258645715

result:

ok 1 number(s): "258645715"

Test #68:

score: 0
Accepted
time: 16ms
memory: 91688kb

input:

mripdormghtfqhjrdtolswppdqvevrvcuuudagmcczlzdwslyymdnhoubuqyzmaszlgwdhiqljjbohgmgagjhwysfcekvpoxwbtulybkoihjpkktshfdnzgkyamhnguaymlesmnptcwgmukbppgxjcmefoxhaydarkqvckeubyccbjsmnzrvvexxqjqezhpzjjdgyycndmazeftjxfvbwbxohzuqkbzizaosgajxpnqbsypzuzcbgbucdukdpwormrxpyitltehbgyveckfevfeadzafllieoixithkgknsx...

output:

400906876

result:

ok 1 number(s): "400906876"

Test #69:

score: 0
Accepted
time: 29ms
memory: 97288kb

input:

ilzdqmlwwaezxsypsrpzdxokyneowbrlmuqfhllkrkumzyqozenwrchcjdrqgzpobdgziczyivijuiylqsykufpcomkkbcnrsfwvkcbbygdwupgqmnhywmekcrcriguzzfrewddznaugbqknbcpmkzugncwnmhewpebdjrqudwsyalwfsvabmkpetosbettiivgpoyflurtmttsibwgwwlyxiemgscsjbrpksioicowbgrusymmfdmorkdrcdoltdunhbqspxhskejqafcnjbsgibokgrvcruzgdmsrnhfzk...

output:

449129670

result:

ok 1 number(s): "449129670"

Test #70:

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

input:

dcowxeuzvojnckdbwutdazoitvsmdsehsmgmfytqvuelurdkgxsrpikkgfkzyrehvqjlpsgryoyomxstnzogmoxoznolxogmpcjpqijcypnpedvimqpmvyqckrefrktekgijhbfpatvtckirexrussmgtkaioyyhwrisgzosdoksskojlgboorbzhoqpqtemqthmdidkvmahycrsznfnmqxeyionkevlsgotbjayiifvmfcgfmmgupjbkewoljuwbzngtdeaimoftfurbeymnagdwagtebntksjxfjerucgw...

output:

842920551

result:

ok 1 number(s): "842920551"

Test #71:

score: 0
Accepted
time: 26ms
memory: 106416kb

input:

nfiykjdlphvipvcqkghwncbsbjxpzxvrgpgepbyyomfuynyyfxdjdgtrdhwzcgjuxzjenrxjnxmgdcdzlwxdtwxgxygxebsfvxkolresweohvdhnmaifjjsrynklpcqellblsjxzpreqsmckndnajavcymhsxcrzkjihpwshxpjqsljivvwoljforlteoviuifchhkfvkhykrlgdhhobmvwwxrtowhlzgjzfkhjtpxmxxjxpiyaacgjwynoerhmupipvlhzmamfcllniygitiojvxdorxtyjouaoeeufexrg...

output:

888008404

result:

ok 1 number(s): "888008404"

Test #72:

score: 0
Accepted
time: 42ms
memory: 110700kb

input:

sjjukizbibjtbauflblwyfojalcrofjbpxzudxxtgowfcemimkdsfyzliybwlfbsmwkszspvzrfhflvgfcgxvpepgvievlyfeabtdflpuburjchoicjtktqpvbtmdnihcqvcpwvdsprkddopipytgtufwgtstpwwmhvttzynodeolwrjfnvgodsrkatzvciridvaytgziqsnrovnrurvfjifupirvyeyeqqmslbzlpbamkmylaeytgppdfebbwvjbrtrajghqurgmqeezactpazxakicygrmstosxnpnodja...

output:

1200839973

result:

ok 1 number(s): "1200839973"

Test #73:

score: 0
Accepted
time: 43ms
memory: 114760kb

input:

hagqpwqpggozvvhkaipeufecoblbdgfuuivutvgvpqifliskqdpyysacvkgacqixifhxambcxnbqmqmigubgegkupooomeltpbmkhocrtcmhlobwcffbdsfrrsmoimefbgcbojibzsdajhvjcbmuxozkhtulbkqegewuspayhrsfyjtahratopbevbezmqipateryrhitlsipggkjsvkouufigvhcoylidnoqkfklovdzxxhlzgiapsfzvlctazbwybjzpdwwxbonpqagtdozgodkmscobzmizwcgemrwzcb...

output:

1624365762

result:

ok 1 number(s): "1624365762"

Test #74:

score: 0
Accepted
time: 55ms
memory: 115160kb

input:

dyevsfmqfewmwkdtpvuydljawyxmnapgiyjuoiyohddrrdifhgrzffjzhmpirzwovixdgpuhbfqxwazaieevczvzrlsyrdlsseinhbknqqrqawfbqojfflwvyovowmsnjjrarzgwuxenabpshetfwwcvwvgipyxjkuynzrwhnkvfldtrjsxkylkelsrnjbxhtdzcacfodjugnxuzztyfdedefyhblebfvqzqkqrzkjahrwgdddcggpbcszahujgwwbmgjnfytxugueyltqykftbonwpvesrqutiuixtzidwj...

output:

1730786929

result:

ok 1 number(s): "1730786929"

Test #75:

score: 0
Accepted
time: 15ms
memory: 87516kb

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

13063858895

result:

ok 1 number(s): "13063858895"