http://acm.hdu.edu.cn/showproblem.php?pid=1221 114 92 31 95 13 96 3 这题只需要判断圆和矩形是否相交,然后在里面是不算相交的. 那么就有好几种情况了. 1.整个矩形在圆形里,NO,(我的做法是所有点到圆心距离小于半径) 2.整个圆在矩形里,NO,一个圆选出5个点,圆心,和最上下左右,如果这些点都在,则不行.我的做法直接PointInPolygon. 3.否则,只要有公共点,就直接YES.然后,如果圆那5个点有一个在矩形,或者矩形的…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1221 Rectangle and Circle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3434    Accepted Submission(s): 904 Problem Description Given a rectangle…
Rect与Circle重叠有三种情况: 1. Rect至少有一个角在Circle里面 2. Circle与Rect的左边或右边相交,或者Circle在Rect内 3. Circle与Rect的顶边或底边相交,或者Circle在Rect内 判断代码: public static boolean IsInside( float x, float y, Circle circle ){ float disX = x - circle.x; float disY = y - circle.y; retu…
下边介绍Vector Layer Path(Layer) Path是其他Vector Layer的父类,比如Polyline.Polygon.Rectangle.Circle.CircleMarker...,虽然我们不直接用Path类,但是它的属性和方法我们需要了解. 1.参数 stroke //是否画边界,默认True,在画Circle和Polygon时很有用 color //Stroke的color weight //Stroke的线宽 opacity //Stroke透明度 dashArr…
pid=5288">http://acm.hdu.edu.cn/showproblem.php?pid=5288 Problem Description OO has got a array A of size n ,defined a function f(l,r) represent the number of i (l<=i<=r) , that there's no j(l<=j<=r,j<>i) satisfy ai mod aj=0,now…
MZL's Circle Zhou 题意:给定两个长度不超过a,b(1 <= |a|,|b| <= 90000),x为a的连续子串,b为y的连续子串(x和y均可以是空串):问x+y形成的不同串的个数? 误区:开始一门心思想着求出总的可形成的字符串个数,再减去a,b中相同的子串重叠的部分:想通过连续插入a+b得到的SAM并不能获得信息:因为x,y是任意的子串,连续插入导致一定是a的后缀和b的前缀 正解:直接在计算有不同子串时,就不去计算重复的 <=>对于一个可能出现x后缀和y前缀相同…
Description Given a rectangle and a circle in the coordinate system(two edges of the rectangle are parallel with the X-axis, and the other two are parallel with the Y-axis), you have to tell if their borders intersect. Note: we call them intersect ev…
MZL's Circle Zhou Time Limit: 1000ms Memory Limit: 131072KB This problem will be judged on HDU. Original ID: 534364-bit integer IO format: %I64d      Java class name: Main   MZL's Circle Zhou is good at solving some counting problems. One day, he com…
绘制线段:line 函数 void line(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0); img: 要绘制线段的图像. pt1: 线段的起点. pt2: 线段的终点. color: 线段的颜色,通过一个 Scalar 对象定义. thickness: 线条的宽度,默认值为 1. lineType: 线段的类型.可以取值 8,4,和 LI…
MZL's Circle Zhou Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Problem Description   MZL's Circle Zhou is good at solving some counting problems. One day, he comes up with a counting problem:You are given two…