https://www.codingame.com/training/hard/apple-tree
Send your feedback or ask for help here!
https://www.codingame.com/training/hard/apple-tree
Send your feedback or ask for help here!
2 posts were merged into an existing topic: Apple tree puzzle from input.txt
Hello
,
Iām trying to solve āApple treeā puzzle from input.txt, approved by Arglanir , InstouT94 and JohnnyYuge.
Link to puzzle
You have the position (I guess the center) of an apple by its (x,y,z), and the radius of the apple.
One apple falls, eventually hitting others, making them fall, too.
And you have to determine the number of fallen apples.
I disagree with the second test (simple collision).
Can anyone explain to me how 4 apples can fall whereas they are so far away one another ?
I would have answered 2. (index 5 and 0)
x y z r
0 0 0 25
200 200 0 25
200 -200 0 25
-200 200 0 25
-200 -200 0 25
5 10 500 10
This last one is falling.
4 apples fall if the radius of the last one is 260.
Thank you for your attention.
Flo
You have to determine the number of REMAINING apples, not the number of fallen apples.
Ok. Thank you. I go and hide myself. ![]()
Hi,
I have some trouble when I submit my solution.
My program is working well in the IDE but when I submit my program for validation, it always fail on the test n°5 (Multiple cascade).
I canāt figure out where my problem since I donāt have any feed back.
Is there anyway to have a feedback on the error during the submit phase ?
Itās an example with no remaining apple.
Try to create a similar case (expert mode in the settings allows you to create custom testcases) and chek how your code handles it.
Validator 4 āCascadeā doesnāt work despite accounting for zero and all remaining apples and as many edge cases as I can think of, all other validators and tests work, so Iām not sure whatās going wrong.
If you want, you may send me your code via private message and Iāll take a look.
Edit
Those who fail Validator 4 (āCascadeā) may try the following the custom case, which may be useful for debugging the code:
Input
9 4
69 -89 6 45
-82 -83 69 35
-52 56 66 40
-6 -63 -16 41
14 -9 56 44
22 -84 43 37
-65 77 -56 36
18 -81 -20 28
-80 66 86 15
Output
4