zacle_HardWorkPaysOff_'s blog

By zacle_HardWorkPaysOff_, history, 9 years ago, In English

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

»
9 years ago, hide # |
← Rev. 2  
Vote: I like it 0 Vote: I do not like it

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 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Could you explain me more deeper Hiasat? Please

    • »
      »
      »
      9 years ago, hide # ^ |
      ← Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      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