Calculate the nth Catalan number
问题 I wrote some code to calculate the Nth catalan number. However, it isn't returning the correct result when N=20 and onwards. The results when N<20 is correct though, so I'm not sure what is wrong. So, when N=20, its supposed to return 6564120420, but it returns 2269153124 for me. Can someone point me in the right direction? #include <iostream> using namespace std; unsigned long int countTree(unsigned int N) { //used to store catalan numbers unsigned long int catalan[N+1]; //N(0)=N(1)=1