Hi Everyone,
Apologies if this post is not formatted properly or does not fit certain cf blog standards as this is my first blog post and I do not read many blogs.
I have been doing codeforces and USACO for over a year now, and I've always practiced just by doing problems and when I get stuck I read the solution, implement etc. I've been told to just do more problems above your level so that's what I've tried to do. However, although I saw fast improvement initially, I feel like I've just hit a certain point where I can't solve questions rated above 1200 and USACO Silver problems and beyond. I've noticed many of my classmates who were worse than me now pass my level after preparing for a much shorter amount of time and I am not sure what I need to change or fix (admittedly this is a little more selfish though and does not matter as much, my main point is that I am putting in effort but feeling stuck at one level).
I've read and been told that after missing a problem, you need to think about how you would arrive to the solution. However, everytime I can't solve a problem (which I attempt for 15-20 min), I read the solution and it just becomes so obvious that I can't think about how I would approach it. Like the key observation just seems so obvious to be made and I can't understand how I didn't see it before so when I consider how I would arrive to it, my only thought is that you simply see it because it is so obvious.
One thing I did notice, however, is that for many of the problems I did not solve originally, if I go back to them some time later (even 2-3 weeks later), I will forget how to do them even though, at the time, the solution made perfect sense to me.
So I guess in short, I have been trying to just do problems around my level and implement those that I miss, but now I have reached a plateu. For those that followed this (intuitive) strategy and it worked, is there anything you notice that I am doing wrong? I feel that possibly my whole approach or even mindset is incorrect when it comes to learning and improving in competitive programming as I followed the standard advice but am stuck. For more background information, I did competitive math up to AIME level but also hit a plateu prior to doing competitive programming.
Thank you so much!
Dont be concerned about my rating as it does not reflect my actual problem solving skills as I have another account. With that being said, I have actually solved problems around the rating of 2000 on my own so I feel I can help a bit.
A few years ago I used to have this mental block that tough problems are out of range and it is hopeless for me. I overcame this with kind of a torturous way — I picked a difficult problem and decided I will not solve any other problem in my life until I have solved this one and I will attempt this for as long it takes. Even when I had no clue I honestly spent like 12 hrs thinking about the problem and finally some idea used to hit me, some insight and I used to arrive at the solution. This gave me the much needed confidence and the way of thinking required to solve tough problems. Spend as much amount of time as needed on a problem, trying to solve it for 12 hr a day until it is solved. Thinking about it even while eating or before bed, finally coming to peace when it is resolved.
This should not be done everytime, just for a few problems until you cross that plateau or gain that self confidence and after that you can solve the problems normally.
That was my 2 cents. All the best!
Thank you so much, so maybe I can apply this even with problems that are not too difficult for me but I struggle to solve. I can just force myself to spend an extreme amount of time thinking about the problem. I will definitely try this out, thanks again!
When you can't solve a problem, you should not be able to say another new fact about it, in other words only when you'd be wasting time saying the same thing. When you read editorial, you should just read as little as possible and try thinking longer. Are you truly feeling exhausted when you look at hint? I think you definitely can be after 15-20min, but not for every single problem, and also many people do not work to their mental exhaustion point. I also think it's good to time yourself to have pressure to work your hardest and say as many new things as fast as possible like in real contest.
Don't worry about solving whole problem at once, feel good about yourself whenever you can say anything new about problem no matter how small or irrelevant it feels, and do more guess and check about properties and work through more samples before you give up. Many people who get stuck don't guess enough. Write down your insights while doing a problem and make sure you are always adding something new no matter what it is you haven't wrote before.
If you did not solve it, consider why it is so obvious in hindsight but not initially. Besides how you would just solve that problem, what type of questions to ask yourself and frameworks of thinking could you use to solve a problem with similar insights in the future. Your goal should be to make simpler and more fundamental steps you use in every problem to through small steps and insights at a time eventually arrive at the solution, and adjust those steps with feedback from every problem you try. Likely you are not breaking things down enough. Try actually writing out notes about common insights and steps between problems you can use in future.
Look at my guide for more details, I mostly just emphasized main points that people don't follow correctly I wrote there (and i just edited some parts to better emphasize).
Ok got it, so basically I need to be reaching that mental exhaustian point on problems rather than focusing on a certain time frame. I also need to write down momre insights and breakdown the problem solving process more. I will look at your guide too. Thank you!
If I solve Div. 3 problems on my own, does this mean I should no longer practice Div. 3? It takes me 2-6 hours to solve everything in Div. 3 just by my own thinking.
For example: https://codeforces.net/contest/1914/problem/F
It took me a while to figure out what's wrong with all my ideas that didn't work and I figured out the working idea the next day. The idea is still not the simplest one (my idea is slower and takes a bit more code).
According to your guide, I'm solving too many problems on my own.
I would think then just the last two problems are worth solving for you if that is normally the case, besides occasional vc's (maybe once, twice a week if it is your main goal now). But as in my guide, i wouldn't practice by division, i'd practice by rating.
I've noticed many weaker participants have a bottleneck in how fast they can figure out an idea they try is a wrong idea, which I think is the case for you. This just gets better with practice, but when you have an idea more consciously consider what are all individual assumptions it relies upon and if it's missing any cases in the problem. If still not sure then build a sample based on what you think could possibly end up wrong and you either end up with some sort of proof (often by contradiction) that it works or doesn't. Also, try thinking more one step at a time at first with what you know, and don't make bigger leaps of logic until more stuck.
Thanks for the feedback. I'll try it out.
I found Div. 2 ratings to be a bit misleading. For example C here https://codeforces.net/contest/1918/problem/C is 1400, but I'm pretty sure it's maybe 60 minutes of thinking for me, if not even more. A and B are 5-30 minutes of thinking.
It looks like I don't have a knowledge problem but just a hole in my problem solving. I waste too much time on approaches that don't work or take too long to prove that they do work.
What I have been doing is not effective.
For example, in my blog entry 20 months ago I describe the thought process https://codeforces.net/blog/entry/103233 . The solution is 1 line of code, yet it took me probably 60-200 minutes to come up with it and I cannot imagine a way where I would come up with it in 5 minutes. Yet it is rated only 1400.
Someone responded to me there and I don't even understand their reponse. I feel similar when I read editorials, most of the time the idea sounds correct but I don't see how I can convince myself it's correct. The idea is just outside of what I can come up with so I just don't internalize it (nim-like games, string problems with infinite moves allowed, all have some thought tricks that take me a long time to find).
Most problems at our level are simple. I've solved 100s of problems on cses.fi. I'm familiar with most standard algorithms. I'm also familiar with common proof methods (induction, counter example etc.). Many problems on cses.fi are easy because they very easily map to an algorithm (dijkstra, scc, recursive formulas, tree algs, bfs, dfs, union find, inclusion-exclusion etc.). After solving them, I might look at the shortest solution and learn a simpler way of implementing something (a 3 line LIS algorithm or short union find or binary lifting with a single loop, or quick 1-scc check with a simple bfs etc.). These simpler solutions allow for more associations to form about a standard algorithm and develop a deeper understanding for the algorithm implementation.
Reading solutions when you aren't familiar with standard algorithms and techniques is fine. Once you know standard tricks and are comfortable implementing them, then it is clear something else is lacking.
At that point you shouldn't read the solutions at all. Just keep a list of problems you don't know how to solve and go over it every day. Think about it a little, think about a favorite one before sleep and eventually you'll come up with a solution. If you want to read a solution, then after reading it, try to come up with extensions or restrictions to the problem and see if you can figure out a solution for that.
Websites like these are good because you have a list of problems that are sorted by difficulty. This means you don't have to be afraid of accidentally picking a problem that is far outside of your experience.
For example, I couldn't solve Div. 2, B or C today, I know B has something to do with sorting and C with bits but I just didn't know how to work through it. Of course, I quit after 45 minutes, being stuck is better done over multiple days than in one session.
As you sleep a bunch of days, you'll have more of these associations chunked and you'll solve harder problems with similar speed and that's all.
If you have a goal with real world impact (winning a contest or whatever), then you might need to read solutions and put in much more wasted effort to guarantee you'll make as much progress as you can. If not, then give yourself time and enjoy the process. If you feel stuck, then take a pause, you can continue tomorrow, the problem will wait for you and you'll have something interesting to do the next day.
Thank you! I will definitely implement this into my practicing. So I should really start refraining from looking at the solution and just come back to the problem in the future to continue working at it, rather than immediately look at sol. Thank you!
No problem. For example, I just solved this problem https://codeforces.net/contest/1914/problem/D .
It was about 5-15 minutes of thinking.
To not discard that thinking, I posed myself a different problem: What if there are $$$m$$$ activities, not 3? How would the algorithm work then?
I already have a clear picture of what the problem is, but it is just harder. This saves you time but also creates stronger associations to correct approaches. Next time, you don't care about 3 activities, you know the underlying deep idea of why the $$$m$$$ algorithm works as fast as possible.