QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#163144#5084. Longest Substringstd_absAC ✓142ms28532kbC++203.4kb2023-09-03 21:23:152023-09-03 21:23:15

Judging History

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

  • [2023-09-03 21:23:15]
  • 评测
  • 测评结果:AC
  • 用时:142ms
  • 内存:28532kb
  • [2023-09-03 21:23:15]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
#define pb push_back
#define all(a) a.begin(), a.end()
#define sz(a) ((int)a.size())
const int mod = 998244353, N = 100005;

struct SAM {
    int ch[N][26], len[N], link[N], pos[N], cnt[N], sz;
    SAM () {
        len[0] = 0, link[0] = -1, pos[0] = 0, cnt[0] = 0, sz = 1;
    }
    void build(string s) {
        int lst = 0;
        for (int i = 0; i < s.length(); ++i) {
            char c = s[i];
            int cur = sz++;
            len[cur] = len[lst] + 1, pos[cur] = i + 1;
            int p = lst;
            while (~p && !ch[p][c - 'a']) {
                ch[p][c - 'a'] = cur, p = link[p];
            }
            if (p == -1) {
                link[cur] = 0;
            } else {
                int q = ch[p][c - 'a'];
                if (len[p] + 1 == len[q]) {
                    link[cur] = q;
                } else {
                    int nxt = sz++;
                    len[nxt] = len[p] + 1, link[nxt] = link[q];
                    pos[nxt] = 0;
                    for (int j = 0; j < 26; ++j) {
                        ch[nxt][j] = ch[q][j];
                    }
                    while (~p && ch[p][c - 'a'] == q) {
                        ch[p][c - 'a'] = nxt, p = link[p];
                    }
                    link[q] = link[cur] = nxt;
                }
            }
            cnt[cur]++;
            lst = cur;
        }
        vector <int> p(sz);
        iota(all(p), 0);
        sort(all(p), [&](int i, int j) {
            return len[i] > len[j];
        });
        for (int i = 0; i < sz; ++i) {
            cnt[link[p[i]]] += cnt[p[i]];
        }
    }
} sam;

vector <int> adj[N];
set <int> pos[N];
int ans[N], occ[N], sz[N];

int query(int v, int len) {
    int ans = 0;
    auto it = pos[v].lower_bound(0);
    while (it != pos[v].end()) {
        ans++;
        int x = *it;
        it = pos[v].lower_bound(x + len);
    }
    return ans;
}

void dfs(int v) {
    int mx = -1;
    for (int u : adj[v]) {
        dfs(u);
        sz[v] += sz[u];
        if (mx == -1 || sz[u] > sz[mx]) {
            mx = u;
        }
    }
    if (mx != -1) {
        swap(pos[mx], pos[v]);
    }
    for (int u : adj[v]) {
        for (int j : pos[u]) {
            pos[v].insert(j);
        }
        pos[u].clear();
    }
    if (v) {
        int cnt = sam.cnt[v];
        assert(pos[v].size() == cnt);
        int l = sam.len[sam.link[v]] + 1, r = sam.len[v] + 1;
        int x = query(v, l);
        if (occ[cnt] > x) {
            return;
        }
        while (r - l > 1) {
            int m = l + r >> 1;
            if (query(v, m) == x) {
                l = m;
            } else {
                r = m;
            }
        }
        if (occ[cnt] == x) {
            ans[cnt] = max(ans[cnt], l);
        } else {
            occ[cnt] = x;
            ans[cnt] = l;
        }
    }
}

// ababab

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    string s; cin >> s;
    int n = s.length();
    sam.build(s);
    for (int i = 1; i < sam.sz; ++i) {
        adj[sam.link[i]].pb(i);
        if (sam.pos[i] > 0) {
            pos[i].insert(sam.pos[i]), sz[i] = 1;
        }
    }
    dfs(0);
    for (int i = 1; i <= n; ++i) {
        cout << ans[i] << " ";
    }
    cout << "\n";
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 12328kb

input:

ababa

output:

5 2 1 0 0 

result:

ok single line: '5 2 1 0 0 '

Test #2:

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

input:

aaaaaaaa

output:

8 7 6 5 4 3 2 1 

result:

ok single line: '8 7 6 5 4 3 2 1 '

Test #3:

score: 0
Accepted
time: 1ms
memory: 12200kb

input:

a

output:

1 

result:

ok single line: '1 '

Test #4:

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

input:

abcdefghijklmnopqrstuvwxyz

output:

26 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 single line: '26 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 '

Test #5:

score: 0
Accepted
time: 74ms
memory: 27796kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

50000 49999 49998 49997 49996 49995 49994 49993 49992 49991 49990 49989 49988 49987 49986 49985 49984 49983 49982 49981 49980 49979 49978 49977 49976 49975 49974 49973 49972 49971 49970 49969 49968 49967 49966 49965 49964 49963 49962 49961 49960 49959 49958 49957 49956 49955 49954 49953 49952 49951 ...

result:

ok single line: '50000 49999 49998 49997 49996 ... 13 12 11 10 9 8 7 6 5 4 3 2 1 '

Test #6:

score: 0
Accepted
time: 108ms
memory: 26300kb

input:

abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...

output:

50000 49998 49996 49994 49992 49990 49988 49986 49984 49982 49980 49978 49976 49974 49972 49970 49968 49966 49964 49962 49960 49958 49956 49954 49952 49950 49948 49946 49944 49942 49940 49938 49936 49934 49932 49930 49928 49926 49924 49922 49920 49918 49916 49914 49912 49910 49908 49906 49904 49902 ...

result:

ok single line: '50000 49998 49996 49994 49992 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #7:

score: 0
Accepted
time: 22ms
memory: 20448kb

input:

hnpyezhavuychdbjldxjofydbuekupcjllbrtehyfangipyjjqhivkyhnlrotjgftqhwlpvmsjtikgsspaxswleauvtzbmqjdywpnilqhawmcqprtynqylzbjganroyiwcbiyqklolxabdowwkrxhzuahgjabvvrkdelzvtdsavbipxpddsopnnxjwasoxnpgknyxrcuypmbgvgymrlymkcufnptcdwbpihxhayfqoylfvrgzhhferphxfjruejyztauvklpchuxduvosjrbwqvnofdnzhtkvwwbdenlzkyf...

output:

30918 6 4 3 3 3 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 0 2 2 0 0 0 0 0 0 2 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 single line: '30918 6 4 3 3 3 3 3 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #8:

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

input:

ujwgcpuvylongozaczorldxrlmgmdyxenplvanjgtgfgzdvllphwyuqvjmzvfskbmjndeazlljvcjwpgmbmhhnlppoahzjxzhlastuawhchrbajvfxgpxgrrzjjnufizgrofjnegdgrdsxnepoajtppsqpsjvscmekdwbsfecczcittiirastwwmhzrtjwksdlwchghosqslgniyxkvoukvbqhmfegaxrljefutidcelusbenpvuzwizoiznksyejikaovbngxmzzjrrumgdkvczjftegspfutgyayaxfozq...

output:

36879 5 4 3 3 3 3 3 3 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 0 0 2 0 0 0 2 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 single line: '36879 5 4 3 3 3 3 3 3 0 3 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #9:

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

input:

jrjefrpmcidljqjqbgcezgstiefshrvwcmtciarsnrnuucovzlltwvbmorxkwlrquidxnvejjedkendyssdtulgavoninkvcjzcpxsnnofaprgfclhxuezkbsezoefqgnnyxbvutgazsjttfftpjturngqoxpisvkpvkgypdpdwittmxnaaorxdkrldlrtatxwheabbyrezemqvymwzqffpysmqicopqxmsydemwzzalmjmjaewqqxwribmpfkafjmgsrpeimoulryfmmrxbvrhxatwoqrtaxqgboohpyqoe...

output:

32956 6 4 3 3 3 3 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 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 single line: '32956 6 4 3 3 3 3 3 3 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #10:

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

input:

bqxywpdcsnccafvrbhsoffpezhdlywtbqpnqfkibmmvsacuohwzsrfmbvqhnqhhnvbkpzrofxssllygtwhxmbtxhvrnivshojgahurbgsnyvxgfdyzgqldgrbnutsakmruxlaadlqqiucwoumrhbkwdosgujwarnmgsjmsexfchydumtjapmngxzyxomsqqfxiksydtjvjnlimzjjeewbjmawzoqmkloamspatyraxnjdkncradykxajsqdbsbairguqqsaixggzrpavkporwnlbukavfsnzqsrxrjokttkn...

output:

37924 6 4 3 3 3 3 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 0 2 2 0 2 0 2 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 single line: '37924 6 4 3 3 3 3 3 3 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #11:

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

input:

bpgokflgellqalcfmnkaazoyenqztpllksopthmvpkmdgmjuhsdmawvgnxomrjpolstdymwkkjpxwxqeltezasdzatufflpyqrgtrkccierbjnrlguvpvyfrgvguivfdpcoankfoooewwulzzmbnltuysvvbethgnvdwpeusklobltcwvubybjtknhzpappqihgnziujksebunfncqgbqylpszscsvhuwmextkqlbxjktubotyzmhklohbesxujsduwreuayrhbsmsbimdlnzxllygzazsavtdejpdkhonch...

output:

21337 6 4 3 3 3 3 3 0 0 0 0 0 0 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 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 single line: '21337 6 4 3 3 3 3 3 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #12:

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

input:

baaaabbababbabbaabbbabaabbababbbbababaaaabbbabaabaabaababbabaabbabaaaababbbbbaaabaaabbabaaabbbabbaababbbbabbbbabbabbbaabbaababbaabbabababbbbbbbabbaaaababbababbbbabbbaabbabbabaabaaaaaaababaaaaabbbbbabbaaaaabbabbbaabbbaabbabababbbaabbaaabaaaabaabaabaabaabbbbbbaabaabbaaaaaabababaabaabbaaaaababbbbbbbbba...

output:

50000 30 22 19 18 17 16 15 14 14 14 14 13 13 13 13 13 12 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 10 11 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 0 9 9 0 9 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 ...

result:

ok single line: '50000 30 22 19 18 17 16 15 14 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #13:

score: 0
Accepted
time: 102ms
memory: 27768kb

input:

aaabbabbabaaabbaaabaaaababbaaaaaabbbabbabbbbbaababbbabbaaaaaabaaabbabbbabbaabbbabbbbaabababbbabbbabbbabaababbaaaabaaabbbaaabbbbaaabaaaabaabaaabbaabababaabaaabbabbabbababbbbbababbaaaaabababbaaababbbaabbabbaabbbaaabbbaabbabbbaaabbaabbbbbaaaabbaabbbaabbbaaaababbbbaabaabbabbabbabbbabbaaabbbabababbbababa...

output:

50000 28 24 20 19 17 16 16 15 14 14 13 13 13 13 13 13 13 12 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 10 10 10 11 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 0 9 0 9 9 10 0 9 0 9 9 0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 ...

result:

ok single line: '50000 28 24 20 19 17 16 16 15 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #14:

score: 0
Accepted
time: 96ms
memory: 28532kb

input:

bbbbbbbabaaaaabaaaaabaaabaabaaabbbabbbbabaabaabaaaabbbabbbbbabbbaabababbabbbabaaabbbabbbababbabaabaaabbbabbbabaabbabbababbbbbbaaabbbbbbabbbbaabaaaaabbbabbbbbabbabaaaaaaaabaaabbbbbababbaaabaabbabaaabbbabaabaaaaaabababbabbbabbaabaaaaabaabbaabaabaabaabbbbabbababbbaaabbaaaaabaababbbaabbaaabbabaaaaabaabb...

output:

50000 33 20 18 17 16 16 15 14 14 14 14 13 13 13 13 12 12 12 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 10 10 11 11 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 9 10 9 0 9 0 10 9 0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9...

result:

ok single line: '50000 33 20 18 17 16 16 15 14 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #15:

score: 0
Accepted
time: 84ms
memory: 27736kb

input:

abaaabbbbaabaaabbabbbbabababbaabbabbbabbbabbaabbbbabbbbbaabbabaaabaabaababbaaaaabbbbababbaaabaaaaabbaabbaaababababbbaabaaabbaaaabbbababaabbaababbbaaabbbbbbabaababbbbabbbbbabbaabbbbaaabaaabaabbaaaabaaaabbababbbababbaaabbabbbbababbbbaabbbbbaaabaabababbbaaaabbbabbabbabababbabaabaabbaabababbaabababbbaba...

output:

50000 28 21 19 18 17 16 15 15 14 14 14 14 13 13 13 13 13 12 13 12 12 12 12 12 12 11 12 11 12 11 11 11 11 11 11 11 11 11 11 11 11 10 10 10 10 10 10 11 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 0 10 10 0 10 10 9 9 0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 ...

result:

ok single line: '50000 28 21 19 18 17 16 15 15 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #16:

score: 0
Accepted
time: 101ms
memory: 27764kb

input:

baabababbbbbbabbbbbbbbbbabaabbbaaaabaaabbabaabbaaababaabbbaabababababbbaababbaabbabbbababbabbaabababbaabaaaaaaaabbabaabbbbabababbbaaaaaabbaabbbabbabbabbaabbabbababaaabaaaaabaabbabaababbbabbabaaaaaaaaabbbaaabbaaabbbbaabbbaabbaaaaaaababaaabbbbaabbbabbaabbbbaaaabbababaaaababbabaaaabbaabababaaaababbbaba...

output:

50000 29 22 18 17 16 15 15 14 14 14 13 13 13 13 13 12 12 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 10 11 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 9 10 9 0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 ...

result:

ok single line: '50000 29 22 18 17 16 15 15 14 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #17:

score: 0
Accepted
time: 76ms
memory: 26960kb

input:

wvwwwuuvwwwuuwvwuwwwuvuuuvwuwuwuwuvuuvwvvvuuvuwuvvuvvuuuwuvvwwvwwvwvvwwvvuvwuuvuuuwuuwvvuuuwvuwwwvwvvuuuwuuuwvwuuwuwwvvwvwvwvwwvwvuvuwvvwuuwvwvvvwvwwuwwvvvvvuwuuwwwuwuuvvvvuwwuuuwuwwuvvvvwwvuwvwuvuuuvuwvuwuvvwwwuuwwvwwuwvvuvuuvwuwvuuuwuuwuuvuwuuwuvuuwuwvuvwuvwwvwuuuvuuwvuwuuuwwuuuuuvvvvuvwwwwvuvuuwv...

output:

50000 23 14 12 11 10 10 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 0 0 0 6 0 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 0 6 6 0 0 0 6 0 0 0 6 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 single line: '50000 23 14 12 11 10 10 9 9 9 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #18:

score: 0
Accepted
time: 73ms
memory: 27508kb

input:

qrqqqqqrrrrrrpprqprrpqprprrppqpqqrpprqrrppqqqrqpqpqprrprqpqprqqqqqrrrrpqrpqqqrppppqqrrrqpqprprqqqpqqqqprpprqqqppqpppprppqpppppprqqprrqrprrqqpqrqrqprqpprpqqppprqqpprqrqprqrqqrqqqrprqpqpqpprpqqqqpqqqqqpqqqppqqqqqrqprqprrprprprprpppqqqqpqppqqqprqrqqrqrqrrrpprrrrrqrprrpqpqrrrrrqrqpppqrprppqqrrpqqqrprrrp...

output:

50000 18 13 12 11 10 9 9 9 9 9 8 9 8 8 8 8 8 7 8 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 0 0 0 0 6 0 0 0 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 0 6 6 0 0 6 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 single line: '50000 18 13 12 11 10 9 9 9 9 9... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #19:

score: 0
Accepted
time: 72ms
memory: 27024kb

input:

opoqoqpqopqpqppqoooqoqpqpooppqppqooqoqpooqpqopqpoqqqqqqqqqpqoqqoooqpqpoqqoopoopoqpqppqoqoqoopopopqpoooppoqppqoooqqoooppqqopqopoqqqpqoqqopoqpopopqqpqppqqqpqpqqpqqoqooppqqpoopqqqqqpoppqoqqpqqqqopqqoqqpoppoopqpqoppooppqpqoqqppqqoooooopqqooqpppoopqqpppoooppqoopqoopopqqoopoqooppppooqqqoqqpooqqqqqqqqoooqp...

output:

50000 19 13 12 11 10 10 9 9 9 9 8 8 8 8 8 8 8 8 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 0 6 0 0 0 0 6 6 0 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 0 6 6 6 6 6 0 6 6 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 single line: '50000 19 13 12 11 10 10 9 9 9 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #20:

score: 0
Accepted
time: 72ms
memory: 27560kb

input:

opqoqppqqqqoqopqoqqqpqpqpqoqooopqpoqqqpopqqooppooppooopooooppppqpoqqqoqpoooppqqpooopoqpoppqooqpoooqppoopqpqqooooqooqqqoqqoqqqqopooooqqpqqooqppopooopoopopqpqqqqoqppqopqpqoqoooooqpqooqqqoopoopopqqqqoqqqpppoopqqqqoopoqqqooqoqqppppoppppqooqoppqoopqqppopqqoqppoppooopqpqpopqqoqoopoqqqqooqppoqqpoooqqqqooqq...

output:

50000 19 13 12 11 10 9 9 9 9 9 8 9 8 8 8 8 8 8 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 0 6 0 0 6 0 6 0 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 0 6 6 0 0 6 0 0 6 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 single line: '50000 19 13 12 11 10 9 9 9 9 9... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #21:

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

input:

qrqqqrqrrqrrqqqqqqrrrqqrqrrrqqrrqqqqrqrqqrqrrqrrrrqrqrrrrqqrqqqqrrrrqqrrrrrqrrqqrqqqqqrqrqrqrqrqqrrrqrrrrrrqrrrrqqrqrqrqqqqqrrrrqqrrqqqrrrqrqrqqqqrrqrqqqrqqqqrrrqqqqqqqqqqrqrrrrqrrqqrrrrqrqqqrqqqrrqqrqqrrqqqrrrqqqrrrqqrrqqqrrqqqqqrqqqrrrrrqrrqrqrrrqrqqqrrqqqqrrrrqqrqrqqrqqrqqqqqqqrrqrrqrrqrrqrrrqrqr...

output:

50000 28 21 18 17 16 15 15 14 14 14 13 13 13 13 13 12 12 12 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 0 0 0 10 10 9 9 9 9 0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 ...

result:

ok single line: '50000 28 21 18 17 16 15 15 14 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #22:

score: 0
Accepted
time: 72ms
memory: 24628kb

input:

dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

output:

50000 15040 15039 15038 15037 15036 15035 15034 15033 15032 15031 15030 15029 15028 15027 15026 15025 15024 15023 15022 15021 15020 15019 15018 15017 15016 15015 15014 15013 15012 15011 15010 15009 15008 15007 15006 15005 15004 15003 15002 15001 15000 14999 14998 14997 14996 14995 14994 14993 14992 ...

result:

ok single line: '50000 15040 15039 15038 15037 ... 3 0 0 0 0 2 0 0 0 0 1 0 0 0 0 '

Test #23:

score: 0
Accepted
time: 54ms
memory: 24232kb

input:

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...

output:

50000 10373 10372 10371 10370 10369 10368 10367 10366 10365 10364 10363 10362 10361 10360 10359 10358 10357 10356 10355 10354 10353 10352 10351 10350 10349 10348 10347 10346 10345 10344 10343 10342 10341 10340 10339 10338 10337 10336 10335 10334 10333 10332 10331 10330 10329 10328 10327 10326 10325 ...

result:

ok single line: '50000 10373 10372 10371 10370 ... 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 '

Test #24:

score: 0
Accepted
time: 65ms
memory: 24752kb

input:

hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...

output:

50000 5349 2526 13898 13897 13896 13895 13894 13893 13892 13891 13890 13889 13888 13887 13886 13885 13884 13883 13882 13881 13880 13879 13878 13877 13876 13875 13874 13873 13872 13871 13870 13869 13868 13867 13866 13865 13864 13863 13862 13861 13860 13859 13858 13857 13856 13855 13854 13853 13852 13...

result:

ok single line: '50000 5349 2526 13898 13897 13... 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 '

Test #25:

score: 0
Accepted
time: 54ms
memory: 25844kb

input:

uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu...

output:

50000 19471 19470 19469 19468 19467 19466 19465 19464 19463 19462 19461 19460 19459 19458 19457 19456 19455 19454 19453 19452 19451 19450 19449 19448 19447 19446 19445 19444 19443 19442 19441 19440 19439 19438 19437 19436 19435 19434 19433 19432 19431 19430 19429 19428 19427 19426 19425 19424 19423 ...

result:

ok single line: '50000 19471 19470 19469 19468 ... 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 '

Test #26:

score: 0
Accepted
time: 62ms
memory: 25308kb

input:

hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh...

output:

50000 8164 10342 10341 10340 10339 10338 10337 10336 10335 10334 10333 10332 10331 10330 10329 10328 10327 10326 10325 10324 10323 10322 10321 10320 10319 10318 10317 10316 10315 10314 10313 10312 10311 10310 10309 10308 10307 10306 10305 10304 10303 10302 10301 10300 10299 10298 10297 10296 10295 1...

result:

ok single line: '50000 8164 10342 10341 10340 1... 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 '

Test #27:

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

input:

dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

output:

50000 17173 17518 17517 17516 17515 17514 17513 17512 17511 17510 17509 17508 17507 17506 17505 17504 17503 17502 17501 17500 17499 17498 17497 17496 17495 17494 17493 17492 17491 17490 17489 17488 17487 17486 17485 17484 17483 17482 17481 17480 17479 17478 17477 17476 17475 17474 17473 17472 17471 ...

result:

ok single line: '50000 17173 17518 17517 17516 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #28:

score: 0
Accepted
time: 67ms
memory: 24972kb

input:

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb...

output:

50000 17084 15615 0 0 1470 0 0 4285 0 0 4284 0 0 4283 0 0 4282 0 0 4281 0 0 4280 0 0 4279 0 0 4278 0 0 4277 0 0 4276 0 0 4275 0 0 4274 0 0 4273 0 0 4272 0 0 4271 0 0 4270 0 0 4269 0 0 4268 0 0 4267 0 0 4266 0 0 4265 0 0 4264 0 0 4263 0 0 4262 0 0 4261 0 0 4260 0 0 4259 0 0 4258 0 0 4257 0 0 4256 0 0...

result:

ok single line: '50000 17084 15615 0 0 1470 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #29:

score: 0
Accepted
time: 65ms
memory: 26252kb

input:

ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

output:

50000 16185 16183 15958 0 15957 0 15956 0 15955 0 15954 0 15953 0 15952 0 15951 0 15950 0 15949 0 15948 0 15947 0 15946 0 15945 0 15944 0 15943 0 15942 0 15941 0 15940 0 15939 0 15938 0 15937 0 15936 0 15935 0 15934 0 15933 0 15932 0 15931 0 15930 0 15929 0 15928 0 15927 0 15926 0 15925 0 15924 0 15...

result:

ok single line: '50000 16185 16183 15958 0 1595... 0 2 0 0 0 0 0 0 1 0 0 0 0 0 0 '

Test #30:

score: 0
Accepted
time: 67ms
memory: 27520kb

input:

mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm...

output:

50000 11875 10728 10726 7097 7096 7095 716 7093 7092 7091 7090 7089 7088 7087 7086 7085 7084 7083 7082 7081 7080 7079 7078 7077 7076 7075 7074 7073 7072 7071 7070 7069 7068 7067 7066 7065 7064 7063 7062 7061 7060 7059 7058 7057 7056 7055 7054 7053 7052 7051 7050 7049 7048 7047 7046 7045 7044 7043 70...

result:

ok single line: '50000 11875 10728 10726 7097 7... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #31:

score: 0
Accepted
time: 67ms
memory: 24976kb

input:

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

output:

50000 15095 14214 9589 9588 9587 9586 9585 9584 9583 9582 9581 9580 9579 9578 9577 9576 9575 9574 9573 9572 9571 9570 9569 9568 9567 9566 9565 9564 9563 9562 9561 9560 9559 9558 9557 9556 9555 9554 9553 9552 9551 9550 9549 9548 9547 9546 9545 9544 9543 9542 9541 9540 9539 9538 9537 9536 9535 9534 95...

result:

ok single line: '50000 15095 14214 9589 9588 95... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #32:

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

input:

llllllllllllllllllllllllllllllllllllllllllllllllllllllllylllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllalllllllllljllllllllllllll...

output:

50000 2445 1515 1460 1049 1047 1044 947 947 938 947 474 1038 473 575 577 574 574 573 474 474 575 575 574 575 0 0 574 573 573 572 573 572 473 473 572 572 572 0 0 571 472 472 571 0 571 571 0 0 570 471 471 0 0 0 570 569 0 0 569 569 569 470 470 0 568 568 568 0 0 0 469 469 0 567 567 0 0 468 468 0 0 0 566...

result:

ok single line: '50000 2445 1515 1460 1049 1047... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #33:

score: 0
Accepted
time: 78ms
memory: 26908kb

input:

eeeeeeeeeeeeeeeeeeeeefeegeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeereeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeefeegeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee...

output:

50000 1375 947 749 739 737 732 540 538 539 538 537 535 533 531 530 430 430 421 420 417 418 418 418 418 417 327 326 123 207 327 325 328 325 0 0 216 216 328 327 326 0 325 327 327 324 0 0 326 324 325 326 326 0 215 215 0 324 325 325 0 0 0 323 324 0 0 323 0 0 0 323 323 324 214 214 0 0 323 0 0 0 323 0 322...

result:

ok single line: '50000 1375 947 749 739 737 732... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #34:

score: 0
Accepted
time: 63ms
memory: 27276kb

input:

wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww...

output:

50000 3940 3239 2565 2379 2377 1702 1717 849 1532 858 1530 858 1531 858 1530 858 1529 1529 1528 1529 1528 858 1528 1527 1526 1527 854 1526 1526 1525 1525 854 0 0 1524 1524 852 0 1523 0 1523 851 0 0 0 1522 850 0 0 0 0 0 0 0 1521 849 849 0 0 0 0 0 0 0 0 0 0 0 678 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '50000 3940 3239 2565 2379 2377... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #35:

score: 0
Accepted
time: 69ms
memory: 26948kb

input:

ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddvddddddddddddddddddddddddddddddddddddddddddqdddddddddddddddddddddjdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddadddddddddddddddddddddddddddddddddddwdddddddddddddddd...

output:

50000 2128 1730 1329 935 932 932 931 930 923 911 805 805 805 799 799 401 405 405 532 533 531 531 315 530 530 404 404 310 532 529 307 306 530 403 403 302 530 530 529 528 529 528 295 529 529 402 402 528 528 528 287 286 285 527 528 527 527 527 279 527 526 276 401 401 526 272 271 526 269 400 400 266 265...

result:

ok single line: '50000 2128 1730 1329 935 932 9... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #36:

score: 0
Accepted
time: 72ms
memory: 26980kb

input:

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqrqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

output:

50000 2440 2431 2427 1825 1821 1820 1216 1216 1221 1220 1217 1219 1218 1217 613 1217 1217 1216 1216 1216 1215 613 1215 1215 1215 1215 0 1214 1214 611 1214 0 1213 0 1213 1213 610 0 0 1212 1212 609 0 0 611 1211 608 0 1211 1211 0 0 0 1210 1210 1210 607 0 0 0 1209 606 0 1209 0 0 0 0 0 0 1208 605 0 0 0 6...

result:

ok single line: '50000 2440 2431 2427 1825 1821... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #37:

score: 0
Accepted
time: 122ms
memory: 27004kb

input:

rzrrrrrrrrrrrrrzrrrrrrrrrrrrrrrrzrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrzrrrrrrrrrrrrrzrrrrrrrrrrrrrrrrzrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrzrrrrrrrrrrrrrzrrrr...

output:

50000 481 373 344 326 307 267 252 251 249 249 247 246 244 242 240 234 233 232 230 213 228 227 225 215 212 207 204 201 216 222 154 212 154 201 209 206 201 204 152 200 198 197 193 152 200 199 185 198 152 179 175 152 197 195 183 145 188 177 173 145 181 181 176 172 145 175 171 143 189 196 186 184 141 14...

result:

ok single line: '50000 481 373 344 326 307 267 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #38:

score: 0
Accepted
time: 126ms
memory: 27356kb

input:

tttttttttttttnttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttnttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttnttttttttttttttttttttttttttttttttttttttnttttttttttttttttttttttttt...

output:

50000 357 300 287 273 257 239 236 235 231 231 230 227 226 224 222 221 220 218 215 214 212 210 208 201 207 206 204 200 198 197 196 195 194 199 199 197 121 197 197 196 195 121 194 193 187 186 183 182 191 185 119 175 186 185 119 174 174 173 171 152 173 172 119 170 169 169 168 171 152 179 168 178 116 16...

result:

ok single line: '50000 357 300 287 273 257 239 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #39:

score: 0
Accepted
time: 127ms
memory: 26956kb

input:

ccccccxccccccccxcccccccccccccccxcccccccxccccccccccccccccccccccxccccccccxcccccccccccccccxcccccccxcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccxccccccccxcccccccccccccccxcccccccxccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccxcccccccc...

output:

50000 385 305 284 269 249 233 228 220 218 217 216 195 188 190 182 160 187 186 182 181 199 175 137 167 193 190 179 174 170 166 146 135 187 186 184 182 160 148 149 171 141 145 133 168 167 133 165 164 163 158 133 158 157 137 155 133 163 154 155 136 149 135 133 136 142 134 131 134 138 133 131 139 132 13...

result:

ok single line: '50000 385 305 284 269 249 233 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #40:

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

input:

zzzzzzzzzzzzpzzzzzzzzzzzzzzzzzzpzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzpzzzzzzzzzzzzzzzzzzpzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzpzzzzzzzzzzzzzzzzzzpzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

50000 358 298 290 283 278 258 249 246 223 213 209 207 207 205 204 203 201 201 200 198 198 198 197 196 195 194 194 176 172 191 121 189 182 188 179 183 182 181 181 180 179 177 176 176 175 175 174 121 173 172 119 171 170 172 170 169 168 166 168 167 168 165 164 119 166 167 164 163 162 163 122 116 121 15...

result:

ok single line: '50000 358 298 290 283 278 258 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #41:

score: 0
Accepted
time: 116ms
memory: 26996kb

input:

fffffffffffffffffffffffffffffffffffffffffffffffffffffnffffffffffffnfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffnffffffffffffnffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffnffffffffffffn...

output:

50000 513 371 357 346 318 297 288 274 271 242 270 236 216 235 229 226 266 216 214 263 262 160 258 255 212 158 205 158 201 253 253 158 249 250 246 158 206 158 201 218 198 158 221 217 158 216 152 208 206 204 148 212 207 148 194 193 192 202 148 148 203 201 191 198 200 143 202 191 200 190 190 205 189 14...

result:

ok single line: '50000 513 371 357 346 318 297 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '