摘要:
题目大意是:在一个有向图中,每条边有距离和费用两个参数,求从 1 到 N 点的费用和在不超过给定费用的情况下求最短路。以 dijkstra 算法为基础,每次选择费用满足下具有最小距离的边.#include <iostream>#include <queue>#include <vector>#define MAXN 110#define INF 1 << 29using namespace std; struct Node{ int id,dis,c; friend bool operator <(const Node &a,con 阅读全文
posted @ 2011-05-19 11:05
张兰云
阅读(320)
评论(0)
推荐(0)

浙公网安备 33010602011771号