2d string array

why is it giving error when i make 2d string array
like string dp[1000][1000];
but not when i make string dp[100][1000];
what should i do if i want to increase the size of row?

hello @varu

because of too much memory allocation it is showing error.

first build lcs table .
and use that table to generate string