class Solution {public: int maxSubArray(int A[], int n) { int cur_sum = 0; int max_sum = INT_MIN; for (int i=0; i max_...
分类:
其他好文 时间:
2014-07-19 15:18:15
阅读次数:
160
说起backlog, 都会想起socket编程中的listen backlog 参数,而这个backlog 是linux内核中处理的backlog么?
int listen(int sockfd, int backlog)man listen
可以看到关于listen 的解释
The backlog argument defines the maximum length to wh...
分类:
系统相关 时间:
2014-07-19 02:44:36
阅读次数:
534
Another recursion-style problem.1. Each count of sub-solution with a certain root should contribute to final count2. With a certain root, the num of l...
分类:
其他好文 时间:
2014-07-18 18:18:01
阅读次数:
187
GoldenGate进程 abend,报错为OGG-00868 ORA-02396: Exceeded Maximum Idle Time, Please Connect Again...
分类:
其他好文 时间:
2014-07-18 14:03:15
阅读次数:
273
感觉动态规划很模糊,怎么办呢???
狂刷题吧!!!!!!!!!!!!!!!!!!!!!!!!!
1.POJ 2479 Maximum sum
首刷水题!!!!
双向统计最大和。
AC代码如下:
#include
#include
#include
#define inf -1000000000
using namespace std;
int main()
{
int ...
分类:
其他好文 时间:
2014-07-18 12:37:39
阅读次数:
228
浅谈尾递归 2013-02-10 14:12:57 在《数据结构与算法分析:C描述》(Data Structures and Algorithm Analysis In C)的第三章中,以打印链表为例,提到了尾递归(tail recursion)并指出了尾递归是使用递归极其不当的例子,它指出虽然编译...
分类:
其他好文 时间:
2014-07-18 08:11:35
阅读次数:
162
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2014-07-17 23:27:12
阅读次数:
216
题目;uva10827-Maximum sum on a torus(矩阵最大和的变形)
题目大意:就是uva108的变形,矩阵能够连通,就是可以从后面连到前面。这里把矩阵复制三遍,然后重新生成一个大的矩阵,就可以解决联通的问题。再枚举矩阵的起点和终点所有情况,保留最大值就可以了。
例如:1 2 3
2 3 4
新的矩阵: 1 2 3 1 2 3
...
分类:
其他好文 时间:
2014-07-17 19:36:02
阅读次数:
201
题目;uva108 Maximum sum(矩阵最大和)
题目大意:给出一个n*n的矩阵,求这个矩阵的最大和。这个矩阵不是连通的,只能在这个矩阵内找子矩阵,不能越过边界。
解题思路:枚举起点和终点,每个起点和终点就是一个矩阵,每个矩阵都算矩阵和,然后保留最大值。每个矩阵的值只要横着相加一遍,再竖着相加一遍,就可以得出以这个矩阵为起点的所有的子矩阵的和(这里可以直接要这个矩阵的和...
分类:
其他好文 时间:
2014-07-17 19:26:05
阅读次数:
194
rman 备份时报:ORA-02396: exceeded maximum idle time...
分类:
其他好文 时间:
2014-07-17 15:12:46
阅读次数:
146