So I sat down to plunge myself into graphs.
The code below is 99% copy-paste of the code posted by @kuruma in the above post. Yet, it reports FIRESC.exe has stopped working as soon as I enter the inputs for the 1st test case. But the code in the above link works fine (obviously!).
https://www.dropbox.com/s/8u6rit6t26hmxh3/Trying%20FIREESC.cpp?dl=0
I’ve compared the codes repeatedly and spent hours debugging and trying to figure out the cause of the mishap. But to no avail. Could anyone out there please help me out?