之前很认真地看了用优先队列来实现Dijkstra这块,借鉴了小白书上的代码模板后,便拿这道题来试试水了.这道题的大意就是问你从地点1到地点2有多少条满足条件的路径(假设该路径经过 1->...-> b -> a ->...-> 2,那么d[b]必须小于d[a],其中d[b],d[a]分别是指 b,a 到地点2的最短距离),所以大体做法就是先求出以2为起点的单源最短路径,然后利用深搜dfs(v)表示 v顶点到2的满足以上条件的路径数,最后答案便是dfs(1),当然要加个记忆化.…
题目链接:http://poj.org/problem?id=3635 Description After going through the receipts from your car trip through Europe this summer, you realised that the gas prices varied between the cities you visited. Maybe you could have saved some money if you were…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1535 Problem Description In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all,…
Invitation Cards Time Limit: 8000MS Memory Limit: 262144K Total Submissions: 16178 Accepted: 5262 Description In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They wan…