poj1328
来源:互联网 发布:mysql 导入employees 编辑:程序博客网 时间:2024/05/01 01:21
#include<IOSTREAM>#include <MATH.H>#include <algorithm>using namespace std;struct point{double left,right;}p[2010],temp;bool operator >(point a,point b){return a.left>b.left;}int main(){int r,n;int ca;while (cin>>n>>r&&(n||r)){double ix,iy;ca=0;bool flag;for(int i=0;i<n;i++){flag=false;cin>>ix>>iy;if(fabs(iy)>r)flag=true;else{p[i].left=ix-sqrt(r*r-iy*iy);p[i].right=ix+sqrt(r*r-iy*iy);}}cout<<"Case "<<ca+1<<": ";if(flag)cout<<-1<<endl;else{int count=1;sort(p,p+n);temp=p[0];for(int j=1;j<n;j++){if(p[i].left>temp.right){count++;temp=p[i];}else if(p[i].right<temp.right)temp.right=p[i].right;}cout<<count<<endl;}}return 0;}
0 0
- POJ1328
- poj1328
- POJ1328
- poj1328
- POJ1328
- poj1328
- poj1328
- poj1328
- poj1328
- poj1328
- poj1328
- poj1328
- poj1328
- POJ1328
- POJ1328
- POJ1328
- poj1328
- POJ1328
- BCD编码
- Tomcat源码分析(一)------ 架构
- Java 实现备忘录(Memento)模式
- ios中单例的使用方法以及加线程锁
- 游戏架构其九:光线投射和天空 { Raycast and Sky }
- poj1328
- mac安装pip
- 注意事项
- 单例设计模式
- 几种解决php+mysql中uft-8中文编码乱码的办法
- The type org.springframework.dao.support.DaoSupport cannot be resolved.
- codeforces 476C Dreamoon and Sums
- malloc和new的区别是什么?
- POJ 2187--Beauty Contest