随笔分类 -  最短路

摘要:黑暗城堡 时间限制: 1 Sec 内存限制: 128 MB 题目描述 你知道黑暗城堡有N个房间(1≤N≤1000),M条可以制造的双向通道,以及每条通道的长度。城堡是树形的并且满足下面的条件:如果所有的通道都被修建,设D[i]为第i号房间与第1号房间的最短路径长度;而S[i]为实际修建的树形城堡中第 阅读全文
posted @ 2019-07-29 10:50 1371767389 阅读(200) 评论(0) 推荐(0)
摘要:汽车加油行驶问题 汽车加油行驶问题 汽车加油行驶问题 时空限制1000ms / 256MB 题目描述 给定一个 N×N 的方形网格,设其左上角为起点◎,坐标(1,1),X 轴向右为正,Y 轴向下为正,每个方格边长为 1 ,如图所示。 一辆汽车从起点◎出发驶向右下角终点▲,其坐标为 (N,N)。 在若 阅读全文
posted @ 2018-09-24 17:10 1371767389 阅读(2312) 评论(0) 推荐(0)
摘要:送外卖 时间限制: 2 s 空间限制: 256000 KB 送外卖 送外卖 时间限制: 2 s 空间限制: 256000 KB 时间限制: 2 s 时间限制: 2 s 空间限制: 256000 KB 空间限制: 256000 KB 题目描述 Description 有一个送外卖的,他手上有n份订单, 阅读全文
posted @ 2018-09-22 21:06 1371767389 阅读(585) 评论(1) 推荐(1)
摘要:Pizza Delivery 题目描述 Alyssa is a college student, living in New Tsukuba City. All the streets in the city are one-way. A new social experiment starting 阅读全文
posted @ 2018-09-08 01:35 1371767389 阅读(756) 评论(0) 推荐(0)
摘要:最优贸易 题目描述 C 国有 n 个大城市和 m 条道路,每条道路连接这 n 个城市中的某两个城市。任意两个城市之间最多只有一条道路直接相连。这 m 条道路中有一部分为单向通行的道路,一部分为双向通行的道路,双向通行的道路在统计条数时也计为 1 条。C 国幅员辽阔,各地的资源分布情况各不相同,这就导 阅读全文
posted @ 2018-08-06 20:54 1371767389 阅读(306) 评论(0) 推荐(0)
摘要:Small Multiple 题目描述 Find the smallest possible sum of the digits in the decimal notation of a positive multiple of K.Constraints2≤K≤105K is an integer 阅读全文
posted @ 2018-08-03 19:16 1371767389 阅读(312) 评论(0) 推荐(1)
摘要:Restoring Road Network In Takahashi Kingdom, which once existed, there are N cities, and some pairs of cities are connected bidirectionally by roads. 阅读全文
posted @ 2018-08-03 01:39 1371767389 阅读(298) 评论(0) 推荐(0)