题目: 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 co...
分类:
其他好文 时间:
2014-05-28 22:37:18
阅读次数:
327
最近要毕业了,有半年没做比赛了.这次参加百度之星的初赛娱乐一下.现在写一下解题报告.还是先看看四道题的类型吧1.Scenic
Popularity 暴力 复杂度O( 100 * 100 * 10000 ) 或者O( T * K * R) 线段树2.Chess DP
复杂度 O(n^2)3.Best ...
分类:
其他好文 时间:
2014-05-28 13:19:16
阅读次数:
261
题目链接题意: find the maximum positive difference
between the price on the ith day and the jth day附上代码: 1 class Solution { 2
public: 3 int maxProfit(ve...
分类:
其他好文 时间:
2014-05-28 03:49:45
阅读次数:
307
一个系列三道题,我都不会做,google之答案。过了两道,第三道看不懂,放置,稍后继续。一、Best
Time to Buy and Sell Stock
I题目:一个数组表示一支股票的价格变换。要求只买卖一次,获得最大收益。思路:一开始我认为是寻找最大、最小值,但由于最大值不一定总是出现在最小值的...
分类:
其他好文 时间:
2014-05-28 01:21:52
阅读次数:
262
题目: 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 transac...
分类:
其他好文 时间:
2014-05-28 00:55:20
阅读次数:
288
题目: 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 co...
分类:
其他好文 时间:
2014-05-28 00:53:26
阅读次数:
338
Best FinancingTime Limit: 20000/10000 MS
(Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s):
120Accepted Submission(s): 24Probl...
分类:
其他好文 时间:
2014-05-27 17:52:10
阅读次数:
223
題目鏈接題意 : 將幾個片段如圖所示方法縮成一個序列,求出最短這個序列。思路 :
其實我也不知道怎麼做。。。。。看網上都用了DP。。。。。但是我不會。。。。。這個DP不錯,還有用KMP+状压DP做的 1 //1699 2 #include 3
#include 4 #include 5 #in...
分类:
其他好文 时间:
2014-05-27 16:06:19
阅读次数:
282
次代码是一个T端的脚本。通过击杀的角色数量等级来获得不同的头衔。下面的Ranks就是击杀的数量。根据你的击杀数量,你可以到NPC那里去领取对应的头衔等级#include
"ScriptPCH.h" enum Ranks{ RANK_1 = 50, RANK_2 = 100...
分类:
其他好文 时间:
2014-05-26 17:26:25
阅读次数:
283
Best FinancingTime Limit: 20000/10000 MS
(Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s):
29Accepted Submission(s): 3Problem...
分类:
其他好文 时间:
2014-05-25 20:13:10
阅读次数:
211