is defining an std::function slower than the normal definition of a function ?

Правка en2, от i3mr125, 2023-10-23 15:48:55

so I was solving a standard dp problem but it got TLE using this form of the calc function

code

and it passed by defining the same function exactly outside the solve function like this.

code

So I really don't understand the issue here

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский i3mr125 2023-10-23 15:48:55 46
en1 Английский i3mr125 2023-10-23 15:48:06 1413 Initial revision (published)