二分图最大匹配(模板)

//#include
#include
#include
#include
#include
#define LL long long
#define Max 100005
const LL mod=1e9+7;
const LL LL_MAX=9223372036854775807;
using namespace std;
int road[505][10005],used[Max];
int match[Max];
int n,k;
bool dfs(int x){
    for(int i=1;i<=n;i++)
    if(!used[i] && road[x][i]){
        used[i]=1;
        if(!match[i] || dfs(match[i])){
            match[i]=x;
            return 1;
        }
    }
    return 0;
}
int main()
{
    scanf("%d%d",&n,&k);
    int x,y;
    for(int i=0;i

你可能感兴趣的:(Acm,网络流)