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

Автор zacle_HardWorkPaysOff_, история, 9 лет назад, По-английски

I'm struggling since 2 days trying to solve this problem Thank you for your help in advance

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

»
9 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

It's can be solved by Back-tracking, Make Frequency array try get point then remove it's distances with other points you already choose from frequency array and repeat till you find valid answer

  • »
    »
    9 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Could you explain me more deeper Hiasat? Please

    • »
      »
      »
      9 лет назад, скрыть # ^ |
      ← Rev. 2  
      Проголосовать: нравится 0 Проголосовать: не нравится

      There is an important observation which is First Point is 0 and Last Point is maximum among the distances.

      Let call last point as LAST

      What do after that is simply back-track which is call function and find maximum remaining distance let it call it MX

      Now try Place point at (Last-MX) or at MX , there is 2 possible point for each step as it's either distance from last point or first point

      Code