Should I quit competitive programing...?

I am trying hard to be a good programer.i solved many problems at differentes platforms like hakerearth,hakerrank,codeforces,codechef and spoj.

now i am trying to learn #dynamic_prgraming but i can’t even solve a single problem of DP. pls gys shere some good resorses which can help me to overcome.

i feel stuck now at this point to improve my skill,plese help gys.
so that i can continue…

2 Likes

Bro DP takes around 6 months to get good at it …so if you are not able to solve any problems right now then don’t think that you are the only one who is facing this … Keep trying hard

2 Likes

I am trying hard to be a good programer

I think it doesn’t feel so hard when you enjoy it but if you are not enjoying it…yes, you should quit immediately

6 Likes

That’s like me, but with segment trees… Maybe one day I’ll get better at it :grinning:

Absolutely !

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.
Thanks!
3 Likes

For segment tree solve
CodeChef: Practical coding for everyone
CodeChef: Practical coding for everyone
FLIPCOIN Problem - CodeChef
MULTQ3 Problem - CodeChef

You will be decent at it if you will solve these problems.
This assumes you have solved basic segment tree ques ( range sum query, range min query etc).

5 Likes

Is this for me?, Thanks, but I don’t understand the concept😥. Once i fully understand how it works I’ll be sure to attempt them😀

This is not how segment tree works :stuck_out_tongue:
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.

3 Likes

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.

3 Likes

If you say so…, I’ll try at least one question by midnight today.

1 Like

Bro, Solving DP is the real game.
You are quitting without even playing it.

3 Likes

Errichto has some great videos on YouTube for Dynamic Programming. You can look into his channel.

3 Likes

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.

3 Likes

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 :wink: and

2 Likes

This is what still keeps me going… Thanks… Looking forward to get better next year :grin:

1 Like

This is better than my strategy. I just picked Sereja and Brackets of cf and tried to solve it for 2-3 days which was quite frustrating, but when I got AC, it was worth it and felt very rewarding.

1 Like

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.

1 Like

I’ve solved the last two problems you mentioned. They are Segment Tree + Lazy Propagation . I know segment tree but i sometimes get stuck in lazy propagation implementation :frowning:

1 Like

Lazy propagation is just extension of segment tree, Just add one lazy tree.
I don’t remember good examples for lazy propagation right now. Will share here if I can find them.

1 Like