题目大意:给树上n个点染k个黑色,求黑点之间、白点之间距离和的最大值。思路:感觉是树形dp,但是觉得转移的时候很难受。后来听到fye大神的背包,就开始想背包方向想,发现多重背包可以解决。我们dfs一个孩子之后就可以进行背包了。但是赋初值的时候,要给f[u][0]和f[u][1]都赋为0,因为对于u这...
分类:
其他好文 时间:
2015-05-22 08:12:44
阅读次数:
117
Java8内置了强大的多核支持,我们在处理数据的时候,如果不充分利用多核,都好不意思跟老板打招呼。 我们经常会使用AtomicInteger来做计数器,如下所示: List<String>?words?=?Files.readAllLines(Paths.get(...
分类:
其他好文 时间:
2015-05-22 07:09:50
阅读次数:
111
Installing the Vagrant VM for Full Stack Foundations1. you need to install Git, VirtualBox, Vagrant2. in git, run the command, create a folder called ...
分类:
其他好文 时间:
2015-05-22 07:07:28
阅读次数:
104
https://github.com/lanyj189/nicehairhttps://github.com/eltld/nicehairhttps://github.com/pepoc/CustomViewGatherhttps://github.com/yueyueniao2012/Expand...
分类:
其他好文 时间:
2015-05-22 07:04:45
阅读次数:
127
参考博客: http://www.2cto.com/os/201212/176520.html http://os.51cto.com/art/201111/304611.htm http://www.cnblogs.com/xiaogangqq123/archive/2011/03/02/1969...
分类:
其他好文 时间:
2015-05-22 07:05:13
阅读次数:
152
https://github.com/cundong/MemoryMonitorhttps://github.com/eltld/MemoryMonitor
分类:
其他好文 时间:
2015-05-22 07:05:35
阅读次数:
86
知识点 使对象之间达到松耦合的效果。 观察者模式定义了对象之间一对多的关系。主题用一个共同的接口来更新观察者。 观察者和被观察者之间通过松耦合的方式结合,被观察者不用理会观察者的实现细节,只需要观察者实现了观察接口(即所谓的注册)。示例代码 public interface Subje...
分类:
其他好文 时间:
2015-05-22 07:05:52
阅读次数:
116
比较难的一道题,但是还是能看懂public class Solution { public List findRepeatedDnaSequences(String s) { // ref http://blog.csdn.net/haiyi727/article/details...
分类:
其他好文 时间:
2015-05-22 07:03:52
阅读次数:
126
编号快捷键功能1Esc切换到代码编辑状态2F1查看帮助(选中某一类或函数,按下F1,出现帮助文档)3F2在光标选中对象的声明和定义之间切换(和Ctrl+鼠标左键一样的效果,选中某一类或函数,按下F2,迅速定位到该类或函数声明的地方或被调用的地方)4F3查找下一个5F4头文件和源文件之间切换6F5开始...
分类:
其他好文 时间:
2015-05-22 07:05:38
阅读次数:
127
public class Solution { public ArrayList grayCode(int n) { if(n==0){ ArrayList res = new ArrayList(); res.add(0); ...
分类:
其他好文 时间:
2015-05-22 07:03:59
阅读次数:
144
Alice and BobTime Limit: 20 SecMemory Limit: 256 MB题目连接http://acm.hdu.edu.cn/showproblem.php?pid=4111DescriptionAlice and Bob are very smart guys and ...
分类:
其他好文 时间:
2015-05-22 07:03:06
阅读次数:
182
七、ISCSI服务器安装配置由于测试环境中没有专业存储来做相关演示,在此通过部署一台WindowsServer2012R2来安装ISCSI服务,来模拟专业存储。安装ISCSI服务登录ISCSI服务器,在Powershell中执行:Add-WindowsFeatureiSCSITarget-VSS-VDS,FS-iSCSITarget-Server,Multipath-IO,如..
分类:
其他好文 时间:
2015-05-22 02:09:47
阅读次数:
394
SortColorsTotalAccepted:51484TotalSubmissions:157920MySubmissionsQuestionSolutionGivenanarraywithnobjectscoloredred,whiteorblue,sortthemsothatobjectsofthesamecolorareadjacent,withthecolorsintheorderred,whiteandblue.Here,wewillusetheintegers0,1,and2toreprese..
分类:
其他好文 时间:
2015-05-22 02:09:40
阅读次数:
114
介绍下centos6上,在命令行中实现无线网络的连接,当然这需要无线网卡的支持,这里就假设驱动已经安装好了。[root@baby-centOS~]#ifconfigwlan0
wlan0Linkencap:EthernetHWaddrAC:72:89:04:EA:84
UPBROADCASTMULTICASTMTU:1500Metric:1
RXpackets:0errors:0dropped:0overruns:0..
分类:
其他好文 时间:
2015-05-22 02:08:36
阅读次数:
176
MergeIntervalsTotalAccepted:34742TotalSubmissions:155846MySubmissionsQuestionSolutionGivenacollectionofintervals,mergealloverlappingintervals.Forexample,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].publicclassSolution{TreeNoderoot;List<Inte..
分类:
其他好文 时间:
2015-05-22 02:05:43
阅读次数:
117
时隔5年,我准备再来认真的学习网络。不抛弃,不放弃。加油加油。当年的不坚持,导致现在的生活状况,不是我预想的样子。我需要赶紧补救。在这里再重新记下我的学习过程。
分类:
其他好文 时间:
2015-05-22 02:05:00
阅读次数:
111