上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 109 下一页

2020年2月28日

【经典】半平面交求解方程组——poj1755

摘要: 神坑,精度要调到1e-10,板子没问题 /* 二分距离,凸包所有边往左平移这个距离,半平面交后看是否还有核存在 */ #include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<vector> #inc 阅读全文

posted @ 2020-02-28 18:59 zsben 阅读(188) 评论(0) 推荐(0) 编辑

【模板】凸包向内推进求不严格的半平面交——poj3384

摘要: 想不明白这题写严格的半平面交为什么会错 /* 凸包所有边向内推进r */ #include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<vector> #include<algorithm> #inclu 阅读全文

posted @ 2020-02-28 14:48 zsben 阅读(122) 评论(0) 推荐(0) 编辑

二分+半平面交——poj1279

摘要: /* 二分距离,凸包所有边往左平移这个距离,半平面交后看是否还有核存在 */ #include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<vector> #include<algorithm> #inc 阅读全文

posted @ 2020-02-28 12:15 zsben 阅读(138) 评论(0) 推荐(0) 编辑

半平面交求面积——poj1279

摘要: #include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<vector> #include<algorithm> #include<queue> using namespace std; #defin 阅读全文

posted @ 2020-02-28 11:14 zsben 阅读(158) 评论(0) 推荐(0) 编辑

2020年2月27日

【模板】多边形的核(非严格的半平面角)——poj3335

摘要: 这个模板用来判断多边形是否存在核(一点也行) 有个地方需要修改的 struct line{}里面的一个函数 int include(point k){return sign(cross(p[1]-p[0],k-p[0]))>=0;}//k在l左端 #include<iostream> #includ 阅读全文

posted @ 2020-02-27 20:48 zsben 阅读(180) 评论(0) 推荐(0) 编辑

2020年2月26日

搜索——UCF2015 H

摘要: 一看题感觉像炮兵布阵类似的状压 写了半天发现是假的解法:这题有一个更强的限制就是要填满, 所以状压dp的话要用dp[i][s][ss]表示第i行的颜色状态和填色策略, 或者外层用3^n复杂度的枚举子集来做 算了一下这么一来时间复杂度就不对了O(3^n*2^n*n) 其实可以直接用dfs剪枝搜索 #i 阅读全文

posted @ 2020-02-26 22:39 zsben 阅读(109) 评论(0) 推荐(0) 编辑

求最大三角形——poj2079

摘要: 用旋转卡壳的思想,固定住一点,然后剩下两点通过单峰函数的性质进行移动 #include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<vector> #include<algorithm> using na 阅读全文

posted @ 2020-02-26 00:44 zsben 阅读(204) 评论(0) 推荐(0) 编辑

2020年2月25日

【模板】旋转卡壳求双凸包最小距离——poj3608

摘要: 求两个凸包间的最小距离,最大距离,都是用同一种思路 最大距离:枚举凸包A的每条边,然后去B找对踵点,求的是点到点的最短距离 最小距离:比最大距离稍复杂一点,枚举凸包A的每条边,去B找对踵点,如果只有一个对踵点,那么求点到线段最短距离 如果有两个对踵点,那么求线段到线段的最短距离(需要改动一下disS 阅读全文

posted @ 2020-02-25 20:46 zsben 阅读(265) 评论(0) 推荐(0) 编辑

【模板】点集直径——p1452

摘要: 首先要了解对踵点的定义https://blog.csdn.net/qq_34921856/article/details/80689629 然后是旋转卡壳算法的全家桶 https://blog.csdn.net/qq_34921856/article/details/80690822 但是代码实现有 阅读全文

posted @ 2020-02-25 16:26 zsben 阅读(238) 评论(0) 推荐(0) 编辑

【模板】多边形面积——poj3348

摘要: #include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<vector> #include<algorithm> using namespace std; #define N 3005 typedef 阅读全文

posted @ 2020-02-25 13:33 zsben 阅读(129) 评论(0) 推荐(0) 编辑

上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 109 下一页

导航