anucode's blog

By anucode, history, 6 weeks ago, In English

when i run my code in multiple test cases output is wrong.

when i run my code on single testcase output is correct. plzz help

code

  • Vote: I like it
  • -15
  • Vote: I do not like it

»
6 weeks ago, # |
Rev. 3   Vote: I like it +3 Vote: I do not like it

your code might be just wrong

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Seems like out-of-bounds error (undetected automatically due to SSO). I would verify that i+5 and others point to valid string locations.

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

dp array doesn't change for every testcase. You have made it a global variable.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    it will changed in every testcase memset