std::dequeue unusually high memory usage

Revision en1, by Aarush, 2024-10-20 19:08:13

101911E - Painting the Fence

When I first got MLE, I suspected it might be because of #define int long long, but even after changing that I still got MLE. I couldn't figure out what was wrong as I was sure that the space was O(n).

When I used std::set instead of std::dequeue it used only 100MB memory.

std::dequeue code
std::set code

Can anybody explain why std::dequeue has such high memory usage?

Tags cpp, debugging

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English Aarush 2024-10-20 19:14:39 0 (published)
en2 English Aarush 2024-10-20 19:12:36 8 Tiny change: 'std::dequeue` it use' -> 'std::deque` it use'
en1 English Aarush 2024-10-20 19:08:13 9509 Initial revision (saved to drafts)