FROGV EDITORIAL DOUBT

In the editorial it is given as ,any two frogs which have same maximum distances can communicate with each other. i am not able to clearly understand this statement.for example let us take this sample test case:

5 1 1

0 1 5 6 8

2 4

the second frog has a max distance of 1,and the fourth frog also has a maximum distance of 1.but they cant communicate with each other …can sumone clarify??also my solution with complexity O(nlogn) is giving tle…how should i correct it??prob link: CodeChef: Practical coding for everyone

1 Like