Codeforces SMILE HOUSE TLE

Getting tle on 31st test case of smile hous eproblem. Tell me how can i create and stop multiple array creations call whichh might cause TLE
https://codeforces.com/contest/147/problem/B

hi @piyush.bansal8158625
ur implementation seems to be correct.
will hv to check why r u getting tle since u r doing every steps as it is supposed to be done.
u will have to fill arrays in every step with INT_MIN.
I will try to debug and tell u how to resolve dis issue.
But implementation wise ur code is correct. no need to worry abt that.
The constaints of the question might be very tight because of which its showing tle again and again.

Any Idea how to improve TLE

@piyush.bansal8158625
ur code is fine.
However i am still looking for what is causing tle .
If anything is found, i will contact u .
Sorry for d inconvinience. I will try to debug ur code again.

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.