padfoot1717's blog

By padfoot1717, history, 4 years ago, In English

Can someone kindly take the pain of checking my submission on which i am getting RE verdict and help me to sort the error?

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

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Use a debugger maybe?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I did, infact the code is giving correct output when i am running it on my device on the sample tests, but the online judge is giving RA verdict.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Why if(i>1){ and if(j>1){ ?

I think that ifs have to be remove, then it should work.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can you please elaborate?

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Consider the first if, if(i>1)...

      Inside of that if you have if(mtr[i][j]) dp[i][j][1]=max(dp[i][j][1],mx+mtr[i][j]);

      Why you should ignore the mtr[][] values of first row?

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Because those cases are being included in "if(j>1)".

        • »
          »
          »
          »
          »
          4 years ago, # ^ |
            Vote: I like it +1 Vote: I do not like it

          Ok, that one if(mtr[i][j]) dp[i][j][1]=max(dp[i][j][1],mx+mtr[i][j]);

          Again, why the if? What if mx!=0 and mtr[i][j]==0?