题目:给出一个图,问最少删除多少个点,使得从点1到点n经过的点数超过k个. 分析: 上网搜了一下,发现很多人用网络流做的,发现我不会.再后来看到这篇说网络流的做法是错的,囧. 后来发现点数有点少,直接上爆搜.每次搜索前先跑一遍最短路,判断是否满足,如果满足更新答案,退出. 否则,在求最短路时记录一下路径,然后枚举删除最短路上的点,继续搜. 第一次写时,记录路径用的是全局变量,每次搜下一层的时候就会变,发现居然也A了... 我试了一下,发现n不会等于1... #include <set> #in…
Description Gabiluso is one of the greatest spies in his country. Now he’s trying to complete an “impossible” mission ----- to make it slow for the army of City Colugu to reach the airport. City Colugu has n bus stations and m roads. Each road connec…
Problem Description Gabiluso is one of the greatest spies in his country. Now he's trying to complete an "impossible" mission ----- to make it slow for the army of City Colugu to reach the airport. City Colugu has n bus stations and m roads. Eac…
Destroying the bus stations                                                                                     Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)                                                       …
Destroying the bus stations Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1832   Accepted: 595 Description Gabiluso is one of the greatest spies in his country. Now he's trying to complete an “impossible” mission - to make it slow for…
POJ 1129 Channel Allocation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 14191   Accepted: 7229 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receive…
Water pipe Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 2265 Accepted: 602 Description The Eastowner city is perpetually haunted with water supply shortages, so in order to remedy this problem a new water-pipe has been built. Builders s…
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=2485 题意:给你n个点,m条相连的边,问你最少去掉几个点使从1到n最小路径>=k,其中不能去掉1,n两个点. 题解:这个题目可以用最小流解决,也可以用IDA*  +  BFS解决. AC代码: #include <iostream> #include <cstdio> #include <cstring> #include <string> #include…
2015 ACM / ICPC 北京站 热身赛 C题 #include<cstdio> #include<cstring> #include<cmath> #include<queue> #include<vector> #include<algorithm> using namespace std; const int INF=0x7FFFFFFF; +;//点的数量 int n,m,k; +],v[+]; int dis1[max…
题意: 就是求最小割点 解析: 正向一遍spfa 反向一遍spfa  然后遍历每一条边,对于当前边 如果dis1[u] + dis2[v] + 1 <= k 那么就把这条边加入到网络流图中, 每个点拆点 边权为1 跑最大流即可 代码还是改的那一题... #include <iostream> #include <cstring> #include <cstdio> #include <queue> #include <cmath> #inc…