Finding the longest palindrome from the given string
You will hit a 64MB memory restriction regardless of how you allocate an array 20+ million entries strong. So you need to revisit an algorithm.

The problem doesn't look like a DP to begin with. Notice that the mere initialization of the array drives the time complexity to be quadratic. If you are happy with the quadratic time, notice that a naive approach requires constant space.

And since the quadratic time complexity will TLE on any decent OJ, you shall check out Manacher's algorithm.