码迷,mamicode.com
首页 >  
搜索关键字:maximum sum subarray    ( 25087个结果
python 求10亿以内和987654互质正整数的和
加群看见的但是计算好慢,谁有更优的算法,麻烦说一下。factor=[]for x in xrange(1, 987654//2+1): if 987654%x==0: factor.append(x)sum=0for y in xrange(1, 1000000000): ...
分类:编程语言   时间:2014-05-06 00:37:50    阅读次数:851
Leetcode | Sum Root to Leaf Numbers
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which...
分类:其他好文   时间:2014-05-05 23:55:36    阅读次数:407
Add Binary
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".思路:一个二进制字符串相加;首先从字符串的末尾开始,先二进制字符转化为数字,然后再相加;然后将...
分类:其他好文   时间:2014-05-05 23:10:15    阅读次数:319
【LeetCode OJ】Sum Root to Leaf Numbers
# Definition for a binary tree node# class TreeNode:# def __init__(self, x):# self.val = x# self.left = None# self.right ...
分类:其他好文   时间:2014-05-05 22:56:23    阅读次数:419
Leetcode: Maximum Depth of Binary Tree
1 /** 2 * Definition for binary tree 3 * public class TreeNode { 4 * int val; 5 * TreeNode left; 6 * TreeNode right; 7 * TreeNo...
分类:其他好文   时间:2014-05-05 22:44:13    阅读次数:328
数学公式再次测试
\begin{align*}\sum_{n=0}^{\infty}\frac{(n!)^{2}2^{n+1}}{(2n+1)!}&=\sum_{n=0}^{\infty}\int_{0}^{1}t^{n}(1-t)^{n}2^{n+1}dt\\&=2\int_{0}^{1}\sum_{0}^{\in...
分类:其他好文   时间:2014-05-04 12:28:56    阅读次数:284
[leetcode] Best Time to Buy and Sell Stock III
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a...
分类:其他好文   时间:2014-05-03 23:21:20    阅读次数:292
【级数】 求和
证明 \[\sum_{n=0}^{\infty}\frac{(n!)^{2}2^{n+1}}{(2n+1)!}=\pi\]分析:这道题初看具有难度运用幂级数恐难解决,由分子分母的特性易想到 $\Gamma$函数然后利用$\Gamma$函数与$\beta$函数的关系即可。Proof:\begin{al...
分类:其他好文   时间:2014-05-03 22:29:12    阅读次数:296
[ACM] hdu 3415 Max Sum of Max-K-sub-sequence (单调队列)
Max Sum of Max-K-sub-sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5673    Accepted Submission(s): 2049 Problem Description...
分类:其他好文   时间:2014-05-03 16:30:10    阅读次数:412
ORA-01925:maximum of 80 enabled roles exceeded
ORA-01925:maximum of 80 enabled roles exceeded...
分类:其他好文   时间:2014-05-03 15:55:33    阅读次数:296
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!