A. Maximum Increase
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

You are given array consisting of n integers. Your task is to find the maximum length of an increasing subarray of the given array.

A subarray is the sequence of consecutive elements of the array. Subarray is called increasing if each element of this subarray strictly greater than previous.

Input

The first line contains single positive integer n (1 ≤ n ≤ 105) — the number of integers.

The second line contains n positive integers a1, a2, ..., an (1 ≤ ai ≤ 109).

Output

Print the maximum length of an increasing subarray of the given array.

Examples
Input
5
1 7 2 11 15
Output
3
Input
6
100 100 100 100 100 100
Output
1
Input
3
1 2 3
Output
3

题目链接: http://codeforces.com/contest/702/problem/A

很水的一道题,暴力即可

 #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std; int main()
{
int n;
cin >> n;
int num[n];
for(int i = ; i < n; i++)
{
cin >> num[i];
}
int ans = , count = ;
for(int i = ; i < n; i++)
{
if(num[i] > num[i-])
{
count++;
}
else
{
ans = max(ans,count);
count = ;
}
}
ans = max(ans,count);
cout << ans;
return ;
}

显示代码

Codeforces Educational Codeforces Round 15 A. Maximum Increase的更多相关文章

  1. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://cod ...

  2. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://code ...

  3. Codeforces Educational Codeforces Round 15 C. Cellular Network

    C. Cellular Network time limit per test 3 seconds memory limit per test 256 megabytes input standard ...

  4. Codeforces Educational Codeforces Round 15 E - Analysis of Pathes in Functional Graph

    E. Analysis of Pathes in Functional Graph time limit per test 2 seconds memory limit per test 512 me ...

  5. Codeforces Educational Codeforces Round 15 D. Road to Post Office

    D. Road to Post Office time limit per test 1 second memory limit per test 256 megabytes input standa ...

  6. Codeforces Educational Codeforces Round 3 B. The Best Gift 水题

    B. The Best Gift 题目连接: http://www.codeforces.com/contest/609/problem/B Description Emily's birthday ...

  7. codeforces Educational Codeforces Round 5 A. Comparing Two Long Integers

    题目链接:http://codeforces.com/problemset/problem/616/A 题目意思:顾名思义,就是比较两个长度不超过 1e6 的字符串的大小 模拟即可.提供两个版本,数组 ...

  8. codeforces Educational Codeforces Round 16-E(DP)

    题目链接:http://codeforces.com/contest/710/problem/E 题意:开始文本为空,可以选择话费时间x输入或删除一个字符,也可以选择复制并粘贴一串字符(即长度变为两倍 ...

  9. Codeforces Educational Codeforces Round 5 E. Sum of Remainders 数学

    E. Sum of Remainders 题目连接: http://www.codeforces.com/contest/616/problem/E Description The only line ...

随机推荐

  1. Android ListView高度自适应和ScrollView冲突解决

    在ScrollView中嵌套使用ListView,ListView只会显示一行到两行的数据.起初我以为是样式的问题,一直在对XML文件的样式进行尝试性设置,但始终得不到想要的效果.后来在网上查了查,S ...

  2. 转Struts 权限控制

    权限最核心的是业务逻辑,具体用什么技术来实现就简单得多. 通常:用户与角色建立多对多关系,角色与业务模块构成多对多关系,权限管理在后者关系中. 对权限的拦截,如果系统请求量大,可以用Struts2拦截 ...

  3. Java API —— Date类

    1.Date类概述 类 Date 表示特定的瞬间,精确到毫秒.  2.构造方法 public Date():分配 Date 对象并初始化此对象,以表示分配它的时间(精确到毫秒). public Dat ...

  4. Windows下搭建Mysql集群

    Mysql集群的基本架构如下: 基本原理参考:[转]MySQL Cluster (集群)基本原理 这里采用最小配置,用两台机器来分别部署一个management 节点,2个data node, 2个s ...

  5. 函数fil_node_create

    /*******************************************************************//** Appends a new file to the c ...

  6. iOS开发:为xcode项目添加git仓储

    现在apple官网下载Command Line Tools 对应mac版本和xcode版本,记录地址:https://developer.apple.com/downloads/ 找到mac的终端,c ...

  7. Qt之自定义界面(窗体缩放-跨平台终极版)

    简述 通过上一节内容,我们实现了窗体的缩放,功能很不错,但是很遗憾-不支持跨平台!如果对于多平台来说,这是一个硬伤,所以,我们急需要一个能够支持跨平台的实现方案. 在网上看到过很多不同的实现方式,多多 ...

  8. UVa 10870 (矩阵快速幂) Recurrences

    给出一个d阶线性递推关系,求f(n) mod m的值. , 求出An-dv0,该向量的最后一个元素就是所求. #include <iostream> #include <cstdio ...

  9. PHP中 对象自动调用的方法:__set()、__get()、__tostring()

    总结: (1)__get($property_name):获取私有属性$name值时,此对象会自动调用该方法,将属性name值传给参数$property_name,通过这个方法的内部 执行,返回我们传 ...

  10. 如何让Vim显示dos下的^M符号

    /*********************************************************************** * 如何让Vim显示dos下的^M符号 * 声明: * ...