memory limit exceeded!! HOW?

Revision en1, by proAakash, 2024-07-27 20:52:57

problem:-https://codeforces.com/contest/1996/problem/C

I was solving the above problem using C++ vector of maps and i got memory limit exceeded. But I solved the same problem with the same logic using vectors of vector and got accepted solution .I am unable to understand why the solution using maps failed.

Solution using maps:-https://codeforces.com/contest/1996/submission/273021146

Solution using vectors of vector:-https://codeforces.com/contest/1996/submission/273020910

Can someone expalin?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English proAakash 2024-07-27 20:58:42 3
en2 English proAakash 2024-07-27 20:57:31 2 Tiny change: '\nproblem:-h' -> 'problem:-h'
en1 English proAakash 2024-07-27 20:52:57 541 Initial revision (published)