|
|
Show all threads Hide all threads Show all messages Hide all messages | Is it possible to get wrong answer because of rounding numbers? | roman velichkin | 2099. Space Invader | 6 Oct 2023 17:43 | 2 | Vectors calculations uses square roots. Could this lead to not very precise floats and wrong results? Edited by author 05.10.2023 13:50 Edited by author 05.10.2023 13:50 In this sort of problems rounding errors could be the source of problems. That's why you shall avoid using float types here. The problem is completely solvable in integers. | WA5 | die_young | 2099. Space Invader | 5 Oct 2023 14:21 | 3 | WA5 die_young 30 Jul 2018 23:38 Check that you indeed turn after reaching point B, i.e. that intersection point is not between A and B or you don't even reach B. Re: WA5 roman velichkin 5 Oct 2023 13:45 There is something else. My code checks turning before B but still got WA on #5. Re: WA5 roman velichkin 5 Oct 2023 14:21 Spaceship can go only forward, so check - there shouldn't be any backward movement. Test #5 is about that. Edited by author 05.10.2023 14:33 | WA9 | Ade | 2099. Space Invader | 25 May 2023 20:35 | 1 | WA9 Ade 25 May 2023 20:35 a-b and c-d are close, but not touching each other. -2 0 0 -1 0 0 0 1 0 0 1000000 1 | WA1 | andreyDagger | 2099. Space Invader | 15 Feb 2022 16:09 | 1 | WA1 andreyDagger 15 Feb 2022 16:09 Spend 10 submissions to realise, that I don't return anything from function, that must return bool value | test | Toshpulatov (MSU Tashkent) | 2099. Space Invader | 22 Dec 2020 17:59 | 1 | test Toshpulatov (MSU Tashkent) 22 Dec 2020 17:59 0 0 0 1 0 0 2 1 1 2 2 1 ans Invalid Совет для тех кто решает векторами, лично у меня не получилось сдать задачу векторами, пришлось писать уравнения прямой в пространстве | Instruction how to solve. | Mahilewets | 2099. Space Invader | 15 Mar 2018 19:04 | 3 | Check (AB,CD)==0 (orthogonality). Check (AB, CD, DA) ==0 (planarity). Check AD>AC>AB, AC>BC, BD>BC (order). Check whether the projections to XY, YZ, XZ craddle each other continuations. It is sufficient to check only the projections to XY plane to get Accepted verdict. Sounds too complex. If we replace C, D with their orthogonal projection on AB, then all steps except first collapse to only one step (check D = C*a, a > 1). Still too complex, though. Over 20 lines in Python. There should be more simple solution... Edited by author 26.12.2017 04:30 No lengths or projections XY, etc. Using scalar product (sp) and triple product (tp) it is at most five conditions: sp(ab,cd) == 0 and tp(ab,bc,cd) == 0 and # ⟂ and planar sp(ab,bc) >= 0 and # C after B sp(cd,bc) >= 0 and # BC goes in direction of CD sp(cd,bd) >= sp(cd,bc) # D after C | Wa #13 | liudy | 2099. Space Invader | 3 Jun 2017 17:53 | 2 | Wa #13 liudy 13 Aug 2016 08:45 Can someone tell me what the test#13 example please? Something like AB and CD are orthogonal and complanar and there is no right such point E, that E lies on AB-line, E lies on CD line and the angle AED is ninety degrees. |
|
|
|