Блог пользователя MayankBhakat

Автор MayankBhakat, история, 4 дня назад, По-английски

Can anyone explain me how to optimize the backtracking algorithm of Knight Tour so that it passes all the testcases. Also, where can I find detailed explanations and solutions to cses problems? I found a explanataion of graph problems by some guy in codeforces but I was unable to understand what I have to sort in the knight tour.

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

A simple pruning that you can do is prioritizing going to adjacent spots that have less options. This should be enough, however do you want a more in depth explanation? I think you can figure out why this works