题目:The Largest City Nearby
描述:
There are N cities, the length of edges between cities is given. Please find the city with the largest index id satisfying that there exisits a path between city 1 and city id and the length of this path is no more than K.
输入:
First line: two positive integers N (N <= 100) and K (K <= 10000).
Next N lines: the i-th line contains N non-negative integers (<= 100) indicating the length of edge between city i and other cities.
输出:
One integer id.
我的翻译:在一个图上有n个城市,编号从1,2,3到n。你的任务就是找到编号最大城市且与1号城市之间的距离不超过k。
输入:第一行两个数,第一个数n表示有哪个城市,第二个数k表示最大的距离。接下来有n行,每一行包括城市与城市之间的距离。
输出;最大的编号。