一个数的序列bi,当b1 a[j]。只有这样才能保证序列是上升的。对比最长上升子序列的长度这类问题,我们可以发现,其实这两个DP问题思想是完全一样的,他们的代码也可以说是一样的,代码的不同之处只是问的不同而在求值处不同而已? 代码如下: #include using namespace st...
分类:
其他好文 时间:
2014-12-14 19:55:15
阅读次数:
146
我们知道,所有整数都是通过二进制编码的形式存储在内存中的。比如32位的整数,最高位是符号位,0代表正数,1代表负数。那么怎么才能够将整数的二进制编码形式打印出来呢?Integer类提供了一个公有静态方法toBinaryString能够达到这一目的。我们来看看这段源码:public static St...
分类:
其他好文 时间:
2014-12-14 11:51:18
阅读次数:
286
今天做了一道MinStack的题,深深的感到自己C++还完全没有学好!!!#include #include using std::stack;class MinStack {public: stack st; stack stm; void push(int x) { ...
分类:
其他好文 时间:
2014-12-13 16:30:27
阅读次数:
174
转载网址:http://blog.sina.com.cn/s/blog_7dbd9c0e01018e4l.html最近搞了块ST的Cortex-M4处理器,然后下了本文档。分享一下。针对目前进入大众视野的M0、M3、M4做了如下简单对比,内容来自ARM等官网,这里仅仅是整理了下,看起来更直观点,呵呵...
分类:
其他好文 时间:
2014-12-12 18:31:19
阅读次数:
140
每个人安装的CentOS的并不是一模一样的,比如我就是全部安装的,自然Apache和http都是安装了,那怎么知道是否安装过了呢?
使用命令rpm就知道了
#rpm -qa | grep apache
如果出来了关于Apache的信息,说明安装好了
#rmp -qa | grep http
对于http服务来说
查看是否启动了httpd服务
#service httpd st...
分类:
Web程序 时间:
2014-12-12 11:45:03
阅读次数:
173
1 #include 2 #include 3 #include 4 using namespace std; 5 struct node 6 { 7 int st; 8 int ed; 9 };10 node a[110];11 int n,ans;12 bool cmp(nod...
分类:
其他好文 时间:
2014-12-11 23:56:33
阅读次数:
179
1 #include 2 #include 3 #include 4 using namespace std; 5 struct node 6 { 7 int st,ed; 8 }; 9 node a[10010];10 11 int n,L,ans,pre;12 13 bool cmp(...
分类:
其他好文 时间:
2014-12-11 23:38:53
阅读次数:
250
$("#startupStatus").find("option").map(function(i) { if ($('#st-status').val() == $(this).val()){ $(this).attr("selected", true); ...
分类:
其他好文 时间:
2014-12-11 22:18:26
阅读次数:
225
标题:Same Tree通过率:42%难度简单Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are st...
分类:
其他好文 时间:
2014-12-11 20:48:26
阅读次数:
164