加群看见的但是计算好慢,谁有更优的算法,麻烦说一下。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
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
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
# 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
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
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
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...
分类:
其他好文 时间:
2014-05-03 15:55:33
阅读次数:
296