虽然割点不好搞,但是可以变成割边呀
拆点,拆出来的边权给1,原图中的边权给inf,然后跑dinic就行了
#include<bits/stdc++.h>
#define pa pair<int,int>
#define CLR(a,x) memset(a,x,sizeof(a))
using namespace std;
typedef long long ll;
const int maxn=,maxm=*,inf=1e9; inline ll rd(){
ll x=;char c=getchar();int neg=;
while(c<''||c>''){if(c=='-') neg=-;c=getchar();}
while(c>=''&&c<='') x=x*+c-'',c=getchar();
return x*neg;
} struct Edge{
int b,l,ne;
}eg[maxm];
int egh[maxn],ect=;
int S,T,N,M;
int cur[maxn],dep[maxn];
queue<int> q; inline void adeg(int a,int b,int c){
eg[++ect].b=b,eg[ect].l=c,eg[ect].ne=egh[a];egh[a]=ect;
eg[++ect].b=a,eg[ect].l=,eg[ect].ne=egh[b];egh[b]=ect;
} inline bool bfs(){
CLR(dep,);CLR(cur,-);
dep[S]=,q.push(S);
while(!q.empty()){
int p=q.front();q.pop();
for(int i=egh[p];i;i=eg[i].ne){
int b=eg[i].b;
if(dep[b]||!eg[i].l) continue;
dep[b]=dep[p]+,q.push(b);
}
}
return dep[T];
} int dinic(int x,int y){
if(x==T) return y;
int tmp=y;
if(cur[x]==-) cur[x]=egh[x];
for(int &i=cur[x];i;i=eg[i].ne){
int b=eg[i].b;
if(dep[b]!=dep[x]+||!eg[i].l) continue;
int re=dinic(b,min(eg[i].l,tmp));
tmp-=re,eg[i].l-=re,eg[i^].l-=re;
if(!tmp) break;
}return y-tmp;
} int main(){
//freopen("","r",stdin);
int i,j,k;
N=rd(),M=rd(),S=rd()+N,T=rd();
for(i=;i<=N;i++)
adeg(i,i+N,);
for(i=;i<=M;i++){
int a=rd(),b=rd();
adeg(a+N,b,inf),adeg(b+N,a,inf);
}
int ans=;
while(bfs()) ans+=dinic(S,inf);
printf("%d\n",ans);
return ;
}