ICPC TRIP QUESTION

i understand the problem but in last part of solution
when i iterat over the disx[] and disy[] by forming the two
loop .
answer is min of dsx[]+diys[]+flight(x,y);
but their is possibilty that between x and y their is no flight

hello @dkroy8790
yeah thats a valid point.

just iterate over given edges instead of all pairs to remove that issue

i does’nt understand what you say

please correct my code https://ide.codingblocks.com/s/279729

edge is the only way through which two nodes are connected right?

so i m telling u to iterate on each edge x----y

and then compute dsx[]+diys[]+flight(x,y);
doing this will ensure that there is a flight between x–y because there is edge b/w them.

now try on ur own

thanks sir i got the answer thankyou sir