思路:最大匹配 (很裸)
// by SiriusRen#include#include #include using namespace std;#define N 205int n,tot=0,first[N],v[N*N],next[N*N],m,s,V,vis[N],fa[N],ans=0;double ax[N],ay[N],bx[N],by[N];void add(int x,int y){v[tot]=y,next[tot]=first[x],first[x]=tot++;}bool dfs(int x){ for(int i=first[x];~i;i=next[i]) if(!vis[v[i]]){ vis[v[i]]=1; if(!fa[v[i]]||dfs(fa[v[i]])){ fa[v[i]]=x;return 1; } } return 0;}int main(){ while(~scanf("%d%d%d%d",&n,&m,&s,&V)){ tot=ans=0,memset(fa,0,sizeof(fa)),memset(first,-1,sizeof(first)); for(int i=1;i<=n;i++)scanf("%lf%lf",&ax[i],&ay[i]); for(int i=1;i<=m;i++)scanf("%lf%lf",&bx[i],&by[i]); for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) if(sqrt((bx[j]-ax[i])*(bx[j]-ax[i])+(by[j]-ay[i])*(by[j]-ay[i]))<=(double)s*V)add(i,n+j); for(int i=1;i<=n;i++,memset(vis,0,sizeof(vis)))if(dfs(i))ans++; printf("%d\n",n-ans); }}