当前位置: 代码迷 >> 综合 >> The Largest City Nearby(翻译)
  详细解决方案

The Largest City Nearby(翻译)

热度:58   发布时间:2023-12-04 22:53:15.0

http://noi.openjudge.cn/english/17/

描述

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到城市id之间有一条路径,并且此路径的长度不超过K。

输入:

第一行:两个正整数N和KN <= 100K < = 10000

接下来N行:第i行包含N个非整数<= 100,指示城市i与其他城市之间边的长度

输出:

一个整数id

  相关解决方案