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

题意:连续的最长上升子序列的长度
题解:dp[i]表示以a[i]结尾的 连续的最长上升子序列的长度
 /******************************
code by drizzle
blog: www.cnblogs.com/hsd-/
^ ^ ^ ^
O O
******************************/
//#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<map>
#include<algorithm>
#include<queue>
#include<cmath>
#define ll __int64
#define PI acos(-1.0)
#define mod 1000000007
using namespace std;
int n;
int a[];
int dp[];
int ans=;
int main()
{
scanf("%d",&n);
int ans=;
for(int i=;i<=n;i++)
scanf("%d",&a[i]);
dp[]=;
ans=;
for(int i=;i<=n;i++)
{
if(a[i]>a[i-])
{
dp[i]=dp[i-]+;
ans=max(ans,dp[i]);
}
else
dp[i]=;
}
cout<<ans<<endl;
return ;
}

Educational Codeforces Round 15 A dp的更多相关文章

  1. Educational Codeforces Round 26 D dp

    D. Round Subset time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...

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

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

  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 A. Maximum Increase

    A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input standard ...

  5. Educational Codeforces Round 60 D dp + 矩阵快速幂

    https://codeforces.com/contest/1117/problem/D 题意 有n个特殊宝石(n<=1e18),每个特殊宝石可以分解成m个普通宝石(m<=100),问组 ...

  6. Educational Codeforces Round 15 C. Cellular Network(二分)

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

  7. Educational Codeforces Round 15 C 二分

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

  8. 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 ...

  9. 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 ...

随机推荐

  1. WCF如何通过契约加编码方式调用

    WCF采用基于契约的服务调用方法,通过System.ServiceModel.ChannelFactory<TChannel>直接创建服务代理对象. 创建服务代理 public stati ...

  2. 基于K2 BPM的航空业核心业务管理解决方案

    基于K2 BPM平台的航空业解决方案,专注航空公司运行类.营销类.管理类所有解决方案. 查看完整版,请访问K2官网http://www.k2software.cn/zh-hans/aviation-i ...

  3. 多线程同步内功心法——PV操作上(未完待续。。。)

    阅读本篇之前推荐阅读以下姊妹篇: <秒杀多线程第四篇一个经典的多线程同步问题> <秒杀多线程第五篇经典线程同步关键段CS> <秒杀多线程第六篇经典线程同步事件Event& ...

  4. 记录一些容易忘记的属性 -- UIView

    一个视图原来添加在某个父视图上,然后再将它添加到另外的一个视图上,这个视图会从原来的某个父视图中移除,添加到新的视图上. 子视图对象指针存在父视图的subviews数组中,说明,一个视图可以有多个子视 ...

  5. Map的遍历

    @Test public void test() { Map<String,String> usersmap = new HashMap<>(); usersmap.put(& ...

  6. UIButton 点击后变灰

    +(UIButton *)getBlueButtonWithTitle:(NSString *)aTitle{ UIButton *button = [UIButton buttonWithType: ...

  7. Java 获取APK安装程序的包名

     Java 获取APK安装程序的包名核心的两个类:  ResPackage ApkDecoder  package com.temobi.util; import java.io.File; impo ...

  8. “java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp”

    最近在项目中使用hibernate查询时,总报错“java.sql.SQLException: Value '0000-00-00' can not be represented as java.sq ...

  9. ajax注释

    //xmlHttpRequest,但是这个对象只是在火狐,google...//在中国用的最广泛的IE浏览器里面是没有这个对象的//在IE里面是用的一个控件来解决这个问题,ActiveXObject/ ...

  10. Emacs+highlight-parentheses高亮括号

    EmacsWiki上关于它的介绍HighlightParentheses,下载最新版请通过作者的GitHub:https://github.com/nschum/highlight-parenthes ...