- Jan-Ove Waldner

Google : "Jan-Ove waldner is a Swidesh former table tennis player."

His playing style is very attractive and his calmness in playing shows his great dominant on the ball. I don't know what do you think about PingPong, but if you think that it is not a real sport , I recommend you to watch some of the Waldner's tubes on youtube. I think you will change your mind. 

Some of good ones : BestPoints , vs TimoBoll

Actually PingPong is Faraz's favorite sport and he downloads so many clips about it and we watch some of them in free time. I am not a PingPong fan but now I think it is good to try and learn it with faraz's helps :)


- Not Obvious Dijkstra!

Some of the Finding Minimum Distance on graph problems are solvable by variations of Dijkstra algorithm but maybe it was not obvious at first glance.


Read this problem 230D. Planets as an example and please try to think about using Dijkstra Algorithm as a direct solution for it , before reading the next paragraph.


Solution : Well , I hope you had came up with the solution by yourself , anyway , I explain my approach.


0 - For simplicity of the explanation , please open this link and follow the steps by checking the code.

1 - Create an ordinary graph with adjacency list.

2 - Do a simple dp on the travelers arrival time. Save for each of them , earliest time that you will be allowed to leave that planet.

3 - Write a function "calcExitTime" that gives the planet index and your arrival time and returns the earliest time that you will be allowed to leave that planet with help of dp's you have calculated at step 2.

4 - Now everything is ready to use the Dijkstra algorithm. Write classical Dijkstra with this difference that you must use the earliest allowed exit time of the destination planet instead of your arriving time in it with help of "calcExitTime" function. I mean this part :

lli t2 = found( xid , t + xt );
s.insert( A( t2 , xid ) );

5 - Note that we use the minimum arrival time on the n'th planet as solution, no exit time. So you must take care of it separately. Minimum time of the arrival times to the n'th planet, is the answer to the problem.


I will update the post with another problems , whenever I found the similar ones. Also It will be great if you suggest us some of them.