Canadian Computing Competition: 2011 Stage 1, Senior #3
Alice is looking at a crystal through a microscope. Alice's microscope has the interesting feature that it can superimpose grid lines over the image that she is looking at.
At level 1 of magnification, Alice sees the image as follows:
Notice that at level 1, there is a
However, as Alice increases the magnification, the leaf pattern becomes more intricate.
At level 2 of the magnification, Alice sees the image with a
Given that Alice's microscope has up to 13 levels of magnification, she would like to try to quantify the detail of each grid cell at every one of these magnification levels.
Specifically, since there is a
Given an integer magnification level
Input Specification
The first line of input will be
Output Specification
The output will be empty
, if the specified grid cell is empty, or crystal
if that grid cell contains crystal.
Sample Input
4
1 1 1
1 1 0
1 2 1
2 8 5
Output for Sample Input
empty
crystal
crystal
crystal
Note: At least 40% of the test cases will have
Comments
Fun fact! If ur really good at math you can create a formula to solve this problem (but not fully)! It also runs alot faster!
I just find this kinda fun...
This comment is hidden due to too much negative feedback. Show it anyway.
it means you need to use recursion mate.
Because you can use Recursion to solve it.
For
, does the pattern recurse onto all of the non-encompassed squares on the top or only on the three local maximum squares?
Only on top of the three local maximum squares. If you don't implement that right, test 5 won't work.