首页 > TAG信息列表 > 10099
UVA 10099 The Tourist Guide(最短路径 Floyd)
题意:n个城市,m条路,一名导游要带领团队从开始城市到目标城市,但每条路上都有人数限制,导游可以分批次运送团队,问最少需几次。 思路:Floyd算法(多源最短路径), dis[i][j]=max(dis[i][j],min(dis[i][k],dis[k][j])),因为从起始点到目标点有多条路线,选择其中流量最大的,但一条路线方案有floyd类型题UVa-10099-The Tourist Guide +Frogger POJ - 2253
The Tourist Guide Mr. G. works as a tourist guide. His current assignment is to take some tourists from one city to another. Some two-way roads connect the cities. For each pair of neighboring cities there is a bus service that runs only between those twCodeforces1157A(A题)Reachable Numbers
A. Reachable Numbers Let's denote a function f(x)f(x) in such a way: we add 11 to xx, then, while there is at least one trailing zero in the resulting number, we remove that zero. For example, f(599)=6f(599)=6: 599+1=600→60→6599+1=600→60→6; f(7)=