QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#411026#6181. 重复函数问题Max_s_xaM100 ✓173ms34384kbC++143.1kb2024-05-14 20:17:422024-05-14 20:17:43

Judging History

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

  • [2024-05-14 20:17:43]
  • 评测
  • 测评结果:100
  • 用时:173ms
  • 内存:34384kb
  • [2024-05-14 20:17:42]
  • 提交

answer

#include <iostream>
#include <algorithm>
#include <set>
#include <cstring>

typedef long long ll;
typedef double lf;

// #define DEBUG 1
struct IO
{
    #define MAXSIZE (1 << 20)
    #define isdigit(x) (x >= '0' && x <= '9')
    char buf[MAXSIZE], *p1, *p2;
    char pbuf[MAXSIZE], *pp;
    #if DEBUG
    #else
    IO() : p1(buf), p2(buf), pp(pbuf) {}
    ~IO() {fwrite(pbuf, 1, pp - pbuf, stdout);}
    #endif
    #define gc() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin), p1 == p2) ? ' ' : *p1++)
    #define blank(x) (x == ' ' || x == '\n' || x == '\r' || x == '\t')

    template <typename T>
    void Read(T &x)
    {
        #if DEBUG
        std::cin >> x;
        #else
        bool sign = 0; char ch = gc(); x = 0;
        for (; !isdigit(ch); ch = gc())
            if (ch == '-') sign = 1;
        for (; isdigit(ch); ch = gc()) x = x * 10 + (ch ^ 48);
        if (sign) x = -x;
        #endif
    }
    void Read(char *s)
    {
        #if DEBUG
        std::cin >> s;
        #else
        char ch = gc();
        for (; blank(ch); ch = gc());
        for (; !blank(ch); ch = gc()) *s++ = ch;
        *s = 0;
        #endif
    }
    void Read(char &c) {for (c = gc(); blank(c); c = gc());}

    void Push(const char &c)
    {
        #if DEBUG
        putchar(c);
        #else
        if (pp - pbuf == MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf;
        *pp++ = c;
        #endif
    }
    template <typename T>
    void Write(T x)
    {
        if (x < 0) x = -x, Push('-');
        static T sta[35];
        int top = 0;
        do sta[top++] = x % 10, x /= 10; while (x);
        while (top) Push(sta[--top] ^ 48);
    }
    template <typename T>
    void Write(T x, char lst) {Write(x), Push(lst);}
} IO;
#define Read(x) IO.Read(x)
#define Write(x, y) IO.Write(x, y)
#define Put(x) IO.Push(x)

using namespace std;

const int MAXN = 1e6 + 10;

int n, z[MAXN], ans[MAXN];
char s[MAXN];

int id[MAXN], st[MAXN], top;
set <int> pos;

int main()
{
    #if DEBUG
    #else
    ios::sync_with_stdio(0), cin.tie(0);
    #endif
    Read(s + 1), n = strlen(s + 1);
    z[1] = n;
    for (int i = 2, l = 0, r = 0; i <= n; i++)
    {
        z[i] = (i > r ? 0 : min(r - i + 1, z[i - l + 1]));
        while (i + z[i] <= n && s[i + z[i]] == s[1 + z[i]]) z[i]++;
        if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
    }
    id[1] = 1;
    for (int i = 2; i <= n; i++)
    {
        id[i] = i;
        if (z[i] == n - i + 1) st[++top] = z[i];
    }
    sort(id + 1, id + n + 1, [&](int x, int y) {return z[x] > z[y];});
    for (int i = 1, j = 1; i <= top; i++)
    {
        int len = st[i];
        while (j <= n && z[id[j]] >= len) pos.insert(id[j]), j++;
        int x = 1, cnt = 1;
        auto y = pos.lower_bound(x + len);
        while (y != pos.end()) cnt++, x = *y, y = pos.lower_bound(x + len);
        ans[cnt] = max(ans[cnt], len);
    }
    for (int i = n - 1; i >= 2; i--) ans[i] = max(ans[i + 1], ans[i]);
    for (int i = 2; i <= n; i++) cout << ans[i] << ' '; cout << '\n';
    return 0;
}

详细

Test #1:

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

input:

dbabeaaaaabccdbadbabeaaaaabccdbadbabeabaaabccdbadbabeaaaaabccdbadbabeaaaaabccdbadbabeaaaaabcdabadbabeaaaaabccdbadbabeaaaaabacdbadbabeaaaaabccdaadbabeaaaaabccdbadbadeaaaaabacdbadbabeaaababccabadbabeaaaaabccdbadbabbaabaabkcdbadbabeaaaaabccdbadbabebaaaabccdbadbaaeaaaaaacadbadbabeaaaaabccdbadbabeaaaaabc

output:

28 28 12 12 12 12 12 12 12 12 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 299 numbers

Test #2:

score: 5
Accepted
time: 2ms
memory: 11772kb

input:

debadebadebadebadebadebadebadebadebadebadebadebadebadebadebbdebfdebadebadegbaebadebadebadebadebadecadebabebadebgdebhdhbadebadebodcbadeaadeaadebadebadebadebadebadebaiebadebadbbadebadebdneaaaebadeeadebadeeadebadeaadabadebadebadebadlbaafnadabadeaadebadebadebadebadebadebadebadebadebadebadebadebadebadeba

output:

56 28 28 24 16 16 16 12 12 12 12 8 8 8 8 8 8 8 8 8 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 299 numbers

Test #3:

score: 5
Accepted
time: 2ms
memory: 11688kb

input:

ldcmbfbaebacibaldcmbfbaebacibaldcmbfbaebacibaldcmbfbaebaciaalgcmbfbaebacibaldcmbfbaebacibaldcmbfbaebacibaldcmbfbdebacabaldcmbfbaebacibaldcmbfbaebacibaldcmbfhaebacibalccmbfbabiacibaldcmbfdaeabcgbaldcmbfbaebacbbaldcmbfbaabacibaldcmbfbaebacibaddcmbfeaebacibalbcmbfbeebacibaldcmafbaeaaciaabdcmbfbaebaciia...

output:

45 45 45 45 45 45 45 45 45 30 30 30 30 30 30 30 30 30 30 30 30 30 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 2999 numbers

Test #4:

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

input:

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccacccccccccccccccccccccccaccccccccccccccacccccccccccccccccccfcccccfcccccccccccccccccccccaccccccccccbccccccccccaccccccccccccbccccccccccccccbccccccccc...

output:

153 94 88 76 66 66 59 56 55 51 50 49 47 44 43 43 41 41 39 38 35 35 35 34 34 33 33 32 31 31 31 31 30 30 29 29 29 29 28 28 28 27 27 27 27 26 26 26 26 25 25 25 25 24 24 24 23 23 23 23 23 23 22 22 22 22 22 21 21 21 21 20 20 20 19 19 19 19 19 18 18 18 18 18 18 17 17 17 17 17 17 17 17 16 16 16 16 16 16 16...

result:

ok 2999 numbers

Test #5:

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

input:

aaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaedfaaebfaaebfaaedcaaedfoaedeaaedfaaebfaaedfaaedfaaedfaaedfaaedfaaedfacecfaaedfaaedfaaebfgaedfaaadfaaedfaaedfaaedfaaeefhaedfaaedfaaedfaaedfanedfaaedf...

output:

150 80 75 75 65 55 50 50 50 50 45 45 45 40 40 40 40 35 35 35 35 35 30 30 30 30 30 30 30 30 30 30 30 30 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15...

result:

ok 2999 numbers

Test #6:

score: 5
Accepted
time: 2ms
memory: 11884kb

input:

aaaaehcgcaaaaehcgcaaaaehcgcaaaaehcgcaaaaehcgcaaaaehcgcaaaaehcgcaaaaehcgcaaaaehcgcaaaaehcgcaaaaehcgcaaaaeabgcaaaaehggcaaaaeacgcaaaaehcgcaaaaehcgcaaaaeaagcaaaaehcgcaaaaehcgccaaaebcgcaaaaehcgcaaaaehcgcaaakehcgcaaaaehcgchaaaehcgcacaaehcghaaagehcgcaaaaehjgcaaaaehcgcaaaaebcbcaacaehcgcaaaaehcgcaaaaehcgcaaa...

output:

93 48 48 48 48 39 39 39 39 39 39 39 39 39 30 30 30 30 30 30 30 30 30 30 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 3 3...

result:

ok 2999 numbers

Test #7:

score: 5
Accepted
time: 9ms
memory: 14656kb

input:

fdeaacqcacbgmabfbrfaaaalbabeaaejbfabbcaaaaaiaegcaabbfmfbaoanaebbgaddmaaabaanahabadlaadecaacagaebafdeaacqcacbgmabfbrfaaaalbabeaaejbfabbcaaaaaiaegcaabbfmfbaoanaebbgaddmaaabaanahabadlaadecaacagaebafdeaacqcacbgmabfbrfaaaalbabeaaejbfabbcaaaaaiaegcaabbfmfbaoanaebbgaddmaaabaanahabadlaadecaacagaebafdeaacqca...

output:

20065 10074 9977 6679 6679 5030 4933 3963 3963 3284 3284 2799 2799 2508 2411 2217 2217 1926 1926 1732 1732 1635 1635 1538 1441 1344 1344 1247 1247 1247 1150 1150 1150 1053 1053 1053 956 956 956 956 956 956 859 859 859 859 859 859 859 859 859 762 762 762 762 762 762 762 762 762 762 665 665 665 665 66...

result:

ok 199999 numbers

Test #8:

score: 5
Accepted
time: 13ms
memory: 15132kb

input:

laaaakeclaadeaibaahencaabygcxadibfbalafhbelicdjaadcdcaabbccablccdbacabdhdbagaaabdbgfaiaagaaqaelaaaakeclaadeaibaahencaabygcxadibfbalafhbelicdjaadcdcaabbcgablccdbacabdhdbagacabdbgfbiaaiaaqaelaaaakeclaadeaieaahencaabygcxadibfbalaahbelicdaaadcdcaabbccablccddacabdhdbagaaabdbgfaiaagaaqaelaaaakeclaadeaebaa...

output:

62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

ok 199999 numbers

Test #9:

score: 5
Accepted
time: 6ms
memory: 14916kb

input:

dibhabddabdageaaaadgbbfbefckaacdfcbcbbgdagdcacbdicabaaaabbablabheaahdibhabddabdageaaaadgbbfbefckaacdfcbcbbgdagdcacbdicabaaaabbablabheaahdibhabddabdageaaaadgmbfbefckaacdfcbcabgddgdcaabdicbbbaaabbaalabheaahdibhabddabdageaaaadgbbfbefckaacdfcbcbbadagdcacbdicabaaaabbablabheaahdibhkbddabdageaaaadcbafbefck...

output:

148 80 80 80 80 80 80 80 80 80 80 80 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12...

result:

ok 199999 numbers

Test #10:

score: 5
Accepted
time: 6ms
memory: 11944kb

input:

cbfatdaacaaacjacbiaaaaajambaabdecadcjceafjacbfatdaacaaacjacbiaaaaajambaabdecadcjceafjacbfatdaacaaacjacbiaaaaajambaabdecadcjceafjacbfatdaacaaacjacbiaaaaabambaabiecbacjceafjacbfatdabcaaacjbcbiaaaaajambaabdecaacjcemfjacbfatdaacaaacjacbiaaaaajambaacdecagcjceafjacbfatdaacabacjacbiaaaaajambaabdecadcjceafj...

output:

136 93 93 93 93 93 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50...

result:

ok 199999 numbers

Test #11:

score: 5
Accepted
time: 15ms
memory: 15024kb

input:

aanaadabafbgaanaadabafbgaanaadabafbgaanaadabafbgaanaadabafbgaanaadabafbgaanaadabafbgaanaadabafbgaanaadabafbgaanaadabafbgaanaadabafbgaanaadabafbgaanaadabafbgajnaadabafbgaanaadabafbgaanaddabafbgaanaadababagadnaadabafbgaanaadebafbaaanaadabafbgaanaadabbfbgaanaadababbgaanabdabafbgaanaadabafbgaanaadabafbg...

output:

152 128 116 116 104 104 104 104 104 104 104 104 104 92 92 92 92 92 92 92 92 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68...

result:

ok 199999 numbers

Test #12:

score: 5
Accepted
time: 21ms
memory: 17276kb

input:

adlaaaebacjabbafebafbkaaechcaakdacclhbaebbeafkbbaabaabecahbegabbfaibbdbfabaaadodaakadlaaaebacjabbafebafbkaaechcaakdacclhbaebbeafkbbaabaabecahbegabbfaibbdbfjbaabdodaakaalqaaebacjabeafebafbaaaechcaakracglhbaebbeafkbbcabaabecahbegabbfaibbdbfabaaadodaakadlaaaebacbabbafebafbkaaechcakkdacclhbaebbeafkbbaab...

output:

136 136 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

ok 199999 numbers

Test #13:

score: 5
Accepted
time: 8ms
memory: 14664kb

input:

antabfebhlnahgaabhbdadpdabbabedbaabeadaaaccadakbbadikblacaaaadbabccabdjbadbhbaaaaantabfebhlnahgaabhbdadpdabbabedbaabeadaaaccadakbbadikblacaaaadbabccabdjbadbhbiaaaantagfebhlnahgaabhbdadpdabbabedbaabecdaaadcadakbbadikblacaaaddbabccabdjatdbhbaaaaantabfeghlnahgaabhbdadpdabbabedbaabeadaaaccadakbbadikblac...

output:

92 92 92 92 92 92 92 92 92 92 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 ...

result:

ok 199999 numbers

Test #14:

score: 5
Accepted
time: 5ms
memory: 11688kb

input:

bccaceeibbeakdibahabaeabbpgiabaabbadcagkafgbkdamaacaaacfcgedagacbckacaaakfkdabgfbhbfeakdhaaebbadababigacadadakabokaanbccaceeibbeakdibahabaeabbpgiabaabbadcagkafgbkdamaacaaacfcgedagacbckacaaakfkdabgfbhbfeakdhaaebbadababigacadadakabokaanbccaceeibbeakdibahabaeabbpgiabaabbadcagkafgbkdamaacaaacfcgedagacbc...

output:

4961 2387 2387 1568 1568 1100 1100 866 866 749 749 632 632 515 515 398 398 398 398 281 281 281 281 281 281 281 281 164 164 164 164 164 164 164 164 164 164 164 164 164 164 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 ...

result:

ok 199999 numbers

Test #15:

score: 5
Accepted
time: 9ms
memory: 16828kb

input:

fbacbcahabigcaahghbhbaadgafbacbcahabigcaahghbhbaadgafbacbcahabigcaahghbhbaadgafbacbcahabigcaahghbhbaadgafbacbcahabigcaahghbhbaadgafbacbcahabigcaahghbhbaadgafbacbcahabigcaahghbhaaabgafbacbcahabigdfahghbhbaadgafbdcbcahabigcaahghbhdaadgafbacbcahabigcaahghahbaadgabbacbcahabigcaahghbhbaadgafbacbcahabigca...

output:

164 138 112 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 86 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 ...

result:

ok 199999 numbers

Test #16:

score: 5
Accepted
time: 8ms
memory: 14676kb

input:

dadbmcbecgceamccbbcjaaacbcdqaddadbmcbecgceamccbbcjaaacbcdqaddadbmcbecgceamccbbcjaaacbcdqaddadbmcbecgceamccbbcjaaacbcdqaddadbmcbecgceamccbbcjaaacbcdqaddadbmccecgcebmccbbcjaajcbcdqaddadbfcbecgceamccbbcjiaacbcdqadhadbmcbecgceamccbbcjaaacbcdqaddadbmcbecgceamccbbcjaaacbadqaddadbmcbecgceamccbbcjagacbcdqad...

output:

140 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50...

result:

ok 199999 numbers

Test #17:

score: 5
Accepted
time: 45ms
memory: 18544kb

input:

ldawaaefcgagabeeaabecjwbdaaadfiaeackcbcacacabadafiedhbgfcaaiaabfaccicebcffcjcmaaaaabaaagbaacbehdaeakibbehaiafbebbfbifabcaecafaoahhceecicheagdaicdbualdawaaefcgagabeeaabecjwbdaaadfiaeackcbcacacabadafiedhbgfcaaiaabfaccicebcffcjcmaaaaabaaagbaacbehdaeakibbehaiafbebbfbifabcaecafaoahhceecicheagdaicdbualdaw...

output:

114960 106672 71004 57388 53244 42588 38296 35484 30452 28676 26604 23644 22904 21276 19352 19056 17724 16392 16244 15208 14320 14172 13284 12692 12396 11804 11360 11064 10620 10324 10028 9584 9436 9140 8844 8696 8400 8104 8104 7808 7512 7512 7216 7068 7068 6772 6624 6624 6328 6328 6180 6032 5884 58...

result:

ok 999999 numbers

Test #18:

score: 5
Accepted
time: 173ms
memory: 34384kb

input:

acahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaejbbehfaacahhafaaej...

output:

115337 59492 57656 39653 38429 29742 28824 23792 23537 23061 21582 19814 19763 19372 19304 19202 18505 17791 17077 16992 16465 16278 15921 15275 14867 14510 14408 14034 13915 13830 13694 13643 13371 13201 13167 13048 12793 12640 11892 11892 11756 11518 11042 10804 10787 10787 10566 10566 10498 10464...

result:

ok 999999 numbers

Test #19:

score: 5
Accepted
time: 42ms
memory: 18068kb

input:

eagbgaceaaacbfckaasaalabhhweigddbbckfaababaadddbhcaaaacctgcfdacdbabldbajageacbnafabefbaacbkbcbaobebbaabaaakakeicdcagadbkcabcaaieobdaaanaeedbraajibeagbbaaacbabcjahdakcdaabeeaicldadaeadbabcfidbajaabjfafdabcdeaaddagaaacjaadamdaaababqbebdbblsweaadaeccacacbemcbpadaaaalasbaccccibebbecbaalafaacbfdmahabahjj...

output:

270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 270 ...

result:

ok 999999 numbers

Test #20:

score: 5
Accepted
time: 47ms
memory: 18276kb

input:

ifdabdbacceabebbceafbbacealaachbajbaieaiaccgaacbbaaadafegkaccdabbdkaabhecbhadfaabbcebaaaeaegdecaifdabdbacceabebbceafbbacealaachbajbaieaiaccgaacbbaaadafegkaccdabbdkaabhecbhadfaabbcebaaaeaegdecaifdabdbacceabebbceafbbacealaachbajbaieaiaccgaacbbaaadafegkaccdabbdkaabhecbhadfaabbcebaaaeaegdecaifdabdbaccea...

output:

20224 10336 10048 6880 6688 5152 4960 4096 4000 3424 3328 2848 2848 2560 2464 2272 2176 1984 1984 1792 1792 1696 1600 1600 1504 1504 1408 1408 1408 1312 1312 1216 1216 1216 1120 1120 1120 1120 1120 1024 1024 1024 1024 1024 1024 1024 1024 1024 1024 928 928 928 928 928 928 928 928 928 928 928 928 832 ...

result:

ok 999999 numbers