问题描述:
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:
Y...
分类:
其他好文 时间:
2014-12-30 22:08:07
阅读次数:
178
Best Time to Buy and Sell Stock IISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the ...
分类:
其他好文 时间:
2014-12-30 21:52:44
阅读次数:
198
/*----------------------------index.html------------------------------------*/ Shopping list What to buy Don't forgrt to buy this stuff. A tin of b...
分类:
其他好文 时间:
2014-12-29 22:56:25
阅读次数:
288
1)---使用带参数的游标;declareCURSORstock_cur(symbol_inVARCHAR2)ISSELECT*FROMrate_combine_nrnrWHEREnr.combine_no=symbol_in;stock_infostock_cur%ROWTYPE;beginOPENstock_cur(‘G600000001‘);--打开游标;loopFETCHstock_curINTOstock_info;--从游标中取值exitwhenstock_c..
分类:
数据库 时间:
2014-12-29 15:38:55
阅读次数:
220
Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie...
分类:
其他好文 时间:
2014-12-28 18:12:08
阅读次数:
170
Description: Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue… The Lunar New .....
分类:
其他好文 时间:
2014-12-28 00:25:48
阅读次数:
147
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),...
分类:
其他好文 时间:
2014-12-26 16:41:15
阅读次数:
136
题目:
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the ...
分类:
编程语言 时间:
2014-12-25 16:25:25
阅读次数:
146
题意:
给n个数,求它的最长下降子序列长度和数量。
分析:
dp,计数的时候要避免重复计数。
代码:
//poj 1952
//sep9
#include
using namespace std;
const int maxN=5012;
int a[maxN];
int dp[maxN];
int num[maxN];
int main()
{
int i,j,n,ans=0,an...
分类:
其他好文 时间:
2014-12-24 14:46:55
阅读次数:
182
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-12-24 11:20:46
阅读次数:
184