What's the problem with the code

https://ide.codingblocks.com/s/279595.
Why this code is giving me segmentation fault. Please fix the bug in the code if u can

hello @aryan
image
declare vector
like
vector< activity> vec(n+1);
and then only u can use indexing

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.