原题地址;http://poj.org/problem?id=3249
题意:给出n个点,m条边,每个点都提供了相对的点权值,然后给出相连着的边,问最大利润值。
思路:在拓扑排序的时候同步更新dp数组就行了.
注意:顶点权值可以取负就行了.
#include <cmath>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <queue>
#include <vector>
#include <stack>
#include <set>
#include <cctype>
#define eps 1e-8