[Community Puzzle] 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 :slight_smile:,

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.

:confused: 4 apples fall if the radius of the last one is 260.

Thank you for your attention.


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. :blush:

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