A dynamic programming problem. This post shares a nice solution and explanation. Well, this article is simply an organization of this post and its fir...
分类:
其他好文 时间:
2015-09-05 13:45:08
阅读次数:
177
Given a sorted array A with length m, we can split it into two part:{ A[0], A[1], ... , A[i - 1] } | { A[i], A[i + 1], ... , A[m - 1] }All elements in...
分类:
其他好文 时间:
2015-09-05 11:12:33
阅读次数:
190
This link shares a nice solution with explanation using DP. You will be clear of the algorithm after running it on its suggested example:matrix = [[0,...
分类:
其他好文 时间:
2015-09-02 13:14:48
阅读次数:
157
Well, this problem is not that easy. First you may need some clarifications about the problem itself. If you do, you may refer to this link for a nice...
分类:
其他好文 时间:
2015-08-25 23:16:23
阅读次数:
326
传送门:点击打开链接
题意:告诉你矩阵大小是n*m,要求矩阵中不能有2*2的白色子矩阵或者黑色子矩阵,最后种类数模P
思路:如果不是大数,这道题还是非常有意思的。。对于专门卡C++的题目也是醉了...因为n太大了,而m最大也只有5,很明显是大数上的快速矩阵幂。
问题是如何构造出矩阵出来,之前做过骨牌的题目,就是利用DFS来构造的,感觉这道题在思路上是一样的,同样也是利用DFS先构造出矩阵
...
分类:
其他好文 时间:
2015-08-25 19:35:35
阅读次数:
129
(官网简介)What is slimScroll?slimScroll is a small (4.6KB) jQuery plugin that transforms any div into a scrollable area with a nice scrollbar.slimScroll d...
分类:
Web程序 时间:
2015-08-21 21:15:14
阅读次数:
166
taskset -c 9,10 bash domain_analysis.sh && /home/work/odp/php/bin/php hourly_localdns_hijack.phpnice -n 19bash domain_analysis.sh && /home/work/odp/ph...
分类:
其他好文 时间:
2015-08-20 20:42:58
阅读次数:
165
The idea and code is just taken from this link. There is a nice explanation to the code on the answer byBrianLuong1337. 1 class Solution { 2 public: 3...
分类:
其他好文 时间:
2015-08-20 06:42:03
阅读次数:
102
在Qt程序调试的时候,经常需要打印一些变量,那么我们就需要使用qDebug()函数,这种函数有两种使用方法,如下所示:QString s = "Jack";qDebug() << "My name is " << s << ", nice to meet you!" << endl;qDebug("...
分类:
其他好文 时间:
2015-08-19 12:44:39
阅读次数:
173
题意:给一个字符串,含有大写字母或者问号’?’。一个字符串被定义为ugly,则能在字符串中找到三个连续的元音字符或者五个非元音字符;一个字符串被定义为nice,则它不是ugly的。现在问,可否改将所有’?’变成字符,使得字符串成为nice或ugly的,如果都可以,输出”47”,如果只能一个,输出”UGLY”或”NICE”。解法:对于是否可为ugly的情况,很简单,将每个’?’都变为元音,看是否存在3...
分类:
其他好文 时间:
2015-08-19 07:09:13
阅读次数:
175