the.one.liner's blog

By the.one.liner, history, 3 years ago, In English

What would be the algorithm of solving the above problem with the help of Dfs and similar approach?

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

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

Well, you could do binary search by d and run DFS to find if it is reachable with such d.

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

    Could you explain your method bit more elaborately?

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

      Please, specify the question. If you don't know binary search, google it.