Help on USACO training Cow Pedigrees(nocows)

Link to Training Page

After spending some time trying to solve this problem, I ended up looking at the solution. Turns out the official solution calls for 2 matrices, one called table and one called smalltrees.

Why would you make a smalltrees matrix, its whole purpose being to count the number of ways to create a tree of height-2, when you can look it up on the main table matrix?

Many people here don’t have an account on the training website. Could you provide a transcript of the problem?

Not the training page but a replica with the analysis solution

I don’t think it’s necessary, only being there for convenience.
If you look at the Java solution, it only uses 1 2D array.