Ai
1 Star 0 Fork 0

JJustRight/ACM-ICPC-Algorithms

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MaximumIncreasingSubarray.cpp 540 Bytes
一键复制 编辑 原始数据 按行查看 历史
shobhitbehl 提交于 2018-10-04 04:16 +08:00 . Added Greedy Problem MaximumIncreasingSubarray
#include <bits/stdc++.h>
typedef long long int lli;
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cout.precision(50);
lli n;
cin >> n;
lli a[n];
for(int i = 0; i<n; i++)
{
cin >> a[i];
}
lli ans = 1;
lli out = 1;
for(int i = 1; i<n; i++)
{
if(a[i] > a[i-1])
{
ans++;
}
else
{
ans = 1;
}
out = max(out,ans);
}
cout << out << endl;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/jjustright/ACM-ICPC-Algorithms.git
git@gitee.com:jjustright/ACM-ICPC-Algorithms.git
jjustright
ACM-ICPC-Algorithms
ACM-ICPC-Algorithms
master

搜索帮助