1.题目描述 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 tran ...
分类:
其他好文 时间:
2018-02-11 21:21:12
阅读次数:
141
题目描述 已知一个数组,第i个元素表示第i天股票的价格,你只能进行一次交易(买卖各一次),设计算法找出最大收益 测试样例 详细分析 初看非常简单,遍历数组,每次选择一个元素,找到这个元素后面的数组的最大值,计算差值,和当前最大收益比较即可,就像这样: [ 7 ,1,5,3,6,4] 当前7,后面最大 ...
分类:
编程语言 时间:
2018-02-07 19:58:51
阅读次数:
125
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 ...
分类:
其他好文 时间:
2018-02-04 20:59:10
阅读次数:
148
122. Best Time to Buy and Sell Stock IISay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to f... ...
分类:
其他好文 时间:
2018-02-03 15:58:17
阅读次数:
195
A. Supermarket We often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the price for a kilo. But in some supermarket ...
分类:
其他好文 时间:
2018-02-01 14:45:06
阅读次数:
207
1、需要先安装python环境 2、安装selenium模拟用户来操作浏览器 3、将chromedriver驱动放入chrome浏览器应用根目录 4、用文本编辑器打开脚本,编辑购票人信息 5、通过cmd运行软件,python tickets.py 上海 广州 2018-01-30 6、程序打开浏览器 ...
分类:
其他好文 时间:
2018-01-30 12:48:32
阅读次数:
171
题链: http://poj.org/problem?id=2828 题解: 线段树。 逆向考虑这个过程。最后的序列S共有n个元素。 先看最后一个人,如果他插入到第i位,那么他最终的位置就是当前序列S的第i号位置,然后把这个位置去掉,得到新序列S'。 再按上面的操作确定倒数第二个人的位置: 如果他插 ...
分类:
其他好文 时间:
2018-01-27 15:22:51
阅读次数:
130
tickts.py: train.py: houcedu.py: parse_station.py: stations.py tickets.py ...
分类:
编程语言 时间:
2018-01-22 17:24:30
阅读次数:
353
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 ...
分类:
其他好文 时间:
2018-01-20 22:46:21
阅读次数:
192
ickets TimeLimit: 2000/1000 MS (Java/Others) MemoryLimit: 65536/32768 K (Java/Others) TimeLimit: 2000/1000 MS (Java/Others) MemoryLimit: 65536/32768 K ...
分类:
其他好文 时间:
2018-01-18 13:19:38
阅读次数:
141