We all face this dp is a hard nut to crack.I would recommmend to first master recursion before jumping into solving dp because recursion is the first step for dp(not always but it gives you a great start).
After that try to understand why do we use dp.For understanding the underlying reason i will be sharing links of few videos which really helped me to think why to use dp.
watch this video to understand how or why dp is used.
And if you think you cant write recursive definition of a program like subset sum or coin change or minimum jumps to reach till end i would recommend you to learn recursion first.
This is not how segment tree works
See 2-3 videos on youtube about segment tree.
Just pick an easy problem, Copy paste code of segment tree from any resource, try editing it and get an AC (Don’t try to go in depth about how is this working). You’ll need lots of efforts for it. Do this for 2-3 easy problems. Then “try” understanding each and every line of code of segment tree. And then solve the problems given by me.
Even I am feeling the same but I am starting to realise that there is much more to learn. I know that feeling of “want to but can’t solve problems related to dp(maybe some of them)” (in my case even other topics like recursion)… What I am doing to overcome is I am practicing some problems related to dp(or any other topic) and just move on to learn different topics from here
I am doing this because I think rather than perfecting a single topic in few weeks, perfecting many topics in few months is far better. And this frustration of wanting to solve moderate to hard problem is normal for beginners (few months in cp) I guess.
My icpc team name is " dp_nahi_aati " XD
Dp is the toughest topic in CP IMO.
It needs lots of practice to be decent at it. Don’t lose hopes, you’ll need time to be good at it. Upsolve problems which you can’t solve during contest.
PS: Is still struggle a lot at DP problems.
yup i too get frustrated sometimes but when i look back 1 year back when i just started coding and could’nt even write a bubble sort program and today i can solve dp,trees,graphs ,heap i think eventually one day i would get better at this.Even though i am an ece student not cse and
I think there is no definition to a “good” programmer. You are “good” (based on stars) for me while for you maybe l_returns is “good”.
After all, CP is quite an unsatisfying sport.
So please do not quit. I think if someone can can do something easily, there would be no fun and learning at all.
Getting stuck somewhere and then after doing what you are doing now and then someday looking back and laughing at the past version of yourself and realizing how much you have improved, this is what makes CP worth doing for me.