码迷,mamicode.com
首页 >  
搜索关键字:points    ( 1654个结果
POJ 1987 BZOJ 3365 Distance Statistics 树的分治(点分治)
题目大意:(同poj1741,刷一赠一系列) CODE: #include #include #include #include #define MAX 20010 #define INF 0x3f3f3f3f using namespace std; int points,edges,k; int head[MAX],total; int next[MAX << 1...
分类:其他好文   时间:2014-10-11 19:19:56    阅读次数:174
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.Brute Force的做法,N个点两两可以构成N(N-1)/2条线,我们可以找这N(N-1)/2条线...
分类:其他好文   时间:2014-10-10 10:39:54    阅读次数:167
HTML5 内联 SVG
SVG 指可伸缩矢量图形 (Scalable Vector Graphics)SVG 用于定义用于网络的基于矢量的图形SVG 使用 XML 格式定义图形SVG 图像在放大或改变尺寸的情况下其图形质量不会有损失 在 HTML5 中,您能够将 SVG 元素直接嵌入 HTML 页面中: <polygon points="100,10 40,180 190,60 10,60 ...
分类:Web程序   时间:2014-10-09 21:08:28    阅读次数:199
判断点是否任意多边形内的2种方法
导入判断触摸点是否在一个多边形的内部方法1、数学方法这个方法的好处是任意平台都可以使用,不仅现于Android算法:求解通过该点的水平线与多边形各边的交点,单边交点为奇数,则成立ok我们其实就是需要看这个点的单边射线与多边形的交点,代码实现如下:public boolean isInPolygon(Point point, Point[] points, int n) { int nCross...
分类:其他好文   时间:2014-10-09 17:47:27    阅读次数:160
[LeetCode] Max Points on a Line
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line. 1 #include 2 #include 3 #include 4 #include 5 #i...
分类:其他好文   时间:2014-10-07 16:09:53    阅读次数:188
Max Points on a Line
计算所有的slope 放到一个arraylist中. 特殊情况是the same as point . 遍历所有./** * Definition for a point. * struct Point { * int x; * int y; * Point() : x(0)...
分类:其他好文   时间:2014-10-07 05:19:42    阅读次数:284
基础 sorted array查找最多的一个值.
int pp = 1; //number of points in the same line of the point i if (k.size()==0){pp=0;} for (int jj=1;jjres){res=pp...
分类:其他好文   时间:2014-10-07 05:19:32    阅读次数:187
acdream1197 Points In Cuboid
题目链接:http://acdream.info/problem?pid=1197题意:给出一些点。每次给出一个长方体,问在长方体中的点的个数。思路:kd-tree。const int N=111111;struct node{ int x[3]; int L,R;};node a[N];int r...
分类:其他好文   时间:2014-10-06 00:02:19    阅读次数:247
UVa 10295 - Hay Points
题目:有很多工人,对应一个能力描述表,每种能力有一个权值,求每个工人的能力值。 分析:字符串,hash表,字典树。利用散列表或者字典树存储对应的单词和权值,查询即可。 说明:注意初始化,计算完将数据清除。 #include #include #include #include using namespace std; //hash_define typedef struct hn...
分类:其他好文   时间:2014-10-05 10:51:38    阅读次数:163
HDU - 5017 Ellipsoid(模拟退火法)
Problem Description Given a 3-dimension ellipsoid(椭球面) your task is to find the minimal distance between the original point (0,0,0) and points on the ellipsoid. The distance between two points...
分类:其他好文   时间:2014-10-04 18:05:26    阅读次数:242
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!