How did I solved this problem :))

At first I had no ideas how to solve it ))

Then I thought that it is a completely physical problem and started to write formulas....

When, after about an hour, I came to integrals I understood that........ I am not a physicist... but I am a PROGRAMER! And at the same moment a good idea came to me: "Oh my God, It is a kind of a labyrinth!"

In 10 minutes source was done and I got AC. Now I am thinking... how easier to be a programmer, than physicist :)))

Re: How did I solved this problem :))

Oh, yes... I had like story. :)))

But physical solution is very easy :)

It's parabola, I don't remember formula but it is

something like y = m*(x^2)/(n^2)

So we can easly solve it O(n) using DP.

Re: How did I solved this problem :))

I think, if you now some physics you can write simple DP, using energy saving rule.

Re: How did I solved this problem :))

Posted by

Jerry 17 Aug 2007 19:34

plz post your AC code

or send it to me

cpp_student@163.com