This is a simple question, but there are not many people and the AC rate is not very high. The main reason is that this question should be noted and detailed, and the card accuracy is not so strict.
1. If the distance from the four vertices of the rectangle to the center of the circle is greater than the radius, it will obviously not overlap (many people will die here)
2. Roll the circle center around the side of the rectangle and the area covered by the circle. As long as the center of the circle is inside the area, it will meet the intersection conditions.
For specific judgment, see the following code in three cases: the distance from the horizontal side, the distance from the vertical side, and the distance from the four vertices.
#include <iostream>#include <string.h>#include <stdio.h>#include <algorithm>#include <cmath>#define eps 1e-8using namespace std;struct point{ double x; double y;}circle,a,b,c,d;double r;double dis(point &a,point &b){ return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));}int main(){ int t; scanf("%d",&t); point temp; while(t--) { scanf("%lf%lf%lf%lf%lf%lf%lf",&circle.x,&circle.y,&r,&a.x,&a.y,&b.x,&b.y); if(a.x > b.x) temp=a,a=b,b=temp; // if(((circle.x >= min(a.x,b.x)) && (circle.x <=max(a.x,b.x))) && ((circle.y <=max(a.y,b.y)) && (circle.y>=min(a.y,b.y)))) // { printf("YES\n");continue;} c.x=a.x,c.y=b.y; d.x=b.x,d.y=a.y; if(dis(a,circle)<r && dis(b,circle) <r && dis(c,circle)<r && dis(d,circle) <r) {printf("NO\n");continue;} if(circle.x>=a.x && circle.x<=b.x) { if(fabs(circle.y-a.y) <= r || fabs(circle.y-b.y) <= r) {printf("YES\n");continue;} } if((circle.y >= a.y && circle.y <=b.y) || (circle.y>=b.y && circle.y<=a.y)) { if(fabs(circle.x-a.x) <=r || fabs(circle.x-b.x) <=r) {printf("YES\n");continue;} } if(dis(a,circle)<=r || dis(b,circle) <=r || dis(c,circle)<=r || dis(d,circle) <=r) {printf("YES\n");continue;} printf("NO\n"); } return 0;}