从左上角到有下角k次能获得的最大值。
跟hdu 2686一样的题目,这题一个点可以重复走,只能得到一次值。
#include<stdio.h>
#include<string.h>
#include<queue>
const int N=5100;
const int inf=0x3fffffff;
using namespace std;
int dist[N],head[N],num,start,end,n,vis[N],pre[N];
struct edge
{
int st,ed,cost,flow,next;
}e[N*10];
void addedge(int x,int y,int c,int w)
{
e[num].st=x;e[num].ed=y;e[num].cost=c; e[num].flow=w;e[num].next=head[x];head[x]=num++;
e[num].st=y;e[num].ed=x......
阅读全文