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
is defining an std::function slower than the normal definition of a function ?
so I was solving a standard dp problem but it got TLE using this form of the calc function
and it passed by defining the same function exactly outside the solve function like this.
So I really don't understand the issue here