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 complet...
分类:
其他好文 时间:
2015-03-17 17:47:37
阅读次数:
140
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...
分类:
其他好文 时间:
2015-03-17 17:30:40
阅读次数:
159
1.header 里面的 meta标签name="viewport" 定义布局width=device-wdith 设置的宽度initial-scale=1.0 确保加载时候比例为1:1user-scalable=no 禁用缩放功能maximum-scale=1.0 确保禁用缩放功能后,用户能够滚动...
分类:
其他好文 时间:
2015-03-16 22:58:40
阅读次数:
200
题意:一个筛子有m个面,然后扔n次,求最大值的期望;思路:最大值为1 有1种,2有2n-1种, 3有3n -2n 种 所以为m的时有mn -(m-1)n 种,所以分别求每一种的概率,然后乘以这个值求和就可以。 1 #include 2 #include 3 #include 4 #inclu...
分类:
其他好文 时间:
2015-03-16 22:32:19
阅读次数:
102
Given a sequence of K integers { N1, N2, ..., NK}. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj} where 1 5 #include 6 #include 7 #...
分类:
其他好文 时间:
2015-03-16 19:10:05
阅读次数:
109
Longest Common Subsequence in disguise.Python impl. has TLE in one case. And C++ is fine.#include #include #include #include #include #include #includ...
分类:
其他好文 时间:
2015-03-16 16:05:11
阅读次数:
204
ORA-00020:maximumnumberofprocesses(150)exceededkill掉相关进程或重启oracle,sqlplus"/assysdba"SQL>showparameterprocesses;NAMETYPEVALUE-----------------------------------------------------------------------------aq_tm_processesinteger1db_writer_processesint..
分类:
其他好文 时间:
2015-03-16 13:04:57
阅读次数:
151
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...
分类:
其他好文 时间:
2015-03-16 00:54:36
阅读次数:
160
题目大意:给出n个数,从中选取k个,使得乘积最大,并且尽量使和最大分析:首先按照数的绝对值大小排序。然后就要分三大类情况讨论:(1)前k个中选到0:如果选到0的话,乘积一定是0,所以尽量选大的数,让和变大。(2)前k个中选到负数的个数为偶数:这样的话直接输出答案(一定为最优解)(3)前k个中选到的负...
分类:
其他好文 时间:
2015-03-15 16:30:30
阅读次数:
103
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,...
分类:
其他好文 时间:
2015-03-15 13:42:18
阅读次数:
118