Dijkstra Floyd
文章平均质量分 72
Dijkstra Floyd
master-dragon
weixin:dwl_1270530306
展开
-
6-08. 城市间紧急救援(25)--Dijkstra
6-08. 城市间紧急救援(25)题目地址 时间限制 150 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救援队数量和每一条连接两个城市的快速道路长度都标在地图上。当其他城市有紧急求助电话给你的时候,你的任务是带领原创 2015-08-13 15:44:01 · 2561 阅读 · 0 评论 -
1072. Gas Station (30) -- Dijkstra
题目地址https://www.patest.cn/contests/pat-a-practise/1072ac代码1(未优化)处理思路 1,2, … , n 表示n个hourse n + 1, n + 2, … , n+m 表示 m个gas使用Dijkstra算法 ,求每一个gas到所有hourse的最小距离,然后判断结果#include <cstdint> #include <cstdi原创 2017-02-10 20:28:24 · 366 阅读 · 0 评论 -
1111. Online Map (30) (Dijkstra 经典变式)
题目地址https://www.patest.cn/contests/pat-a-practise/1111题目描述Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: o原创 2016-11-04 16:04:25 · 499 阅读 · 0 评论 -
1003. Emergency (25)
1003. Emergency (25) As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue team原创 2015-10-15 11:03:56 · 504 阅读 · 0 评论 -
1030. Travel Plan (30) - Dijkstra
1030. Travel Plan (30)题目地址/* http://www.patest.cn/contests/pat-a-practise/1030 1030. Travel Plan (30) 此题用数组 把city结构体分开用变量 一直是内存超限??换成vector 加结构体的模式 就ok 了 另外 vector 使用resize() assign() 要会 */ #include <i原创 2015-08-12 14:13:58 · 967 阅读 · 0 评论 -
5-9 旅游规划 (25分)
5-9 旅游规划 (25分) 有了一张自驾旅游路线图,你会知道城市间的高速公路长度、以及该公路要收取的过路费。现在需要你写一个程序,帮助前来咨询的游客找一条出发地和目的地之间的最短路径。如果有若干条路径都是最短的,那么需要输出最便宜的一条路径。 输入格式: 输入说明:输入数据的第1行给出4个正整数N、M、S、D,其中N(2≤N≤500)是城市的个数,顺便假设城市的编号为0原创 2015-10-03 21:50:24 · 3530 阅读 · 0 评论 -
HDU 1596 find the safest road -- floyd
find the safest roadTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9570 Accepted Submission(s): 3386Problem Description XX星球有很多城市,每个城市之间有原创 2015-09-07 17:24:17 · 349 阅读 · 0 评论 -
05-图3. 六度空间 (30) floyd bfs
05-图3. 六度空间 (30) 题目地址floyd 最后一个case 超时 (想想也应该是超时的)/* 05-图3. 六度空间 (30) http://www.patest.cn/contests/mooc-ds/05-%E5%9B%BE3 floyd() 算所有两点之间的距离 运行超时 */ #include <iostream> #define N 10001 #define INF 99原创 2015-08-11 19:56:56 · 768 阅读 · 0 评论 -
1087. All Roads Lead to Rome (30) -- Dijkstra经典
题目地址:http://www.patest.cn/contests/pat-a-practise/1087ndeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gain原创 2015-08-15 17:33:29 · 2207 阅读 · 2 评论