### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,393)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (61)
- site news (62)
- tantalizer (105)
- teaser (7)
- today (1)

### Site Stats

- 244,211 hits

Programming Enigma Puzzles

25 May 2020

Posted by on **From New Scientist #1703, 10th February 1990** [link]

Bern, Cara and Loren are climbing in the Hillymayas and have decided to tackle Mount Veryrest which is 700 metres high. There are three different approaches and they each take a different one. Bern’s approach is shown in the diagram.

All slopes in the Hillymayas have the same steepness — 1 up or down for 1 across; all climbers go at the same pace — 100 metres up or down in each hour. Thus, Bern could reach the top in 13 hours.

Bern’s approach is described as: up 5, down 3, up 5.

Cara’s approach is: up 3, down 2, up 4, down 1, up 3.

Loren’s approach is: up 5, down 2, up 3, down 6, up 7.The three decide that, to be fair, they will climb so that, at each point in time, all three are at the same height. This will involve some retracing of steps. Given that condition, they try to reach the top as soon as they can.

How may hours does it take them to reach the top?

[enigma550]

%d bloggers like this:

I liked this puzzle, although it is solved by a fairly straightforward recursive function.

The following Python program runs in 69ms. (I got a new laptop for my birthday yesterday, so timings from today onwards will be recorded using that, rather than my 9 year old laptop, that I’ve had since I started the site).

Run:[ @repl.it ]Solution:It will take them 59 hours to reach the summit.The profile of the solution looks like this:

Note that L’s route returns to level 0, so after 40 hours B and C will be back at the beginning of their routes. And they were only 100m (vertically) away from the summit after 22 hours.