Does Codechef really have no memory limits?

I was going through an old code of mine. I noticed something very funny. I had initialized an array of size 10^9 + 1 and miraculously it still didn’t show MLE at that time.
Here is the link to the solution.

There is no memory limit. But you are constrainted by INT_MAX bytes for compile time static allocation and you will get TLE if you use malloc a lot for run time memory allocation if you try to bypass INT_MAX.

6 Likes

INT_MAX being 2^{31} - 1 ?

The maximum memory used so far by a solution without giving MLE is 8188 MB which is very close to 8 GB. So, what I guess is that the memory limit is 8 GB which is 231 ints.

1 Like

What are the memory limit and stack size on CodeChef? is the current configuration. The memory reported in submissions is sometimes much higher than the limit, but that is because of differences in what is being measured, and compiler optimizations. The actual memory used is bounded by 1.5 GB.

1 Like