std::deque unusually high memory usage

Revision en2, by ArushN27, 2024-10-20 19:12:36

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::deque it used only 100MB memory.

std::deque code
std::set code

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

Tags cpp, debugging

History

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