称号: Maple trees Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 177 Accepted Submission(s): 63   Problem Description There are a lot of trees in HDU. Kiki want to surround all the trees with the m…
题目: Wall Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 119 Accepted Submission(s): 47   Problem Description Once upon a time there was a greedy King who ordered his chief Architect to build a wa…
题目: 最大三角形 Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 121 Accepted Submission(s): 61   Problem Description 老师在计算几何这门课上给Eddy布置了一道题目.题目是这种:给定二维的平面上n个不同的点,要求在这些点里寻找三个点.使他们构成的三角形拥有的面积最大.Eddy对这道题目百…
Maple trees Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 222 Accepted Submission(s): 79   Problem Description There are a lot of trees in HDU. Kiki want to surround all the trees with the minim…
HDU 1394 Minimum Inversion Number(线段树求最小逆序数对) ACM 题目地址:HDU 1394 Minimum Inversion Number 题意:  给一个序列由[1,N]构成.能够通过旋转把第一个移动到最后一个.  问旋转后最小的逆序数对. 分析:  注意,序列是由[1,N]构成的,我们模拟下旋转,总的逆序数对会有规律的变化.  求出初始的逆序数对再循环一遍即可了. 至于求逆序数对,我曾经用归并排序解过这道题:点这里.  只是因为数据范围是5000.所以全…
Surround the Trees:http://acm.hdu.edu.cn/showproblem.php?pid=1392 题意: 在给定点中找到凸包,计算这个凸包的周长. 思路: 这道题找出凸包上的点后,s数组中就是按顺序的点,累加一下距离就是周长了. #include <algorithm> #include <iterator> #include <iostream> #include <cstring> #include <cstdli…
题目链接:HDU 1392 Problem Description There are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he must know the minimal required length of the rope. However, he does not know how to calculate it. Can you…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1392 这里介绍一种求凸包的算法:Graham.(相对于其它人的解释可能会有一些出入,但大体都属于这个算法的思想,同样可以解决凸包问题) 相对于包裹法的n*m时间,Graham算法在时间上有很大的提升,只要n*log(n)时间就够了.它的基本思想如下: 1.首先,把所有的点按照y最小优先,其次x小的优先排序 2.维护一个栈,用向量的叉积来判断新插入的点跟栈顶的点哪个在外围,如果栈顶的点在当前插入的点的…
Surround the Trees Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6728    Accepted Submission(s): 2556 Problem Description There are a lot of trees in an area. A peasant wants to buy a rope to…
Surround the Trees Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7043    Accepted Submission(s): 2688 Problem Description There are a lot of trees in an area. A peasant wants to buy a rope to…
Surround the Trees Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Problem Description There are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he must know the mi…
增量法的最小包围圈算法,不会…… #include <cstdio> #include <cstring> #include <iostream> #include <cmath> #include <algorithm> using namespace std; const double EPS = 1e-10; inline int sgn(double x) { return (x > EPS) - (x < -EPS);} s…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4946 题目大意:在一个平面上有n个点p1,p2,p3,p4....pn,每个点可以以v的速度在平面上移动,对于平面上任意一点,假设有唯一一个点pi从初始的位置到这个点的时间最短,那么就说平面上的这个点是属于pi这点管辖的.现在要你判断pi管辖的范围是不是无穷大的,如果是输出1,否则输出0: 首先大致的方法就是构造凸包,不过要遵循一下前提: 一定是只考虑速度最大的点,然后,如果两个点所在的位置与速度都…
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1392 题意:求凸包,不知道的百度 题解:模版题 #include<cstdio> #include<cmath> #include<algorithm> using namespace std; /* * 求凸包,Graham算法 * 点的编号0~n-1 * 返回凸包结果Stack[0~top-1]为凸包的编号 */ ; ; const double PI = acos(-…
Surround the Trees 此题讨论区里大喊有坑,原谅我没有仔细读题还跳过了坑点. 题意:平面上有n棵树,选一些树用绳子围成一个包围圈,使得所有的树都在这个圈内. 思路:简单凸包入门题,凸包裸模板.在做这个题前建议先去学学:叉积,极角排序,三角形有向面积. 贴上代码以后再复习. struct node { double x,y; } a[N],p[N]; int n,tot;//总点数和凸包上的点数: double dis(node a,node b)//两点间距离 { return…
Problem Description Josh Lyman is a gifted painter. One of his great works is a glass painting. He creates some well-designed lines on one side of a thick and polygonal glass, and renders it by some special dyes. The most fantastic thing is that it c…
第一次做凸包,这道题要特殊考虑下,n=2时的情况,要除以二才行. 我是从最左边的点出发,每次取斜率最大的点,一直到最右边的点. 然后从最左边的点出发,每次取斜率最低的点,一直到最右边的点. #include<stdio.h> #include<math.h> #include<algorithm> #include<string.h> using namespace std; const double eps=1e-9; struct node { doub…
Eat the Trees Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5079    Accepted Submission(s): 2628 Problem Description Most of us know that in the game called DotA(Defense of the Ancient), Pudge…
Surround the Trees Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7203    Accepted Submission(s): 2752 Problem Description There are a lot of trees in an area. A peasant wants to buy a rope to…
Wall Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2848    Accepted Submission(s): 811 Problem Description Once upon a time there was a greedy King who ordered his chief Architect to build a w…
由于题目要求,首先维护出一个凸包,然后在凸包上寻找点对关系,用rel[i][j]表示i点和j点之间是否可以连线,又由于维护出来的凸包上的点的个数不多,可以直接枚举点对并枚举所有圆,判断两点直线和圆是否相离,由于维护出来的凸包已经按照逆时针排序,又要满足两两线段不相交,最后就变成了求最大不相交线段个数,但是可以包含(2-5线段可以包含3-4,但是不能选择3-6),然后考虑区间DP去枚举所有情况,设dp[s][t]表示起点在s终点在t之间的区间内的最大不相交线段个数,枚举终点和起点,再枚举起点到终点…
题目: ACboy needs your help again! Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 73 Accepted Submission(s): 57   Problem Description ACboy was kidnapped!! he miss his mother very much and is very…
题目: Strategic Game Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 110 Accepted Submission(s): 75   Problem Description Bob enjoys playing computer games, especially strategic games, but sometim…
题目: Lifting the Stone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 168 Accepted Submission(s): 98   Problem Description There are many secret openings in the floor which are covered by a big he…
称号: You can Solve a Geometry Problem too Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 145 Accepted Submission(s): 100   Problem Description Many geometry(几何)problems were designed in the ACM/IC…
称号: Card Game Cheater Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 103 Accepted Submission(s): 74   Problem Description Adam and Eve play a card game using a regular deck of 52 cards. The rules…
称号: Cat vs. Dog Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 219 Accepted Submission(s): 86   Problem Description The latest reality show has hit the TV: ``Cat vs. Dog''. In this show, a bunch…
称号: Girls and Boys Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 189 Accepted Submission(s): 127   Problem Description the second year of the university somebody started a study on the romanti…
题目: 士兵队列训练问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 56 Accepted Submission(s): 37   Problem Description 某部队进行新兵队列训练,将新兵从一開始按顺序依次编号,并排成一行横队.训练的规则例如以下:从头開始一至二报数.凡报到二的出列,剩下的向小序号方向靠拢,再从头開始进行一…
section 1 不解释~ section 2 1.2.1 a+b coming #include<stdio.h> long long z,x,y; int main( ) { while( scanf( "%I64x%I64x",&x,&y ) != EOF ) { z = x + y; ) printf( "-" ), z = -z; printf( "%d\n",z ); } ; } 1.2.2 Climbi…