Geothermal's blog

By Geothermal, history, 3 years ago, In English

Hi, Codeforces!

Recently, Wind_Eagle wrote a blog with his thoughts on practicing in which he asserted the standard advice to solve more problems is not a reliable way for gray/green users to improve. I don't agree with some of his conclusions: for example, he asserts that it is difficult/impossible to practice at the gray/green level without a coach; as anecdotal evidence, I have never had a coach coordinating my competitive programming practices, and I think many other top competitive programmers have also never had access to coaching. However, I agree that the standard "just solve problems" advice is not working, and I don't know what is the best advice to give to gray/green users on how best to practice, so I wanted to start a discussion of what has worked for people in the past.

Therefore, I have a request for everyone reading this blog: if you are cyan or above, please post a comment sharing what you did to advance to cyan (or perhaps even blue). Everyone is welcome to comment, no matter your current rank and no matter when you made the climb to cyan.

I'm hoping it should be interesting to see if there are any patterns in the responses (e.g. how many people had a coach? What sort of mathematical preparation did most people have? What resources did people use? How do all of things vary when we compare people who started competitive programming many years ago to people who started today?). I'm primarily interested in hearing what you actually did, not what you would recommend to someone else who's currently gray/green (though if you want to give advice after sharing your experience, please feel free to do so). The reason I'm writing this blog is because I think the advice we're giving is generally not working, so I'd like to learn more about what actually worked for others in order to get a better sense of what the "standard" path to cyan is (and how it can perhaps be made more efficient).

I'll start by posting a comment about my own experience and some thoughts on why training as a new competitive programmer is so difficult in the current landscape. I'm looking forward to reading what you have to say!

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

| Write comment?
»
3 years ago, # |
Rev. 2   Vote: I like it +160 Vote: I do not like it

As promised, here's a quick overview of my path to cyan. I did math contests for five years before picking up competitive programming, which meant that my mathematical preparation was not a bottleneck during my first few years as a competitive programmer. (I suspect this is highly unusual--I think the math is a bottleneck for the vast majority of competitive programmers without that kind of experience.) I was introduced to CP through the USACO (I started competing in December 2015); I immediately advanced from Bronze to Silver and then didn't get anywhere on Silver because I had no knowledge of algorithm design, complexity analysis, etc.

The next year, I completed most of the courses in the Coursera specialization at this link, then started reading Competitive Programming 3. I found Chapter 3 of CP3, which covered several strategies frequently used in competitive programming (greedy algorithms, complete search, divide and conquer, and dynamic programming), particularly useful, and I think the night I read it was the point at which I learned how to actually think about programming contest problems. Afterwards, I promoted to USACO Platinum fairly quickly.

I started Codeforces around the same time. I tanked my first contest quite badly (getting hacked on A by missing the n = 0 case and missing B because I didn't know what the XOR operation was), but I made it back to cyan afterwards and climbed fairly steadily afterwards, only reaching my first real bottleneck around high expert/low CM.

A few thoughts on all of this:

  • Obviously, I'm not advocating that you spend five years doing math before even starting programming contests. However, I do think that a lot of what I learned from math contest prep transferred very well to competitive programming. In particular, if you find that your mathematical preparation is stopping you from solving Div. 2 A/Bs, I can strongly recommend Introduction to Counting and Probability and Introduction to Number Theory at this link. Alcumus (available on the same site) is also a good source of practice math problems (for competitive programming, I recommend focusing mainly on higher-level combinatorics/number theory problems).
  • The USACO is vastly more difficult now than it was when I started. I think if the problems were as hard as they are now when I was first competing, the preparation above would definitely not have gotten me to Platinum, and it might not even have been enough for me to pass Silver. Similarly, today, that preparation would not have gotten me to CM on CF, but I think it probably would have been enough for cyan (maybe even blue). And, more importantly, it was enough to show me how to start thinking about programming contest problems, which meant that I could improve on my own by solving more problems.
  • I don't necessarily endorse the Coursera specialization I used; there are probably better resources available now (e.g. the Competitive Programmer's Handbook). I do think CP3 (now, CP4) may still be a useful resource, though--the explanations of algorithms aren't as clear as those in CPH, but the book does a much better job than CPH of showing how algorithms can be applied to actual programming contest problems.
  • You'll notice that I didn't mention any particular sources of practice problems above. That's because at that time, I was not actively solving many practice problems, aside from the occasional past USACO Silver/Gold problem and a handful of easy CF problems here and there. I would not recommend this strategy, and I think I only got away with it because of my math background.
  • While I focused mainly on the USACO for my first few years as a competitive programmer, I did not rely heavily on the USACO training pages and I would not recommend them as a source of practice material. (Their content is almost wholly irrelevant to modern competitive programming, so I view them as valuable only as implementation practice.)
  • As a corollary, though, the way I reached cyan was not by following the standard "just solve problems" advice. I think my math contest prep effectively substituted for problem-solving experience, but I also was able to shortcut a lot of the journey by learning how to think about problems (e.g. by reading CP3). This is largely the inspiration for this blog--my goal is to see if there exists a way to learn how to think about easy problems that is more efficient than the brute-force method of solving a bunch of problems and trying to learn how to think along the way.

Additionally, some comments on why I think training as a gray/cyan is so difficult:

  • I think the main issue gray/cyan CPers face is that they haven't yet developed a framework for thinking about programming contest problems. This, to me, is the hardest part of improving as a competitive programmer--it's a very difficult skill to teach, but before you develop this framework, it's hard to learn from practice problems because you don't yet really know how to think about problems effectively (in particular, it's then hard to look at an editorial and realize how you could have thought of the idea in-contest). I'm largely writing this blog to try to brainstorm the best/most efficient way to learn how to think about solving problems (and, from my POV, how I can teach others to think about solving problems).
  • Training has become particularly challenging over the last few years as almost every contest has shifted towards more ad-hoc problems/fewer educational problems. Six years ago, I could have recommended the USACO to anyone looking to build their fundamental programming contest skills; now, even at the Silver level, USACO problems no longer involve standard applications of algorithms.

Finally, a few thoughts on practicing. All of this has worked for me ever since I was blue/CM; below that point, your mileage may vary (in particular, my approach is largely to solve problems from the CF archive, and I'm not convinced that this works well for new competitive programmers). As a result, treat this as advice primarily intended for more experienced competitors.

Also, as many before me have noted, whether you practice at all is more important than how exactly you practice. However, the approach I outline below has worked for me, and if you follow it, then you'll be practicing rather than thinking about practicing, which is probably a step in the right direction.

  • Solving past Codeforces problems has worked fairly well for me. I generally practice by difficulty (e.g., right now, I would filter the CF archive by ratings 2900-3200 and just solve the problems one by one), rather than by topic (this way, you practice identifying the best technique to use for a problem, which is a very important skill). The one exception is if you're learning a new topic for the first time, in which case solving a handful of problems with that topic may be useful (for example, a few years ago, I spent a few days doing only centroid decomposition problems until I felt comfortable solving them quickly).
  • I disagree with those who argue in favor of never reading editorials. This approach really makes no sense to me--by not reading editorials, you are essentially forcing yourself to derive every programming contest technique for yourselves (or to chance upon the techniques you need while reading articles/blog posts). However, if you can't solve a problem, I recommend putting it aside for a few days and trying again later before giving up and looking at the solution. If you do read the editorial, you must implement the solution independently afterwards--if you can't write the code yourself, you likely don't truly understand the solution, and developing a deep understanding is critical if you want to actually learn to solve similar problems in contest.
  • I think you should generally be solving around 30-70% of problems you attempt independently (without the editorial). Otherwise, you're probably working on problems that are too easy or too hard.
  • After every problem you solve, think critically about your solution and the path you took to finding it (or, if you didn't solve the problem yourself, think about how you could solve a similar problem next time). It can be very valuable to explicitly think about what elements of the problem statement gave the solution away, or what the overall strategy underlying your solution was.

As an example of this last tip, a few months ago, I failed to solve this problem in a global round. After reading and thinking about the editorial, I condensed it into a general problem-solving heuristic: when faced with a difficult problem about the structure of a graph, look for ways in which the graph can be simplified. Then, simplify the graph as much as possible and see if adding the constraint that the graph is fully simplified makes the problem easier to solve. Understanding that heuristic allowed me to solve this problem last week, even though the two problems do not appear at all similar.

Thanks to anyone who read all the way through--I hope you found some of this useful! If you have any questions (about my experience with programming contests, my thoughts on practicing, etc), please feel free to post below.

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

    What are your thoughts on passing USACO Gold?

    I've finished all USACO Gold problems, and I'm treking through USACO Platinum problems. Most of the Platinum problems I haven't solved are way out of my difficulty range.

    I made USACO Gold in January of 2021 — I was specialist at the time. Since then, I've taken 6 USACO contests, all of which I've gotten 1 problem (except for the last contest, in which I got 0). This seems to suggest no progress on competitive programming, since my scores have plateaud and maybe even gotten worse. However, I have gotten significantly better on Codeforces, improving my rating from 1440 to 1940. Through that time, I've practiced exclusively on Codeforces — I just tag problems 2200-2300 and solve them. I suspect that USACO and Codeforces have little correlation, since my improvement on CF has not warranted USACO score increases.

    Recently, I've thought of changed my dynamic, since my USACO isn't going to well. I've been solving more Olympiad problems from BOI, CEOI, APIO, and COCI. Do you think this is a good idea, if my target is USACO? More specifically, what style problems would help with USACO Platinum qualification?

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

      My own experience with USACO is that people tend to either get rekt by them, or can solve them on sight. I spent about 3 years wondering why my scores were consistently 500 points lower than my elementary school friends (who mostly went to that school with 2 nutellas), then got a bunch of 1000s in senior year.

      Not sure if this is much encouragement, but there is indeed light at end of the (rather long) tunnel.

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

      I generally agree with rpeng--I don't find that I instantly solve USACO problems even now, but I do think it's easy to get a near-zero score by choosing the incorrect problem to focus on, and thus, if you make any strategic errors, you'll likely end up getting either a zero or a 1000 (strategy doesn't matter if you can just solve every problem). I also think there's a huge gap between solving one Gold problem and solving all three; the hardest Gold problems are absurdly difficult nowadays (e.g. I maintain that Bovine Genetics would be rated no less than 2500 if it appeared on a CF round).

      For what it's worth, most of my improvement at USACO past the level of modern-day Gold came from solving CF problems. (I was a decidedly average Platinum competitor up until the second half of my senior year, when I decided to focus on CF rating as my main goal and ended up seeing my USACO scores improve substantially as a byproduct.) It sounds like this isn't working for you, though, so while I don't think that OI practice strictly dominates CF for improving at USACO, it probably is a good idea to switch what you're doing if your current approach is failing.

      I'd also spend some time thinking about why what you're doing right now isn't working, both from the perspective of figuring out why you're having trouble with USACO contests (i.e., why aren't you solving the problems you miss, and what could you do to solve them next time?). Similarly, I recommend spending more time reflecting on the problems you solve in order to figure out how to apply the same idea in the future.

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

    galen_colin made a video which discusses how one might structure/organize one's post-solving analysis. You don't have to follow the exact steps, but the process of reflecting after solving a problem is really important.

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

    "I found Chapter 3 of CP3, which covered several strategies frequently used in competitive programming (greedy algorithms, complete search, divide and conquer, and dynamic programming), particularly useful, and I think the night I read it was the point at which I learned how to actually think about programming contest problems. Afterwards, I promoted to USACO Platinum fairly quickly."

    Can you elaborate on what you meant by "learned how to actually think" about programming contest problems?

  • »
    »
    9 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Wow This comment is too much informative Thanks Geothermal

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

I practiced a lot of 1300-1500s from Dec 2020 to Jan 2021 to reach cyan.

»
3 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

I solved 900-1300 problems trying to solve it using a good way necessarily. This way was to write a small understandable code and don't write anything if there is no a clear solution in my head. I practicated so for a 1.5 months and at some contest I noticed that not only 900-1300 but 1400-1500 are also solvable for me. In this time a reached cyan. When I reached blue I did it in a same way — I solved about 50 1600 problems and in two contests I solve 1900 problem after this I got blue.

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

Math. Contest math. AOPS. AMC/AIME. Maybe even textbook math. Did I say math? I honestly think being grey/green is not a cp related issue. It's a problem solving issue. Just do more math. Even if problems are not math related, doing contest math helps build creativity and an intuition for thinking about problems. CP adds the extra hurdle of having to code, so if you're grey or green, I'd just eliminate that hurdle entirely and go back to the fundamentals (solving problems). Once you do more math and are better at problem solving, most of the questions you need to do to reach cyan will seem trivial, except now you have to code it (which isn't the hard part for the vast majority of people). TLDR math.

»
3 years ago, # |
Rev. 4   Vote: I like it +43 Vote: I do not like it

[Deleted]

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

Watched the Joma Tech interview with Errichto. Learned c++. Solved a bunch of leetcode problems. Found codeforces. Solved problems. Got to cyan.

Besides solving problems I also went through the MIT introduction to algorithms course, read most of CLRS, learnt manymany algorithms that I've never used. I do think that these also contributed to my rank, but they contributed much less than simply solving problems.

In conclusion:

  • If you want to get a good rank: solve problems.
  • If you enjoy subjects related to competetive programming: solve interesting hard problems, study interesting and complicated algorithms and datastructures.
»
3 years ago, # |
  Vote: I like it +6 Vote: I do not like it

I filter out and practice 1500-1600 problems and focus on them. I have CF Analytics Extension which is super helpful and allows you to know which rating questions you should focus on (you want to make the problems graph look like a bell curve).

I think it can be demotivating and disheartening to see blues or even purples solving below 200 questions on codeforces. I have solved over 600 questions and yet I just reached cyan. I am not sure if they have been practice problems on other platforms, or they are just naturally talented. However, keep in mind that solving more problems do help!

»
3 years ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

AtCoder Beginner Contest problems are less adhoc than those of CF so that might be an option for Greys/Greens (and others). Adhoc problems can be fun too but I get how beginners may want more immediate feedback for the algos and tricks they learn.

For my history: when I started CF about a year ago I had no previous online judge experience (but I did have a decent non-competitive math background, having solved the 200 first Euler Project problems for example and knew Python). I spent about a month solving old problems in the archive in chronological order. Then when I started doing the contests I got to mid Cyan in more or less one go (but I plateaued there — you can see my graph).

Now besides CF and AtCoder contests I mostly do Virtual Contests as practice and solve the CSES problem set (while reading the Competitive Programmer's Handbook among other resources) to learn new techniques.

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

When I was in the ninth grade, I participated in the Excellence Center of Informatics ( Centru de excelenta ), which was basically additional CS classes with extra curriculum, organized by the school (it wasn't very advanced: binary search, introduction to number theory, a few examples of greedy algorithms etc.). Here was the place where I learnt the basic CP stuff. When I seriously took up CP (in the tenth grade), however, a Romanian book became the main learning support I had, because I didn't have a coach and I didn't know many CP-oriented websites. The book was a shortened and more CP-oriented version of "Introduction to Algorithms" and featured slightly more advanced CS things, such as recursion, backtracking, combinatorics and DP. It explained things very clearly with a lot of exercises and problems alongside their solutions. It was incredibly versatile, as it presented the topics in a very structured way, which was very important for me as a beginner back then. I also used the sequel of the book to learn most of the graph theory I know (in fact, I think flows are the only graph concept which I didn't learn from the book).

When it comes to the online judge, until reaching expert on CF I almost exclusively used pbinfo, a Romanian website. The site includes hundreds of problems grouped into categories, like recursion, DP, greedy, etc. The problems themselves are very standard and half of them are variations of each other, but they were excellent training material nonetheless. Pbinfo also has an archive of OI problems of various dificulties which proved to be very useful.

Before taking up CP, I didn't have an impressive math background (only some random prizes in regional contests). I practised without a coach, using only books and (more recently) CP websites such as cp-algo and Codeforces as learning materials. I find Codeforces extremely valuable if you are already experienced enough in CP to know what to practise and to be able to tackle the ad-hoc nature of the problems. For beginners, I would say that Codeforces because of its ad-hoc problems can be too disorganized for practising. At least in my case, standard problems, featuring basic concepts, with a slight focus on implementation were the most suitable way of training.

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

Very interesting. I surely agree with Wind Eagle about the mathematical bottleneck.

My journey to Cyan (I will try to elaborate a bit more than required to try to mention everything):

  • Reached Cyan in a bit more than 2 months (Time frame : Dec 2020 — Feb 2021)

  • I had solved 188 problems on Codeforces by that time (Used no other platforms and had no significant programming background before, as in did not know things like vector and set in C++ but knew a little bit of python for machine learning).

  • Out of these 188, only 62 were rated above 1000 points.

  • I had no coach, not only for CP but for any kind of programming (Had some high-rated friends for motivation and tips though)

  • I read the competitive programmers handbook to understand the basics algorithms and data-structures (the first 30-40 pages in the book)

  • I believe the reason I could get rated specialist easier than a few other people here is because I was decent in using logic to solve mathematical problems due to studying for the JEE-Advanced college entrance examination.

  • I do not recall any specific topic I learnt in the JEE exam which I used to get to specialist. It was mostly the ability to think logically and mathematically.

  • One thing I am not sure about is whether solving Div 2A, 2B is an optimal way to develop logical ability. I do think that even Div 3A, 3B problems are fairly complex and not the easiest to pick for the literally beginner competitor.

  • Another opinion I see mentioned a lot is to ask everyone to solve problems only above their rating level. I think solving a problem which you only have a 50% chance of solving in a contest is very boring. I prefer solving problems which are a bit lower rated (100-300 points) than your level. This helps me practice for a decent enough time. Ofc people have largely varying opinions over this.

Good luck to all the newbies and pupils wanting to get better

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

I started with learning Data structures and algorithms. Then i learned about applications of Binary search, Sorting(merge sort) and Hashing. Then I just solved 100 problems(or until my ratings increased by 100-200) each having ratings +200 and +300 than my current ratings and also once in a two week tried to fast solve problems having difficulty <= my current rating.

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

I have been grey for about a year,and after learning and practising some basic techniques in luogu,I went back to codeforces then kept practising problems with difficulty of my rating+200,several months later I reached cyan. Now I stick again,when I can't solve a problem,in most cases it's not because I don't know the technique it needs,so I feel hard to improve myself now.:/

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

My path to cyan:

  • June 2019: I "learned" C++ (I had already used JavaScript and PHP) and I qualified to national OI by getting the 5th place in a competition reserved to medalists at national MO (I actually started MO in 2017, but I never trained seriously).
  • September 2019: I got a bronze medal at national OI (it was easy, it was enough to write a brute force for each task). My "training" was on the national CMS, but there are no editorials and I was hardly ever able to solve nontrivial problems (so I actually didn't learn anything new).
  • October 2019: I was invited to an OI camp, but my level was too low to actually understand something (e.g. I wasn't able to write a DFS).
  • November 2019: 2nd OI camp. I became aware of the existence of CPH, I liked it very much and I read the whole book the night before the TST. The next day, I solved my first problem with "two pointers" but I failed to implement SCCs in 4 hours. I was eliminated from the OI camps (mainly because of the bad scores at the 1st camp).
  • February 2020: IIOT final round. After reading the solutions of the tasks I didn't solve, I actually started liking cp. Therefore, I started solving random *1800 problems and reading a lot of editorials (I solved on my own around $$$30\%$$$ of the tasks I attempted). I felt I was finally learning something new.

Then,

  • April 2020: NOI (valid for the TST score), online. After a repechage, I was readmitted to the OI camps team.
  • July 2020: last TST. I qualified to IOI.
  • September 2020: awful performance at IOI.
  • December 2020: bad performance at RMI ($$$22$$$ points in total on the two easiest problems, $$$88.76$$$ points on the hardest problem :D).
  • March 2021: I started doing virtual participation of the ARCs from 058 to 103.
  • June 2021: I started using USACO Guide. Bad performance at IOI.
  • December 2021: decent performance at RMI, but with a lot of facepalms.

Am I improving? My CF score says the opposite, but I feel much better than before at data structures and, in general, at OI. However, I'm still weak overall (data structures bash isn't enough to solve OI problems). I think that I'm not training properly right now: I have trouble finding problems of the right difficulty and learning something new from them.

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

EDU section on codeforces + CSES free book & problemset.

  • »
    »
    15 months ago, # ^ |
      Vote: I like it -9 Vote: I do not like it

    Did you have a mathematical background before CP?

»
3 years ago, # |
Rev. 2   Vote: I like it +21 Vote: I do not like it

Hello! Thank you for this response.

Of course, I understand, that it is possible to train without a coach. I just said that I can't imagine this. Maybe this is just my problem, but I have never met someone IRL who reached cyan without a coach. I glad to hear that situation is a lot better that I thought.

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

    Sure, makes sense (and apologies if I misinterpreted your position!). Thanks for your post today; I think you raised an important point about the failings of the standard advice we give to newcomers, and I'm hoping that the community collectively can make some sense out of the best ways for new competitive programmers to get started.

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

It is as simple as that : I learnt important techniques that occur often in Div2s or Div3s (Like binary search) and I learnt from my mistakes in past contests, other thing to mention is of course "Practice", but not on random problems, I focused on (Interactives, Math and similar, binary search, basic dp, implementation), and finally greedy skills which increase from normal practicing and participating in rounds (not necessarily on codeforces, there are other OJs like Atcoder, DMOJ, Codechef, SPOJ, CSES, ...etc)

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

I learned a programming language and started CP during my 4th semester in university.

If you can't understand

For a more detailed answer: ICPC participants in my uni somewhat introduce CP to people that haven't done it before to "recruit" new participants, that being in a format of around 10 weeks with (weekly) a 5 hour contest, a 10-15 problems list about some topic they explained to us and some explanation about some topic (it starts from STL and gets into seg trees near the end). Since I had uni classes and this, it was hard to participate in cf contests seriously, I remember bombing back to cyan in a contest that I took right after the 5 hour contest while I was tired for example.

Other than that, I used 3-4x the time spent on those things with practice by my own, mostly doing virtuals and picking problems with few solves to try solving them while trying to really understand the solution. This could take up to a couple of days in a single problem depending on the problem, as I was a cyan solving 2500+ rating problems (usually they were around 2000 though probably, at the time there was no problem rating and I still think it's a shit metric) with the help of the editorial.

In my opinion, having experienced people around helped me a lot at first, but it served more as the start of my motivation and within months I passed almost everyone around me in rating, even though I considered (and still think this was true) that I was worse in most formats that weren't codeforces because I was too inexperienced even as a purple.

All in all, Introduction to Programming (1st semester) and Algorithms & Data Structures (2nd semester) classes along with some other logic classes were enough to get me to cyan level. I guess most people just learn enough to get past them though...

»
3 years ago, # |
Rev. 2   Vote: I like it +18 Vote: I do not like it

I had strong math background, when I started doing CP, I didn't have any coaches at all, Just solve more problems worked fine for me.

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

How to reach master?

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

I feel that I'm speaking for a very limited group of participants here, but anyways. I had been an active participant in maths olympiads for probably 10 years, and got bronze medals in IMO 2020 and 2021. In the fall of 2021, I was introduced to CP by my math friends, and to me, reaching expert was barely any trouble. Most likely because that the ideas in many basic CP algorithms are also relevant in maths, and I had also been exposed to other programming books from a young age.

While I didn't have a coach, I had reliable friends that I could ask if I needed help. Throughout my road to blue, though, I barely encountered any difficulties, and that was all without a regular "coach".

The thing in Hong Kong is that there aren't that many CPers. In places like China, where there are hundreds of red, a blue is a nobody. But in Hong Kong, anyone can obtain the support of a great community, and from the team training sessions which weren't very hard to get to. Late January marked the beginning of my training in the form of team training sessions, where I also get to know the majority of the CP community in HK.

I know I'm speaking for a tiny minority, but the hardest part of CP for me (and other MO-turned CPers) is without a doubt debugging. I believe don't lack the thought capability to reach (and I'm gonna be confident) red, but I can barely code a bug-free DFS, and don't even know how to code DSU or segment trees and the like. The toughest tasks are generally graphs and data structures, and it takes forever for me to debug any data structure. For people in a similar spot as me, I would recommend trying a mix of tougher constructive problems and simpler data structure / graph problems, to acquaint yourself with the algorithmic part of CP.

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

    Where can I find CP communities in HK? I am interested.

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

I took an algorithm course at university, had a coach and practiced in teams for regional ICPC contests.

Lessons from that time:

  • practice. a lot.
  • use pen and paper, make notes, only start coding if you're somewhat confident you have all required ideas
  • if your solution fails, try to come up with testcases yourself even if you have access to the failing testcase
  • if you have difficulties to imagine a failing testcase, try to come up with small, basic testcases instead and think about what you could change to introduce new situations
  • if you haven't solved a problem during the live contest, after the contest take a break, then try again and only read the editorial if you're sure you can't come up with a solution yourself
  • if you failed during the contest and have read the editorial, don't just think "Oh, I get it now." — try to implement it
  • even if you've solved a problem, compare your solution to the editorial and to solutions from others
  • if there are multiple solutions or variants to your solution: try to implement several of them to get a better feel for difference in memory consumption and runtime
  • discuss your ideas and solutions with others (only during practice of course)
  • don't focus on rating — focus on learning/understanding

Also there was one problem that I have solved at least 4 times, about a year apart each time. It was nice to see how my coding style had evolved: Each time the solution was different, shorter and better.

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

Solving 1400+ rated adhoc problems helped me to reach cyan

»
3 years ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

When I started codeforces, everyone start at cyan (1500).

Spoiler

In any case, I think rating is a function of skill and knowledge:

  • If your skill is good, but you don't have the necessary knowledge to solve a problem, it is very hard to invent the necessary knowledge in time (or even at all).
  • If your knowledge is good, but you don't have the skill to use said knowledge, then you will likely not solve the problems fast enough for things to matter.

Knowledge for me is something we need to learn "externally" (most commonly from someone or from reading, but can also be gained by experimenting). Examples:

  • Knowledge of the computing system (i.e. cache, memory allocation, cpu instructions).
  • Knowledge of the language I'm coding in (examples for C/C++):
  1. How to write fast codes (i.e. pass by (const) ref / pointer, loop over recursive, template, constexpr, fast io, ...)
  2. How to write codes fast (i.e. when is the performance loss small enough to justify the more convenience syntax)
  3. How to debug (i.e. gdb, cerr, assert, try catch throw, ...)
  • Knowledge of data structures and algorithms:
  1. Knowledge of how a data structure or algorithm work (i.e. vector, set, map complexity, segment/fenwick tree inner working, binary search reasoning, ...).
  2. Knowledge of which problems a data structure / algorithm can do, and at what cost (i.e. segment tree for range min max update, segment tree beat for even more crazy stuff, dynamic self-balancing segment tree for people who don't want to learn treap, ...)
  3. Knowledge of how to implement, or at least use an existing implementation of algorithms and data structures.
  • Knowledge of problems types:
  1. Types of problems like: data structures, flow, simulation, ... (basically the tags in codeforces)
  2. What to use for each type of problems (bfs/dfs for tree/graph, segment tree / sqrt decomposition for range query)

Skill for me is something we already have, but can be improved upon ourselves. Example:

  • Skill to understand the problem (reading, attention to constrains, ...)
  • Skill to solve a problem (analysing the problems, the constrains, constructing a simple solution or path way to solution, test approaches and see if each approaches can be chosen.
  • Skill to implement (typing speed, debugging speed, ability to not make dumb mistakes, ...)

From my definition, it should be clear that both skills and knowledges are important. If we only try to solve the tasks that we can already solve, then we only improve our skills, not our knowledge. We can be very proficient with the skills and knowledges we already have, but we can only do so much without learning new knowledges.

Having a coach can help improving knowledges, but the coach is not necessary as long as we can obtain the knowledges from reading or other source. This raise the question of what to learn, and my answer for that is "what is used by others":

  • When you failed to solve a problem, read the editorial or other people code, see what they use and learn that. Note that this is not limited to algorithm or data structures, it can also be the math/thinking/analysis behind the solution.

Virtual contest is a great way to improve both skill and knowledge:

  • The problems you can solve improve your skill and reinforce the existing knowledges
  • The problem you can't solve can improve your knowledge after you have read and understand the editorial. Note that if it use something totally new, you might want to practice that for a while before doing new virtual contest (or you can put learning that thing on hold), because learning too many things at one might lead to forgetting all of them.

So if I have this great framework of how to improve why am I still only a GM?

  • Skill issue
  • Knowledge issue
  • Too much idoru
»
3 years ago, # |
  Vote: I like it +55 Vote: I do not like it

I payed 200$ to Mike and now I am blue

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

    So, Can i pay 800$ to Mikkie and become yellow?

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

      yes but also buy some cookies for him

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

        is it from experience :P ? coz u know he might have stopped you at 1898 lol.

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

          that's a visual bug, I have reached 3700 already.

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

I have a passion of learning foreign languages. I treat CP as if it were another foreign language.

In the past, I had learnt a few foreign languages. It took me years to be able to master a language. Looking back, I realize that even though in the beginning of the learning process I knew very little about a subject, given enough time I can slowly master it.

Now I combined my passion for foreign languages with CP. I watch CP videos in Japanese (for AtCoder), Korean and English (for CodeForces etc).

I started CP on March 2021. I practice CP alone and do not have a coach. I am currently a cyan.

Spoiler

I know after some years I will become higher rank, just like how I learnt foreign languages.

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

I have a secret coach. And I was doing MO from before OI. (I am still doing MO)

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

i forced myself not to look at the editorials and solved 1500 rated problems, when i was ~1300

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

Well, I started coding in 2018. And even in the start of 2020 my rating was 1350+. I used to solve problems topic wise like math, string, dp etc. Then during covid period, I started solving rating wise. Since my rating was 1350+, I started with 1500 rated problems and solved almost 200 of them. Then I also solved 1600 and 1700 rated problems. My rating also improved in this training process. And while solving this problems you will encounter basic topics like dp, bfs, dfs, binary search and some basic implementation tricks.

And as far as concerned about when you should go for editorials then I follow erricto's advice in this case. Keep trying till you don't run out of mind.

Moreover, in this case of difficulty wise problem solving, I don't have any idea like from which topic a problem belongs to. And I have to read the problem to figure out this just like contests. Though this process has drawbacks as well. As you have to solve lots of problems and progress is just too slow. But you will improve and that's for sure.

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

From my perspective, the fundamental question that determines whether you improve is 'am I learning from the problems that I fail to solve?'

Practice is obviously at the heart of improving, but two things will prevent this from being meaningful:

1) Practising entirely in your comfort zone

2) Attempting harder questions, failing, but learning nothing from them

When you fail to solve a question, read the editorial, read it again, check that you actually understand what it's saying, review techniques employed by other contestants, solve the problem, and write down what you now know that you didn't before. Save helpful templates in a library, if applicable. Even better, seek out similar questions and put the new knowledge into practice immediately.

»
3 years ago, # |
Rev. 4   Vote: I like it +32 Vote: I do not like it

I guess my experience is more like "what not to do", but that can be valuable too.

When I reached 1400, there was no such thing as cyan yet. It took me almost two years from when I was first introduced to cp (Feb 2013 — Jan 2015). I never had any MO experience, but maybe I got lucky to be living in one of the major cp cities of Russia :)

My practice routine has never been optimized or consistent. I was solving problems on Timus every once in a while and only joining codeforces to participate in rounds. On Timus I was sorting problems by rating (which is more or less the same as solve count) and solving them one by one. There are no editorials, but I was reading problem discussions after solving sometimes.

I had probably <100 problems solved in total. On cf it was 40 problems, with only 6 of them being 1200+ rating. I don't think I learned any algorithms at this point, but I became confident enough in my coding ability. I only learned some algorithms when I joined the courses that my local university organized for schoolchildren back in 2015-2016. And that helped me to reach CM (when it was at 1700).

My most significant progress was when I had a coach during the first years of uni (2016-2017), and I think having a coach could've sped up my progress a lot. Honestly, I think I would benifit from having a coach even now. If only there was someone to guide me to LGM...

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

Disclaimer: this is my opinion and it is not backed up by any evidence except my personal experience.

I would go as far as to say that in order to reach cyan, one needs to improve their thinking ability in general. It seems to me, that today the thinking ability of many people is degrading and it becomes more and more difficult to resist it. The reason is that more and more low-value and high satisfaction activities are becoming available. Things like social media, e-mails, Youtube and TikTok severely damage people's ability to concentrate. Concentration is essential not only for solving CP problems, but also for simply collating various facts and making coherent conclusions (let it be a loose definition of thinking). I have fallen victim to aforementioned services countless number of times and I cannot say that they helped me to think more effectively.

In order to become cyan, one needs to solve first two-three problems (two consistently, third is not required to solve consistently) of Div 2 round. When I am not able to solve them during contest and come up (or look up) with a solution later, more often than not these problems feel SO easy, that it makes me feel shameful that I could not solve them in contest. It seems to me that the only thing that stopped me from solving the problem was the absence of the clear picture of this problem in my mind. And I believe that this ability to have a "clear picture of the problem" heavily depends on concentration. So, try to decrease the usage of social media and similar services, as they are not good for your attention focus. Instead, read a book, try to summarize it and think about it (I was surprised, that this activity requires good amount of effort, at least for me), communicate, discuss things with other people and in general be mindful about your leisure. Every activity that ensures that you will be thinking actively and will be making an intellectual effort is probably beneficial for you.

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

    Interesting take. I found math courses, competition math (I wasn't ever good at it), and solving competition programming on CF and Project Euler trained me to think for hours or days on one problem.

»
3 years ago, # |
  Vote: I like it +5 Vote: I do not like it
  1. Become comfortable with the programming language you use. You should be able to turn your ideas into code.
  2. Find a range of problem difficulty (like [1000 — 1300]) that you feel challenged but not overwhelmed. When you feel problems seem easier than before, increase the difficulty.
  3. Slowly, start reading a book like "Competitive Programming 3" (or 4; I've used 3), and solve problems by topic.

P.S. 3 helps you become better at 2, and 2 helps you become better at 1.

»
3 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

he asserts that it is difficult/impossible to practice at the gray/green level without a coach; I have never had a coach coordinating my competitive programming practices,

Were you actually gray/green? You only have few green points and even they probably weren't green back then.

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

    There was a time when I was at a gray/green level, it just ended before I started CF. (i.e., it wasn't as if I started programming and was immediately blue level--I just practiced using other resources and didn't end up starting CF until I was already past the gray/green skill level.) This means I can't really relate to the experience of being hardstuck green on CF (which motivates this blog, so that I can better understand the experiences of people who were stuck at this level and ultimately managed to improve), but I do think it's fair to say I learned enough to advance past gray/green without coaching.

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

My first cf contest I was cyan, and all I had done before it was usaco training gate. I usually recommend complete beginners to complete chapter 1 then move to practicing random cf problems.

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

Before knowing about CP, I had just solved some problems from Advent Of Code. Then I got to know a regional CP contest, participated with no experience and solved nothing. This encouraged me to improve, so I started to practice seriously last year in May. I think the first month I was solving mainly 800-900 rated problems, but at least it helped me to understand the style of CF problems. Then the next month I just started solving 1500 rated problems. It was a high jump. I couldn't solve them at first but I read editorials, learning some topics.

So I just kept solving 1500 rated problems until I got to cyan I guess. The important fact was that although I wasn't into math olympiads, I had a math background, and most of the problems just felt like an interesting thinking challenge.

So, to sum up, I started solving 1500 rated problems from very early, and my math background certainly helped. I also didn't have any friends who were into CP at that time nor any coach, so it was just intensive self-practice.

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

I got stuck in newbie for long time, my rate then was about 1000 so I practiced in two different ways: first learning some important topics like binary search , two pointers , bit manipulation tricks and solve many problems on them. on the other hand, I practiced solving general problems from the problemset, first I solved problems with difficulties 1000 — 1100 then 1100 — 1200 and so on, once I feel I am comfortable with some range I increase the difficulty of the this range. Also upsolving problems that you didn't manage to get during the contest is very important.

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

I have a strong MO background when I embarked on my CP journey in September 2019. I immediately got a cyan performance in my first CF contest after about one month of practice, and I never fall out of cyan.

I suspect that this is very uncommon, because both MO and CF (and OI in general) are observation-oriented, although the tools are very different, the way to practice is incredibly similar, which led to my early cyan performance. The Um_nik blog (I strongly recommend this) can apply to MO as well.

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

For me, the journey of getting from grey to cyan (and even on expert) was just understanding how codeforces works, getting used to the problem structure/language and becoming better at solving problems that involve simple algorithms that I knew from the beginning of my journey. Thus, I felt like getting cyan is only passion and practice on what you are doing.

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

I have a similar story to a lot of other people but with a little twist. I had a pretty good math background from school times, but I only found out about the competitive programming 2 years after I finished my university, at the age of 25 (of course I knew about school olympiads and did some quickbasic stuff there, and heard something about some kind of university team competitions but I never really came close enough to it). At that point I already knew some basic C++ and with that the transition from math to CP felt very smooth and I was able to quickly jump up to 2100 (although two of my first contests being a very math oriented 2-rounds cup helped a lot).

Since then just solving problems worked fine for me and I was almost exclusively solving problems on virtual contests cause it was (and still is!) the most fun. I believe most of my cp related algorithm knowledge comes from scrolling e-maxx (and much later codeforces blogs) under a time pressure during a contest trying to find and copy-paste something to work.

I also read some parts of "Introduction to Algorithms" some time before the discovery of CP, but I didn't want to mention it before because I have mixed feelings about it being a good advice to start with. On the one hand it is a very good book and it gave me a lot of long-term benefits like the better grasp on concepts of complexity and how to think about algorithms in general (and some vague memories of what can I search for on e-maxx :)). On the other hand it doesn't at all help directly with problems you encounter when you start doing CP, and even later it's not very relevant, and it can certainly be too difficult and time-consuming to delve into.

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

    Thanks for your comment! I'm curious--based on your rating graph, it looks like you stalled around 2600 in late 2021 but then quickly and abruptly began to consistently perform at LGM level. Do you have a sense of what changed for you around the beginning of 2022?

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

      I didn't really change much but I practised a lot during these 6 months, maybe about 2 contests a day on average. In late 2021 I was still very rusty from the 3 years break and I think I also had a bit of an anxiety problem in some of the first rated contests I did after getting back.

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

    I really liked your story, thanks for sharing. I am also curious to know what motivated you to begin competitive programming after finishing university? Have you had a full-time job while practicing on CP? If so, then how did you manage your time?

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

      I don't really know how to answer to the first question, because I don't feel like CP is something that requires motivation, just like you don't usually need motivation to play a game or watch a movie or something. I never forced myself to study unpleasant topics or upsolve/implement some tedious problems I didn't want to.

      At that particular moment in the very beginning I think I still had a half-time job, but even with full-time jobs afterwards I always had plenty of time for CP, maybe I am a bit lucky in this regard.

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

        I usually need motivation to play a game...

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

I started observing what errors I make in thinking (like being stuck in one approach to a problem or over-complicating stuff) and began using that knowledge to improve my thinking processes. Also, when solving a problem, I began to ask myself, "What do I know and what this implies?".

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

The only thing I had (and now have) is being olympic at math. Up to participating at JBMO and taking bronze medal. So what mostly helped me get to where I am now is math == being good at logical thinking. That's how, for example I got to cyan just in 3 months with absolutely no knowledge of basic cp algorithm/ideas (even, for example, DP, Fenwick/Segment Trees, whatever else you can consider basic ideas)

For getting to the blue (where I am now) helped those two which I named earlier. (DP and segtree/BIT) Including my Math knowledge and experience, obviously.

P.S. Obviously, you have to know binary search, dfs, bfs.

That's pretty much everything that helped me to reach what I reached, will update comment when I reach CM.

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

I solved ~330 tasks from acmp.ru and after that i became cyan.

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

I suggest practising the ABCD problems in the Atcoder Beginner Contest

»
19 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I thought competitive programming was interesting so I tried to participate in Leetcode and Codeforces contests. Leetcode had a lower barrier of entry for me, so I spent a month doing medium DP Leetcode problems then a month doing medium graph problems. These first 2 months were a struggle but I began to improve after that and now I just participate in contests and upsolve when I have time. Also I had no math/programming background as I am still in highschool.

»
19 months ago, # |
  Vote: I like it 0 Vote: I do not like it

you don't have to know much to reach cyan. just greedy, dp, constructive, data structure, brute force, 2pointers, prefix sum, point update range segtree, math and a bit of ad hoc should be enough to reach cyan