Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the a...
分类:
其他好文 时间:
2015-07-30 18:36:07
阅读次数:
107
1.Sliding Window Maximum 1 class Solution { 2 public: 3 vector maxSlidingWindow(vector &nums, int k) { 4 deque dq; 5 vector res; 6...
分类:
其他好文 时间:
2015-07-30 18:27:08
阅读次数:
96
地址:http://blog.csdn.net/z287438743z/article/details/8132806RMQ(Range Minimum/Maximum Query)问题就是求区间最值问题。这里要仔细分析的是ST算法,它可以做到O(nlogn)的预处理,O(1)回答每个询问。网上看了...
分类:
编程语言 时间:
2015-07-30 11:10:53
阅读次数:
155
Given a sequence of integers S = {S1, S2, . . . , Sn}, you should determine what is the value of the maximum positive product involving consecutive te...
分类:
其他好文 时间:
2015-07-30 10:59:44
阅读次数:
146
LeetCode 5_Longest Palindromic Substring
题目描述:
Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and there exists one unique ...
分类:
其他好文 时间:
2015-07-29 15:57:00
阅读次数:
131
【053-Maximum Subarray(最大子数组和)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the ar...
分类:
编程语言 时间:
2015-07-29 07:55:12
阅读次数:
131
LeetCode Maximum Product SubarrayDescriptionGiven a sequence of integers S = {S1, S2, . . . , Sn}, you should determine what is the value o...
分类:
其他好文 时间:
2015-07-28 22:54:07
阅读次数:
195
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x...
分类:
其他好文 时间:
2015-07-28 17:59:29
阅读次数:
96
Problem Definition:Given a string S, find the longest palindromic substring in S.You may assume that the maximum length of S is 1000, and there exists...
分类:
其他好文 时间:
2015-07-28 17:22:12
阅读次数:
111
题目描述:
求连续子序列,使乘积最大
解题思路:暴力枚举,枚举所有可能的序列
#include
#define MAXN 20
using namespace std;
int d[MAXN];
int main()
{
int t=0;
int n;
while(scanf("%d",&n)==1)
{
t++;
...
分类:
其他好文 时间:
2015-07-28 10:47:40
阅读次数:
111