只看某一个象限 能看到的数 == 一个 象限*4+4
能看到的树既距离原点的距离 gcd(x,y)==1
a 和 b 一大一小 预处理2000以内的phi函数,枚举小的一条边
从1...a 与 a gcd 为 1 的数的个数就是 phi(a)
从 1+a ... 2*a 与 a gcd 为 1 的数的个数 因为 GCD(i,a) = GCD(i+a,a) 所以还是 phi(...
分类:
其他好文 时间:
2015-05-12 00:12:12
阅读次数:
129
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the ne...
分类:
其他好文 时间:
2015-05-12 00:03:17
阅读次数:
122
代码:/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : va...
分类:
其他好文 时间:
2015-05-12 00:00:59
阅读次数:
140
PHP使用BLOB存取图片信息实例
BLOB介绍
mysql BLOB类型
创建数据库
PHP文件转二进制代码
HTML代码
读取二进制图片
php完整代码
HTML代码PHP使用BLOB存取图片信息实例BLOB介绍
BLOB (binary large object),二进制大对象,是一个可以存储二进制文件的容器。在计算机中,BLOB常常是数据库中用来存储二进制文件的字段类型。BLOB是一个大...
分类:
Web程序 时间:
2015-05-11 20:09:16
阅读次数:
224
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree should look like:
1
...
分类:
其他好文 时间:
2015-05-11 14:54:35
阅读次数:
134
谈谈计算机和网络常用进位制:二进制(Binary)、十进制(Decimal)和十六进制(Hexadecimal)二进制、十进制和十六进制,这几个个进制里算十进制我们最熟悉了,从学前教育或者幼儿园最先接触的数学到再我们日常生活几乎天天和他打交道的下面这十个数字。但是,话又说回来,你..
分类:
其他好文 时间:
2015-05-11 11:03:02
阅读次数:
428
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).
For example, the 32-bit integer ’11' has binary representation 00000000000000000000000000001011, so the function should return 3....
分类:
其他好文 时间:
2015-05-11 10:53:29
阅读次数:
135
题目描述:
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [3,2,1].
Note: Recu...
分类:
其他好文 时间:
2015-05-11 09:10:00
阅读次数:
104
For example:
Given the below binary tree and sum
= 22,
5
/ 4 8
/ / 11 13 4
/ \ / 7 2 5 1
re...
分类:
其他好文 时间:
2015-05-11 09:08:25
阅读次数:
120
题目描述
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next righ...
分类:
其他好文 时间:
2015-05-11 09:03:22
阅读次数:
100