
计算几何
poursoul
这个作者很懒,什么都没留下…
展开
-
【HDU】4978 A simple probability problem. 凸包
传送门:【HDU】4978 A simple probability problem.题目分析:原创 2014-08-22 10:25:41 · 820 阅读 · 0 评论 -
【codeforces】660F. Bear and Bowling 4【分治+维护凸壳】
题目链接:【codeforces】660F. Bear and Bowling 4考虑对序列分治,然后可以发现,以左半部分每个下标为x,右边则可以表示成kx+bkx+b的形式,因此可以对右边的直线维护一个下凸壳。 复杂度O(nlog2n)O(nlog^2n),如果用归并排序代替快排,可以做到O(nlogn)O(nlogn)#include <stdio.h>#include <string.h>原创 2016-11-06 21:56:37 · 1015 阅读 · 0 评论 -
【HDU】5549 Walk Around The Campsite【极角排序+set+最短路dp】
题目链接:Walk Around The Campsite要知道多边形的边只会在端点相交。则如果以一个点为原点,作射线,然后旋转,那么遇到边的左端点我们往set插入线段,遇到边的右端点我们删除线段,那么任意时刻在set中的线段和射线的交点到原点的距离的大小关系是相对不变的。那么我们就可以通过动态维护set的操作符’<’动态维护线段距离原点的远近了。 接下来就很简单了,枚举原点,然后极角排序,然后转原创 2016-10-23 22:23:12 · 1535 阅读 · 0 评论 -
【HDU】5817 Ice Walls【极角排序+树状数组+最短路】
题目链接:Ice Walls#include <bits/stdc++.h>using namespace std ;typedef long long LL ;typedef pair < double , int > pii ;#define clr( a , x ) memset ( a , x , sizeof a )const int MAXN = 1005 ;const doubl原创 2016-10-17 17:10:33 · 544 阅读 · 0 评论 -
【玲珑杯】1048 - Best substring【manacher+分治维护凸壳】
题目链接:【玲珑杯】1048 - Best substringwa了一辈子,最后发现是利用归并排序后的退栈策略错了。应该是判栈顶和当前元素的关系,然而我偷懒只判了相邻两个元素的关系,gg。#include <bits/stdc++.h>using namespace std ;typedef long long LL ;#define clr( a , x ) memset ( a , x , s原创 2016-11-07 14:52:02 · 484 阅读 · 0 评论 -
【HDU】5928 Birthday Gift【极角排序+dp】
题目链接:Birthday Gift首先,最优解一定是一个凸包,但是接下来的算法不会显性利用到凸包的性质。 枚举每个点作为多边形最左侧的端点(然后删除他左侧的点,否则可能会错,我就因为这个问题错了好几发,虽然不知道什么情况,删了保证对),然后以这个点做极角排序,接下来dp[i][j]表示多边形上上个极角序最大的点是i,内部包含了j个点的最小周长,然后枚举下一个点就可以做到n^3转移(三角形内点的个原创 2016-10-08 11:08:31 · 1411 阅读 · 0 评论 -
【SGU】110. Dungeon 计算几何——线对球的反射射线
传送门:【SGU】110. Dungeon原创 2014-11-05 22:40:33 · 993 阅读 · 0 评论 -
【HDU】5033 Building 单调栈
传送门:【HDU】5033 Building原创 2014-09-23 10:28:11 · 746 阅读 · 0 评论 -
【HDU】4946 Area of Mushroom 凸包
传送门:【HDU】4946 Area of Mushroom原创 2014-08-15 09:40:18 · 868 阅读 · 2 评论 -
【ZOJ】3806 Incircle and Circumcircle
传送门:【ZOJ】3806 Incircle and Circumcircle原创 2014-08-24 17:39:09 · 897 阅读 · 4 评论 -
【HDU】5020 Revenge of Collinearity 极角排序
传送门:【HDU】5020 Revenge of Collinearity原创 2014-09-19 22:20:29 · 970 阅读 · 0 评论 -
【codeforces】678 F. Lena and Queries【线段树维护凸壳】
题目链接:【codeforces】678 F. Lena and Queries#include <bits/stdc++.h>using namespace std ;typedef long long LL ;typedef pair < int , int > pii ;#define getid( l , r ) l + r | ( l != r )const int MAXN = 30原创 2016-12-06 19:57:42 · 1534 阅读 · 0 评论