Dynamic Programming Problem Solving Session - 2 || Tackle DP Problems with Ease

preview_player
Показать описание
*Kindly Ignore the Background Music*
Links to all problems discussed:

Hey everyone! So this is the recording of the 2nd problem-solving session I took on Intermediate Dynamic Programming. Hope you get to learn something new after watching this.

If you are interested in attending free classes based on competitive programming and ask cp related and other doubts, then you are welcome to join my discord server.

Contact me here :

#CP #Codeforces #Dynamic_Programming #Tutorial

Timestamps :
0:00 - Intro + Agenda
1:46 - Problem 1 - Add One(1600)
22:06 - Problem 2 - The Sports Festival(1800)
54:00 - Problem 3 - Explorer Space(1800)
Рекомендации по теме
Комментарии
Автор

Me trying dp meanwhile background sounds 😭🔥😂

nitianvlogs
Автор

40:05
I have a doubt in problem 2, from the greedy observation we know that both the maximal and the minimal elements should come at the last and the second last positions only so
Can we do it like this first figure out the ans for i+1 to j-1 and then
From the two transition choices :
if we place the minimum at last dp(i, j) = dp(i+1, j-1) + a[j]-a[i+1] + a[j]-a[i]
And when we place maximum element at last
dp(i, j) = dp(i+1, j-1) + a[j-1]-a[i] + a[j]-a[i]
And we take min of both these
Can we do it so ?
Because from the transition what you have written, actually we will also be considering the following type cases: first we are at the state (i, j), here suppose we decide to put the minimum element at last, then we move to the state (i+1, j) and here too we decide to put the minimum element at the last, which is not required but it wont matter as when we take the minimum possible answer, these choices produce a greater value and get reject, can you please tell if my transitions are correct

Hap
Автор

Can you please do a solution video on problem "Empty string" from additional problem part of cses. Not able to find any proper explanation for this anywhere. Thanks!

aaravarya
Автор

Thank you sir u explained very well..:)

codingwithanonymous
Автор

Sir please put these in a playlist and contests discussion in othere.

mohammedarshkhan
Автор

Kindly teach us DP nobody can teach dp well on YouTube or share your resources from where you learn DP

HassanHassan-chml
Автор

3 5 2 6 -> 0 2 3 4 =9
3 2 5 6 ->0 1 3 4 =8
but you said maximum and and minimum should lie at last and second last.
Am i missing something here?

abhisheksingh