vaibhavsingh100070's blog

By vaibhavsingh100070, history, 5 years ago, In English

Please help I'm unable to figure out why I'm getting wrong answer in this problem https://mirror.codeforces.com/problemset/problem/701/C . My solution — https://mirror.codeforces.com/contest/701/submission/58672781

»
5 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I think your approach is wrong. On this example:

n=9

abcaabbcc

your program outputs 4, but the correct output is 3.

This problem can be solved using prefix sums and binary search. You can take a look at my AC code. I hope this helps :)

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Your rating is 1100 — this task is too hard for you. You can solve only Div2 A