题意:给你一颗树,每个节点上面都有一个值,每一次可以进行一次操作,一次操作包含以下两步1)选择一颗包含 1 节点的子树。2)对这颗子树进行加一或者减一的操作。问你最后使得这颗树 所有点上面的值全部变为 0 的操作数为多少。解题思路:dp[i][0/1] 表示 到了这个点 加 和 减的最大值。解题代码...
分类:
其他好文 时间:
2015-03-13 00:10:55
阅读次数:
207
stringkjid="0001";if(Cache[kjid]==null){S_spacesp=Lib.S_spaceLib.SelectOne(kjid);Cache.Add(kjid,sp,null,DateTime.Now.AddHours(3),TimeSpan.Zero,CacheItemPriority.Normal,null);}S_spacespW=(S_space)Cache[kjid];Cache.Remove(kjid);S_spacespp=Lib.S_spaceLib.Selec..
分类:
系统相关 时间:
2015-03-11 15:00:27
阅读次数:
184
-q 参数,本意是 Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. 中文....
分类:
其他好文 时间:
2015-03-11 10:42:40
阅读次数:
2067
uva 10718 Bit Mask
In bit-wise expression, mask is a common term. You can get a certain bit-pattern using mask. For example, if you want to make first 4 bits of a 32-bit number zero, you can us...
分类:
其他好文 时间:
2015-03-08 14:21:22
阅读次数:
186
问题描述:
给定四个长度为n的数组A, B, C, D。 要求从每个数组中取一个数, 这样得到四个数, 并且这四个数的之和为0. 求这样组合的个数。
限制条件: 1
例如, 输入:
6
-45 -41 -36 -36 26 -32
22 -27 53 30 -38 -54
42 56 -37 -75 -10 -6
-16 30 77 -46 62 45格式是: 数组大小
...
分类:
其他好文 时间:
2015-03-08 10:32:45
阅读次数:
133
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
ARPCHECK=no /sbin/ifup eth1 2> /dev/null
Stdout from the command:
Device eth1 does not seem to be present, delaying initialization.
St...
分类:
Windows程序 时间:
2015-03-07 20:05:43
阅读次数:
1240
评价下面代码片断,找出其中的错误。unsigned int zero = 0;unsigned int compzero = 0xFFFF; // complement of zero析:该题主要考察处理器字长问题。对于一个int型且不是16位的处理器来说,上面的代码是不正确的。正确的反码编写为:....
分类:
其他好文 时间:
2015-03-05 16:30:48
阅读次数:
104
Given an array S of n integers, are there elements a, b, c in S such
that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
Elements in a triplet (a,b,c) ...
分类:
其他好文 时间:
2015-03-03 23:42:48
阅读次数:
191
最近了解了一下linux的环回文件系统.着实有趣啊.
所谓环回文件系统,就是它不同于常规意义的文件系统,常规的文件系统建立于设备上,而它则是建立在文件中.
无论是那种文件系统,都需要通过挂载才可以使用.
下面了解一下环回文件系统.
首先我们应该建立一个空的文件,随便你取什么名字都行.
dd if=/dev/zero of=image.img bs=1G count=1 #可能有别的方...
分类:
系统相关 时间:
2015-03-02 23:54:12
阅读次数:
239
mysql - Event Scheduler: No data - zero rows fetched, selected, or processed,mysql警告提示解决!
分类:
数据库 时间:
2015-03-01 23:37:35
阅读次数:
222