Please read the new rule regarding the restriction on the use of AI tools. ×

the.one.liner's blog

By the.one.liner, history, 4 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

»
4 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.

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

    Could you explain your method bit more elaborately?

    • »
      »
      »
      4 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.