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

Автор allllekssssa, 10 лет назад, По-английски

I do this task 536B - Tavas and Malekas and I have two solutions ( with hashing and z-function ), but I saw one strange solution with dp.I think that isn't good, but also I don't understand how this solution passed all samples 10723410 ?

Exapmle:

7 2 ababb 1 3

Answer should be 0 , but this code gave result 1.

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

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

Instead of looking for matching between two adjacent occurrences, this solution just comparing first two characters which is obviously wrong. DP named array is holding prefix summations and I would not call it as "dp".

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Thanks for reply! I thought I might be mad , and don't understand solution :D

    I appreciate the effort made to create competition, but this things shouldn't occur.In this solution the main problem the task isn't done, that isn't some corner case.