OpenJudge - 17: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和它之间的距离不超过K。
输入
第一行:两个正整数N和K
接下来的N行:
第i行包括N个非负数分别表示第i个城市到其他城市的距离。
输出:
一个数