码迷,mamicode.com
首页 >  
搜索关键字:buy tickets    ( 1402个结果
Codeforces 938 D. Buy a Ticket
D. Buy a Ticket time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Musicians of a popular b ...
分类:其他好文   时间:2018-06-12 00:12:49    阅读次数:200
B - Soldier and Bananas
Problem description A soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so o ...
分类:其他好文   时间:2018-06-03 14:27:15    阅读次数:129
angular - 使用es6等一些功能
app.module.ts 1 var model = { 2 user: 'Admin', 3 items: [{ 4 action: 'buy flowsers', done: false 5 },{ 6 action: 'get shoes', done: false 7 },{ 8 acti ...
分类:其他好文   时间:2018-06-01 22:16:16    阅读次数:226
leetcode-121-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 trans ...
分类:其他好文   时间:2018-05-29 13:11:16    阅读次数:142
hdoj 1260(简单dp)
Tickets Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7051 Accepted Submission(s): 3587 Problem ...
分类:其他好文   时间:2018-05-25 19:18:36    阅读次数:169
hdu 2126 Buy the souvenirs 【输出方案数】【01背包】(经典)
题目链接:https://vjudge.net/contest/103424#problem/K 题目大意: 给n个物品,和m块钱,输出能够购买最多物品的个数和购买这么多物品的方案数。 2018-05-21 ...
分类:其他好文   时间:2018-05-21 23:37:54    阅读次数:230
HDU - 1260 (Tickets)
题意: 买票 一个人要么自己买 要么和前面的人一起买 这两种情况分别有一个买票所花费的时间 求总的花费时间最小 解析: dp[i] 表示前i个人买票总的花费时间 v[i]表示第i个人买票花费的时间 w[i]表示第i个人与前一个人买票花费的时间 则 dp[i] = min(dp[i-1]+v[i], ...
分类:其他好文   时间:2018-05-21 21:11:47    阅读次数:170
121. Best Time to Buy and Sell Stock
class Solution { public: int maxProfit(vector& prices) { if (prices.size() == 0) return 0; int res = 0, _min = prices[0]; for (auto p : prices) { if (... ...
分类:其他好文   时间:2018-05-20 15:30:16    阅读次数:130
122. Best Time to Buy and Sell Stock II
可以多次买卖的话,就可以利用累加效应,只要后面相邻值大于当前值,就可以获利,将差值作为最大获利值的一部分累加起来。最后结果即为最大获利值。 ...
分类:其他好文   时间:2018-05-18 20:14:21    阅读次数:110
121. Best Time to Buy and Sell Stock
扫描一遍数组,用当前值减去之前的最小值,即为当前可获得的最大利润。扫描完毕后,即为买卖一次能获得的最大利润。 ...
分类:其他好文   时间:2018-05-18 19:24:17    阅读次数:131
1402条   上一页 1 ... 20 21 22 23 24 ... 141 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!