4.

From iKu, 9 Months ago, written in Plain Text, viewed 2 times. This paste will slip away in 1 Second.
URL https://paste.paivola.fi/view/e19731b8 Embed
Download Paste or View Raw
  1. Every year, Santa manages to deliver all of his presents in a single night.
  2.  
  3. This year, however, he has some new locations to visit; his elves have provided him the distances between every pair of locations. He can start and end at any two (different) locations he wants, but he must visit each location exactly once. What is the shortest distance he can travel to achieve this?
  4.  
  5. For example, given the following distances:
  6.  
  7. London to Dublin = 464
  8. London to Belfast = 518
  9. Dublin to Belfast = 141
  10. The possible routes are therefore:
  11.  
  12. Dublin -> London -> Belfast = 982
  13. London -> Dublin -> Belfast = 605
  14. London -> Belfast -> Dublin = 659
  15. Dublin -> Belfast -> London = 659
  16. Belfast -> Dublin -> London = 605
  17. Belfast -> London -> Dublin = 982
  18. The shortest of these is London -> Dublin -> Belfast = 605, and so the answer is 605 in this example.
  19.  
  20. What is the distance of the shortest route?
  21.  
  22.  
  23. AlphaCentauri to Snowdin = 66
  24. AlphaCentauri to Tambi = 28
  25. AlphaCentauri to Faerun = 60
  26. AlphaCentauri to Norrath = 34
  27. AlphaCentauri to Straylight = 34
  28. AlphaCentauri to Tristram = 3
  29. AlphaCentauri to Arbre = 108
  30. Snowdin to Tambi = 22
  31. Snowdin to Faerun = 12
  32. Snowdin to Norrath = 91
  33. Snowdin to Straylight = 121
  34. Snowdin to Tristram = 111
  35. Snowdin to Arbre = 71
  36. Tambi to Faerun = 39
  37. Tambi to Norrath = 113
  38. Tambi to Straylight = 130
  39. Tambi to Tristram = 35
  40. Tambi to Arbre = 40
  41. Faerun to Norrath = 63
  42. Faerun to Straylight = 21
  43. Faerun to Tristram = 57
  44. Faerun to Arbre = 83
  45. Norrath to Straylight = 9
  46. Norrath to Tristram = 50
  47. Norrath to Arbre = 60
  48. Straylight to Tristram = 27
  49. Straylight to Arbre = 81
  50. Tristram to Arbre = 90

Reply to "4."

Here you can reply to the paste above