Preparing NOJ

The Largest City Nearby

1000ms 65536K

Description:

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.

Input:

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.

Output:

One integer id.

Sample Input:

4 6
0 4 5 7
4 0 9 3
5 9 0 1
7 3 1 0

Sample Output:

4

Info

NOIOPEN

Provider NOIOPEN

Origin 简单英文题

Code NOIOPJENGLISH17

Tags

Submitted 0

Passed 0

AC Rate 0%

Date 08/15/2021 18:56:22

Related

Nothing Yet