给一个矩阵,依然是求满足条件的最大子矩阵不过题目中说任意两列可以交换,这是对题目的简化求出h数组以后直接排序,然后找出(col-j)*h[j]的最大值即可(这里的j是从0开始)因为排序会影响到h数组下一行的求解,所以将h数组中的元素复制到temp数组中去,再排序 1 //#define LOCAL ...
分类:
移动开发 时间:
2014-07-30 00:40:22
阅读次数:
232
[LeetCode]Binary Tree Level Order Traversal II...
分类:
其他好文 时间:
2014-07-29 14:42:48
阅读次数:
145
HDU 2830 Matrix Swapping II (最大完全子矩阵之可移动列)...
分类:
移动开发 时间:
2014-07-29 14:36:08
阅读次数:
236
其实每一行的结果是二项式展开的系数,但是考虑到当给定的参数过大的时候,在求组合的过程中会出现溢出(中间过程要用到乘法),但是这样的算法的时间复杂度是O(N),所以在参数不太大的时候,还是不错的。
这里用迭代的方法来求,当然复杂度就高了,是O(N^2),这里主要说下迭代时候的技巧,即在一个列表(数组)里进行迭代,实现如此的操作,要求在求下一行的时候,要从后往前进行,若是从前向后,就把后面要用的变量...
分类:
编程语言 时间:
2014-07-29 14:35:28
阅读次数:
452
微软近期Open的职位:Position: SDE II or Senior SDE -- Mobile Products Android/WPContact Person: Winnie Wei (wiwe@microsoft.com)Location: BeijingRoles & Respon...
分类:
移动开发 时间:
2014-07-29 14:09:48
阅读次数:
257
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ...
分类:
其他好文 时间:
2014-07-29 13:43:58
阅读次数:
223
原创文章,链接:
(I) connection.py
负责根据setting中配置实例化redis连接。被dupefilter和scheduler调用,总之涉及到redis存取的都要使用到这个模块。
(II) dupefilter.py
负责执行requst的去重,实现的很有技巧性,使用redis的set数据结构。但是注意scheduler并不使用其中用于在这个模块中实现的dupe...
分类:
其他好文 时间:
2014-07-28 16:10:23
阅读次数:
395
题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your ma....
分类:
编程语言 时间:
2014-07-28 11:34:40
阅读次数:
210
Palindrome Partitioning II
Total Accepted: 11791 Total
Submissions: 66110My Submissions
Given a string s, partition s such that every substring of the partition is a palindrome.
Return t...
分类:
其他好文 时间:
2014-07-27 23:59:19
阅读次数:
592
解题报告
题目传送门
题意:
n只地鼠,m个洞,老鹰的到达地面的时间s,地鼠的移动速度v,求多少只地鼠会被老鹰吃了。
思路:
地鼠和洞看成两集合,建立二分图。只有当地鼠到洞的时间少于老鹰到地面的时间才连边。
#include
#include
#include
#include
using namespace std;
int n,m,s,v,mmap[500][500],v...
分类:
其他好文 时间:
2014-07-27 11:23:02
阅读次数:
240