QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#194672#6364. The Most Expensive GiftZhangYiDeTL 563ms4320kbC++1.2kb2023-09-30 21:41:042023-09-30 21:41:05

详细

Test #1:

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

input:

11
abcabacbcac

output:

18

result:

ok 1 number(s): "18"

Test #2:

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

input:

10
aaaaaaaaaa

output:

100

result:

ok 1 number(s): "100"

Test #3:

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

input:

10
aabbbabbba

output:

36

result:

ok 1 number(s): "36"

Test #4:

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

input:

10
acaabbacbb

output:

16

result:

ok 1 number(s): "16"

Test #5:

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

input:

10
abbabaabba

output:

25

result:

ok 1 number(s): "25"

Test #6:

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

input:

10
abcbcacabb

output:

16

result:

ok 1 number(s): "16"

Test #7:

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

input:

10
cbccbcbccb

output:

36

result:

ok 1 number(s): "36"

Test #8:

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

input:

10
abaabaabaa

output:

49

result:

ok 1 number(s): "49"

Test #9:

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

input:

10
abaabaabaa

output:

49

result:

ok 1 number(s): "49"

Test #10:

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

input:

10
bcbcbcbcbc

output:

50

result:

ok 1 number(s): "50"

Test #11:

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

input:

10
aacacbaaca

output:

36

result:

ok 1 number(s): "36"

Test #12:

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

input:

10
aaaaaacaab

output:

64

result:

ok 1 number(s): "64"

Test #13:

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

input:

10
acacacacac

output:

50

result:

ok 1 number(s): "50"

Test #14:

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

input:

10
abacabacab

output:

25

result:

ok 1 number(s): "25"

Test #15:

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

input:

10
aaabaaabaa

output:

64

result:

ok 1 number(s): "64"

Test #16:

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

input:

10
ababacabab

output:

32

result:

ok 1 number(s): "32"

Test #17:

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

input:

10
aaaaabaaaa

output:

81

result:

ok 1 number(s): "81"

Test #18:

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

input:

10
aaaaaaaaaa

output:

100

result:

ok 1 number(s): "100"

Test #19:

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

input:

10
aaaaaaabaa

output:

81

result:

ok 1 number(s): "81"

Test #20:

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

input:

10
abacabacab

output:

25

result:

ok 1 number(s): "25"

Test #21:

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

input:

100
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

output:

10000

result:

ok 1 number(s): "10000"

Test #22:

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

input:

100
abaaabaabaabbabbabbaaabbbbbbabbbababaaaaabbaaabbbababbbaabaabababababbbabaaaababaababbabbbabbbabaabb

output:

2704

result:

ok 1 number(s): "2704"

Test #23:

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

input:

100
ccbcbcccbcbbbabaabcacbbabbbcbcbcbabbbababbcbaccaacbaabbbccccbcbabcbbcacbbbcaacababbacbaaaaacbaaaacbc

output:

1681

result:

ok 1 number(s): "1681"

Test #24:

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

input:

100
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabba

output:

2500

result:

ok 1 number(s): "2500"

Test #25:

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

input:

100
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaa

output:

1156

result:

ok 1 number(s): "1156"

Test #26:

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

input:

100
acaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacacaacaacacaacaacacaacacaacaacacaacaacacaacacaaca

output:

3844

result:

ok 1 number(s): "3844"

Test #27:

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

input:

100
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaabab

output:

4096

result:

ok 1 number(s): "4096"

Test #28:

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

input:

100
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa

output:

4489

result:

ok 1 number(s): "4489"

Test #29:

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

input:

100
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbc

output:

5000

result:

ok 1 number(s): "5000"

Test #30:

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

input:

100
bacccbacacbcbababbcabbbbbabacbabcbaacbbbbbbaabbbcbabcbbbbcabbcababccbcbabbcbbbaacbccbbabbbbbbbacbbbb

output:

3136

result:

ok 1 number(s): "3136"

Test #31:

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

input:

100
bcabbabbcbbbbbbbbbbbbcbbcbbbcbbbbbbbbbcbabacbabababbcbbbbbcbbabbbbbaabbbbbbbbbbbbbcbbbbbacabcbbbbbbb

output:

5776

result:

ok 1 number(s): "5776"

Test #32:

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

input:

100
abababababababababababababababababababababababababababababababababababababababababababababababababab

output:

5000

result:

ok 1 number(s): "5000"

Test #33:

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

input:

100
cbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbca

output:

2500

result:

ok 1 number(s): "2500"

Test #34:

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

input:

100
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaab

output:

5776

result:

ok 1 number(s): "5776"

Test #35:

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

input:

100
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaabab

output:

2916

result:

ok 1 number(s): "2916"

Test #36:

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

input:

100
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaa

output:

7056

result:

ok 1 number(s): "7056"

Test #37:

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

input:

100
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

output:

10000

result:

ok 1 number(s): "10000"

Test #38:

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

input:

100
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaa

output:

7744

result:

ok 1 number(s): "7744"

Test #39:

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

input:

100
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabac

output:

3364

result:

ok 1 number(s): "3364"

Test #40:

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

input:

1000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

1000000

result:

ok 1 number(s): "1000000"

Test #41:

score: 0
Accepted
time: 58ms
memory: 4144kb

input:

1000
bababbbababaabbbbababaaabbabbaabaabbabbbbbbbabbbabbbababbbbabaabbbabbaaaaaabbaababbbabbaaaabaababaaabbbbbaabaabbaabbaabbabbbabbbaaaaabbabbbbbbabaaaaabaaabaaabababaaaaababbbaabbaaaaabbbbaabaaaaabaabbaaabbabbbbababbabbbaaaaaaaabbbababaaabaabaabbaababaaabbababbaaaabbbaaabbbaabbababbaaaaabbbaababab...

output:

260100

result:

ok 1 number(s): "260100"

Test #42:

score: 0
Accepted
time: 155ms
memory: 4116kb

input:

1000
acbbcacabacccbabcabccccccbaabccaccbcbacccabbaaacbcbbaccbcabcaacbbbbcccabcccbacccabbbcaaacbaabbaccacaccabbbbbbbacaabaaaacaaaaaaabccabbcaaaaabcacabbacacacaaabccbaabbbaccccaaaabbaccbacabccacbbbacbabcabaaacbcacabacbacbaaaabcbcaaaccacaaabbabaabbcaccbcccbccabcabaccbcccbbacbbaabccabccacabbcabccabaaabb...

output:

116964

result:

ok 1 number(s): "116964"

Test #43:

score: 0
Accepted
time: 52ms
memory: 4156kb

input:

1000
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaa...

output:

250000

result:

ok 1 number(s): "250000"

Test #44:

score: 0
Accepted
time: 146ms
memory: 4000kb

input:

1000
abcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcacababcbcaabcbcacabbcacababcabcbcacabbcacababccababcbcabcacababccababcbcaabcbcacabbcacababccababcbcaabcbcacabcababcbcaabcbcacabbcacaba...

output:

111556

result:

ok 1 number(s): "111556"

Test #45:

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

input:

1000
abaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaabaababaababaabaababaababaabaababaabaababaababaabaababaababaabaabab...

output:

381924

result:

ok 1 number(s): "381924"

Test #46:

score: 0
Accepted
time: 56ms
memory: 4156kb

input:

1000
abaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaababaabaabaabaaba...

output:

413449

result:

ok 1 number(s): "413449"

Test #47:

score: 0
Accepted
time: 56ms
memory: 4176kb

input:

1000
abaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaabaa...

output:

444889

result:

ok 1 number(s): "444889"

Test #48:

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

input:

1000
bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbcb...

output:

500000

result:

ok 1 number(s): "500000"

Test #49:

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

input:

1000
cabaccccbbbaccaccbccbccbbbaccbcccbccbbcacabcaccacaccaacbcbacbcbcabbbbcaccabbcccbacaabccbbccacccbbccbcbbbbcccaccbbbcbcbcccacbcacaaacbbbcbcccaacbbbbcacacbccacabcbbccaababccbccbccbcacabcacaacccbcbcbbcaccccbbacccccacbcacaccbabccccabcacccabbacaccccbcccccaabcccaccabcccacaccacccbbaabcccccccaabcabaccab...

output:

267289

result:

ok 1 number(s): "267289"

Test #50:

score: 0
Accepted
time: 112ms
memory: 4156kb

input:

1000
bcccacccabcabacccccccccccccabccacccccccbbacaccaccccaacacccccccaaccbaacccbccaccaaccbccaccaacbcccccbccacacccccaccacccccacaacabbbaccccbccaacaccaccacbccccacccbacccaacccaacacccccccccccccccbbacacccacacaacccbccacbccccccaccaccccaacacbccaaccacaaaaacacccacacccacabaccabcccabacccaaccccaacacccccccccbbccccaa...

output:

408321

result:

ok 1 number(s): "408321"

Test #51:

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

input:

1000
bababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab...

output:

500000

result:

ok 1 number(s): "500000"

Test #52:

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

input:

1000
cacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcacbcac...

output:

250000

result:

ok 1 number(s): "250000"

Test #53:

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

input:

1000
aaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaaaaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaacaaabaaabaaabaaabaaabaaabaaabaaacaaabaaabaaabaaacaaabaaa...

output:

580644

result:

ok 1 number(s): "580644"

Test #54:

score: 0
Accepted
time: 64ms
memory: 4172kb

input:

1000
ababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacababaaababacababacababacabababababacababacababacababaaababacababacababacababaaababaca...

output:

284089

result:

ok 1 number(s): "284089"

Test #55:

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

input:

1000
aaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaaaaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaabaaaaabaaaaabaaaaabaaaaabaaaaacaaaaaba...

output:

702244

result:

ok 1 number(s): "702244"

Test #56:

score: 0
Accepted
time: 50ms
memory: 4172kb

input:

899
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

808201

result:

ok 1 number(s): "808201"

Test #57:

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

input:

1000
aaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaaaaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaabaaaaaaabaaaaaaacaaaaaaa...

output:

774400

result:

ok 1 number(s): "774400"

Test #58:

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

input:

1000
abacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacabacabaaabacaba...

output:

339889

result:

ok 1 number(s): "339889"

Test #59:

score: 0
Accepted
time: 512ms
memory: 4272kb

input:

9995
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

99900025

result:

ok 1 number(s): "99900025"

Test #60:

score: 0
Accepted
time: 563ms
memory: 3992kb

input:

9995
bababaaabaabaabbabbabbaaabbbbbbabbbababaaaaabbaaabbbababbbaabaabababababbbabaaaababaababbabbbabbbabaabbbbbaababaaaabaaaaaabaabbaaaabbaaababbbabbaabaababbbaabbbbaabbbbabbaabbabababaaabaababaabaabababbabbbabaaabaaabaabbaabbaabababaaaaabaabbabbbaaaabbbabbabbbaaabaaaabbbbaabbaaaabaabbaaaaaababbbaaa...

output:

25391521

result:

ok 1 number(s): "25391521"

Test #61:

score: -100
Time Limit Exceeded

input:

9995
aaccabbbcbbbcacaacbbccbbbccacabcaccbaccbccbaaaabbbcabbcbbbcabcaabbcbacccaabbcbcbcbccccccccccccccacbccaaaabacbbccbbcccbbcbacbcaabcbbcaccbbcabaabaacaacccbcbaaacbacacbabcaaaaabbbbcaaccaababbcabacbcaacbaababbacaaababacaaabcaacbaababbaabacababacaccbabbccaaaacbaacbcbbcbaccbbccbbccbaaaaabbacbacabbbbaa...

output:


result: