码迷,mamicode.com
首页 >  
搜索关键字:points    ( 1654个结果
LeetCode 149. Max Points on a Line
今天手残,碰了一道leetcode HARD难度题目,果然来着不善,花了不少时间,题目很简单,求平面内一些离散点中,最大共线点的数量。最直接的思路就是通过斜率判断,但是考虑到斜率很可能是小数,比较小数的大小会有误差,因此我们不做除法,取横纵坐标差值的最大公约数,然后横纵坐标分别除以最大公约数即可,这 ...
分类:其他好文   时间:2018-04-03 23:44:22    阅读次数:266
Linux绘图函数
gdk_draw_line () gdk_draw_rectangle () gdk_draw_arc () gdk_draw_polygon () gdk_draw_string () gdk_draw_text () gdk_draw_pixmap () gdk_draw_bitmap () g ...
分类:系统相关   时间:2018-04-02 01:07:12    阅读次数:601
poj1860(Bellman—fold)
题目连接:http://poj.org/problem?id=1860 Description Several currency exchange points are working in our city. Let us suppose that each point specializes i ...
分类:其他好文   时间:2018-03-30 19:56:51    阅读次数:148
Atcoder 091/092 C 2D Plane 2N Points[扫描线]
昨晚打了第一场atcoder...这题卡了1h...今天听课的时候听到了一个极相似的题。。。 题意:给出2n个点的坐标(x,y) 前n个是红点,剩下是蓝点,当一个红点的横纵坐标都小于一个蓝点的时候,他们可以匹配,求最大的匹配对数 按照横坐标排序,排序后从右往左扫描,发现蓝点将其纵坐标存入set中(因 ...
分类:其他好文   时间:2018-03-18 16:26:45    阅读次数:262
走楼梯2
Description  One steps through integer points of the straight line. The length of a step must be nonnegative and can be by one bigger than, equal ...
分类:其他好文   时间:2018-03-17 23:24:34    阅读次数:212
dhcp 过程
The Question SuperUser reader Sagnik Sarkar wants to know what the difference between 127.0.0.1 and 0.0.0.0 is: I understand that 127.0.0.1 points to  ...
分类:其他好文   时间:2018-03-14 16:55:58    阅读次数:180
【Mark】四叉树与八叉树
写在前面,四叉树和八叉树就是2D和3D的“二分法”,搜索过程与二叉树搜索也类似,二叉树中是将数组sort后存入二叉树中,从而在查找中实现时间复杂度为log2;四叉树/八叉树是按平面/空间范围划分有序node,将所有points(坐标已知)放入所属node中,实现所有points的sort,进而在搜索 ...
分类:其他好文   时间:2018-03-10 00:20:15    阅读次数:313
poj1958——Strange Towers of Hanoi
The teacher points to the blackboard (Fig. 4) and says: "So here is the problem: There are three towers: A, B and C. There are n disks. The number n i ...
分类:其他好文   时间:2018-03-06 17:14:32    阅读次数:198
2018.03.04 晚上Atcoder比赛
C - March Time limit : 2sec / Memory limit : 256MB Score : 300 points Problem Statement There are N people. The name of the i-th person is Si. We woul ...
分类:其他好文   时间:2018-03-04 23:00:15    阅读次数:246
poj3090 Visible Lattice Points
答案就是 $3+2 \times \sum_{i=2}^n \varphi(i)$,记得特判 cpp include include using namespace std; int n, T, phi[1005]; void shai(){ for(int i=1; i T; for(int i= ...
分类:其他好文   时间:2018-03-04 22:56:47    阅读次数:211
1654条   上一页 1 ... 57 58 59 60 61 ... 166 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!