proAakash's blog

By proAakash, history, 5 hours ago, In English

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?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it