%@ Language=JavaScript %>
I am also very beginner in this site. If you don't understand any word or site. Please just mail me. This page was last updated on 08/25/05. Solved and have hints: Mail me: smibrahim@gmail.com This is a easy problem, just follow the algorithm and count the length of every cycle. After that just find out the max length. I think you will get the accept. Must be careful about the max and min condition. (as start can be bigger then the end). so just use: if ( start > end ) tmp=start; start =end; end=tmp; Now it's i and j limit is 1 million. Be careful!!!!!!! Too much lengthy problem. But interesting............. From the problem definition and also from the input & output, This problem can be solve using simple using stack. Here I use stack with structure.
Others will be added soon..............
|