Maximum length bitonic

getting tle and two wrong answer

Please provide your code in Coding Blocks IDE so that I can have a look at it.

Hey use #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); or scanf and print for reading and printing.
And when you are creating dec array, you are taking strictly greater than make it greater than equal to.

Where should I put this line in the main function?


I have added the line in code, you can have a look at it.
If this resolves your query mark it as resolved.

1 Like

yes this worked but when i am slightly changing my code in the form of function it is giving tle after including fast input output as well
https://ide.codingblocks.com/s/187999 have a look at this code…correct my mistake plz…

I guess the constraints for the problem are too tight, when ever we call any function it consumes a little extra time in calling storing the result and returning back to main function. In most cases this does not happens that these kind of little changes result in TLE, but as I said the constraint and checking for the problem seems to be tight.

but when we do it in a while loop it will make a new array of different size in every test case in a single program is it does not take too much of space??

No space will be allotted and freed every time.

1 Like

And one more doubt sir when I am tring to initialize my array globally then the program. Is giving compilation error…

I cannot tell what is the mistake without seeing the code.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.