图论--Dijkstra
codancer
为信仰而战斗
展开
-
【HDU 1596 】find the safest road(怪我太怂)dijkstra变形
find the safest road Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15957 Accepted Submission(s): 5538 Problem Description...原创 2018-04-17 17:18:23 · 121 阅读 · 0 评论 -
EZDIJKST - Easy Dijkstra Problem(基础有向图最短路)
EZDIJKST - Easy Dijkstra Problemno tags Determine the shortest path between the specified vertices in the graph given in the input data.Hint: You can use Dijkstra's algorithm.Hint 2: if you're a lazy ...原创 2018-04-18 21:01:29 · 234 阅读 · 0 评论 -
【codeforces 20C】 Dijkstra?(堆优化)最短路
D - Dijkstra? CodeForces - 20C #include<bits/stdc++.h>using namespace std;typedef long long LL; const int MAXN = 1e5 + 10; const LL INF = 1LL<<62; vector<int> e[MAXN];//点 ...原创 2018-04-13 17:53:10 · 425 阅读 · 1 评论 -
【hdu 1142】A Walk Through the Forest(最短路+DFS)
A Walk Through the ForestTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9950 Accepted Submission(s): 3625Problem DescriptionJimmy experience...原创 2018-07-12 10:24:35 · 149 阅读 · 0 评论 -
【ABC 132 E】Hopscotch Addict(最短路)
题面题意:一个有向图,从SSS出发,每次只能走三步(即连续三条边),现在问你能否经过若干步到达TTT,如果可以输出最少的步数,否则输出−1-1−1。思路:disi,jdis_{i,j}disi,j代表S到iS到iS到i的距离disdis%3dis为jjj的最短路,我们要计算的即为disT,0dis_{T,0}disT,0,BFSBFSBFS即可,注意状态的传递。code:#incl...原创 2019-06-30 16:40:55 · 498 阅读 · 0 评论