题意:有n个地方,m个任务,每个任务给出地点,开始的时间和完成需要的时间,问最少派多少工人去可以完成所有的任务。给出任意两点直接到达需要的时间,-1代表不能到达。
思路:很明显的最小路径覆盖问题,刚开始脑子抽了,没求最短路直接就做了,题目只给了两点间直接到达的时间,还可以间接到达,用floyd求出最短路。。。
#include<stdio.h>
#include<string.h>
const int N=300;
const int inf=0x3fffffff;
int head[N],num,match[N],link[N],map[30][30],n,m;
struct edge
{
int st,ed,next;
}e[N*N];
stru......
阅读全文