题目链接: http://acm.hust.edu.cn/vjudge/problem/356788 Airports Time Limit: 3000MS 问题描述 An airline company offers flights out of n airports, conveniently labeled from 1 to n. The flight time tij from airport i to airport j is known for every i and j. It…
Occupy Cities Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 509 Accepted Submission(s): 125 Problem Description The Star Wars is coming to an end as the Apple Planet is beaten by the Banan…
题意:有 n 个客人,要从 si 到 ti,每个人有一个出发时间,现在让你安排最少和出租车去接,在接客人时至少要提前一分钟到达客人的出发地点. 析:把每个客人看成一个结点,然后如果用同一个出租车接的话,那么肯定是先接 u 然后再去接 v,也就是有一条边 u->v,画图看的就成知道,这是一个最小路径覆盖的问题.把每个结点拆成 X和 Y 然后如果 u 能连 v,那么就 Xu -> Yv,然后跑一次二分最大匹配,那么答案就是 n - 最大匹配数. 代码如下: #pragma comment(link…
题意:有n个地方,m个任务,每个任务给出地点,开始的时间和完成需要的时间,问最少派多少工人去可以完成所有的任务.给出任意两点直接到达需要的时间,-1代表不能到达. 思路:很明显的最小路径覆盖问题,刚开始脑子抽了,没求最短路直接就做了,题目只给了两点间直接到达的时间,还可以间接到达,用floyd求出最短路... #include<stdio.h> #include<string.h> const int N=300; const int inf=0x3fffffff; int hea…