poj1273 Drainage Ditches Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 54962 Accepted: 20960 Description Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is cov…
isap模板核心代码: //d[]为距离标号数组,d[i]表示节点i到汇点的距离 //gap[]为GAP优化数组,gap[i]表示到汇点距离为i的节点个数 int dfs(int k,int flow){//flow为当前剩余流量 int i; if(k==t)return flow; ; for(i=head[k];i;i=e[i].nxt){ int v=e[i].to; ){//判断能否通过流量以及走的是否为最短路 int f=dfs(v,min(flow-sum,e[i].f));//注…
Ikki's Story I - Road Reconstruction Time Limit: 2000MS Memory Limit: 131072K Total Submissions: 7491 Accepted: 2172 Description Ikki is the king of a small country – Phoenix, Phoenix is so small that there is only one city that is responsible fo…
虽然这道题用最小割没有做出来,但是这个板子还是很棒: #include<stdio.h> #include<math.h> #include<string.h> #include<iostream> #include<algorithm> #define ll long long using namespace std; #define REP( i , a , b ) for ( int i = a ; i < b ; ++ i ) #d…
Minimum Cut Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 8324 Accepted: 3488 Case Time Limit: 5000MS Description Given an undirected graph, in which two vertices can be connected by multiple edges, what is the size of the minimum c…
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; ; const int INF=0x7fffffff; int N,M,S; int a[MAXN][MAXN],dis[MAXN]; bool visit[MAXN],d[MAXN]; int StoerWagner(in…
Dual Core CPU Time Limit: 15000MS Memory Limit: 131072K Total Submissions: 21453 Accepted: 9297 Case Time Limit: 5000MS Description As more and more computers are equipped with dual core CPU, SetagLilb, the Chief Technology Officer of TinySoft Co…
Dual Core CPU Time Limit: 15000MS Memory Limit: 131072K Total Submissions: 24830 Accepted: 10756 Case Time Limit: 5000MS Description As more and more computers are equipped with dual core CPU, SetagLilb, the Chief Technology Officer of TinySoft C…