Given a sequence of integers S = fS1; S2; : : : ; Sng, you should determine what is the value of the
maximum positive product involving consecutive terms of S. If you cannot nd a positive sequence,
...
分类:
其他好文 时间:
2015-07-27 21:03:46
阅读次数:
112
两个暴力题。。
题目传送:11827 Maximum GCD
AC代码:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define LL l...
分类:
其他好文 时间:
2015-07-27 16:24:02
阅读次数:
66
问题描述Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longes...
分类:
其他好文 时间:
2015-07-27 13:02:11
阅读次数:
98
那是因为nginx限制了上传文件大小,必须指定下。在nginx.conf的http{}中增加client_max_body_size 20m;增加上传大小限制同时要修改php.ini中相关参数[Resource Limits]max_execution_time = 800; Maximum exe...
分类:
Web程序 时间:
2015-07-27 12:58:03
阅读次数:
140
题目:
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
/ 2 3
Ret...
分类:
编程语言 时间:
2015-07-26 22:39:28
阅读次数:
189
/* Write a program to print all input lines that are longer than 80 characters. */
#include
#define MAXLINE 1000 /* maximum input line size */
#define LONGLINE 80
int getline(char line[], in...
分类:
其他好文 时间:
2015-07-26 19:15:48
阅读次数:
104
题目:Given an arraynums, there is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbe...
题目:
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most k transactions.
Note:
Y...
分类:
编程语言 时间:
2015-07-26 15:56:12
阅读次数:
142
题目:
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
...
分类:
编程语言 时间:
2015-07-26 15:53:12
阅读次数:
155
题意:给定一个长度为N的数组,求两个连续的子序列,使得两个连续子序列的和最大。
分析:乍一看,跟最大连续和有点类似,但是,又有区别,因为对于这个题,考虑第i项两个连续子序列的最大和,不能仅仅由前i-1项递推得出,第i项两个连续子序列的最大和,与前i项和i以后的之间是存在关系的,因此这个题目是一个双向dp。
假如给定的序列为a0, a1, a2, a3, a4, ...... ,an,那么,对于...
分类:
其他好文 时间:
2015-07-26 11:15:59
阅读次数:
144