题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1332

#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std; const double eps = 1e-;
const double PI = acos(-1.0);
const double INF = 1000000000000000.000; struct Point{
double x,y;
Point(double x=, double y=) : x(x),y(y){ } //构造函数
};
typedef Point Vector; struct Circle{
Point C;
double r; Circle(Point C=Point(,),double r=0.0): C(C),r(r) {}
Point getpoint(double ang){ //可以用来求圆上与x正半轴成ang度的点的坐标。
return Point(C.x +cos(ang)*r,C.y + sin(ang)*r);
}
}; Vector operator + (Vector A , Vector B){return Vector(A.x+B.x,A.y+B.y);}
Vector operator - (Vector A , Vector B){return Vector(A.x-B.x,A.y-B.y);}
Vector operator * (double p,Vector A){return Vector(A.x*p,A.y*p);}
Vector operator / (Vector A , double p){return Vector(A.x/p,A.y/p);} bool operator < (const Point& a,const Point& b){
return a.x < b.x ||( a.x == b.x && a.y < b.y);
} int dcmp(double x){
if(fabs(x) < eps) return ;
else return x < ? - : ;
}
bool operator == (const Point& a, const Point& b){
return dcmp(a.x - b.x) == && dcmp(a.y - b.y) == ;
} ///向量(x,y)的极角用atan2(y,x);
inline double Dot(Vector A, Vector B){ return A.x*B.x + A.y*B.y; }
inline double Length(Vector A) { return sqrt(Dot(A,A)); }
inline double Angle(Vector A, Vector B) { return acos(Dot(A,B) / Length(A) / Length(B)); }
double Cross(Vector A, Vector B) { return A.x*B.y - A.y * B.x; } Vector vecunit(Vector v){ return v / Length(v);} //单位向量 /*************************************分 割 线*****************************************/ const int maxn = ; Circle cir[maxn];
int N;
double R,r; int main()
{
//freopen("E:\\acm\\input.txt","r",stdin);
cin>>N;
for(int i=;i<=N;i++){
scanf("%lf %lf",&cir[i].C.x,&cir[i].C.y);
}
scanf("%lf %lf",&R,&r); if(dcmp(R-r) < ){
printf("0\n");
return ;
} Circle NewC;
NewC.r = R; for(int i=;i<=N;i++){
cir[i].r = r;
}
double ave = *PI / ;
int ans = ;
for(int i=;i<=N;i++){
for(double ang=;ang<=*PI;ang+=ave){
int temp = ;
Point P = cir[i].getpoint(ang); //在圆上取点。 NewC.C = P + R * (cir[i].C-P)/Length(cir[i].C-P); for(int j=;j<=N;j++){
if(i == j) continue;
if(dcmp(fabs(NewC.r-cir[j].r) - Length(NewC.C - cir[j].C)) >= ) {
temp++;
}
}
ans = max(ans,temp);
}
} printf("%d\n",ans);
}

最新文章

  1. 关于SQL Server镜像的一个小误区
  2. LA4287--tarjan
  3. sqldatasource控件设置where语句
  4. 转!!EL表达式大全
  5. 如何打开asp.net中的出错提示?在程序发布后
  6. 如何:确定调用 ASP.NET 网页的方式
  7. 再起航,我的学习笔记之JavaScript设计模式25(迭代器模式)
  8. PHP四种基本排序算法
  9. asp.net core上使用Redis探索(2)
  10. centos添加开放端口
  11. react中的传参方式
  12. MySQL 高可用性—keepalived+mysql双主
  13. 获得小程序码getWXACodeUnlimit
  14. JDK常用命令(一)jps、jstat
  15. 处理tcp里的粘包问题
  16. EJB Remote/Local 绑定和JNDI Lookup
  17. Springboot 之 自定义配置文件及读取配置文件
  18. /usr/bin/ld: cannot find -lxxx 的解决办法
  19. idea列表
  20. Google 做过的 12 件奇葩事

热门文章

  1. 完全背包的变形POJ1252
  2. MVVM模式应用 之在ViewModel中使用NavigationService
  3. Jquery Mobile下设置radio控件选中
  4. 关于js的callback回调函数的理解
  5. Windows下面对环境变量的操作
  6. Python Tutorial学习(十一)-- Brief Tour of the Standard Library – Part II
  7. Lambda表达式, 可以让我们的代码更优雅.
  8. Spring4.0整合Hibernate3 .6
  9. 【产品体验】ONE一个
  10. java-String中的 intern()&lt;转&gt;