Problem 702A — Maximum Increase | What is wrong in this Plz HELP I SPENT 2 Days finding bug PLZZZZ HELP.

Правка en1, от ABhinav2003, 2020-06-06 10:38:11
#include<bits/stdc++.h>
using namespace std;
int in=0 , ex;
int sub(int a[] , int len)
{
//	if(len<1)
//		return 0;
	 if(len <= 0  )
		return 0;

	  ex = sub(a,len-1);
	  cout<<"EX "<<ex<<"\n";

	 if(a[len-1] >a[len-2])
	 {
		int t = a[len-1]>a[len-2];cout<<"T "<<t<<"\n";
	 	 in = 1+sub(a,len-1);
	 }
	 cout<<"IN "<<in<<"\n";

	int max1 = max(in,ex);
	cout<<"MAX "<<max1<<"\n";

	return max1;
}

int main()
{
	int len;
	cin>>len;
	 int a[len];
	for(int i = 0;i<=len-1;i++)
	{
		cin>>a[i];
	}
	int m = sub(a , len);
	cout<<m;
}
[**HERE IS THE PROBLEM**](https://mirror.codeforces.com/problemset/problem/702/A)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ABhinav2003 2020-06-06 10:38:11 764 PLZZ HELP | just say where i am wrong what is wrong in my code | csz i wanted to do in my tyle | plz HELP (published)