Competitive Programming: Progress and Insights as a Beginner
Just this summer, my mother enrolled me in an introductory Python class. After a couple weeks of classes, I found out that the same teacher also taught a course about something called USACO.
The USA Computing Olympiad (USACO) is a programming competition for middle school to college kids. Each year, they host four contests, with four different divisions (Bronze, Silver, Gold, and Platinum, in increasing order of difficulty). Each contest lasts 4 hours and consists of 3–4 problems designed to challenge an individual’s algorithmic thinking and programming skills. A participant’s score is determined by a number of test cases his or her program can solve for each question. At the end of each contest, if the participant’s score is higher than a certain threshold, you are promoted to the next level, with the top competitors in Platinum given a chance to compete in the IOI (International Olympiad in Informatics).
This competition piqued my interest, and I decided to take the course. The class consisted of a weekly meeting, where the teacher introduced new concepts such as simulation and complete search and assigned problems that tested our knowledge of the new concepts. Many of the problems were incredibly challenging and I spent hours trying to (unsuccessfully) figure out. But after some tips and hints from my teacher, I was able to solve almost all of the problems.
These classes lasted about 2 months, at the end of which I felt pretty confident about my skills. I kept honing my skills through the USACO guide website. Soon, the December contest rolled around, and I immediately entered the competition. I clicked “Start Contest” and proceeded to the problems, where I promptly flunked the contest, managing to only solve 6 out of 31 test cases, giving me a total score of 127, placing me at rank 4335 out of 7673 pre-college competitors. I couldn’t even crack the first problem! To give you some context, the maximum attainable score was 1000 points, with anybody scoring above 750 being promoted to Silver. If this were a conventional test, I would have gotten 12%.
After some self-reflection and analysis of my performance, I concluded that the only reason I completely bombed because my question analysis and algorithmic thinking skills were just not good enough. I had knowledge of all the tools I needed to solve the problem, I just didn’t know how to use them. So, I vowed to keep training until the 2nd contest in January.
The January contest happened, and I once again entered the competition feeling pretty confident that THIS time, I would get promoted to Silver. I clicked start and started coding. After solving the first problem and missing just 1 test case, I felt pretty confident as I approached the 2nd and 3rd questions. To make a long story short, I failed yet again.
Although I was able to solve 12 test cases, twice the number of cases I solved in the December contest, that was still a far cry from my goal of Silver. I placed 3117 out of 5382 pre-college participants this time, with a score of 356 out of 1000, or about 36%.
What was I not seeing? After looking at the problems’ analysis I realized the 2nd and 3rd problems required simulation and complete search! The VERY SAME concepts that my teacher had taught me! I (mentally) punched myself in the face and tried to understand where I had gone wrong. After some more deep thinking, I came up with a solid self-analysis. It was not my skill set or my problem comprehension, it was my plan of approach. After I had decided on one possible way to solve a problem, I would keep following that path to a dead end.
A great example of this is the 2nd problem in the January contest, which was about creating a set of 3 non-transitive, tetrahedral dice. During the contest, I convinced myself that this was in fact, not a programming question, but a math analysis/probability one, and I spent the next hour reading essays about Tiggeman’s Dice and submitting several unsuccessful solutions, when in reality, all I had to do was test all possible values of the dice’s faces!
To find a solution to my inaccurate problem-solving technique, I vowed to do 2 new problems to help improve my skills every day from that day on until the February contest, which is in exactly 18 days.
To sum it all up, I simply did not have enough practice.
So, what can you learn from this? Well, for starters, if you want to get good at something, you need practice. You probably know this already, but this is yet another story about a kid who didn’t listen and saw the consequences. But more specifically, studying theory is not good enough. You need to get hands on and actually do it yourself. Immerse yourselves in your goal and keep on struggling and fighting until you reach it.
Also, competitive programming is difficult.