QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#194147#6364. The Most Expensive GiftMaMengQiTL 129ms4380kbC++2.7kb2023-09-30 19:18:312023-09-30 19:18:31

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 4264kb

input:

11
abcabacbcac

output:

18

result:

ok 1 number(s): "18"

Test #2:

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

input:

10
aaaaaaaaaa

output:

100

result:

ok 1 number(s): "100"

Test #3:

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

input:

10
aabbbabbba

output:

36

result:

ok 1 number(s): "36"

Test #4:

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

input:

10
acaabbacbb

output:

16

result:

ok 1 number(s): "16"

Test #5:

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

input:

10
abbabaabba

output:

25

result:

ok 1 number(s): "25"

Test #6:

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

input:

10
abcbcacabb

output:

16

result:

ok 1 number(s): "16"

Test #7:

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

input:

10
cbccbcbccb

output:

36

result:

ok 1 number(s): "36"

Test #8:

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

input:

10
abaabaabaa

output:

49

result:

ok 1 number(s): "49"

Test #9:

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

input:

10
abaabaabaa

output:

49

result:

ok 1 number(s): "49"

Test #10:

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

input:

10
bcbcbcbcbc

output:

50

result:

ok 1 number(s): "50"

Test #11:

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

input:

10
aacacbaaca

output:

36

result:

ok 1 number(s): "36"

Test #12:

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

input:

10
aaaaaacaab

output:

64

result:

ok 1 number(s): "64"

Test #13:

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

input:

10
acacacacac

output:

50

result:

ok 1 number(s): "50"

Test #14:

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

input:

10
abacabacab

output:

25

result:

ok 1 number(s): "25"

Test #15:

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

input:

10
aaabaaabaa

output:

64

result:

ok 1 number(s): "64"

Test #16:

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

input:

10
ababacabab

output:

32

result:

ok 1 number(s): "32"

Test #17:

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

input:

10
aaaaabaaaa

output:

81

result:

ok 1 number(s): "81"

Test #18:

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

input:

10
aaaaaaaaaa

output:

100

result:

ok 1 number(s): "100"

Test #19:

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

input:

10
aaaaaaabaa

output:

81

result:

ok 1 number(s): "81"

Test #20:

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

input:

10
abacabacab

output:

25

result:

ok 1 number(s): "25"

Test #21:

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

input:

100
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

output:

10000

result:

ok 1 number(s): "10000"

Test #22:

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

input:

100
abaaabaabaabbabbabbaaabbbbbbabbbababaaaaabbaaabbbababbbaabaabababababbbabaaaababaababbabbbabbbabaabb

output:

2704

result:

ok 1 number(s): "2704"

Test #23:

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

input:

100
ccbcbcccbcbbbabaabcacbbabbbcbcbcbabbbababbcbaccaacbaabbbccccbcbabcbbcacbbbcaacababbacbaaaaacbaaaacbc

output:

1681

result:

ok 1 number(s): "1681"

Test #24:

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

input:

100
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabba

output:

2500

result:

ok 1 number(s): "2500"

Test #25:

score: 0
Accepted
time: 6ms
memory: 4200kb

input:

100
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaa

output:

1156

result:

ok 1 number(s): "1156"

Test #26:

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

input:

100
acaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacaacacaacacaaca

output:

3844

result:

ok 1 number(s): "3844"

Test #27:

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

input:

100
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaabab

output:

4096

result:

ok 1 number(s): "4096"

Test #28:

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

input:

100
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa

output:

4489

result:

ok 1 number(s): "4489"

Test #29:

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

input:

100
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbc

output:

5000

result:

ok 1 number(s): "5000"

Test #30:

score: 0
Accepted
time: 9ms
memory: 4236kb

input:

100
bacccbacacbcbababbcabbbbbabacbabcbaacbbbbbbaabbbcbabcbbbbcabbcababccbcbabbcbbbaacbccbbabbbbbbbacbbbb

output:

3136

result:

ok 1 number(s): "3136"

Test #31:

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

input:

100
bcabbabbcbbbbbbbbbbbbcbbcbbbcbbbbbbbbbcbabacbabababbcbbbbbcbbabbbbbaabbbbbbbbbbbbbcbbbbbacabcbbbbbbb

output:

5776

result:

ok 1 number(s): "5776"

Test #32:

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

input:

100
abababababababababababababababababababababababababababababababababababababababababababababababababab

output:

5000

result:

ok 1 number(s): "5000"

Test #33:

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

input:

100
cbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbca

output:

2500

result:

ok 1 number(s): "2500"

Test #34:

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

input:

100
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaab

output:

5776

result:

ok 1 number(s): "5776"

Test #35:

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

input:

100
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaabab

output:

2916

result:

ok 1 number(s): "2916"

Test #36:

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

input:

100
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaa

output:

7056

result:

ok 1 number(s): "7056"

Test #37:

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

input:

100
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

output:

10000

result:

ok 1 number(s): "10000"

Test #38:

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

input:

100
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaa

output:

7744

result:

ok 1 number(s): "7744"

Test #39:

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

input:

100
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabac

output:

3364

result:

ok 1 number(s): "3364"

Test #40:

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

input:

1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

1000000

result:

ok 1 number(s): "1000000"

Test #41:

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

input:

1000
bababbbababaabbbbababaaabbabbaabaabbabbbbbbbabbbabbbababbbbabaabbbabbaaaaaabbaababbbabbaaaabaababaaabbbbbaabaabbaabbaabbabbbabbbaaaaabbabbbbbbabaaaaabaaabaaabababaaaaababbbaabbaaaaabbbbaabaaaaabaabbaaabbabbbbababbabbbaaaaaaaabbbababaaabaabaabbaababaaabbababbaaaabbbaaabbbaabbababbaaaaabbbaababab...

output:

260100

result:

ok 1 number(s): "260100"

Test #42:

score: 0
Accepted
time: 92ms
memory: 4236kb

input:

1000
acbbcacabacccbabcabccccccbaabccaccbcbacccabbaaacbcbbaccbcabcaacbbbbcccabcccbacccabbbcaaacbaabbaccacaccabbbbbbbacaabaaaacaaaaaaabccabbcaaaaabcacabbacacacaaabccbaabbbaccccaaaabbaccbacabccacbbbacbabcabaaacbcacabacbacbaaaabcbcaaaccacaaabbabaabbcaccbcccbccabcabaccbcccbbacbbaabccabccacabbcabccabaaabb...

output:

116964

result:

ok 1 number(s): "116964"

Test #43:

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

input:

1000
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaa...

output:

250000

result:

ok 1 number(s): "250000"

Test #44:

score: 0
Accepted
time: 90ms
memory: 4380kb

input:

1000
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcacababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacaba...

output:

111556

result:

ok 1 number(s): "111556"

Test #45:

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

input:

1000
abaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaabab...

output:

381924

result:

ok 1 number(s): "381924"

Test #46:

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

input:

1000
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaaba...

output:

413449

result:

ok 1 number(s): "413449"

Test #47:

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

input:

1000
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa...

output:

444889

result:

ok 1 number(s): "444889"

Test #48:

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

input:

1000
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb...

output:

500000

result:

ok 1 number(s): "500000"

Test #49:

score: 0
Accepted
time: 86ms
memory: 4128kb

input:

1000
cabaccccbbbaccaccbccbccbbbaccbcccbccbbcacabcaccacaccaacbcbacbcbcabbbbcaccabbcccbacaabccbbccacccbbccbcbbbbcccaccbbbcbcbcccacbcacaaacbbbcbcccaacbbbbcacacbccacabcbbccaababccbccbccbcacabcacaacccbcbcbbcaccccbbacccccacbcacaccbabccccabcacccabbacaccccbcccccaabcccaccabcccacaccacccbbaabcccccccaabcabaccab...

output:

267289

result:

ok 1 number(s): "267289"

Test #50:

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

input:

1000
bcccacccabcabacccccccccccccabccacccccccbbacaccaccccaacacccccccaaccbaacccbccaccaaccbccaccaacbcccccbccacacccccaccacccccacaacabbbaccccbccaacaccaccacbccccacccbacccaacccaacacccccccccccccccbbacacccacacaacccbccacbccccccaccaccccaacacbccaaccacaaaaacacccacacccacabaccabcccabacccaaccccaacacccccccccbbccccaa...

output:

408321

result:

ok 1 number(s): "408321"

Test #51:

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

input:

1000
bababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...

output:

500000

result:

ok 1 number(s): "500000"

Test #52:

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

input:

1000
cacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcac...

output:

250000

result:

ok 1 number(s): "250000"

Test #53:

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

input:

1000
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaabaaabaaabaaabaaacaaabaaabaaabaaacaaabaaa...

output:

580644

result:

ok 1 number(s): "580644"

Test #54:

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

input:

1000
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababaca...

output:

284089

result:

ok 1 number(s): "284089"

Test #55:

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

input:

1000
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaaaaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaaba...

output:

702244

result:

ok 1 number(s): "702244"

Test #56:

score: 0
Accepted
time: 6ms
memory: 4132kb

input:

899
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

808201

result:

ok 1 number(s): "808201"

Test #57:

score: 0
Accepted
time: 13ms
memory: 4336kb

input:

1000
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaa...

output:

774400

result:

ok 1 number(s): "774400"

Test #58:

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

input:

1000
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacaba...

output:

339889

result:

ok 1 number(s): "339889"

Test #59:

score: 0
Accepted
time: 88ms
memory: 4188kb

input:

9995
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

99900025

result:

ok 1 number(s): "99900025"

Test #60:

score: 0
Accepted
time: 129ms
memory: 4332kb

input:

9995
bababaaabaabaabbabbabbaaabbbbbbabbbababaaaaabbaaabbbababbbaabaabababababbbabaaaababaababbabbbabbbabaabbbbbaababaaaabaaaaaabaabbaaaabbaaababbbabbaabaababbbaabbbbaabbbbabbaabbabababaaabaababaabaabababbabbbabaaabaaabaabbaabbaabababaaaaabaabbabbbaaaabbbabbabbbaaabaaaabbbbaabbaaaabaabbaaaaaababbbaaa...

output:

25391521

result:

ok 1 number(s): "25391521"

Test #61:

score: -100
Time Limit Exceeded

input:

9995
aaccabbbcbbbcacaacbbccbbbccacabcaccbaccbccbaaaabbbcabbcbbbcabcaabbcbacccaabbcbcbcbccccccccccccccacbccaaaabacbbccbbcccbbcbacbcaabcbbcaccbbcabaabaacaacccbcbaaacbacacbabcaaaaabbbbcaaccaababbcabacbcaacbaababbacaaababacaaabcaacbaababbaabacababacaccbabbccaaaacbaacbcbbcbaccbbccbbccbaaaaabbacbacabbbbaa...

output:

11202409

result: