A vector of size n*n*m works but not m*n*n. Why?

Revision en1, by TheDutchLion, 2025-01-15 18:02:07

I have recently encountered a problem where my solution that used a vector of size n * n * m was giving TLE whereas when i changed the dimension to m * n * n it got accepted.(I kept the remaining logic and the rest of the code same).

Question 2057E1 - Another Exercise on Graphs (Easy Version)

TLE solution 301118680

ACCEPTED solution 301119202

Tags memory management, vector, tle, dp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English TheDutchLion 2025-01-15 18:02:07 395 Initial revision (published)