Tparsa's blog

By Tparsa, 10 years ago, In English

Hello !

I want to solve this problem but got WA on test 45

I use DFS and this is my code : http://paste.ubuntu.com/7587811/

what's Wrong ? please Help me!

Thank you!

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

»
10 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Number of moves it has taken you to get to a certain square matters, but you don't take it into account.

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

    why it matter?

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

      Just try to simulate your code's behaviour on the test number 45. You'll move in a snake pattern and you'll close your way to the last column.

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

        why in my code "just" move like snake ?

        I have 2 loops! but it doesn't work well!