网络流24题小结
1.飞行员配对方案问题 二分图最大匹配。 #include<bits/stdc++.h> using namespace std; inline int read(){ int x= 0 ,f= 1 ; char ch= getchar(); while (ch< ' 0 ' ||ch> ' 9 ' ){ if (ch== ' - ' )f=- 1 ;ch= getchar();} while (ch>= ' 0 ' &&ch<= ' 9 ' ){x=(x<< 3 )+(x<< 1 )+ch- ' 0 ' ;ch= getchar();} return x* f; } #define MN 2005 #define S 0 #define T 205 #define inf 200000000 struct edge{ int to,w,nex;}e[MN* T]; int hr[T+ 5 ],cnt= 1 ,d[T+ 5 ]; int q[T+ 5 ],top,ans; int m,n; void ins( int f, int t, int w){ e[ ++cnt]=edge{t,w,hr[f]};hr[f]= cnt; e[ ++cnt]=edge{f, 0 ,hr[t]};hr[t]= cnt; } bool bfs(){ memset(d, 0 , sizeof d);