Snippets Collections
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define ll long long
#define ull unsigned ll
#define take(n) ll int n;cin>>n
#define mod 1000000007
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define pp pop_back()
#define array(n,name) ll int *name=new ll int[n]
#define takearray(n,name) rep(i,0,n) cin>>name[i];
#define Zubin ios::sync_with_stdio(false);
#define Shah cin.tie(NULL);cout.tie(0);
#define nl cout<<endl;
using namespace std;

int xcor[4]={-1,0,0,+1};
int ycor[4]={0,-1,1,0};

ull int power(ull n,int x){
    if(x==0) return 1;
    return n * power(n,x-1);
}

int main(){

    Zubin Shah

    take(n);
    array(n,numbers);
    takearray(n,numbers);
    int maxcount=0;
    int count=0;
    int currmax=0;
    rep(i,0,n){
        if(numbers[i]>currmax){  //continuing the streak
            currmax = numbers[i];    // updating the max of current streak
            count++;   
        }
        else {  //streak broken
            count=1;
            currmax=numbers[i];
        }
        maxcount = max(maxcount,count);
    }
    cout<<maxcount<<endl;


return 0;
}
star

Sat Feb 12 2022 03:34:41 GMT+0000 (Coordinated Universal Time)

#c++ #codeforces

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension