Блог пользователя vaibhavsingh100070

Автор vaibhavsingh100070, история, 5 лет назад, По-английски

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

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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