poj 1511 Invitation Cards
这个题的题意就是从1到所有点以及从所有点回到1所需最小的花费。这道题实质是求最短路径,我的思路是用SPFA,正反两次SPFA。对spfah还是第一次写,不知道怎么优化。
代码:
#include
#include
using namespace std;
const int maxn=1000005,inf=1000000005;
struct node
{
int y,w,
原创
2012-08-23 17:13:37 ·
600 阅读 ·
0 评论