POJ 3592 Instantaneous Transference
题目链接
题意:一个图,能往右和下走,然后有*可以传送到一个位置,'#'不能走,走过一个点可以获得该点上面的数字值,问最大能获得多少
思路:由于有环先强连通缩点,然后问题转化为dag,直接dp即可
代码:
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <stack>
using namespace std;
const int N = 1605;
const int d[2][2] = {0, 1, 1, 0};
int t, n, m, val[N];
char str[45][45];
vector<int> g......
阅读全文