QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#817267#275. PalindromesSGColin100 ✓17ms41784kbC++201.8kb2024-12-16 21:16:352024-12-16 21:16:36

Judging History

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

  • [2024-12-16 21:16:36]
  • 评测
  • 测评结果:100
  • 用时:17ms
  • 内存:41784kb
  • [2024-12-16 21:16:35]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define eb emplace_back
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)

const int N = 400001;

//const int mod = 998244353;

ll ans = 0;

struct Palindromic_AutoMaton {
    vector<int> str;
    int nxt[N][26], fail[N], len[N];   
    int num[N], last, tot;
    void clear() {
        len[1] = -1; fail[1] = 0;
        len[0] = 0; fail[0] = 1;
        str.clear(); str.eb(-1);
        last = 0; tot = 1;
        memset(nxt[0], 0, sizeof(nxt[0]));
        memset(nxt[1], 0, sizeof(nxt[1]));
    }
    Palindromic_AutoMaton(){clear();}
    int newnode(int _len) {
        len[++tot] = _len;
        fail[tot] = num[tot] = 0; 
        memset(nxt[tot], 0, sizeof(nxt[tot]));
        return tot;
    }
    int get_fail(int u) {
        int strlen = str.size() - 1;
        while (str[strlen - len[u] - 1] != str[strlen]) u = fail[u];
        return u;
    }
    void append(int ch) {
        str.emplace_back(ch);
        int fat = get_fail(last);
        if (!nxt[fat][ch]) {
            int cur = newnode(len[fat] + 2);
            fail[cur] = nxt[get_fail(fail[fat])][ch];
            nxt[fat][ch] = cur; 
        }
        last = nxt[fat][ch];
        ++num[last];
    }
    void add(string &s) {
        for (auto &ch : s) append(ch - 'a');
    }
    void get_cnt() {
        per(u, tot, 2) num[fail[u]] += num[u];
        num[0] = num[1] = 0;
    }
    void calc() {
        rep(u, 2, tot) ans = max(ans, 1ll * len[u] * num[u]);
    }
} pam;

int main() {
    cin.tie(0);
    ios::sync_with_stdio();
    string s; cin >> s;
    pam.add(s);
    pam.get_cnt();
    pam.calc();
    cout << ans;
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 8
Accepted

Test #1:

score: 8
Accepted
time: 1ms
memory: 7648kb

input:

abacaba

output:

7

result:

ok single line: '7'

Test #2:

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

input:

www

output:

4

result:

ok single line: '4'

Test #3:

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

input:

abacababa

output:

9

result:

ok single line: '9'

Test #4:

score: 8
Accepted
time: 1ms
memory: 7636kb

input:

r

output:

1

result:

ok single line: '1'

Test #5:

score: 8
Accepted
time: 1ms
memory: 9988kb

input:

xd

output:

1

result:

ok single line: '1'

Test #6:

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

input:

dd

output:

2

result:

ok single line: '2'

Test #7:

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

input:

opo

output:

3

result:

ok single line: '3'

Test #8:

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

input:

opoo

output:

3

result:

ok single line: '3'

Test #9:

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

input:

abacabadabacaba

output:

15

result:

ok single line: '15'

Test #10:

score: 8
Accepted
time: 2ms
memory: 9984kb

input:

xxxxxyxxxxyxxxxx

output:

24

result:

ok single line: '24'

Test #11:

score: 8
Accepted
time: 1ms
memory: 7904kb

input:

xxxyxxxyzzzabcdxxdcba

output:

10

result:

ok single line: '10'

Test #12:

score: 8
Accepted
time: 1ms
memory: 9912kb

input:

qpppppppwowpppppq

output:

24

result:

ok single line: '24'

Test #13:

score: 8
Accepted
time: 1ms
memory: 7868kb

input:

mqmwmemrmtymmmmmmmmqwertyeeeeeeeee

output:

25

result:

ok single line: '25'

Test #14:

score: 8
Accepted
time: 1ms
memory: 9756kb

input:

mqmwmmmmmemrmtymmmmmmmmqwertyeeeeeeeee

output:

28

result:

ok single line: '28'

Test #15:

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

input:

abcdefghijklmnopqrstuvwxyzz

output:

2

result:

ok single line: '2'

Test #16:

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

input:

abcdefghijklmnopqrstuvwxyz

output:

1

result:

ok single line: '1'

Test #17:

score: 8
Accepted
time: 1ms
memory: 7680kb

input:

apiodpdpdpdpdpgoodchallenge

output:

15

result:

ok single line: '15'

Test #18:

score: 8
Accepted
time: 1ms
memory: 7636kb

input:

pdpdpdpxdpdpdxdpdpdx

output:

18

result:

ok single line: '18'

Test #19:

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

input:

jejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejeje

output:

1176

result:

ok single line: '1176'

Test #20:

score: 8
Accepted
time: 1ms
memory: 7884kb

input:

wzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzw

output:

1225

result:

ok single line: '1225'

Test #21:

score: 8
Accepted
time: 1ms
memory: 9700kb

input:

qsqsqsqsqsqsqianananananananananaygsgsgsgsgsgsgsgsgsgsgsgsgsgsgsgszikidnsnsnsnsnsnsnsnsnsnsnsnsn

output:

136

result:

ok single line: '136'

Test #22:

score: 8
Accepted
time: 1ms
memory: 7660kb

input:

hsoqhdnglglqqhqhqhqhqhqhqmyiyiyiyiyiyiyiyiywrvrvrvrvrvzttttfsfsfsfgkhkhkhkfuhuhlggggggggssfsfs

output:

45

result:

ok single line: '45'

Test #23:

score: 8
Accepted
time: 1ms
memory: 9740kb

input:

ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

output:

2500

result:

ok single line: '2500'

Test #24:

score: 8
Accepted
time: 1ms
memory: 7828kb

input:

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcpppppppppppppppppppppnuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

output:

380

result:

ok single line: '380'

Test #25:

score: 8
Accepted
time: 1ms
memory: 7940kb

input:

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

output:

2304

result:

ok single line: '2304'

Test #26:

score: 8
Accepted
time: 1ms
memory: 7712kb

input:

gggggggggtoooooooooccwwwwwwwwwwwwwwwwmllllllllllllllxvvjeeeppppppdnswwwwieeeeeeeeeeeeeeeeeeeesl

output:

110

result:

ok single line: '110'

Test #27:

score: 8
Accepted
time: 1ms
memory: 7716kb

input:

vlvivlvwvlvivlvkvlvivlvwvlvivlvfvlvivlvwvlvivlvkvlvivlvwvlvivlvzvlvivlvwvlvivlvkvlvivlvwvlvivlvfvlvi

output:

93

result:

ok single line: '93'

Test #28:

score: 8
Accepted
time: 1ms
memory: 7704kb

input:

nbnenbnjnbnenbnxnbnenbnjnbnenbnmnbnenbnjnbnenuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

output:

729

result:

ok single line: '729'

Test #29:

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

input:

ydycydylydycydyodoycydylydycydybydyccccccccccccccccccccccdycydyxydycydylydycydyrydycydylydycydybydvq

output:

132

result:

ok single line: '132'

Test #30:

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

input:

dzydpxreexldgbslbouxllaizermiyzzmnawejbabckjdqybqwsaysietcsdfkclenvpkbsxhumglxvxmprkijakygjgjsbsawfj

output:

7

result:

ok single line: '7'

Test #31:

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

input:

bpmerpingvjipwmenzzalhrsmrkmxvmizieduxoxlxembhjjfrxsrecuhmntpwbjhxysmgrqvuqxhysalvpeurrkdifqloo

output:

8

result:

ok single line: '8'

Test #32:

score: 8
Accepted
time: 1ms
memory: 7964kb

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaab

output:

64

result:

ok single line: '64'

Subtask #2:

score: 15
Accepted

Dependency #1:

100%
Accepted

Test #33:

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

input:

yhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyhyh...

output:

124251

result:

ok single line: '124251'

Test #34:

score: 15
Accepted
time: 1ms
memory: 7816kb

input:

nknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknknk...

output:

38226

result:

ok single line: '38226'

Test #35:

score: 15
Accepted
time: 1ms
memory: 9804kb

input:

oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo...

output:

249500

result:

ok single line: '249500'

Test #36:

score: 15
Accepted
time: 1ms
memory: 7752kb

input:

ktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktktkokpkpkpkpkpkpjrjrjrjrjrjrjrjrjrjrjrjrjrjrjrjrjrjhtktpwuwuwuwuwuwuwuwuwuwuwuwiisisisisis...

output:

5778

result:

ok single line: '5778'

Test #37:

score: 15
Accepted
time: 1ms
memory: 8056kb

input:

gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg...

output:

247506

result:

ok single line: '247506'

Test #38:

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

input:

dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...

output:

248004

result:

ok single line: '248004'

Test #39:

score: 15
Accepted
time: 1ms
memory: 7748kb

input:

tdtytdtxtdtytdtptdtytdtxtdtytdtmtdtytdtxtdtytdtptdtytdtxtdtytdtbtdtytdtxtdtytdtptdtytdtxtdtytdtmtdtytdtxtdtytdtptdtytdtxtdtytdtztdtytdtxtdtytdtptdtytdtxtdtytdtmtdtytdtxtdtytdtptdtytdtxtdtytdtbtdtytdtxtdtytdtptdtytdtxtdtytdtmtdtytdtxtdtytdtptdtytdtxtdtytdtetdtytdtxtdtytdtptdtytdtxtdtytdtmtdtytdtxtdty...

output:

973

result:

ok single line: '973'

Test #40:

score: 15
Accepted
time: 1ms
memory: 7752kb

input:

xfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxfxf...

output:

123753

result:

ok single line: '123753'

Test #41:

score: 15
Accepted
time: 1ms
memory: 9840kb

input:

yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyybbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgvgtgsgtgvgtgegtgvgtgygtgvgtgegtgvgtgngtgvgtgegtgvgtgygtgvgtgegtgvgtgbgtgvgtgegtgvgtgygtgvgtgegtgvgtgngtgvgtgegtgvgtgygtgvgtgegtgvgtgmgtgvgtgegtgvgtgygtgvgtgegtgvgtgngtgvgtgegtgv...

output:

2346

result:

ok single line: '2346'

Test #42:

score: 15
Accepted
time: 1ms
memory: 9600kb

input:

phxbzjihyzgshwcidlnkwkltarrnbvkgkzdakoyzeuhoeizcoemcdrtqrsesggbnvltdwrjahpekhylmtkwfcxrvgzdcarhtxkhejosurcntcgsycxkrkxspdqfcwiscudscsmfxjqxmxacgdzjupbaqbfzpsasyrvrpuhuusulurpmwfllpgbtgqnslvjupnpvgfvrdlowwsoaqsepmzdsirpmklgugblxexfxhtjigkhiwndihqsnowlrbyxeqczhyesczvuwthgvidmwtarmbokalyabzmdddcegplfpn...

output:

53

result:

ok single line: '53'

Test #43:

score: 15
Accepted
time: 1ms
memory: 7756kb

input:

nkevzhqlzcmqmbvtbojxbbtvgsxkbhyxrmwkzvvnvqppgbcgwplnupeizuimryoomumihznxizqcchutpzangopekbxirfgpunctyhdvkuhloshxnsmbyjtsdkevaaktccybajxmesubgmfennovcwlskuzjencrbafrzvgylsrzxpxvbrwapbkbqehtdopkgnvdifhkvtzbbjzdylautvnjqcmbrdyxpgsjtxptpayfyiyybkgvodovlvehskrvhtecinxbucymhucgudaujpcujdtgwdojjjvkewtjnghe...

output:

52

result:

ok single line: '52'

Test #44:

score: 15
Accepted
time: 1ms
memory: 7744kb

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

976

result:

ok single line: '976'

Subtask #3:

score: 24
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #45:

score: 24
Accepted
time: 2ms
memory: 8776kb

input:

lnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnlnln...

output:

12497500

result:

ok single line: '12497500'

Test #46:

score: 24
Accepted
time: 2ms
memory: 10888kb

input:

qhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqhqh...

output:

6481800

result:

ok single line: '6481800'

Test #47:

score: 24
Accepted
time: 2ms
memory: 10752kb

input:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

25000000

result:

ok single line: '25000000'

Test #48:

score: 24
Accepted
time: 2ms
memory: 11940kb

input:

ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...

output:

17816841

result:

ok single line: '17816841'

Test #49:

score: 24
Accepted
time: 2ms
memory: 8844kb

input:

xlxixlxpxlxixlxexlxixlxpxlxixlxgxlxixlxpxlxixlxexlxixlxpxlxixlxmxlxixlxpxlxixlxexlxixlxpxlxixlxgxlxixlxpxlxixlxexlxixlxpxlxixlxfxlxixlxpxlxixlxexlxixlxpxlxixlxgxlxixlxpxlxixlxexlxixlxpxlxixlxmxlxixlxpxlxixlxexlxixlxpxlxixlxgxlxixlxpxlxixlxexlxixlxpxlxixlxsxlxixlxpxlxixlxexlxixlxpxlxixlxgxlxixlxpxlxi...

output:

9945

result:

ok single line: '9945'

Test #50:

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

input:

elelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelelel...

output:

504100

result:

ok single line: '504100'

Test #51:

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

input:

afamafacafamafakafamafacafamafaqafaanananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananananana...

output:

1512930

result:

ok single line: '1512930'

Test #52:

score: 24
Accepted
time: 1ms
memory: 8092kb

input:

hmdqbxxvfzcxpohuffioztrgqgxkhfvtpgpudbbyaihadhzbeqrmjhljwmflxhhmrjqaumcacixjrcegaloxzzoprmnrzuldssiyuxfjtxsjjhvywupyviwunipmgxuqalcxatphosveipikcopziexcpspnidczvmupoxvabmlndxdrcrhdregvkqxnsjyfyvbqusygczosimhtjdbwwnlrqasixheataqyjwpxmrrkpxrvcbmkzbdafyahbzrhxkfbkfzrawufisbrdzfkdhuivwqueqlhisiwmahvagqn...

output:

413

result:

ok single line: '413'

Test #53:

score: 24
Accepted
time: 1ms
memory: 7872kb

input:

xznwghgyngrjehtffuiepaedcvdovapnjltjdavlxwmmcexbvxuhlohrfdjwnoimduzngahcupnwmuvqgyqutwaxzpxcqbvahcwwndugzesfkyhyxxehphrdhzucneyhdtlxhixdqrzmbtjxnatzjmwftvjknajzugquxubfmqvqxxqkpztyjfqsuzreyegwqvjbdqfzdjmctntsyjocdlxulnvqvxfjxdpefduawiosrekasgtqpnyhxuglvxorkqyemjkvcsimphvgwspqpaigfulymtkryxeibdilknxm...

output:

428

result:

ok single line: '428'

Test #54:

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

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

7232

result:

ok single line: '7232'

Subtask #4:

score: 26
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #55:

score: 26
Accepted
time: 6ms
memory: 19340kb

input:

bhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbhbh...

output:

1249925001

result:

ok single line: '1249925001'

Test #56:

score: 26
Accepted
time: 3ms
memory: 19680kb

input:

usususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususususus...

output:

396337935

result:

ok single line: '396337935'

Test #57:

score: 26
Accepted
time: 7ms
memory: 22276kb

input:

yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

2500050000

result:

ok single line: '2500050000'

Test #58:

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

input:

llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll...

output:

1016525689

result:

ok single line: '1016525689'

Test #59:

score: 26
Accepted
time: 3ms
memory: 19296kb

input:

kvkikvklkvkikvkgkvkikvklkvkikvkckvkikvklkvkikvkgkvkikvklkvkikvkakvkikvklkvkikvkgkvkikvklkvkikvkckvkikvklkvkikvkgkvkikvklkvkikvkxkvkikvklkvkikvkgkvkikvklkvkikvkckvkikvklkvkikvkgkvkikvklkvkikvkakvkikvklkvkikvkgkvkikvklkvkikvkckvkikvklkvkikvkgkvkikvklkvkikvkhkvkikvklkvkikvkgkvkikvklkvkikvkckvkikvklkvki...

output:

99645

result:

ok single line: '99645'

Test #60:

score: 26
Accepted
time: 3ms
memory: 17972kb

input:

pqpzpqpupqpzpqpbpqpzpqpupqpzpqpwpqpzpqpupqpzpqpbpqpzpqpupqpzpqpipqpzpqpupqpzpqpbpqpzpqpupqpzpqpwpqpzpqpupqpzpqpbpqpzpqpupqpzpqpspqpzpqpupqpzpqpbpqpzpqpupqpzpqpwpqpzpqpupqpzpqpbpqpzpqpupqpzpqpipqpzpqpupqpzpqpbpqpzpqpupqpzpqpwpqpzpqpupqpzpqpbpqpzpqpupqpzpqpgpqpzpqpupqpzpqpbpqpzpqpupqpzpqpwpqpzpqpupqpz...

output:

78569380

result:

ok single line: '78569380'

Test #61:

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

input:

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq...

output:

82810000

result:

ok single line: '82810000'

Test #62:

score: 26
Accepted
time: 3ms
memory: 8116kb

input:

vmlqjhjiwwzijupbzztlkcxbcdavxyqryzttbvvwwekgresldvhrtwwzkgldqvmtecanlhirufqzzvfoybnqorcgmpzhkedhxelbfgkdrktqblcsfngtmhpijdbmtznvmatyrwrbjkmmtgbbwhsiacswcuvszlwgveqehiudnnnuetqucajijlzcomkqfvhaukpnzwlrysonewxfopijuyatwmpslwelwljnkyiibdeuvernjqizvzmtutgsvzdjfksyghkmbqimxarcmkerlbrxnfehzpbmzrvzbjhetlgv...

output:

3989

result:

ok single line: '3989'

Test #63:

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

input:

bcqqtvvdvexrttkgcbhmlhoasnlcektbxssxkxyavuqritimuzvnaurotozfdfglteetpbnpuvymvaghqzqznontyyxciqbglyaedgnzxjzmvampibduzoypreeconehptujqukxezbdcmcguzxgeqzsuqrrhtiudmeqflamybdebwpdkgohesfmbzemzojexzcljvcopvtvlovbngdvhxcshgbwcaluonvfzlaloirqpqqpnbhbbhvyizecupuoyhmcfbobawpqlwmtornvtipqsfphujgltwmodxdcwfpg...

output:

125529616

result:

ok single line: '125529616'

Test #64:

score: 26
Accepted
time: 6ms
memory: 17448kb

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

66664

result:

ok single line: '66664'

Subtask #5:

score: 27
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #65:

score: 27
Accepted
time: 4ms
memory: 41700kb

input:

bnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbnbn...

output:

11250075000

result:

ok single line: '11250075000'

Test #66:

score: 27
Accepted
time: 7ms
memory: 41360kb

input:

jzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjzjz...

output:

894243195

result:

ok single line: '894243195'

Test #67:

score: 27
Accepted
time: 17ms
memory: 41684kb

input:

yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...

output:

22499400004

result:

ok single line: '22499400004'

Test #68:

score: 27
Accepted
time: 8ms
memory: 41656kb

input:

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...

output:

2958163321

result:

ok single line: '2958163321'

Test #69:

score: 27
Accepted
time: 12ms
memory: 41784kb

input:

xqxtxqxwxqxtxqxlxqxtxqxwxqxtxqxexqxtxqxwxqxtxqxlxqxtxqxwxqxtxqxyxqxtxqxwxqxtxqxlxqxtxqxwxqxtxqxexqxtxqxwxqxtxqxlxqxtxqxwxqxtxqxsxqxtxqxwxqxtxqxlxqxtxqxwxqxtxqxexqxtxqxwxqxtxqxlxqxtxqxwxqxtxqxyxqxtxqxwxqxtxqxlxqxtxqxwxqxtxqxexqxtxqxwxqxtxqxlxqxtxqxwxqxtxqxvxqxtxqxwxqxtxqxlxqxtxqxwxqxtxqxexqxtxqxwxqxt...

output:

298935

result:

ok single line: '298935'

Test #70:

score: 27
Accepted
time: 8ms
memory: 37476kb

input:

zwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzwzw...

output:

1210831209

result:

ok single line: '1210831209'

Test #71:

score: 27
Accepted
time: 13ms
memory: 37748kb

input:

hyhnhyhehyhnhyhlhyhnhyhehyhnhyhkhyhnhyhehyhnhyhlhyhnhyhehyhnhyhdhyhnhyhehyhnhyhlhyhnhyhehyhnhyhkhyhnhyhehyhnhyhlhyhnhyhehyhnhyhwhyhnhyhehyhnhyhlhyhnhyhehyhnhyhkhyhnhyhehyhnhyhlhyhnhyhehyhnhyhdhyhnhyhehyhnhyhlhyhnhyhehyhnhyhkhyhnhyhehyhnhyhlhyhnhyhehyhnhyhvhyhnhyhehyhnhyhlhyhnhyhehyhnhyhkhyhnhyhehyhn...

output:

303195156

result:

ok single line: '303195156'

Test #72:

score: 27
Accepted
time: 8ms
memory: 9860kb

input:

hnrootvymrwweaxjusfltkgyqyeioonpksxtampxsamlfcitaauwcjfmxbtvghsyswjyaephlciqgpdwvqnkdhtzkqmyuqukbsobqrpuowsyspglpdypcejwdvolfyezxpjyjztwgcgudvrtsdxouampqybzqtoosumwzwsgboqbgpdycknpatsirizrqioxoxdjfxwdvnqixhlstcrvrkpvazncakguavcbjazssqsfbnrdrhdlozsohomcpannklcxcluhcjvumhfntubbqwnmeosusnoopqicougnnpxc...

output:

11804

result:

ok single line: '11804'

Test #73:

score: 27
Accepted
time: 8ms
memory: 9804kb

input:

yoljcehfgzraqykusrdwgqxdudzvepmjvrsfoosapcxoxoqzfaebohkstrtgnawnonwuynojpzulyulmlxfzbdmqeofumicjihysfofcyfhnsjurggtonwstxatbpoffhamgqkktzdphibrpeiiledjizhvrcnywcyyhvujhqvhvsyxkifcizpczjawdwuxkrxcmkqbsrlbrorrcyznwzpcejgrryyxnursejnogvjlehfspyutfnbmjniaaxtsfmnsvsebwotxqempvqreeeslrxwlljwsawxkktdayuumi...

output:

11813

result:

ok single line: '11813'

Test #74:

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

input:

abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaab...

output:

262144

result:

ok single line: '262144'

Test #75:

score: 27
Accepted
time: 3ms
memory: 41260kb

input:

acbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabcacbabc...

output:

3750025000

result:

ok single line: '3750025000'

Test #76:

score: 27
Accepted
time: 3ms
memory: 12072kb

input:

uptvtysodzujkjcvrzkzydggrhjjlicywbakjpulmdqnlhzqbyhbblhzemftazrldvrxmfuiejvuxvevvescgolivepuwbdyyiylvtqubxfrnmouoshonhbwojudfexgnafvjxrogotuomkwlyoafqsqrzmomodmkxuguysscbidukwlblzrsyqdjsoaqfplvhmqhhpgkvztkpiwowfmjtujkzpileosqqsskywfnvaqhprbhcyfvbzrtkkjmbvxzqgfdoelxzecvgnsxiuvmassxzmweiixxppvmmbxvgol...

output:

184796836

result:

ok single line: '184796836'