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

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

Could some one help me for finding the error in my submission :-(https://codeforces.com/contest/1092/submission/47307889). Thanks! :)

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

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

Auto comment: topic has been updated by vivek034 (previous revision, new revision, compare).

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

Check this slight update to your code.

47347385

Your code should have the if-condition (i > 0 and p[i] == q[i-1]) to avoid accessing q[-1] when i = 0. The updated code did not pass test case 19 as it computed the n-letter string to be "babab" whereas the correct string should be "ababa", as both prefix and suffix of length 1 are "a".

You may check the the following solution as well as the tutorial for hints on how the correct string is computed.

47236313

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

gaurav172 You must see this code. It must be little familiar to you. #chandela xD