674. Longest Continuous Increasing Subsequence
static int wing=[]()
{
std::ios::sync_with_stdio(false);
cin.tie(NULL);
return ;
}(); class Solution
{
public:
int findLengthOfLCIS(vector<int>& nums)
{
int sz=nums.size();
if(sz<)
return sz;
int count=;
int res=INT_MIN;
for(int i=;i<sz;i++)
{
if(nums[i]>nums[i-])
count++;
else
{
res=max(res,count);
count=;
}
}
return max(res,count);
}
};
扫描一遍,问题不大
674. Longest Continuous Increasing Subsequence的更多相关文章
- leetcode300. Longest Increasing Subsequence 最长递增子序列 、674. Longest Continuous Increasing Subsequence
Longest Increasing Subsequence 最长递增子序列 子序列不是数组中连续的数. dp表达的意思是以i结尾的最长子序列,而不是前i个数字的最长子序列. 初始化是dp所有的都为1 ...
- 【Leetcode_easy】674. Longest Continuous Increasing Subsequence
problem 674. Longest Continuous Increasing Subsequence solution class Solution { public: int findLen ...
- [LeetCode] 674. Longest Continuous Increasing Subsequence 最长连续递增序列
Given an unsorted array of integers, find the length of longest continuous increasing subsequence. E ...
- LeetCode 674. Longest Continuous Increasing Subsequence (最长连续递增序列)
Given an unsorted array of integers, find the length of longest continuous increasing subsequence. E ...
- [Leetcode]674. Longest Continuous Increasing Subsequence
Given an unsorted array of integers, find the length of longest continuous increasing subsequence. E ...
- [LeetCode&Python] Problem 674. Longest Continuous Increasing Subsequence
Given an unsorted array of integers, find the length of longest continuousincreasing subsequence (su ...
- 674. Longest Continuous Increasing Subsequence最长连续递增子数组
[抄题]: Given an unsorted array of integers, find the length of longest continuous increasing subseque ...
- 674. Longest Continuous Increasing Subsequence@python
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (s ...
- LeetCode 674. Longest Continuous Increasing Subsequence最长连续递增序列 (C++/Java)
题目: Given an unsorted array of integers, find the length of longest continuous increasing subsequenc ...
- [LC] 674. Longest Continuous Increasing Subsequence
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (s ...
随机推荐
- sourceforge
sourceforge SourceForge.net,又称SF.net,是开源软件开发者进行开发管理的集中式场所. SourceForge.net由VA Software提供主机,并运行Source ...
- 数据库存储 datetime,时差问题
var offset = moment().utcOffset(); var localText = moment.utc(datetime from database).utcOffset(offs ...
- [Mysql]——通过例子理解事务的4种隔离级别(转)
第1级别:Read Uncommitted(读取未提交内容) 第2级别:Read Committed(读取提交内容) 第3级别:Repeatable Read(可重读) 第4级别:Serializab ...
- first H5
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- sourceTree git的一些命令
经常使用的三个命令 1.添加修改过的文件到缓冲区 git add. 2.commit到本地 git commit -am ' 更改描述' 3.如果是多人开发的话,中间可能会有别人先提交的这是就需要先把 ...
- Django 实现登陆验证码
一 基本使用方法 Python生成随机验证码,需要使用PIL模块 安装: pip3 install pillow 基本使用 1 创建图片 from PIL import Image, ImageDra ...
- pop_heap(_RAIter,_RAIter,_Compare)
make_heap()是生成一个堆,大顶堆或小顶堆 make_heap(_RAIter,_RAIter) 默认生成大顶堆 make_heap(_RAIter,_RAIter,_Compare) _Co ...
- ios证书安装和打包流程
iOS开发流程 1.拿到源文件 2文件目录大致名字 一.证书配置 参考网站:http://www.jianshu.com/p/9d9e3699515e (证书配置参考地址) 准备工作 首先要有苹 ...
- encode/decode/bytes
python3中如何将字符型转换成utf-8格式的bytes类型 str_me = '字符是我'.encode('utf-8') print(str_me) >>:b'\xe5\xad\x ...
- 5.Mysql常用函数
5.常用函数函数可以进行字符串的处理.数值计算和日期计算等,mysql可以用在SQL(DML)中以增加SQL的功能.5.1 数值函数1. abs(x) 返回x的绝对值select abs(5),abs ...