给出一些正方形,让你求这些正方形顶点之间的最大距离的平方。
//返回点集直径的平方
int diameter2(vector & points) {
vector p = ConvexHull(points);
int n = p.size();
if(n==1) return 0;
if(n==2) return Dist2(p[0], p[1]...
分类:
其他好文 时间:
2014-08-20 02:42:15
阅读次数:
165
Problem Description
Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars tha...
分类:
其他好文 时间:
2014-08-18 23:37:23
阅读次数:
306
Intersecting LinesTime Limit:1000MSMemory Limit:10000KTotal Submissions:10967Accepted:4930DescriptionWe all know that a pair of distinct points on a p...
分类:
其他好文 时间:
2014-08-18 20:11:22
阅读次数:
244
1 package com.lw.leet3; 2 3 import java.util.HashMap; 4 import java.util.Iterator; 5 import java.util.Map; 6 import java.util.Map.Entry; 7 ...
分类:
其他好文 时间:
2014-08-17 19:45:52
阅读次数:
259
UVA 10869 - Brownie Points II
题目链接
题意:平面上n个点,两个人,第一个人先选一条经过点的垂直x轴的线,然后另一个人在这条线上穿过的点选一点作垂直该直线的线,然后划分出4个象限,第一个人得到分数为1,3象限,第二个人为二四象限,问第一个个人按最优取法,能得到最小分数的最大值,和这个值下另一个人的得分可能情况
思路:树状数组,可以枚举一点,如果能求出...
分类:
其他好文 时间:
2014-08-16 23:51:11
阅读次数:
531
题意:一条线上面有n个目标,每个目标有三个值,表示不取相邻的,取一个相邻的,取两个相邻的值,问你怎么选才能最大解题思路:每个点有个5种情况dp,dp状态转移方程在程序里,5种情况分别是 1) 不取 2) 取自己 3) 取自己和左边,4)取自己和右边,5)取自己和左右边解题代码: 1 Name: 12...
分类:
其他好文 时间:
2014-08-16 23:49:31
阅读次数:
272
In the model layer, the Model class is the base class while the ModelBase class is metaclass. They are the entry points of the whole model layer...
分类:
其他好文 时间:
2014-08-16 22:32:31
阅读次数:
282
链接:http://poj.org/problem?id=2079TriangleTime Limit:3000MSMemory Limit:30000KTotal Submissions:8173Accepted:2423DescriptionGiven n distinct points on ...
分类:
其他好文 时间:
2014-08-16 17:07:40
阅读次数:
284
Intersecting LinesTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 10942Accepted: 4917DescriptionWe all know that a pair of distinct points o....
分类:
其他好文 时间:
2014-08-14 23:27:38
阅读次数:
248
DescriptionYou are given n points and two circles. The radius of the circle will be dynamical. Your task is to find how many points are under both cir...
分类:
其他好文 时间:
2014-08-12 02:57:33
阅读次数:
276