题目链接题意:分析: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define LL long long 9 using namespace std;10 11 int ...
分类:
其他好文 时间:
2014-08-02 12:43:43
阅读次数:
217
题目:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1...
分类:
编程语言 时间:
2014-08-02 09:50:13
阅读次数:
232
Distinct SubsequencesGiven a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is...
分类:
其他好文 时间:
2014-08-02 04:17:48
阅读次数:
177
MTU是Maximum Transmission Unit的缩写,意为最大传输单元,通俗的理解就是在网络上传送的最大数据包,单位是字节。 以太网对数据帧的长度都有一个限制,其最大值为1500,这个特性被称作MTU,不同类型的网络大多数都有一个上限。如果IP层有一个IP包要传,而且数据的长度比链路.....
分类:
其他好文 时间:
2014-08-02 01:32:22
阅读次数:
1806
题意:从一个n*n的矩阵中找出和最大的子矩阵
思路:最大连续和的求解。我们可以将二维的转化为一维进行计算。sum[i][j]表示以(1, 1)和(i, j)为对角的矩阵的和。之后只要逐个枚举每个可能出现的值,保存最大值即可。
#include
#include
#include
#include
using namespace std;
const int INF ...
分类:
其他好文 时间:
2014-08-01 23:16:52
阅读次数:
283
题目地址:HDU 1839
我去。。原来这题这么简单。。。网络流中这种二分建图的方式做了一大堆了。。这种题还能难倒我吗。。。白天一直没怎么看懂题,对题意懵懵懂懂的。。。晚上好好看了看题,这不就是网络流中练的最多的那种二分建图模型吗。。。。只是把网络流算法改成最短路就行了。。但是两个地方手残了没能在实验室当场A掉。。sad。。。
这题就是二分最小容量,对满足容量的加边,对时间求最短路。如果最短时...
分类:
其他好文 时间:
2014-08-01 23:07:42
阅读次数:
283
问题:二叉树的最深深度class Solution{public: void dfs(TreeNode *root,int step,int &MAX) { if(root==NULL) { if(MAXleft,step+1); ...
分类:
其他好文 时间:
2014-08-01 22:49:02
阅读次数:
202
Greedy, Greedy, Greedy.. It is all about maximum interval update.One trick is, we start looping over each element from the one nearest to end to farth...
分类:
其他好文 时间:
2014-08-01 13:32:21
阅读次数:
283
Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there...
分类:
其他好文 时间:
2014-08-01 04:47:25
阅读次数:
243
Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root ...
分类:
其他好文 时间:
2014-07-31 23:19:10
阅读次数:
259