Advertisement
cat_baxter

Programming Challenge 54 - Fastest Railroad Route [RESULT]

Apr 20th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. 1 2 3 4 5 6 7
  2. 0123456789012345678901234567890123456789012345678901234567890123456789012345678
  3. 00 ...............................................................................
  4. 01 ...............................................................................
  5. 02 .......1++++...................................................................
  6. 03 .......+....+.............................+++++++4.................++i+........
  7. 04 ......+......+...........................+.......+................+....+.......
  8. 05 .....+........S+++++++2.................+........S++++++++++S++++S.....+.......
  9. 06 ......+........+.......+................+........+.........+......+....S++.....
  10. 07 .......+.......+........+..............+.........S++++++++S........+...+..+....
  11. 08 ........+.......+........+............+...++++...+..................S++h...+...
  12. 09 ........+.......+.........S+++3++++++S++++....S++S+++++5............+.......+..
  13. 10 .........+.......6.......+...................+........+...++++++++++S........k.
  14. 11 .........+.......+........+.................+........S+++S..........+........+.
  15. 12 ..........7++S++++S++++S++S+++++S+++......+S........+.....+..........+g.....+..
  16. 13 .............+.........+........+...b+++++..+......+......+...........+....+...
  17. 14 .............+.........+........+............+....+.......++.........+....+....
  18. 15 .............+.........+........+.............c++S..........+.......S+...+.....
  19. 16 ..............+........+.........+...............+...........+.....+..+.+......
  20. 17 ..............+........S.........S++++++.....++++.............S++++f..S+.......
  21. 18 ..............+.......+..........+......+...+................+........+........
  22. 19 ..............8++++++S............+......+.+...........+++++S.........+........
  23. 20 .....................+.........+++S.......S.....+++S++d......+.......+.........
  24. 21 ......................+.....++S....+.....+..++++....+.........+....++..........
  25. 22 .......................+++9+...+...+.....S++.........+.........e++S............
  26. 23 ................................++++S...+.............+............+...........
  27. 24 ....................................+...+..............+j++++++++++............
  28. 25 ....................................a+++.......................................
  29. 26 ...............................................................................
  30. k -> i = 16 path = ['k', 'S71_6', 'i']
  31. i -> h = 12 path = ['i', 'S71_6', 'h']
  32. h -> g = 16 path = ['h', 'S68_8', 'S68_10', 'g']
  33. g -> f = 11 path = ['g', 'S68_15', 'f']
  34. f -> e = 18 path = ['f', 'S62_17', 'S60_19', 'e']
  35. e -> d = 15 path = ['e', 'S60_19', 'd']
  36. d -> j = 14 path = ['d', 'S51_20', 'j']
  37. j -> a = 29 path = ['j', 'S51_20', 'S41_22', 'a']
  38. a -> 9 = 20 path = ['a', 'S36_23', 'S30_21', '9']
  39. 9 -> 8 = 19 path = ['9', 'S21_19', '8']
  40. 8 -> 7 = 16 path = ['8', 'S13_12', '7']
  41. 7 -> 1 = 14 path = ['7', '1']
  42. 1 -> 6 = 18 path = ['1', 'S14_5', '6']
  43. 6 -> 2 = 19 path = ['6', 'S14_5', '2']
  44. 2 -> 3 = 14 path = ['2', 'S26_9', '3']
  45. 3 -> 4 = 26 path = ['3', 'S37_9', '4']
  46. 4 -> 5 = 22 path = ['4', 'S49_5', 'S49_7', 'S49_9', '5']
  47. 5 -> c = 17 path = ['5', 'S53_11', 'S49_15', 'c']
  48. c -> b = 16 path = ['c', 'S43_12', 'b']
  49. Shortest path = 332
  50. Time (s): 8.01600003242
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement