#include #include void main(){ while(1) { char input1[1000] = {'\0'}; char input2[1000] = {'\0'}; int count = 0; sca...
分类:
其他好文 时间:
2015-07-10 23:36:14
阅读次数:
140
int InversePairs(int* data, int length)
{
if (data == NULL || length
return 0;
int *copy = new int[length];
for (int i = 0; i
copy[i] = data[i];
int count = InversePairsCore(data, copy, 0, le...
分类:
编程语言 时间:
2015-07-10 19:17:44
阅读次数:
113
想到的是两种方法,第一种是 ``` $array = array(1,3,10,4,6,9,7,5,8); $new_arr = $tmp = array(); $count = count($array); for($i=0; $i<$count; $i++) { $key = 0; for($j = 0; $j < $count; $j++) { if(isse...
分类:
编程语言 时间:
2015-07-10 15:31:59
阅读次数:
148
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw...
分类:
其他好文 时间:
2015-07-10 15:04:57
阅读次数:
111
select * from hengtu_demandpush a where (a.did,a.mid) in (select did,mid from hengtu_demandpush group by did,mid having count(*) > 1) 或select * from h...
分类:
数据库 时间:
2015-07-10 13:04:13
阅读次数:
156
操作对象
直接改变容器的内容 将原容器的内容复制一份,修改其副本,然后传回该副本
功能:
非可变序列算法 指不直接修改其所操作的容器内容的算法
计数算法 count、count_if 搜索算法 search、find、find_if、find_first_of、… 比较算法 equal、mismatch、lexicographical...
分类:
编程语言 时间:
2015-07-10 09:30:48
阅读次数:
112
题目大意: 有n次操作,每次都是对一根线中的一段区间进行染色(颜色并不相同),有时候后面的颜色有可能覆盖前面的颜色,问最后涂完色,能看到的颜色有几种,每种颜色有几部分?解题思路: 这个题目建树的时候有些不同,并不是以点为对象,而是以区间为对象,很明显是对线段树的区间进行操作,更新的时候要以区间为.....
分类:
其他好文 时间:
2015-07-10 00:22:46
阅读次数:
128
For a given chemical formula represented by a string, count the number of atoms of each element contained in the molecule and return an object. 1 wate...
分类:
其他好文 时间:
2015-07-10 00:11:30
阅读次数:
152
Count and Say
The count-and-say sequence is the sequence of integers beginning as follows:
1, 11, 21, 1211, 111221, ...
1 is read off as "one 1" or 11.
11 is read off as "two 1s" or 21.
21 i...
分类:
其他好文 时间:
2015-07-09 22:45:31
阅读次数:
140
题目:
Given a complete binary tree, count the number of nodes.
Definition of a complete binary tree from Wikipedia:
In a complete binary tree every level, except possibly the last, is completel...
分类:
编程语言 时间:
2015-07-09 22:42:58
阅读次数:
266