Vectors give TLE?

Revision en1, by Raks_splunk, 2024-06-27 10:16:18

Was solving Matrix chain multiplication on GFG using memoization and got this weird error.

Code works fine when I use a 2D array to store the states, But Gives TLE when vectors are used. Is there any specific reason for this?

Accepted submission: https://pastebin.com/3ZdC61Vc

TLE submission: https://pastebin.com/VbdFrzDJ

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Raks_splunk 2024-06-27 10:16:18 350 Initial revision (published)