kpw29's blog

By kpw29, 3 years ago, In English

Introduction

So, I set myself that challenge to retire as a red coder before 24.09.2020... and I failed miserably. At least I am less delayed than most civil infrastructure projects.

This blog will be a recap of this short challenge with a mixture of some tips on practicing (for all levels!), some random life advice and, of course my bad sense of humour. It is dedicated to all those who aren't wonderkids, go from failure to failure and feel like banging their head into a wall during most of their competitive programming journey. Whatever your goal is, I'd like to strengthen your beliefs — you can do it!

How it all started

My skill level has been in constant stagnation for years. I've always thought that I'm just not talented enough to be a grandmaster. Although I've been red twice in the past, it was quite lucky and the next contests were solid $$$-137$$$ and $$$-189$$$ so that life could get back to normal. If you know a bit about chess titles, you are probably aware that you need to score three so-called norms to be granted a title for your lifetime. Thus, I wanted my third one.

In 2019 I noticed that an acquaintance of mine, kostka did something very impressive. His rating just exploded. I was inspired by Bartosz's improvement. Maybe I wasn't doomed to be yellow forever?

By the way, there's also a thread about users with inspirational rating graphs

What didn't work — the beginning

At the beginning of the challenge (spring 2020) I didn't really change much in my CP. I was kinda doing the same thing over and over, orbiting around 2300, hoping that a good performance is bestowed upon me and I can finally get red. Oh, how foolish it was... Just participating in contests did not, obviously, increase my skill.

Around June 2021 I was already almost late one year with completing the challenge. My exams were over, the delayed ICPC finals (September 2021) were coming. I decided to take my practice seriously. I wanted to be a better competitor and team member. For that, I needed to seriously improve. I started doing virtual CF contests and upsolving almost every day. That was quite a challenge, because I had already started a full-time job. I would wake up before 7 AM, do some CF contest, and then go to work. I, the lazy night owl, had to become a morning coder, it was painful at start, but doable. That was the only way if I wanted to keep up with my training partner, tnowak (ahh, those lucky university students). I did around 45 contests during the summer, upsolving usually at least one problem per contest. Yet, my CF rating wouldn't move. Actually, despite feeling much more confident in implementation, I lost around 200 rating points after the summer. I was quite purple then, and I needed to climb 450 rating points to regain GM title. Yikes.

The truth is that although older CF contests were very good practice for ICPC, they are not a very good source if you want to gain rating in 2022 (at the end of my trainings I was doing some contests from the 200-300 range...). Modern problems are different, rarely focusing on implementing some standard algorithms, much more mathematical instead. A nice library won't help anymore.

What worked for me

Six months ago demoralizer wrote a blog (it is deleted/hidden now, I can't find it anymore) offering coaching for yellow competitors hoping to get better. I reached out, and he, being a really nice guy, shared with me his recipe: First solved 100 2000 rated problems then 100 2100 then 100 2200 and so on...I reached red before I could solve a 100 2300 problems...

Fair enough, such a grind seemed doable. But I added a little twist to it — I practiced on AtCoder since I was notoriously bad at problems involving combinatorics or other mathsy stuff. And I needed to improve my thinking skills, too. With the help of kenkoooo website (great website, check it out!), I could easily find problems at the right level. In the next three months, I solved 100 yellowish (2000-2400 rating) problems. After that, tnowak became curious about effectiveness of this training and suggested I do a couple of virtual contests to compare my performances. The results were astonishing. The average of five contests I did was around 2500, two hundred rating points above the summer average. After two years of struggle, I finally became better.

Seeing the tangible results, I continued my trainings this way, skipping to orange (2400-2800) problems this time. I got red on the 23rd April, by the time I managed to solve 50 of them. Roughly two years after I started the _simple_challenge of gaining 100 rating points.

A universal practice method

If you're stuck or wondering how to improve, here's a simple recipe how to get better. The advice to "solve more problems" always irritated me. You may be unsure which problems to solve, how long to solve them, or just want to have a practice method that worked for someone else, here is what you need to do.

  1. Find a range of Atcoder problems which you can solve in around 60-90 minutes.
  2. Solve them, one by one, in some order which sounds reasonable to you. You can open many problems and think about them in parallel. You don't need to get them accepted in order, but try to get all the problems you see accepted eventually. Try not to look at editorials, but don't be too afraid to look at the editorial if you spent significantly longer than expected. You failed to solve that one, it happens.
  3. Repeat. You'll improve quickly if you just follow this routine. Probably quicker than I did.

Here's some rationale why it should work. This problems range are the critical problems for you, they are in something that Um_nik in the best and truthest blog on Codeforces ever calls an interesting interval. If you haven't read his blog, go and do it now. Seriously, it's the best advice. Worked even for me. Thanks, Alex! (though to be precise, I have already been applying the takeaways from the blog before he published them. But I wanted to mention his name since he described it first and very well — I'm just highlighting that this indeed DOES work).

To improve, you want to be tackling the problems that you would be reasonably hoping to solve during the contest, and be faster in getting them accepted. That has three factors: coming up with the solution idea, clarifying the solution and making sure that it works, and only then implementing it. The third step should usually be straightforward -- if you have troubles implementing your solution, it means you haven't thought through it well enough. The faster you are at getting these challenging (for you) problems accepted, the more likely you are to solve more problems during the contest (as you have more time), and by facing obstacles on the right level you also don't waste too much time. Some may argue that usually solve within the contest level is too easy, or that reading editorials is bad. I didn't have infinite time to think about problems, and I wanted to feel confident that the problems are within my reach so that I can avoid the temptation to look at the editorial. That felt very important to me. When I was in high school, my teacher would usually give the same extremely difficult problem over and over to the top students until someone finally solved it. I developed sort of a PTSD for too difficult problems, wanting to quit as soon as I saw one of them again.

If you're on your own however, nobody will be torturing you with too hard problems, but you need to find a way to efficiently select problems to solve. I would always solve problems randomly — from various online judges, competitions or from my juniors. But overall I wasted a lot of time searching for tasks or solving ones that were not developing me (that includes participating in contests that mostly consist of problems you can solve). This is where the proposed practice method excels — you don't do that at all. Because AtCoder problems are all (or almost all) of very high quality, you have a nearly infinite supply of good problems to practice on. A word of warning here — if you're preparing for ICPC or some other coding-and-algorithm-heavy competition, consider moving to something ICPC-like from time to time).

If you really like contests, you can also use the kenkoooo website to create contests out of the problems from your range. It's also a fun way to challenge yourself. An additional tip would be to try to do it page-by-page. While it may not work like that for everyone, I found it useful to set mini goals for myself, and felt very happy after filling the entire page with shiny green colour. I practiced here

Do you have to do it?

I'd like to conclude with a small remark to be wise about your goals. Writing software is all about tradeoffs. Your life is all about tradeoffs. There's always an opportunity cost, for all things you do. During your practice time you could instead be hanging out with friends, practicing your interview skills to get a real job, or getting involved in some random machine learning startup that will make you rich. Before you declare you want to be a Legendary grandmaster (while cyan at the moment), look into the mirror without blindly following the crowd and ask yourself if it's really worth it. If CP is your passion and red/orange/purple is your dream, go ahead and do it! I believe in you :)

  • Vote: I like it
  • +435
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it +66 Vote: I do not like it

Honorary mention to -is-this-fft-, whose blog about self-deception is another extremely valuable resource which I can relate to, but didn't really fit anywhere in the narrative...

»
3 years ago, # |
  Vote: I like it +25 Vote: I do not like it

What would you change / add to this training routine if I am preparing for IOI instead of CF rating or ICPC results? How similar would the training routine be?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    I never qualified for IOI and I don't know what would be a good training routine for IOI. I guess similar but with slightly harder problems should work fine.

    For ICPC, depends if you want to improve personally or as a team. I'd do the same thing, but on Codeforces (using its search by difficulty feature) problems that appeared in rounds 200-600. They contain more standard, coding oriented problems.

    But in general your goal is to improve. If you improve, your performance at those competitions in principle should also improve. I feel like "just doing contests" is suboptimal because you waste too much time trying to solve problems which are not developing you.

»
3 years ago, # |
  Vote: I like it +35 Vote: I do not like it

Did you also use problems of those ratings from ABC, or only ARC and AGC?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    I used both. ABCs were a bit easier and more standard. But that didn't seem like a big problem. Although when I was doing orange problems I tried to avoid ABCs — life became much more difficult then...

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Really get inspired a lot from your words.

I have been doing virtual contests from round 1 for a long time (now it is about round 280), and try my best to solve until Div1 D. But my rating still does not improve. Maybe it is because as you said

"The truth is that although older CF contests were very good practice for ICPC, they are not a very good source if you want to gain rating in 2022 (at the end of my trainings I was doing some contests from the 200-300 range...). Modern problems are different, rarely focusing on implementing some standard algorithms, much more mathematical instead. A nice library won't help anymore."

Recently, I started participating atcoder contests (not virtual contests), including ABC, ARC and AGC, and find it helps a lot. So, my training nowadays is, virtual contests in eraly cf rounds (learn classic algorithms from practice), and contests in atcoder (follow up what modern problems ask, and also as a test to check whether I get improved or not).

Really respect your hard working, and not giving up. I will also try my best.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Pretty cool blog.

»
3 years ago, # |
  Vote: I like it +3 Vote: I do not like it

When I was in high school, my teacher would usually give the same extremely difficult problem over and over to the top students until someone finally solved it. I developed sort of a PTSD for too difficult problems, wanting to quit as soon as I saw one of them again.

can relate...

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +25 Vote: I do not like it

    we definitely didn't go to the same school... :)

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    +200 rating when? Oops, wrong person

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Never. I probably won't participate in a rated contest again. I might test a round and then jinx the contest announcement again...

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

If you look at my user profile, I've been doing smth kind of similar.

»
3 years ago, # |
  Vote: I like it +20 Vote: I do not like it

Congrats for reaching your goal! Thanks for sharing your experience and encouragement.

I just wanted to share a similar site to Kenkoooo but for CodeForces https://cftracker.netlify.app

It might be useful to those who wanna try your practice suggestions using CF problemset (credits to bashem for creating it)

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You mention how old CF problems are not good, but what about new ones? I believe anything with an ID greater than 1500 should be good for today's problems, but that is just my opinion.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I'm not saying they're not good, they're just not really similar to modern CF problems. I couldn't really use it for training since I've literally seen almost every div1 round since 2016...

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

When I was in high school, my teacher would usually give the same extremely difficult problem over and over to the top students until someone finally solved it.

I liked that routine, and even (when I had enough time) I often looked for this type of tasks myself

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

As you said you started to solve 100 problems starting from 2100 ratings! But you definately knew the algorithms. What should a person do if he doesn't know that much algorithm? Should he learn algorithm and practise problems of that topic until he masters it and then start solving rating wise problem or he should start solving rating wise problem and whenever he finds out a new algorithm, he learns it and keep practising it on his level?

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Atcoder problems rarely require any algorithms, and among those they do, you can figure them out.

    If you haven't figured out a task for a while (even though it should be within your reach), you can peek at editorial and check if it uses some keywords you haven't heard of. Don't learn algorithms for the sake of learning algorithms unless you're preparing for ICPC

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You practice on problems that potentially take you 60-90 minutes to solve. So normally how many problems you can solve a day? You can only use the morning time to do it so I guess the number wouldn't be too large, right?

Btw, thanks for the nice article!