This problem is our weak school freshman race of the anti-AK problem ...
I was looking at him in less than 1.5 hours to finish the other questions.
But I didn't learn to match the two points.
Then the various structures of the sort ...
It's been 3 hours or a defeat.
So I learned a bit, and it was easy.
Test instructions is to give you n a mouse m-hole, and give you the coordinates and the speed of the mouse and the latest time
By these distances, each mouse will be able to enter in the specified time for each hole.
And then just ... All right
/************************************************author:d evilcreated TIME:2016/4/8 23:53:26****************** ****************************** */#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#include<vector>#include<queue>#include<Set>#include<map>#include<string>#include<cmath>#include<stdlib.h>using namespacestd;Doublex1[ the],x2[ the],yy[ the],y2[ the];BOOLvis[ the];intn,m,s,v,linker[ the];vector<int>eg[ the];intDfsintu) { for(intI=0; I<eg[u].size (); i++) { intto=Eg[u][i]; if(!Vis[to]) {Vis[to]=1; if(linker[to]==-1||DFS (Linker[to])) {Linker[to]=T; return 1; } } } return 0;}intMain () {//freopen ("In.txt", "R", stdin); while(~SCANF ("%d%d%d%d",&n,&m,&s,&v)) { for(intI=0; i<n; i++) eg[i].clear (); MEMSET (linker,-1,sizeof(linker)); for(intI=0; i<n; i++) scanf ("%LF%LF",&x1[i],&Yy[i]); for(intI=0; i<m; i++) scanf ("%LF%LF",&x2[i],&Y2[i]); V=v*s*v*s; for(intI=0; i<n; i++) { for(intj=0; j<m; J + +) { DoubleP= (X1[i]-x2[j]) * (X1[i]-x2[j]) + (Yy[i]-y2[j]) * (yy[i]-Y2[j]); if(p<=v) eg[i].push_back (j); } } intans=0; for(intI=0; i<n; i++) {memset (Vis,0,sizeof(VIS)); Ans+=DFS (i); } printf ("%d\n", N-ans); } return 0;}
UPCOJ2985 Gopher (two-point match)