|
|
Precision problem: try rounding intersection points or using epsilon when comparing points. Edited by author 26.02.2015 13:30 Edited by author 26.02.2015 13:30 No, the problem statement makes no sense for nested rectangles. Can you guys provide me with a brief math proof that searched direction always contains at least one rectangles vertex (that is, no need to search for it between those rays made from vertexes coordinates)? Thanks. In a small enough neighborhood of a line that does not pass thru one of the vertices, the distance traveled inside rectangle is smaller on one side and larger on the other, thus the distance on the line is not smaller/larger than in the neighborhood. Yes, there is an optimal line that passes thru one of the vertices (remember, that there are 4N vertices, not 2N :-) Some bugs in the validator were fixed. The problem was rejudged. 299 WA submits turned to AC and 84 AC submits turned to WA. If you will find new bugs, please, write to timus_support (at) acm.timus.ru. Edited by author 09.09.2010 10:57 To those who have WA at 2 after rejudge: The ending point MUST have positive (STRICTLY) coordinates. Try this testcase: 1 1 1 2 2 4 2 3 to see if your answer satisfies the condition. Thx a LOOOOT of @198808xc. I got AC . if c0 less than all of other delay times: x = 0.003 ; y = sqrt(L*L - x*x)
Right or wrong my answer to the next test? 10 1 1 2 2 3 10 1 11 2 1 5 5 6 7 2 3 4 8 7 3 1 3 9 9 3 12 11 15 12 1 3 3 6 6 2 4 6 8 10 3 3 7 4 12 3 2 5 4 7 2 4 50 rez: 107.071068 35.355339 35.355339 and this one: 10 1 1 2 2 8 10 1 11 2 1 5 5 6 7 2 3 4 8 7 3 1 3 9 9 3 12 11 15 12 6 3 3 6 6 5 4 6 8 10 3 3 7 4 12 3 2 5 4 7 2 4 50 rez: 153.263903 19.695965 45.957252 Edited by author 21.11.2007 14:15 Edited by author 15.03.2008 10:46 Edited by author 15.03.2008 10:49 On the first test my AC prog gives 179.034852 36.857707 33.786231 On the second case 191.055728 22.360680 44.721360 Your angle is correct, but the time delay is NOT. My AC programme said that time delay is: 1. 171.265415 2. 184.347524 Good luck~ My AC program got the same answer as 198808xc. Given tests contain nested/overlaped rectangles. And original tests dont (problem statement is not clear enough concerning this, though). Hence, different AC solutions may return different result, these tests don't make sense. I SUBMIT MY SOLLUTION: [code deleted] AND GET WA1. NEXT I COMMENT "_y1<=a2[i].y" AT LINE XXX AND "_y2>=a1[i].y" AT LINE XXX AND SUBMIT: [code deleted] AND GET AC!!!! Edited by author 28.05.2007 00:53 Oh, I have understood... Really, both my sollutions was wrong...) My pro in pascal got wrong but not in C++. so fun !!!!!!!!! the code is trivial......but the proof is a little hard...... I thought out the algo early before,but I don't know whether it is right......it puzzles me......now,I have proved it!:) hint: put the intersects into four cases for thought... |
|
|