Problem link:http://codeforces.com/contest/702/problem/A
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,i,t1,mx,sum,t2,a;
while(cin>>n)
{
t1=0;
mx=0;
sum=0;
for(i=0; i<n; i++)
{
cin>>a;
if(a>t1)
sum++;
else
sum=1;
t1=a;
if(mx<sum)
mx=sum;
}
cout<<mx<<endl;
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,i,t1,mx,sum,t2,a;
while(cin>>n)
{
t1=0;
mx=0;
sum=0;
for(i=0; i<n; i++)
{
cin>>a;
if(a>t1)
sum++;
else
sum=1;
t1=a;
if(mx<sum)
mx=sum;
}
cout<<mx<<endl;
}
return 0;
}
No comments:
Post a Comment