After each contest, each race, and each test, it would be preferable if I spent at least a little bit of time on reflection, regardless of whether of the results or the performance. My main goal in doing math and computer science olympiads is to get good at problem-solving and computationally difficult problems.
Today, during physics, I decided to do the Codeforces contest on a whim. The contest window was during the remainder of physics, all of Spanish (which I had sub-study for), all of lunch, and the first ten minutes of Health. One thing I need to work on is organizing my schedule a little better. That is, if there seems to be a great time to do a Codeforces Round in school, I should be wary enough to plan it at least two hours ahead.
As I did problem A today, I noticed that my mentality wasn’t fully locked in. I knew I was going to push through it, especially because Division 3 is harder than Division 4, but the fact that I was still unsure of my participation at the beginning of class tripped me up quite a bit. I’m glad that I chose to stay hard, but many times it also means knowing in advance that you’re going to do something.
I started struggling with the second problem and resorted to solving it on paper. Unfortunately, because I wasn’t sure enough to do the contest, I ended up staring at the problem for too long before I did so. Although I solved it using a simple casework chart, I used up almost ten minutes of my time.
Because the bell rang when I solved B, I had to briskly speed-walk to the Spanish sub-study in order to get back on it again. I got out my earplugs, which I plan to use whenever I need to concentrate on something that requires a lot of brainpower, especially math and computer science.
Problem C wasn’t too bad, but I ran into a slight error in my code while solving it because I misread what the problem required us to find. In my first few attempts, I thought that the problem asked for the number of pairs , until I read the problem again and realized that it asked for the number of distinct
that has a valid pair
. Subtle difference, but I was solving the wrong problem! This was quite disappointing as this could have saved me at least five minutes. Threw the valid
‘s in a set and you’re done.
I recognized problem D as a math problem and it didn’t take me too long to get it.
However, when I read the later problems (E,F,G), I knew that from this point on, I would have to lock in and focus on the problem completely. I had an hour and a half left, so I would need to zone in on one of the problems to maximize my chances. I had the lofty goal of solving at least one problem after the four-problem streak, because the last time I checked, I had failed to do so. Additionally, these later problems would require insights that I don’t normally recognize that well, so I would have to be a full-on detective to fully understand a problem and investigate its properties.
I had a little over an hour before the bell rang for lunch. For the entirety of the forty-minute block, I sat next to my friends and coded. They were playing cards and being disruptive, so I put on my earplugs again. I was able to make significant progress in recognizing a binary search for queries (typically in E’s you can solve queries in
), and iterating around the right bound that would give you the subarray sum of closest to
. I observed that the function
increases and then decreases because once the sum exceeds
you start adding negative numbers. I thought of meeting in the middle for some strange reason, but that wasn’t even a tactic that I was familiar with.
I hurried to my gym class. I got WA (wrong answer) on test 1 twice, because I had missed a single number. I fidgeted around with the initial bounds and answers and prayed for an AC. Thank the Lord because I actually did get the accepted verdict four minutes before the contest ended. What a clutch!
So yes, I locked in and beat myself to problem E.
I’m still unsure of how to do problems F and G. They look daunting, but the only way to improve is to solve problems you don’t like, especially the hard, ugly ones. Getting through the pain and thoroughly understanding problems and concepts is my main goal.
Overall, I was solid on my solves, but I definitely could’ve mentally prepared better for this in-school competition. I also could’ve been more careful and try to fully understand the problems. Additionally, problem E took me an hour even though it was a simple binary search with prefix sums. I still think that I have an upper ceiling of the difficulty of problems that I can solve (which caused me some anxiety after I solved problem D). However, I’m willing to break that barrier with hard work and shatter my expectations.
I’m going to march forward. Next: Expert!


