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 ...
随机推荐
- 103. Binary Tree Zigzag Level Order Traversal (Tree, Queue; BFS)
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to ...
- PHP系统编程--PHP进程信号处理(转)
原地址:https://www.cnblogs.com/linzhenjie/p/5485436.html PHP的pcntl扩展提供了信号处理的功能,利用它可以让PHP来接管信号的处理,在开发服务器 ...
- YII2开启路由配置后,新加的模块无法访问
最近使用YII2,自定义创建了一个自定义模块users,位置为app\modules\users. 'modules' => [ 'users' => [ 'class' => 'a ...
- go语言template包中模板语法总结
package main; import ( "html/template" "os" "fmt" ) type Person struct ...
- 瑞波Ripple-OnlineDeletion配置的理解
1.概要 如果没有设置online deletion,那么Rippled Server的本地数据库大小将会无限增长.为了释放磁盘空间,那种情况应该被制止并且那些数据库文件应该被手动删除.online ...
- 微信公众号H5支付步骤
微信公众平台:https://mp.weixin.qq.com/ 进入 微信支付 管理>开通支付功能. 微信支付|商户平台: 设置安全目录:https://pay.weixin.qq.com/i ...
- [z]nativeSql
http://blog.csdn.net/chenallen1025/article/details/9169543 EntityManager API 提供了创建 Query 实例以执行原生 SQL ...
- DOM-动态操作心得
这个知识点都是之前看过的,就当是复习了 一.创建元素的三种方法 第一种: document.write() 识别标签 但会覆盖之前内容 第二种: 用元素自身的innerHTML方法 不识别标签 但 ...
- andorid 帧布局
framelayout.xml帧布局 <?xml version="1.0" encoding="utf-8"?> <FrameLayout ...
- hdu 1198 (并查集 or dfs) Farm Irrigation
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1198 有题目图11种土地块,块中的绿色线条为土地块中修好的水渠,现在一片土地由上述的各种土地块组成,需要浇 ...