# 【二分图匹配（最小路径覆盖）】hdu 1151 Air Raid

http://acm.hdu.edu.cn/showproblem.php?pid=1151

#include<iostream>
#include<cstring>
#include<cstdio>

const int NM=130;

int Find(int x)
{
for(int i=1;i<=cross;i++)
{
if(a[x][i]&&!flag[i])
{
flag[i]=1;
{
return 1;
}
}
}
return 0;
}

int main()
{
int T,street,i,ans,x,y;
scanf("%d",&T);
while(T--)
{
memset(a,0,sizeof(a));
scanf("%d%d",&cross,&street);
for(i=0;i<street;i++)
{
scanf("%d%d",&x,&y);
a[x][y]=1;
}
ans=0;
for(i=1;i<=cross;i++)
{
memset(flag,0,sizeof(flag));
if(Find(i)) ans++;
}
printf("%d\n",cross-ans);
}
return 0;
}

• 本文已收录于以下专栏：

## hdu 1151 Air Raid(二分图匹配--最小路径覆盖)

Air Raid Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total...

## hdu 1151 Air Raid (二分匹配，最小路径覆盖)

Problem Description Consider a town where all the streets are one-way and each street leads from on...

## hdu1151Air Raid (二分匹配，最小路径覆盖)

Problem Description Consider a town where all the streets are one-way and each street leads from on...

## HDOJ 题目1151 Air Raid（二分图，最小路径覆盖）

Air Raid Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total...

## HDU 1151 Air Raid 二分图最小边覆盖

• NMfloat
• 2016年02月19日 17:33
• 293

## hdu 1151 Air Raid 最小路径覆盖(最大匹配)

#include #include #include #include #include using namespace std; const int maxn=1010; vectore[...

## poj 1422 Air Raid 最小路径覆盖 二分图匹配 解题报告

Description Consider a town where all the streets are one-way and each street leads from one inte...

举报原因： 您举报文章：【二分图匹配（最小路径覆盖）】hdu 1151 Air Raid 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)