题目描述:
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has t...
分类:
其他好文 时间:
2014-11-03 22:35:55
阅读次数:
168
#include
#include
#include
using namespace std;
const int MAX=1000001;
bool nums[MAX];
int indexes[MAX];
void eraosthenes()
{
int n=sqrt((double)MAX);
for(int i=2; i<=n; i++)
{
...
分类:
其他好文 时间:
2014-11-02 16:31:15
阅读次数:
167
# include
# include
# include
# include
using namespace std;
__int64 a[100010],l[100010],r[100010];///l[i]左边连续大于等于a[i]的下标,r[i]右边连续大于等于a[i]的下标,所以对于a[i]的矩形面积为(l[i]-r[i]+1)*a[i];
int main()
{
__i...
分类:
其他好文 时间:
2014-11-02 10:51:51
阅读次数:
174
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?2,1,?3,4,?1,2,1,...
分类:
其他好文 时间:
2014-11-02 07:07:06
阅读次数:
167
题目:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?2,1,?3,4,?1,2...
分类:
其他好文 时间:
2014-11-02 01:57:41
阅读次数:
192
LeetCode Maximum Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [?2,1,?3,4,?1,2,1,?5,4],the contiguous su...
分类:
其他好文 时间:
2014-10-30 07:12:42
阅读次数:
151
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?2,1,?3,4,?1,2,1,...
分类:
编程语言 时间:
2014-10-29 12:31:32
阅读次数:
188
题目描述:
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4...
分类:
其他好文 时间:
2014-10-29 09:15:57
阅读次数:
139
题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=25&page=show_problem&problem=2299题意:给你一个有向图,求一个点集合的最大大小,使得此点集合中对于任意点对...
分类:
其他好文 时间:
2014-10-28 21:33:13
阅读次数:
449
这回要求的是第k小的元素,参考了ljl大神的模板,orz 1 //insert 插入 2 //remove 删除 3 //_find 查找 4 //kth 返回root为根的树中第k小的元素 5 //treap插入、删除、查询时间复杂度均为O(logn) 6 #include 7 #...
分类:
其他好文 时间:
2014-10-28 19:55:27
阅读次数:
283