- 博客(3)
- 收藏
- 关注
原创 LeetCode : Best Time to Buy and Sell Stock III & IV
首先让我们来考虑一下III的DP做法class Solution { public: int maxProfit(vector& prices) { int buy1 = INT_MIN,buy2 = INT_MIN; int sell1 = 0, sell2 = 0; for(int i=0;i<prices.size();i++){
2015-05-01 17:29:44
381
转载 网络通信的大端模式和小段模式
一、大端模式和小端模式的起源 关于大端小端名词的由来,有一个有趣的故事,来自于Jonathan Swift的《格利佛游记》:Lilliput和Blefuscu这两个强国在过去的36个月中一直在苦战。战争的原因:大家都知道,吃鸡蛋的时候,原始的方法是打破鸡蛋较大的一端,可以那时的皇帝的祖父由于小时侯吃鸡蛋,按这种方法把手指弄破了,因此他的父亲,就下令,命令所有的子民吃鸡蛋的时候,必
2015-04-18 19:01:29
3597
转载 LeetCode:Maximum Product Subarray
原文转自 http://www.cnblogs.com/bakari/p/4007368.html 题目:Maximum Product Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest product. For exa
2015-04-13 16:50:27
275
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅