# [Community Puzzle] Apple tree

https://www.codingame.com/training/hard/apple-tree

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.

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.

Flo

You have to determine the number of REMAINING apples, not the number of fallen apples.

1 Like

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.

1 Like