This is the link to the question SPOJ.com - Problem PT07Z . And Link to my solution TanPlumGreatargus - Replit .
I am not getting for what case is my answer wrong?
This is the link to the question SPOJ.com - Problem PT07Z . And Link to my solution TanPlumGreatargus - Replit .
I am not getting for what case is my answer wrong?
INPUT:
5
1 2
2 3
1 4
4 5
YOUR OUTPUT:
2
CORRECT OUTPUT:
4
In line 51, it should be
if\ (mx < dist[i])
instead of
if\ (mx > dist[i])
Rest looks correct and should get an AC.
Thanks! Silly mistake, It was!