ICode9

精准搜索请尝试: 精确搜索
  • Best Time to Buy and Sell Stock II2019-06-27 09:49:41

    Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times). Howev

  • 静态代理与动态代理2019-06-20 19:51:24

    代理模式 介绍 为其他对象提供一种代理以控制对这个对象的访问。在某些情况下,一个对象不适合或者不能直接引用另一个对象,而代理对象可以在客户端和目标对象之间起到中介的作用。 1. 组成 抽象角色:通过接口或抽象类声明真实角色实现的业务方法。 代理角色:实现抽象角色,是真实

  • best-time-to-buy-and-sell-stock-iii2019-06-14 21:01:26

    题目描述   Say you have an array for which the i th element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most two transactions.(最多两次买卖) Note: You may not engage in multiple transactio

  • Vue入门十二、路由的跳转2019-06-07 12:55:05

    路由之间的跳转有再种:1、通过标签<router-link to='/login'>去登录</router-link>实现跳转2、通过js实现:this.$router.push({path:'/buy'})this.$router.replace({path:'/buy'})2.1push与replace的区别push会向history插入新记录replace不会插入history历史记录,如果返回上一页,则会

  • 数据分析--均值回归2019-06-01 19:38:37

    均值回归理论 均值回归:“跌下去的迟早要涨上来”  ,  选股用, 不适合做择时,因为不知道什么时候是偏离最低 均值回归的理论基于以下观测:价格的波动一般会以它的均线为中心。也就是说, 当标的价格由于波动而偏离移动均线时,它将调整并重新归于均线。 定义偏离程度:(MA-P)/MA       --

  • LeetCode 121. Best Time to Buy and Sell Stock2019-05-29 09:03:35

    121. Best Time to Buy and Sell Stock(买卖股票的最佳时机)   题目:     给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格。   如果你最多只允许完成一笔交易(即买入和卖出一支股票),设计一个算法来计算你所能获取的最大利润。   注意你不能在买入股票前卖出股票。

  • 购物车2019-05-22 12:45:04

    goods_list = [{'name':'iphone','price':4500,'count':40},{'name':'手机','price':7000,'count':100},{'name':'平板','price':5000,'count':60},{&

  • 购物车2019-05-22 12:42:36

    product_list=[("IPHONE1",5800),("IPHONE2", 5800),("IPHONE3", 5800),("IPHONE4", 5800),("IPHONE5", 5800),]shopping_list = []info = """----- supermarket info -----1.Please enter the goods numbe

  • 购物车2019-05-22 12:39:54

    a1=""; sum=0;shuru={ (‘短袖’,301), (‘长裤’,401), (‘球鞋’,1001), (‘帽子’,801),}a1=printf("输入shuru查看商品列表"); if a1 == "shuru" while true: printf("shuru"); choice = input("请输入想要买的商品:")

  • 作业22019-05-22 11:38:12

    producty_list = [ ('笔记本电脑', 4000), ('小米7', 2500), ('床', 500), ('椅子', 180), ('杯子', 5) ]shopping_list = []info = """----- supermarket info -----1.Please enter the goods nu

  • 第五章 第四节 算法分析与优化(机器学习系统设计--垃圾邮件分类)2019-05-15 09:50:55

    机器学习系统设计--垃圾邮件分类 假定我们现有一封邮件,其内容如下: From: cheapsales@buystufffromme.com To: ang@cs.stanford.edu Subject: Buy now! Deal of the week!Buy now! Rolex w4ches - $100 Med1cine (any kind) - $50 Also low cost M0rgages available. 充斥着

  • Buy Tickets(线段树单点更新,查询某个节点的值)2019-05-08 21:43:07

    Buy Tickets Time Limit: 4000MS   Memory Limit: 65536K Total Submissions: 26008   Accepted: 12446 Description Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue… The Lunar Ne

  • (贪心) leetcode 121. Best Time to Buy and Sell Stock2019-05-06 20:52:20

    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 (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit. Note th

  • 门面模式2019-05-05 14:53:48

    老王的股票   大家好,我是小赵,目前任职藏剑山庄高级铸剑师,在山庄里和我玩的比较好的有老王和老刘他们几个,都是组长级别的二货们,经常混在一起打牌。   今天上午闲得蛋疼晃悠晃悠的晃到的老王的地盘,看到老王在埋头写程序: public static void main(String[] args) { St

  • AJPFX平台:02.21日内交易策略2019-05-01 22:53:09

    AJPFX恒指: 恒指昨日收阳,日线阴阳交替,价格运行在布林带上轨下方,MA均线呈多头排列,附图指标MACD两线位于0轴上方粘合运行,绿色动能开始缩量弱势,KDJ三线交金叉向上发散,向上趋势强劲。4小时上,K线运行在上轨附近,指标呈现背离,上轨依然存在压力,MACD指标粘合在一起,绿色动能缩量。目前恒指预计

  • AJPFX平台:01.11日内交易策略2019-05-01 21:43:45

    AJPFX分析恒指: 恒指昨日收阴,日线上呈现较长下影线的小阴线,表示日线多头有减弱迹象,由于昨日晚间的大幅上行,今日早盘预计低开或伴随有回调修复走势,昨日最高触及26675位置,大趋势多头较强,上方阻力看27000点整数关口。   日线级别布林带呈现缩口迹象,KDJ三线均处于超卖区,MA均线呈多头排

  • AJPFX平台:01.14日内交易策略2019-05-01 21:42:58

    AJPFX分析恒指: 恒指从周线上看,恒指经过近五周的短线下行后收取启明之星形态,上周恒指收取光头光脚大阳线,后市有望打破宽幅整理区间,大趋势上看多头占优,低位支撑看26230、26000两个关键位置的情况,目前恒指价格运行在保利加通道的中轨附近,若继续上破,中线阻力位为28600附近。   日线级

  • AJPFX平台:01.15日内交易策略2019-05-01 21:42:00

    AJPFX分析恒指: 恒指前期触及保利加通道下轨支撑后反弹,目前价格位于保利加上轨下方,昨日日线收中阴线,最低触及26164位置,预计今日日线收阴概率较大,上方阻力看26800附近。四小时上看,保利加通道向上倾斜运行,恒指低位受到保利加通道中轨支撑,预计短线反弹后回落,MA短周期均线交死叉向下发散

  • Mybatis插入数据返回主键ID2019-04-26 17:40:30

    <insert id="add" parameterType="com.dsa.core.base.model.ProductSync">        insert into tm_sync_product(            <if test="productId!=null">product_id,</if>            <if test="mainLimit!=null&q

  • poj 2828 buy Tickets 用线段树模拟带插入的队列2019-04-19 16:44:31

    Buy Tickets Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2795 Description Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a

  • luogu CF865D Buy Low Sell High2019-04-16 10:55:08

    背景: 代码贼短......... 题目传送门: https://www.luogu.org/problemnew/show/CF865D 思路: 考虑dpdpdp,设fi,jf_{i,j}fi,j​表示第iii天拥有jjj股时的利润。 则: [1][1][1]考虑买入:fi,j=max⁡k=1j−1fk,j−1−aif_{i,j}=\max_{k=1}^{j-1}f_{k,j-1}-a_ifi,j​=maxk=1j−1​fk,

  • Codeforces 938D. Buy a Ticket (最短路+建图)2019-04-11 12:42:06

    <题目链接> 题目大意: 有n座城市,每一个城市都有一个听演唱会的价格,这n座城市由m条无向边连接,每天变都有其对应的边权。现在要求出每个城市的人,看一场演唱会的最小价值(总共花费的价值=所看演唱会的价值+该城市的人去那个城市看演唱会的往返距离之和)。 解题分析:比较好的一道最短路题

  • 122. Best Time to Buy and Sell Stock II(买卖股票的最佳时机 II)2019-04-06 15:48:38

    题目链接:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ 思路: 最初我的理解出了问题,我忘了题目背景是美国股票,可以当天卖再当天买, 我以为是N+1的股市制度,尴尬。。。 比较简单的思路就是只要后一个大于前一个就进行买卖。计算总和即可。 这种思路对于连续

  • POJ2828 Buy Tickets2019-04-06 08:48:46

    题意 Language:DefaultBuy Tickets Time Limit: 4000MSMemory Limit: 65536KTotal Submissions: 25813Accepted: 12368DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Y

  • [Leetcode188] 买卖股票的最佳时机IV 动态规划 解题报告2019-04-05 18:49:27

    题源:https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iv/   本题代码: 1 /** 2 * @author yuan 3 * @version 0.1 4 * @date 2019/4/5 5 */ 6 public class Leetcode188 { 7 8 private int getBetterBuy(int[] buy, int[] sell, int price, int i) {

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

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

ICode9版权所有