Show all threads Hide all threads Show all messages Hide all messages |
Как получен ответ из примера? | Felix_Mate | 1359. Construction | 3 Nov 2022 13:47 | 2 |
Из точки (2,2) мы можем попасть в (1,1),а потом в (0,0), сразу в (0,0), в (1,0),а потом в (0,0). В первом случае t=0.63246+0.23277=0.86522, во втором t=0.86522, в третьем t=0.70711+0.15811=0.86522. Я использую формулу для t=(-v+sqrt(v*v+2*g*len*sina))/(g*sina)),если наклонный отрезок и t=len/v иначе. Попробуй вариант 2,2 -> 2,1 -> 0,0 (опускаемся на 1 вниз(по вертикали), потом проводим до конца(по диагонали)) |
How to solve this one? | Douglas Cardoso | 1359. Construction | 25 Jun 2010 11:39 | 1 |
I really couldn't figure out how to solve it. The way I tried even gives the wrong output for the sample! I modelled like this: Each integer coordinates point represents a node of a graph. There is a edge form point (a, b) to (c, d) iff a >= c and b > d. The edge's weight is equal to the time to go from one point to another one adjacent to the first, which is calculated like this: if theta is the angle between the segment (a, b)-(c, d) and the x-axis, then due to the gravity there is a 10*cos(theta) acceleration in the x-axis direction. So the time needed to go from (a, b) to (c, d) is sqrt(2*(c-a)/(10*cos(theta))). Finally, what I do is to run a shortest-path algorithm in this graph. But for the sample my program answers 0.752121. Does any one knows if ignored any detail? Or maybe if my entire model is wrong? Thanks! |
Please write answer for test "2 1" | VasilySlesarev | 1359. Construction | 4 Feb 2010 00:47 | 4 |
My program writes 0.8561 and gets WA I`ve found stupid mistake and got AC! Doski ne mogut bit raspologeni gorizontalno! Thanks, i had this mistake too :) It was WA #3 |
Pay attention to the input!!! | Punkrocker | 1359. Construction | 17 Aug 2007 19:35 | 2 |
The input is not very usual!!! n goes BEFORE m. This permutation cost me 11 unsuccessfull submissions! :) Edited by author 24.03.2005 21:11 |
How did I solved this problem :)) | Alexandrov Sergey | 1359. Construction | 17 Aug 2007 19:34 | 4 |
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 :))) 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. I think, if you now some physics you can write simple DP, using energy saving rule. plz post your AC code or send it to me cpp_student@163.com |
Why I have t=0.7691 on example test? | Kirin Vladislav | 1359. Construction | 4 Oct 2006 16:41 | 2 |
I have calculate time by formula t=sqrt(2*s/g) there s - distance and g - changing speed (g=10m/c^2). Distance I have calculate by trapezium method. I have distance for this test s=2.9578. There is wrong?:-( I find where I made mistake - in idea of solution: traectory of moving barrel is not a parabola, it's a cycloid. But I have next problem - what is formula of cycloid? Edited by author 04.10.2006 16:43 Edited by author 04.10.2006 16:45 |
Hello everyboby! I found solution in O(n^4), what about others? (-) | Victor Barinov (TNU) | 1359. Construction | 3 Oct 2006 21:16 | 6 |
The fastest solution is precalc (as usual :] ), but you can make your solution very fast without it. It is clear that there is some physical dependence in this problem - the line of optimal movement is some function (a parabola, I presume). So you can look for several nearest points with integer coordinates and use dp only for them. But it is much more difficult and unsafe, isn't it? Not parabola, but cycloid! It's variational stuff :)! What is cycloid's formula? |
Why WA 9... | SPIRiT | 1359. Construction | 19 Sep 2006 19:03 | 2 |
I have a question. Can the barrel use the ground, I mean if it reached the ground,can it simply move till the destination point? Edited by author 30.08.2006 12:38 To anyone who can't get AC on C++, just use Delphi. I am not kidding. The solution on C++ with double had WA at test 9. The analogical solution on Delphi with real got AC. |
Sample test | Anton [SUrSU] | 1359. Construction | 11 Aug 2006 16:22 | 1 |
Explain me answer for the sample test case please! |
hint formyla (+) | Виктор Крупко | 1359. Construction | 12 Jul 2006 14:19 | 2 |
o(n^4) algoritm cos:=(j-j1)/sqrt(sqr(i-i1)+sqr(j-j1)); f (a[i1,j1]>a[i,j]+abs(v[j]-v[j1])/(g*cos)) or (a[i1,j1]=0) then a[i1,j1]:=a[i,j]+abs(v[j]-v[j1])/(g*cos); |
Although this problem isn't so hard,I like it very much. | Yu Yuanming | 1359. Construction | 11 Jun 2005 19:07 | 4 |
For O(n^4) algo, take care that: mv^2 / 2 = mgh |
Help PLZ | mahbubul | 1359. Construction | 31 Mar 2005 01:17 | 2 |
Can any1 plz tell me what type of dp will be applied here? The initial velocity will be changed as soon as it appears at another point. So how the fastest time of that next point can help? V = sqrt(2 * y * g) So for each point you know the speed in it... Now that you can find minimal time to reach it. |
Give me answer for this test | Burunduk1 | 1359. Construction | 30 Mar 2005 21:03 | 3 |
I have WA 2. This test is 1, 2 My program outputs 0.7092 and I think that it is true. Give me please right answer for this test and how we should move to reach minimal time. |
Problem definition seems to be incorrect (+) | Dmitry 'Diman_YES' Kovalioff | 1359. Construction | 21 Mar 2005 22:18 | 2 |
1) It is said: "Output should contain minimal time in seconds ... accurate within 10^-3". But sample output is 0.8614. 2) In the russian version file "output.txt" is mentioned, while the program shouldn't use any files. 1) You may output arbitrary number of digits after decimal point, but your number should not differ from correct answer more than 10^-3 2) output.txt: fixed. |