signed main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int n1,n2,m;
cin >> n1 >> n2 >> m;
vector<vector<int>>ver(n1+1);
for(int i = 1;i <= m;i++){
int x,y;
cin >> x >> y;
ver[x].push_back(y);
}
int ans = 0;
vector<int>match(n2+1);
for(int i = 1;i <= n1;i++){
vector<int>vis(n2+1);
auto dfs = [&](auto self,int x) -> bool {
for(auto y : ver[x]){
if(vis[y])continue;
vis[y] = 1;
if(!match[y] || self(self,match[y])){
match[y] = x;
return true;
}
}
return false;
};
if(dfs(dfs,i)){
ans++;
}
}
cout << ans << '\n';
return 0;
}#include<cstring>
#include<cstdio>
#define Re register int
const int N=1003;
int o,n,m,e,x,y,ans,pan[N],head[N],match[N];
struct QAQ{int to,next;}a[N*N];
inline void in(Re &x){
int f=0;x=0;char c=getchar();
while(c<'0'||c>'9')f|=c=='-',c=getchar();
while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();
x=f?-x:x;
}
inline void add(Re x,Re y){a[++o].to=y,a[o].next=head[x],head[x]=o;}
inline int dfs(Re x){
for(Re i=head[x],to;i;i=a[i].next)
if(!pan[to=a[i].to]){
pan[to]=1;
if(!match[to]||dfs(match[to])){
match[to]=x;return 1;
}
}
return 0;
}
int main(){
in(n),in(m),in(e);
while(e--){
in(x),in(y);
if(x<=n&&y<=m)add(x,y);
}
for(Re i=1;i<=n;++i){
memset(pan,0,sizeof(pan));
ans+=dfs(i);
}
printf("%d",ans);
}
#include<algorithm>
#include<cstring>
#include<cstdio>
#define Re register int
using namespace std;
const int N=2003,M=1e6+3;
int n,m,x,y,h,t,o,T,O,Q[N],head[N],color[N];
struct QAQ{int to,next;}a[M<<1];
inline void add(Re x,Re y){a[++o].to=y,a[o].next=head[x],head[x]=o;}
inline void in(Re &x){
int f=0;x=0;char c=getchar();
while(c<'0'||c>'9')f|=c=='-',c=getchar();
while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();
x=f?-x:x;
}
inline int judge(){
for(Re i=1;i<=n;++i)
if(!color[i]){
h=1,t=0,Q[++t]=i,color[i]=1;
while(h<=t){
Re x=Q[h++];
for(Re j=head[x],to;j;j=a[j].next)
if(!color[to=a[j].to])color[to]=3-color[x],Q[++t]=to;
else if(color[to]==color[x])return 0;
}
}
return 1;
}
int main(){
in(T);
while(T--){
memset(color,0,sizeof(color));
memset(head,0,sizeof(head));
in(n),in(m),o=0;
while(m--)in(x),in(y),add(x,y),add(y,x);
printf("Scenario #%d:\n",++O);
puts(judge()?"No suspicious bugs found!\n":"Suspicious bugs found!\n");
}
}