1、题目描述

2、问题分析

从每一个num[i]往前扫描即可。

3、代码

  1. int findLengthOfLCIS(vector<int>& nums) {
  2. if( nums.size() <= ){
  3. return nums.size() ;
  4. }
  5.  
  6. vector<int> dp(nums.size(), );
  7. int maxans = ;
  8.  
  9. for(int i = ; i < nums.size() ; i++){
  10. int maxI = ;
  11. for( int j = i-; j >= ; j--){
  12. if( nums[j] < nums[j+] )
  13. maxI++;
  14. else
  15. break;
  16. }
  17.  
  18. maxans = max( maxI, maxans);
  19. }
  20. return maxans;
  21.  
  22. }

LeetCode题解之Longest Continuous Increasing Subsequence的更多相关文章

  1. 【LeetCode】674. Longest Continuous Increasing Subsequence 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 动态规划 空间压缩DP 日期 题目地址:https: ...

  2. LeetCode算法题-Longest Continuous Increasing Subsequence(Java实现)

    这是悦乐书的第286次更新,第303篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第154题(顺位题号是674).给定未排序的整数数组,找到最长连续增加子序列的长度.例如 ...

  3. LeetCode Longest Continuous Increasing Subsequence

    原题链接在这里:https://leetcode.com/problems/longest-continuous-increasing-subsequence/description/ 题目: Giv ...

  4. LeetCode 674. Longest Continuous Increasing Subsequence (最长连续递增序列)

    Given an unsorted array of integers, find the length of longest continuous increasing subsequence. E ...

  5. [LeetCode] Longest Continuous Increasing Subsequence 最长连续递增序列

    Given an unsorted array of integers, find the length of longest continuous increasing subsequence. E ...

  6. [LeetCode] 674. Longest Continuous Increasing Subsequence 最长连续递增序列

    Given an unsorted array of integers, find the length of longest continuous increasing subsequence. E ...

  7. LeetCode 674. 最长连续递增序列(Longest Continuous Increasing Subsequence) 18

    674. 最长连续递增序列 674. Longest Continuous Increasing Subsequence 题目描述 给定一个未经排序的整型数组,找到最长且连续的递增序列. Given ...

  8. [Leetcode]674. Longest Continuous Increasing Subsequence

    Given an unsorted array of integers, find the length of longest continuous increasing subsequence. E ...

  9. [LeetCode&Python] Problem 674. Longest Continuous Increasing Subsequence

    Given an unsorted array of integers, find the length of longest continuousincreasing subsequence (su ...

随机推荐

  1. java+hibernate+mysql

    实体类News package org.mythsky.hibernatedemo; import javax.persistence.*; @Entity @Table(name="new ...

  2. Gen类的字符串操作

    public void t(String d){ final String str = "b"; String s = "a"+"c"+st ...

  3. springboot-31-springboot静态注入

    springboot中 使用 @Autowired 注入时, 是可以为静态变量进行注入的 package com.iwhere.footmark.tools; import org.springfra ...

  4. lucene 初探

    前言: window文件管理右上角, 有个搜索功能, 可以根据文件名进行搜索. 那如果从文件名上判断不出内容, 我岂不是要一个一个的打开文件, 查看文件的内容, 去判断是否是我要的文件? 几个, 十几 ...

  5. 测试JavaScript数组Array

    <script> var numbers = [1, 2, 3, 4, 5]; function isLessThan3(value,index,array) { var returnVa ...

  6. Linq 多表连接查询join

    在查询语言中,通常需要使用联接操作.在 LINQ 中,可以通过 join 子句实现联接操作.join 子句可以将来自不同源序列,并且在对象模型中没有直接关系(数据库表之间没有关系)的元素相关联,唯一的 ...

  7. 使用clamav模块对数据流进行病毒检测

    准备工作:linux下安装clamav成功,启动clamav并打开本地socket监听"/tmp/clamav.socket" clamav开源工程目录:/usr/local/ 修 ...

  8. zoj 2724 Windows Message Queue(使用priority_queue容器模拟消息队列)

    题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2724 题目描述: Message queue is the b ...

  9. 24.ArrayBuffer

    ArrayBuffer ArrayBuffer ArrayBuffer对象.TypedArray视图和DataView视图是 JavaScript 操作二进制数据的一个接口.这些对象早就存在,属于独立 ...

  10. 在JAVA中封装JSONUtil工具类及使用

    在JAVA中用json-lib-2.3-jdk15.jar包中提供了JSONObject和JSONArray基类,用于JSON的序列化和反序列化的操作.但是我们更习惯将其进一步封装,达到更好的重用. ...