c++ - How to handle very large matrices (e.g. 1000000 by 1000000) -
My question is very common..and its not a duplicate ..
When we like something Announce this as int mat [1000000] [1000000];
It is certain that this will give an error by saying the matrix size is too big.
I have seen many problems on many competitive programming websites where we need to declare a 2D matrix with 10 ^ 6 rows, columns, I know that to reduce the matrix size, always its There are some tricks attached to it.
That's why I just want to ask what can we do in the case of possible ways or tricks to reduce the size in such cases .. This means what type of algorithm is like a DP or someone else Need to solve ??
std :: map
instead of the 2D array.
Comments
Post a Comment