1 / 5
Jul 2019

I am solving NATALIAG4 using gridwalk but I keep getting a WA even though my code works on all the testcases I tried out. I used spojtoolkit.com1 but some testcases were obviously wrong so I am hesitant to trust it yet whatever correct testacase I could find gave the right answer.
Anyway , here is my code

[removed my code]

So can anyone point out my mistake(s) so that I can finally get an AC.
Well , thanks anyway , for helping out.

Edit 1 : Got an AC thanks (again) to @simes and hence removed my code.

  • created

    Jul '19
  • last reply

    Jul '19
  • 4

    replies

  • 571

    views

  • 2

    users

  • 2

    links

I got 9 as the answer. As far as I can see my program takes the longer route. Any suggestions.

@simes
Again, thanks so much . After reading this I realized I was reusing most of my code from a dfs problem and I absolutely forgot about implementing a queue and thus my code was taking the longer route. Anyway , thanks to you I modified it to run with a queue, and got an AC.
And so , another problem ends.
tips hat