Sindbad the Sailor sold 66 silver spoons to the Sultan of Samarkand. The selling was quite easy; butdelivering was complicated. The items were transported over land, passing through several towns andvillages. Each town and village demanded an entry toll. There were no tolls for leaving. The toll forentering a village was simply one item. The toll for entering a town was one piece per 20 items carried.For example, to enter a town carrying 70 items, you had to pay 4 items as toll. The towns and villageswere situated strategically between rocks, swamps and rivers, so you could not avoid them.Figure 1: To reach Samarkand with 66 spoons, traveling through a town followed by two villages, youmust start with 76 spoons.Figure 2: The best route to reach X with 39 spoons, starting from A, is A→b→c→X, shown witharrows in the figure on the left. The best route to reach X with 10 spoons is A→D→X, shown in thefigure on the right. The figures display towns as squares and villages as circles.Predic
UVA - 10537 The Toll! Revisited dijkstra反向
最新推荐文章于 2021-02-18 10:43:28 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)