Why is my code not giving any output

here’s a link to my code .

this is not giving me any output.

hello @pewpiyu

pls wait i m checking.
btw it is solution of SEQ problem right?

yes it is SEQ on spoj

check now->

still not running

check now->

it should work

1 Like

A few question i want to ask

  1. In line 43 it should b[n] cus i have taken all the indices from one same in line 49 and 67.
  2. and in line 123 and 124 why are we performing these operations even though test cases are independent ?

no it is zero based indexing , look at line 113 u are inserting in empty vector so it will store elements from 0th index hence nth element will be at n-1 index

that is the reason na, test cases are independent thats why we are clearing out the previous vector so that in next iteration we get empty vectors

1 Like

ok I understood
Thanks for the help

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.