码迷,mamicode.com
首页 >  
搜索关键字:choose the best rout    ( 3445个结果
Problem Best Time to Buy and Sell Stock III
Problem Description: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...
分类:其他好文   时间:2014-07-07 16:05:24    阅读次数:229
Problem Best Time to Buy and Sell Stock 11
Problem Description: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...
分类:其他好文   时间:2014-07-07 15:24:41    阅读次数:212
Problem Best Time to Buy and Sell Stock I
Problem Description: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...
分类:其他好文   时间:2014-07-07 15:24:05    阅读次数:206
最简单的RASPBERRY PI wifi配置
Setting up Wifi with the Command LineSIMON MONKThis tutorial works best if your router is broadcasting the SSID. Make sure you have "Broadcast SSID" s...
分类:Web程序   时间:2014-07-07 08:56:24    阅读次数:288
【LeetCode】Best Time to Buy and Sell Stock
题目 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-07-03 17:51:01    阅读次数:235
UVA 624 CD
CD  You have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is on CDs. You need to have it on tapes so the problem to solve is: you have a tape N min...
分类:其他好文   时间:2014-07-03 15:34:36    阅读次数:176
Mybatis 动态sql
choose, when, otherwise有时我们不想应用所有的条件, 相反我们想选择很多情况下的一种。 Java 中的 switch 和 语句相似,MyBatis 提供 choose 元素。我们使用上面的示例,但是现在我们来搜索当 title 提供时仅有 title 条件,当 author 提...
分类:数据库   时间:2014-07-03 09:23:49    阅读次数:223
mybatis动态SQl语句
choose语句 where语句
分类:数据库   时间:2014-07-01 17:28:30    阅读次数:215
Choose the best route(迪杰斯特拉)
通过做这题,发现了自己的问题很大,做题不是贴代码,而是要了解思想;这题考的是有一个起点的集合,求起点集合到一个终点的最短距离,本来想用Floy的但一看map[1000][1000]超时,有向图,逆序建邻接矩阵,这样就成了一个终点到所有点的最短路了。 1 #include 2 #include ...
分类:其他好文   时间:2014-06-29 18:40:11    阅读次数:170
leetcode——Best Time to Buy and Sell Stock III 买卖股票最大收益(AC)
需要注意的是,可以操作两次买卖,但是第二次买入必须在第一次卖出之后才能操作。所以思路就是先正序使用贪心计算每一天之前买入卖出可能达到的最大收益,拿数组记录下来。再逆序计算每一天对应的之后买入卖出可能达到的最大收益,拿数组记录下来。然后将两个数组中每一天对应的两种情况可以实现的收益之和,得到最大值即为可以实现的最大收益。code如下:...
分类:其他好文   时间:2014-06-27 23:44:49    阅读次数:247
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!