ICode9

精准搜索请尝试: 精确搜索
  • AE2ACE coursework2019-12-14 19:00:07

    AE2ACE coursework 2019-2020This coursework is worth 25% of the final mark.Stock Trading & Algorithm Correctness.Deadline: 29 November 2019 16:00Part I: Stock Trading (12 marks)Warning: If program cannot be complied, it will result in an immediate zero

  • 小白学Python—Day082019-11-28 16:00:45

      1.元组   元祖被称为只读列表,即数据只可以被查询但不能被修改,所以列表的各项操作除修改以外的都适用元组。当元组内只有一个元素时,也建议在后面加上逗号。 2.小项目实战——购物车程序   需求:显示商品信息。             输入商品序号,将商品加入购物车。      

  • CF 938D Buy a Ticket - 最短路2019-11-12 22:01:42

    CF 938D Buy a Ticket 题目链接:洛谷 CF938D Buy a Ticket 算法标签: 最短路、图论 题目 题目描述 流行乐队“Flayer”将在n个城市开演唱会 这n个城市的人都想去听演唱会 每个城市的票价不同 于是这些人就想是否能去其他城市听演唱会更便宜(去要路费的) 输入格式: 第一行包含两个整数n

  • USACO4.3 Buy Low, Buy Lower【简单dp·高精度】2019-11-06 23:03:40

    如果没有方案数的话,这道题水的不得了,裸的最长下降子序列。 但是它有方案数,所以... 一个是方案数的求法: 设$f[i]$是以$a[i]$结尾的最长下降子序列的长度,可以$n^2$$dp$出答案 如果$a[j]>a[i],1<=j<=i-1$,可以更新$f[i]=max(f[i],f[j]+1)$,这个额老生常谈了 设$s[i]$是以$a[i]$结尾的最

  • P2376 [USACO09OCT]津贴Allowance2019-11-05 19:03:34

    题目背景 作为学习刻苦、成绩优秀的回报,妈妈决定开始每个星期给杀马特一点零花钱。 题目描述 作为创造产奶纪录的回报,Farmer John决定开始每个星期给Bessie一点零花钱。 FJ有一些硬币,一共有N (1 <= N <= 20)种不同的面额。每一个面额都能整除所有比它大的面额。 他想用给定的硬

  • PAT B1039/A1092 To Buy or Not to Buy2019-10-12 14:02:05

    PAT B1039/A1092 To Buy or Not to Buy 题目描述:   Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only sell the str

  • day2作业2019-10-07 15:00:43

    # 程序练习# 购物车程序# 需求:# 1、启动程序后,让用户输入工资,然后打印商品列表# 2、允许用户根据商品编号购买物品# 3、用户选择商品后,检测余额是否足够,够就直接扣款,不够就提醒# 4、可随时退出,退出时,打印商品列表和余额#使用一个列表存储商品和价格shop_list = [[

  • LeetCode121(买卖股票的最佳时机)2019-09-24 22:04:50

    菜鸟成长逆袭之旅,爱好撸铁和撸代码,有强制的约束力,希望通过自己的努力做一个高品质人 Work together and make progress together 买卖股票的最佳时机 给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格。 如果你最多只允许完成一笔交易(即买入和卖出一支股票),设计一个

  • 122. Best Time to Buy and Sell Stock II2019-09-22 09:38:19

    这道题里面可以买卖股票多次。 这里我加入了sell price。 基本上就是有这个特性:如果看到价格比卖出价格低,就应该换手,这样肯定比不换手得到的利润要高。 Greedy算法就可以解决这个问题。 class Solution: def maxProfit(self, prices: List[int]) -> int: # Ini

  • 121. Best Time to Buy and Sell Stock2019-09-22 09:02:08

    Traverse list, 不断检查是不是有新的更好的deal,定义为,更低的买入价,以及刷新后的卖出价,而且sell_price-lowest_price>原来的max_profit. class Solution: def maxProfit(self, prices: List[int]) -> int: # This is time serial data # Note that thi

  • BUY LOW, BUY LOWER, POJ - 1952(LIS+去重计数)2019-09-21 11:07:07

    一开始疯狂WA,后来用别人题解代码debug发现 2 1 1 这组数据应该输出1,而我输出0,原来是ans初始化错了。。。。 解析: 我去重的思想是,如果a [ i ] == a [ j ] (j<i) && dp [ i ] == dp [j ] ,那么说明就存在重复序列了,为了避免之后算重复,则有: (f为计数数组,储存的是长度为dp[ i ]

  • 多种方式实现平均分栏布局+有分栏距离2019-09-15 12:05:22

    以下例子基于分四栏+栏间有间距的例子分析 效果图:      html代码:    <div class="buy-one-buy"> <h3>淘一淘</h3> <ul> <li><img src="../img/homePage/rotation-1.jpg" alt="First buy"></li> <li>

  • [codeforces938D]Buy a Ticket2019-09-12 17:35:51

    time limit per test : 2 seconds memory limit per test : 256 megabytes Musicians of a popular band “Flayer” have announced that they are going to “make their exit” with a world tour. Of course, they will visit Berland as well. There are n cities in

  • The Preliminary Contest for ICPC Asia Xuzhou 2019 徐州网络赛 C Buy Watermelon2019-09-07 19:40:11

    The hot summer came so quickly that Xiaoming and Xiaohong decided to buy a big and sweet watermelon. But they are two very strange people. They are even-numbered enthusiasts. They want to cut the watermelon in two parts, and each part weighs two times as

  • 1. 拒绝(No photographing in the museum)2019-09-06 19:43:07

    原文链接:http://talk.oralpractice.com/article_3784.html - Execuse me. In this museum, you are not supposed to take pictures. - Is that right? I didn't know it. - Will you give me your camera? We have to confiscate your film. - Wil

  • Oracle使用总结2019-09-05 14:39:34

    1.Oracle中连接字符串有两种方式: (1)使用|| select * from hrp_eps.eps_equ_buy_apply where equ_name like '%'||'测试'||'%'; select '设备名称:'||equ_name from hrp_eps.eps_equ_buy_apply; (2)使用CONCAT()函数,可以多层嵌套 select * from hrp_eps.eps_equ_

  • 经验分享:python利用关键字做字典切片2019-09-01 17:02:33

    Python中dataFrame或者Series类型可以使用标准方式按选定关键字对数据进行切片,但是字典类型就比较麻烦了,有没有比较简洁的方式完成呢? 例如:字典按{日期:列表}方式构成,日期是Key,字典: buy ‘2018-01-05’: [a1,a2,a3] ‘2018-01-06’: [a3,a5,a6,a9] … ‘2019-01-04’:[a1,a2,

  • Two Cakes2019-08-30 20:40:59

    Sasha and Dima want to buy two n-tier cakes. Each cake should consist of n different tiers: from the size of 1 to the size of n. Tiers should go in order from the smallest to the biggest (from top to bottom). They live on the same street, there are 2⋅

  • TS2019-08-15 16:56:43

        布林通道 1 inputs: baolin_price(close), //用于 计算宝林通道 2 current_price(close), //当前价格 3 length(20), 4 up_std(2), 5 dn_std(2), 6 long_ma_day(120), //长期趋势线 上升时购买 7 diaodeng_para(2);//

  • python编写购物车-实时购买2019-08-06 19:50:30

    本次编写的是实时购买(输入商品直接进行购买),余额不足可以进行充值或结束购物 1 goods = [ 2 {"name": "电脑", "price": 1999}, 3 {"name": "鼠标", "price": 10}, 4 {"name": "游艇", "price": 20}, 5

  • [动态规划] leetcode 309 Best Time to Buy and Sell Stock with Cooldown2019-08-04 19:00:23

    problem:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/         这道题有好几个变种。对于没有cooldown的题目而言,只需要考虑第i天,当前持有股票的最大收益和当前不持有股票的最大收益。而引入cooldown后,我们也需要引入新的状态:         h

  • Buy Tattoo Aftercare Products2019-08-01 22:41:15

    原文链接:http://www.cnblogs.com/kangshifu/archive/2008/11/20/1337635.html 来源:http://www.howbeauty.org/body-care/229337.htm Choose a product size suitable for the area your tattoo covers. If you have a small tattoo, such as a quarter-s

  • leetcode刷题121 买卖股票的最佳时机 Best Time to Buy and Sell Stock(简单) Python Java2019-07-18 14:03:21

    给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格。 如果你最多只允许完成一笔交易(即买入和卖出一支股票),设计一个算法来计算你所能获取的最大利润。 注意你不能在买入股票前卖出股票。 示例 1: 输入: [7,1,5,3,6,4] 输出: 5 解释: 在第 2 天(股票价格 = 1)的时候买

  • LeetCode - 122. Best Time to Buy and Sell Stock II2019-07-17 19:43:13

    题目 LeetCode - 122. Best Time to Buy and Sell Stock II 题目链接 https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ 参考博客 https://www.cnblogs.com/grandyang/p/4280803.html 解题思路 一开始把思路想复杂了,参考博客即可。 解题源码 class Solut

  • 188. Best Time to Buy and Sell Stock IV2019-06-29 12:28:16

    class Solution { public int maxProfit(int k, int[] prices) { if(k>=prices.length/2) { int maxProfit=0; for(int i=1;i<prices.length;i++) maxProfit+=prices[i]>prices[i-1]?prices[i]-prices[

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有