题目链接:

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
51 7 2 11 15

output
3

input
6100 100 100 100 100 100

output
1

input
31 2 3

output
3

题意:

求最长的上升子串;

思路:

水题;

AC代码:
/************************************************
┆  ┏┓   ┏┓ ┆
┆┏┛┻━━━┛┻┓ ┆
┆┃       ┃ ┆
┆┃   ━   ┃ ┆
┆┃ ┳┛ ┗┳ ┃ ┆
┆┃       ┃ ┆
┆┃   ┻   ┃ ┆
┆┗━┓    ┏━┛ ┆
┆  ┃    ┃  ┆      
┆  ┃    ┗━━━┓ ┆
┆  ┃  AC代马   ┣┓┆
┆  ┃           ┏┛┆
┆  ┗┓┓┏━┳┓┏┛ ┆
┆   ┃┫┫ ┃┫┫ ┆
┆   ┗┻┛ ┗┻┛ ┆
************************************************ */  #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <bits/stdc++.h>
#include <stack>using namespace std;#define For(i,j,n) for(int i=j;i<=n;i++)
#define mst(ss,b) memset(ss,b,sizeof(ss));typedef  long long LL;template<class T> void read(T&num) {char CH; bool F=false;for(CH=getchar();CH<'0'||CH>'9';F= CH=='-',CH=getchar());for(num=0;CH>='0'&&CH<='9';num=num*10+CH-'0',CH=getchar());F && (num=-num);
}
int stk[70], tp;
template<class T> inline void print(T p) {if(!p) { puts("0"); return; }while(p) stk[++ tp] = p%10, p/=10;while(tp) putchar(stk[tp--] + '0');putchar('\n');
}const LL mod=1e9+7;
const double PI=acos(-1.0);
const int inf=1e9;
const int N=1e5+10;
const int maxn=(1<<8);
const double eps=1e-8;int a[N],g[N],d[N];
int main()
{       int n;read(n);For(i,1,n)read(a[i]);int ans=1,temp=1;For(i,2,n){if(a[i]>a[i-1])temp++;else {ans=max(ans,temp);temp=1;}}ans=max(ans,temp);/*For(i,1,n){int k=lower_bound(g+1,g+n+1,a[i])-g;d[i]=k;g[k]=a[i];}cout<<d[n]<<endl;*/cout<<ans<<endl;return 0;
}

  

转载于:https://www.cnblogs.com/zhangchengc919/p/5720262.html

codeforces 702A A. Maximum Increase(水题)相关推荐

  1. Codeforces 864 A Fair Game 水题

    题目链接: http://codeforces.com/problemset/problem/864/A 题目描述: 看不是是不是一串数中只有两种数且这两种数字的数量是相同的 解题思路: 水题, 水过 ...

  2. 【CodeForces - 569B】Inventory (水题)

    题干: Companies always have a lot of equipment, furniture and other things. All of them should be trac ...

  3. CodeForces - 1141D Colored Boots(暴力+水题)

    题目链接:点击查看 题目大意:给出两个字符串s和t,两个字符串中相同的字母可以匹配,问号可以和任意字符匹配,现在问两个字符串最多能匹配多少个字符,并给出匹配的下标 题目分析:挺好玩的一道水题,大体思路 ...

  4. Codeforces gym 100685 C. Cinderella 水题

    C. Cinderella Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/ ...

  5. codeforces 667A A. Pouring Rain(水题)

    题目链接: A. Pouring Rain time limit per test 1 second memory limit per test 256 megabytes input standar ...

  6. 【CodeForces - 485A】Factory (水题,抽屉原理,tricks)

    题干: One industrial factory is reforming working plan. The director suggested to set a mythical detai ...

  7. CodeForces - 25A IQ test【水题】

    题目链接:https://codeforces.com/contest/25/problem/A #include <iostream> using namespace std; int ...

  8. 【Educational Codeforces Round 6A】【水题】Professor GukiZ's Robot 曼哈顿距离

    A. Professor GukiZ's Robot time limit per test 0.5 seconds memory limit per test 256 megabytes input ...

  9. CodeForces - 29A Spit Problem【水题】

    题目链接:https://codeforces.com/contest/29/problem/A #include <iostream> #include <cstdio> # ...

最新文章

  1. 谈谈一些有趣的CSS题目(五)-- 单行居中,两行居左,超过两行省略
  2. linux读写usb host,LINUX下USB1.1设备学习小记(3)_host与device
  3. 计算机分类及在信息社会中的应用,計算机在信息社会中的应用.doc
  4. 本田da屏怎么进wince系统_本田新XR-V首试:配置提升,依然好开
  5. GeoServer服务器环境的搭建
  6. 《Linux嵌入式实时应用开发实战(原书第3版)》—2.2 硬件需求
  7. 【水果识别】基于matlab PCA苹果酸甜度识别【含Matlab源码 1634期】
  8. object-c的继承
  9. 数据结构系列之大话数据结构
  10. gan处理自己的数据集_数据集难找?GAN生成你想要的数据!!!
  11. 最值得看的文章之一:林锐《大学十年》
  12. 深度强化学习训练调参方法
  13. 优秀课件笔记之视听巧记汉英成语2
  14. 图文对齐居中的几种方式
  15. 关于C语言中的宏的一点点讨论
  16. 行内元素设置margin:0 auto无效的问题
  17. nodejs中解决发出响应数据正常但是浏览器没有正确显示的问题
  18. 职场邮件的十大忌讳,你犯了吗?
  19. 手机传感器的意义:未来生活将被彻底改变
  20. DevOps 一篇入门介绍

热门文章

  1. 需要多少次找出较轻的小球
  2. CSS选择器的优先级计算
  3. 又见n/i下取整+分块
  4. 数据结构—图的基本概念
  5. Qt 中实现在控件中点击鼠标,就在鼠标点击处加载图片的方法
  6. k8s prometheus/grafana 监控系统建设
  7. python批量将文件夹下所有图片中一种颜色改变为随机颜色
  8. JAVA运算的类型兼容原则_Java基础语法回顾(一)
  9. pycharm怎么修改python路径
  10. 发布后500访问错误 —— dll引用错误