
Dijkstra
文章平均质量分 54
desyang66
代码改变世界
展开
-
PAT 1111 Online Map (Dijkstra)
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: one is the shortest, and the other is the fastest. It is guaranteed that a path exists for any request.Input Speci原创 2022-06-30 20:34:08 · 83 阅读 · 0 评论 -
Dijkstra算法模板
Dijstra算法基本模板最短路的一般题目通用, 其它题目修改即可大家想学的可以看看这个UP主#include "bits/stdc++.h"#define P pair<int, int>#define inf 0x3f3f3f3fusing namespace std;const int N = 1e5 + 10;vector<P> edge[N];int dis[N];int main(){ int n, m; cin>>n>&g原创 2022-04-16 12:42:49 · 117 阅读 · 0 评论 -
PTA L2 - 紧急救援
紧急救援L2-001 紧急救援 (25 分)作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救援队数量和每一条连接两个城市的快速道路长度都标在地图上。当其他城市有紧急求助电话给你的时候,你的任务是带领你的救援队尽快赶往事发地,同时,一路上召集尽可能多的救援队。输入格式:输入第一行给出4个正整数N、M、S、D,其中N(2≤N≤500)是城市的个数,顺便假设城市的编号为0 ~ (N−1);M是快速道路的条数;S是出发地的城市编号原创 2022-04-16 12:19:13 · 394 阅读 · 0 评论