泛型接口指定实参 public sealed class Point { public Int32 x; public Int32 y; public override string ToString() { ...
分类:
其他好文 时间:
2014-07-09 23:26:48
阅读次数:
208
Redis 持久化:提供了多种不同级别的持久化方式:一种是RDB,另一种是AOF.RDB 持久化可以在指定的时间间隔内生成数据集的时间点快照(point-in-time snapshot)。AOF 持久化记录服务器执行的所有写操作命令,并在服务器启动时,通过重新执行这些命令来还原数据集。 AOF 文...
分类:
数据库 时间:
2014-07-06 19:45:26
阅读次数:
248
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ...
分类:
其他好文 时间:
2014-07-06 17:44:30
阅读次数:
181
double dis(Point a){ return a.x*a.x+a.y*a.y;}struct Circle Circumcircle(){ Circle tmp; double a,b,c,c1,c2; double xa,ya,xb,yb,xc,yc; a ...
分类:
其他好文 时间:
2014-07-06 17:39:21
阅读次数:
153
2014.07.04 23:57简介: 这本教材中提到了一个概念,叫关节点(articulation point)。如果从某个无向图里去掉某个顶点以及这个顶点所有的边,如果此时图中连通分量的个数增加了,那么定义这个顶点为“关节点”。更通俗地解释,可以说如果拿走这个顶点,这幅图就破成了好几块,因此这....
分类:
编程语言 时间:
2014-07-06 16:28:12
阅读次数:
287
链表的归并排序
超时的代码
class Solution:
def merge(self, head1, head2):
if head1 == None:
return head2
if head2 == None:
return head1
# head1 and head2 point to the same link list
if head1 == he...
分类:
编程语言 时间:
2014-07-06 09:09:51
阅读次数:
275
题意:给你四个点,找出一个点到四个点的距离最小
四边形的费马点:凸边形是两对角线的交点,凹边形式凹点。
PS:
三角形的费马点:
1.若三角形3个内角均小于120°,那么3条距离连线正好三等分费马点所在的周角,即该点所对三角形三边的张角相等,均为120°。所以三角形的费马点也称为三角形的等角中心。
2.若三角形有一内角大于等于120°,则此钝角的顶点就是距离和最小的点...
分类:
其他好文 时间:
2014-07-05 11:00:52
阅读次数:
229
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
分类:
其他好文 时间:
2014-07-03 23:46:37
阅读次数:
389
Delphi中WebBrowser控件打开部分网站报"Invalid floating point operation”解决EmbeddedWBWebBrowserDelphi最近用EmbeddedWB控件做浏览器相关应用的时候,发现有些网页只要一打开就一定会蹦出一个“Invalid floatin...
分类:
Web程序 时间:
2014-07-03 19:21:23
阅读次数:
234
UVA 11768 - Lattice Point or Not
题目链接
题意:给定两个点,构成一条线段,这些点都是十分位形式的,求落在这个直线上的正数点。
思路:先把直线表达成a x + b y = c的形式,a,b, c都化为整数表示,然后利用扩展gcd求出x和y的通解,然后已知min(x1, x2)
值得注意的是,直线为平行坐标系的情况,要特殊判断一下
代码...
分类:
其他好文 时间:
2014-07-03 16:28:47
阅读次数:
169