### Clark_Kent's blog

By Clark_Kent, history, 7 weeks ago,

In this problem, 757D - Felicity's Big Secret Revealed the space complexity N*(2^20) causes MLE in JAVA whereas gets accepted in C++. The DP array uses space N*(2^20) in my submission.

Can somebody help me understand why this is happening? Is it a java thing?

• -2

 » 7 weeks ago, # |   +4 Don't use java lol
 » 7 weeks ago, # | ← Rev. 2 →   0 Where is the C++ accepted solution with the same approach? https://codeforces.com/contest/757/submission/124896403 try to understand why
 » 7 weeks ago, # |   +10 You are allocating a $N \, 2^{20}$ sized array of 64 bit integers (8 bytes). $N$ can go up to 75. This means you are allocating $8 \cdot 75 \cdot 2^{20} \, \text{bytes} = 600 \, \text{MiB}$. The memory limit for that problem is $512 \, \text{MiB}$.