Tuesday, August 19, 2014

COJ 1566. Cannon Balls

After having a look at a few layers you will figure out how the pyramid is built. 




















The first layer is only one ball. The second layer needs to have 4 balls so that the one can be on the second layer's top. The red dots show the spots were the previous layer is laid. As you can see every layer needs to be a square, and the side is the index of it's own layer. 


       FULL SOURCE CODE

No comments:

Post a Comment