anucode's blog

By anucode, history, 2 months 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

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

your code might be just wrong

»
2 months 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.

»
2 months 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.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    it will changed in every testcase memset