码迷,mamicode.com
首页 >  
搜索关键字:points    ( 1654个结果
hdu 4717 The Moving Points(三分)
http://acm.hdu.edu.cn/showproblem.php?pid=4717 大致题意:给出每个点的坐标以及每个点移动的速度和方向。问在那一时刻点集中最远的距离在所有时刻的最远距离中最小。 比赛时一直以为是计算几何,和线段相交什么的有关。赛后队友说这是道三分,仔细想了想确实是三分,试着画画图发现它是一个凸性函数,存在一个最短距离。然后三分时间就可以了。 ...
分类:其他好文   时间:2014-07-08 16:05:41    阅读次数:234
[leetcode] Max Points on a Line
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
分类:其他好文   时间:2014-07-08 00:41:49    阅读次数:235
【LeetCode】Max Points on a Line
Max Points on a LineGivennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.点和方向确定一条直线。需要两重循环,第一重循环遍历起始点a,第二重...
分类:其他好文   时间:2014-07-06 18:21:01    阅读次数:175
poj1329Circle Through Three Points(三角形外接圆)
链接套模板不知道有没有x,y=0情况,不过这种情况都按+号输出的。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 using namespac....
分类:其他好文   时间:2014-07-06 17:38:49    阅读次数:166
hdu4717The Moving Points(三分)
链接需要特判一下n=1的时候精度调太低会超时 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 using namespace std;11 #d....
分类:其他好文   时间:2014-07-06 17:30:13    阅读次数:247
【leetcode】Max Points on a Line (python)
给定一个点,除该点之外的其他所有点中,与该点的关系要么是共线,要么就是共点,也就是两点重合。 共线有三种情况:水平共线,垂直共线,倾斜的共线。合并下这三种情况就是斜率存在的共线和斜率不存在的共线。 那么我们的任务就是针对每个点,找出与其共线的这些情况中,共线最多的点的个数。 注意:最终的结果别忘了加上共点的个数。 class Solution: def maxPoints(self, p...
分类:编程语言   时间:2014-07-05 23:52:29    阅读次数:402
poj 3090 Visible Lattice Points 法雷级数||打表
由于图像关于对角线对称,所以我们只看下三角区域。将x轴看做分母,被圈的点看成分子 依次是{1/2},{1/3,1/2},{1/4,3/4},{1/5,2/5,3/5,4/5} 写成前缀和的形式就是 {1/2},{1/2,1/3,2/3},{1/2,1/3,1/3,1/4,3/4},{1/2,1/3,1/3,1/4,3/4,1/5,2/5,3/5,4/5} 发现,这就是一个法雷级数,即第k项增...
分类:其他好文   时间:2014-07-02 11:41:03    阅读次数:137
UVA 12714 Two Points Revisited(简单数学题)
UVA 12714 Two Points Revisited(简单数学题)...
分类:其他好文   时间:2014-07-02 06:54:53    阅读次数:154
LeetCode: Max Points on a Line [149]
【题目】 Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 【题意】 给定一堆点,要求找出一条之前上的最大点数 【思路】 没什么好的方法,从每个点P出发,遍历所有的情况 从每个点P出发,斜率相同的点即为统一之前上的点 注意两种特殊情况: 1. 两个点重合(即为同一个点) ...
分类:其他好文   时间:2014-07-02 06:52:06    阅读次数:171
纯css做三角形形状
1 /* create an arrow that points up */ 2 div.arrow-up { 3 width:0px; 4 height:0px; 5 border-left:5px solid transparent; /* left arrow slant */...
分类:Web程序   时间:2014-07-01 16:53:30    阅读次数:183
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!