hackerrank graphs

Can anyone find what is mistake in my solution to the problem roads and libraries.
I am getting a SIGSEGV error.

https://www.hackerrank.com/challenges/torque-and-development/forum/comments/454647

I think, because you don’t read graph in the first branch case when lib < road.