计算几何
Gipsyu
这个作者很懒,什么都没留下…
展开
-
HDU1115 多边形求重心
https://vjudge.net/problem/HDU-1115直接找的模板抄上去了首先划分多个三角形然后算出每个三角形的质量和重心再然后就是高中物理竞赛的质心的算法AC代码:#include<bits/stdc++.h> using namespace std; typedef long long ll; /*==================================...原创 2018-04-08 19:54:23 · 188 阅读 · 0 评论 -
BZOJ1069 二维凸包+三分
标准做法二维凸包+旋转卡壳 但是满足凸性可以三分 #include<bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-15, pi = acos(-1); int sign(db x) {return x < -eps ? -1 : x > eps;} int cmp(db...原创 2019-07-27 16:26:36 · 202 阅读 · 0 评论 -
Codeforces 1195F Geometers Anonymous Club
可以写树状数组,这里直接写的线段树 #include<bits/stdc++.h> using namespace std; const int N = 1e5 + 10; struct SegmentTree { int l, r, sum, f; #define l(x) Tree[x].l #define r(x) Tree[x].r #def...原创 2019-07-18 08:05:10 · 478 阅读 · 0 评论 -
LuoGu P4724 三维凸包
#include<bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-15, pi = acos(-1); int sign(db x) {return x < -eps ? -1 : x > eps;} int cmp(db x, db y) {return sign(x - ...原创 2019-07-17 18:46:59 · 188 阅读 · 0 评论 -
LuoGu P2510 && BZOJ 1043 下落的圆盘
#include<bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-15, pi = acos(-1); int sign(db x) {return x < -eps ? -1 : x > eps;} int cmp(db x, db y) {return sign(x - ...原创 2019-07-16 23:38:03 · 144 阅读 · 0 评论 -
2018 ACM NanJing Country Meow 模拟退火法求最小球覆盖
#include<bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-15, pi = acos(-1); int sign(db x) {return x < -eps ? -1 : x > eps;} int cmp(db x, db y) {return sign(x - ...原创 2019-07-14 11:51:22 · 142 阅读 · 0 评论 -
2018 ACM ShenYang Machining Disc Rotors
沈阳赛区金牌题 #include<bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-15, pi = acos(-1); int sign(db x) {return x < -eps ? -1 : x > eps;} int cmp(db x, db y) {return ...原创 2019-07-14 00:10:00 · 151 阅读 · 0 评论 -
GYM Breaking Biscuits
#include<bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-15, pi = acos(-1); int sign(db x) {return x < -eps ? -1 : x > eps;} int cmp(db x, db y) {return sign(x - ...原创 2019-07-13 19:44:42 · 203 阅读 · 0 评论 -
2018 ACM XuZhou Rikka with Illuminations
#include<bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-12, pi = acos(-1); int sign(db x) {return x < -eps ? -1 : x > eps;} int cmp(db x, db y) {return sign(x - ...原创 2019-06-14 23:24:39 · 240 阅读 · 0 评论 -
HDU1007 Closest Pair
#include<bits/stdc++.h> using namespace std; typedef double db; const db inf =1e9; const int N=1e5+10; struct Point{ db x,y; void input(){scanf("%lf%lf",&x,&y);} db dis(Poin...原创 2019-06-09 21:34:48 · 130 阅读 · 0 评论 -
HDU1756 Position of Point and Polygon
#include<bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-12, pi = acos(-1); int sign(db x) {return x < -eps ? -1 : x > eps;} int cmp(db x, db y) {return sign(x - ...原创 2019-06-09 11:55:12 · 175 阅读 · 0 评论 -
HDU 2857 Point of Intersection
先求投影,然后对称点,然后直线交点 #include<bits/stdc++.h> using namespace std; typedef double db; const db eps=1e-8,pi=acos(-1); int sign(db x){if(x>eps)return 1;if(x<-eps)return -1;return 0;} int cmp(d...原创 2019-06-07 17:01:31 · 153 阅读 · 0 评论 -
HDU2036 Area of Polygon
#include<bits/stdc++.h> using namespace std; typedef double db; const db eps=1e-8; const db pi=acos(-1); int sign(db x){if(x>eps)return 1;if(x<-eps)return -1;return 0;} int cmp(db x,db y)...原创 2019-06-07 13:39:06 · 116 阅读 · 0 评论 -
HDU1147 Intersection of Segment
#include<bits/stdc++.h> using namespace std; typedef double db; const db eps=1e-8; const db pi=acos(-1); int sign(db x){if(x>eps)return 1;if(x<-eps)return -1;return 0;} int cmp(db x,db y)...原创 2019-06-07 12:55:50 · 125 阅读 · 0 评论 -
POJ3304 Computation Geometry
计算几何 //#include<bits/stdc++.h> #include<iostream> #include<cmath> #include<stdio.h> using namespace std; typedef double db; const db eps=1e-8; const db pi=acos(-1); int sign(...原创 2019-06-07 11:07:20 · 141 阅读 · 0 评论 -
2019 Xuzhou Online Contest Problem K Center
将所有点的两两的中心处理出来,看哪个点被用的最多用哪个 尊龙的代码~ #include<bits/stdc++.h> using namespace std; struct point{ int x,y; } p[1010]; struct { int x,y,cnt=-1; } ha[10000010]; int num,n; long long h=1...原创 2019-09-11 16:18:45 · 144 阅读 · 0 评论