Why is C++ 14 better than C++ 20 in memory management here?

Revision en1, by Nozarashi, 2022-01-12 18:40:38

Hello all, I participated in Codeforces Round #765 (Div. 2). I implemented a 0/1 Trie for {D. Binary Spiders} => {https://codeforces.me/contest/1625/problem/D}

When I used C++17 {https://codeforces.me/contest/1625/submission/142523361} it got an MLE verdict and the memory required is 262144 KB.

However when I changed it to C++14 {https://codeforces.me/contest/1625/submission/142523239} it got an AC verdict and the memory required is 161068 KB.

Why does this happen, how can the same code require so much more memory in C++20? Can anyone help me? Kinda seems like black magic to me.

Thank you!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Nozarashi 2022-01-12 18:41:13 4 Tiny change: 'I used C++17 {https://' -> 'I used C++20 {https://'
en1 English Nozarashi 2022-01-12 18:40:38 670 Initial revision (published)