asipu_pawan's blog

By asipu_pawan, history, 6 years ago, In English

Hello everyone,

I got AC for the problem GSS1. And I added an extra function "update" to solve a problem GSS3 in the same code but continuously getting WA. Here is the link to my WA solution.

So, please help.

Thanks in advance

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Your Accepted Code.

In merge function there should be check to see if y corresponds to an empty node.

Also MAXI should be larger than the maximum sum which is $$$5 * 10 ^ 8$$$

  • »
    »
    6 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    Thank you. But, how did I get AC for GSS1.

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

      There wouldn't have been a case where right node would have been null. Or even if it was, the best answer was obtained from the left node.