ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
back to board

Discussion of Problem 2008. Swifty

Posted by Rodrigo Paim 25 May 2014 23:54
Hello there,

I keep getting wrong answer for test 13 and I have no clue whatsoever of the reason. I am using integer values (long long) in this problem and always check if the flea can go left->right->left->head OR right->left->right->head. Moreover, I consider different scenarios:
* Pure vertical jump (dx = 0), and I only allow an upward jump in this case (otherwise it would be a simple fall with no effort);
* Horizontal jump (dy = 0): I apply the formula for the maximum horizontal range (with theta = 45 degrees);
* Upward jump with horizontal move: I calculate the minimum initial horizontal and vertical speeds (as it is a parabolic trajectory, I try to check if there is an initial configuration such that the vertex of the parabola (with Vy = 0) coincides with the final position;
* Fall with horizontal move (dy < 0 and dx != 0): In this case, I consider that the flea only has non null initial horizontal speed and check if the horizontal distance is enough to reach the final point.

So that is it. Thank you very much for eventual answers.

Edited by author 25.05.2014 23:55