LFSTACK - Editorial

You have made the qq array with size q and above your code q is 0, thus you are getting segmentation fault SIGSEV.

can someone please tell me ,why my code gives TLE in subtask3.
https://www.codechef.com/viewsolution/48329409
thanks in advance.

https://www.codechef.com/viewsolution/57452032

I have tried backtracking and I got a segmentation error. Can anybody tell me where I did the mistake??

Thanks in Advance!