题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2141题目大意:查找是否又满足条件的x值。这里简单介绍一个小算法,二分查找。 1 /* 2 3 x^2+6*x-7==y 4 输入y 求x 精确度为10^-5 5 0= 9 #includ...
分类:
其他好文 时间:
2014-08-03 12:40:35
阅读次数:
175
1 find find({查询条件},{"key":1,"email":1})? 后面表示返回哪些键 2 可用的比较操作符 $lt , $lte,$gt,$gte 比如db.users.find({"age":{"$gte":18,"$lte":30}}) 3不等于 find(...{"key":{"$ne":"value"}} 4 ...
分类:
数据库 时间:
2014-08-03 10:23:35
阅读次数:
312
总体介绍
Android Camera框架从整体上看是一个client/service架构。有两个进程,一个是client进程,可以看成AP端
,主要包括Java代码和一些native层的c/c++代码;另一个是service进程,属于服务端,是native c/c++代码,
主要负责和linux kernel中的camera driver交互,搜集linux kernel中...
分类:
移动开发 时间:
2014-08-03 10:20:45
阅读次数:
472
# include
# include
# include
using namespace std;
int fa[10010];
struct node
{
int p;
int d;
};
struct node a[10010];
bool cmp(node a1,node a2)//利润从大到小
{
return a1.p>a2.p;
}
int find(int x)
{...
分类:
其他好文 时间:
2014-08-03 10:16:25
阅读次数:
208
题目:Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to ....
分类:
编程语言 时间:
2014-08-03 05:24:06
阅读次数:
304
题目:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the....
分类:
编程语言 时间:
2014-08-03 04:40:04
阅读次数:
351
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
/**
* Definition for binary tree
...
分类:
其他好文 时间:
2014-08-02 23:32:04
阅读次数:
232
序号任务命令组合1删除0字节文件find . -type f -size 0 -exec rm -rf {} \;find . type f -size 0 -delete2查看进程,按内存从大到小排列ps -e -o “%C : %p : %z : %a”|sort -k5 -nr3按cpu利用率...
分类:
系统相关 时间:
2014-08-02 23:17:54
阅读次数:
341
二叉树的深度的概念最值得注意的地方,在于 到"叶子"节点的距离。一般来说,如果直接说“深度”,都是指最大深度,即最远叶子的距离。这里放两道例题,最小深度和最大深度。1. 二叉树的最小深度Given a binary tree, find its minimum depth.The minimum d...
分类:
其他好文 时间:
2014-08-02 23:17:44
阅读次数:
243
题目来源:POJ 2356 Find a multiple
题意:n个数 选出任意个数 使得这些数的和是n的倍数
思路:肯定有解 并且解是连续的一段数
证明:
假设有m个数 a1,a2,a3...am s1 s2 s3...sm为前缀和 s1 = a1 s2 = a1+a2 s3 = a1+a2+a3... sm = a1+a2+a3+...+am
1.如果某个前缀和si%m =...
分类:
其他好文 时间:
2014-08-02 21:01:54
阅读次数:
312