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

Автор Asmodeus, история, 3 года назад, По-английски

problem is this.

https://codeforces.net/contest/1003/problem/F

i can't understand why the answer for test case below is 5

3 abcdef abcdef abcdef

my program (and i ) think A abcdef A is optimal so output 10

vovuh's solution output 5.

how 5 is possible? since we should select non-intersecting segments, at least one abcdef should remain and the answer must >=6. need help for this.

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

»
3 года назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

you have to choose at least two non-intersecting equal segments of words.

i think it's ok to choose three words,so the answer can be 'A A A'.

I hope i haven't made mistakes because of my poor English.

»
3 года назад, # |
  Проголосовать: нравится -8 Проголосовать: не нравится

oh i thought i should select exactly 2 segments of any length. i'll try out choosing several segments. thank you