vaibhavsingh100070's blog

By vaibhavsingh100070, history, 11 days ago, In English,

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

 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it

»
11 days 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 :)

»
10 days 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