2017 ECNA Regional Contest B:Craters (圆的凸包)

传送门
题意:
给你 200 200 200个圆,让你求出所有圆的凸包。
思路:
先把圆去重,然后把圆套圆中的小圆给去掉。
接着做出圆的两两公切点,丢掉所有在某个圆内部的点,然后做凸包即可。

计算长度时要判断是否在一个圆上,如果在上面要判优弧/劣弧,不在就直接加距离。
凸包求错导致调了 3 h 3h 3h的圆的部分硬是过不了。。。
代码:

#include<bits/stdc++.h>
#define ri register int
using namespace std;
const int rlen=1<<18|1;
inline char gc(){
   
	static char buf[rlen],*ib,*ob;
	(ib==ob)&&(ob=(ib=buf)+fread(buf,1,rlen,stdin));
	return ib==ob?-1:*ib++;
}
inline int read(){
   
	int ans=0;
	bool f=1;
	char ch=gc();
	while(!isdigit(ch))f^=ch=='-',ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return f?ans:-ans;
}
typedef long double ld;
typedef long long ll;
const int N=2e6+5;
const ld eps=1e-8,pi=acos(-1.0);
inline int signal(const ld&x){
   return (x>eps)-(x<-eps);}
struct pot{
   
	ld x,y;
	pot(ld x=0,ld y=0):x(x),y(y){
   }
	friend inline pot operator+(const pot&a,const pot&b){
   return pot(a.x+b.x,a.y+b.y);}
	friend inline pot operator-(const pot&a,const pot&b){
   return pot(a.x-b.x,a.y-b.y);}
	friend inline ld operator^(const pot&a,const pot&b){
   
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值