这里只能使用1到9九个数字,并且使用的数字的个数有限制。方法类似 1 public class Solution { 2 public void dp(List> list, List listone, int tmpsum, int start, int k, int target){ 3...
分类:
其他好文 时间:
2015-08-12 23:00:18
阅读次数:
173
由于每个元素我可以出现的次数没有限制,我们可以在使用某个元素的时候进行计算一下最多的个数,进行枚举。同样的道理,在每一层递归只考虑一个元素,并且在当前sum大于目标sum的时候进行剪枝。 1 import java.util.*; 2 3 public class Solution { 4 ...
分类:
其他好文 时间:
2015-08-12 21:35:08
阅读次数:
88
实际上这里的道理和Combination Sum是一样的,只是对于每个元素的次数我们不需要在每次递归的时候进行计算上限,因为题目限制了最多的出现次数。其他类似。 1 import java.util.*; 2 3 public class Solution { 4 private void...
分类:
其他好文 时间:
2015-08-12 21:33:47
阅读次数:
97
Feel GoodTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluBill is developing a new mathematical theory for human emotions. His recen...
分类:
其他好文 时间:
2015-08-11 06:50:46
阅读次数:
134
PrefixIn the GRE tunnels post I’ve explained how overlay networks are used for connectivity and tenant isolation. In the l2pop post, or layer 2 popula...
分类:
其他好文 时间:
2015-08-10 13:34:04
阅读次数:
155
这是DFS系列的第二篇割边的概念Ingraph theory, abridge,isthmus,cut-edge, orcut arcis anedgeof agraphwhose deletion increases its number ofconnected components.Equiva...
分类:
其他好文 时间:
2015-08-08 17:59:08
阅读次数:
211
[LeetCode] 039. Combination Sum (Medium) (C++)...
分类:
编程语言 时间:
2015-08-08 09:14:11
阅读次数:
132
[leetcode] 040. Combination Sum II (Medium) (C++)...
分类:
编程语言 时间:
2015-08-08 09:10:53
阅读次数:
111
这种题目,一般要用到递归或回溯两种方法,用回溯法试过,代码规模总是越来越庞大,但最终还是没能通过所有的测试用例,^-^!
用递归的话这题目看着要容易理解的多,每递归一次target要变为target=target-candidates[i],并将开始index赋值为i,当target==0时,条件满足,如果target<candidates[i],这轮循环结束,方法出栈,当前的i++,继续循环。
总之,用递归来解决问题,难想到,也不太容易被看懂。...
分类:
其他好文 时间:
2015-08-07 11:10:37
阅读次数:
97
1、GRSEC and PaX
加固主机系统。
2、Use Docker in combination with AppArmor/SELinux/TOMOYO
使用强制访问控制(mandatory access control (MAC))对Docker中使用的各种资源根据业务场景的具体分析进行资源的访问的控制。
3、Limit traffic with ip...
分类:
其他好文 时间:
2015-08-07 01:49:35
阅读次数:
203