View Code of Problem 4037

#include<iostream>
using namespace std;
int n;
const int N = 1100;
int a[N];
int main()
{
	while(cin >> n)
	{
		for(int i = 0;i < n;i ++) cin >> a[i];
		int res = 0;
		for(int i = 0;i < n;) 
		{
			int j = i + 1;
			while(j < n && a[j] > a[i]) j ++;
			res = max(res,j - i);
			i = j;
		}
		cout << res << endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 4037