When a train travels from one station to another, stopping at all stations in between is too time-consuming. The Japanese tackled this issue with a simple idea: skip some of the stations!
The FUTSŪ train stops at every station.
The KAISOKU train skips some stations.
The KYŪKŌ train skips more stations.
The TOKKYŪ train skips most stations, only stopping at the biggest stations.
Consider a hypothetical map below:
Alice is currently at the station and would like to travel with the fewest stops possible. She came up with a simple method:
Take the fastest train to the nearest station without passing the desired station. Repeat this procedure until reaching the desired station.
However, this algorithm does not always give the fewest stops. Which station can be traveled with fewer stops than the proposed algorithm requires?
For example, this is how Alice would travel to the station:
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Algorithm would take Kyuko from 1st to 5th. Next take Kaisoko from 5th to 7th. Lastly, take Futsu from 7th to 8th. 3 stops.
Instead, take Tokkyu to 9th. Then take Futsu back to 8th. 2 stops.