Code giving compilation error

Why this code is giving compilation error. https://ide.codingblocks.com/s/231149

@ayusdas2000 line 36 due to space between > and =

Though after changing the code, it is giving sigsev error in spoj.

Please clear my doubt sir, my code is giving sigsev error in spoj. Please help me. It has already been 3 days since i asked it.

@ayusdas2000 for input case
10 20
When X = 3
Start will be 9 and segment of I - m will be -1

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.

i still have the doubt. I saw the code written by Prateek Bhaiya in the video. It was same and it ran well.

You can refer to 21:35 for Prateek Bhaiyas code

hi @ayusdas2000 please see this thread. The difference is that you used vector whereas bhaiya used array. Arrays dont have any error handling in case of negative index whereas a vector will throw an error if you try to access a negative index, hence resulting in a segmentation fault.

your code is giving segmentation fault. I have also changed the code like you said. Though it is giving wrong answer.

@ayusdas2000 i told you to refer to that thread not to that code

@ayusdas2000 just see the above thread once, it has the exact problem as you. Refer to the thread and make changes accordingly in your code