Memoirs of Competitive Programming
It is now the early hours of July 28, 2022, and I have just finished CCPC Final 2021. Taking home an iron medal was never in doubt, and we only went to the Final for a laugh anyway, but this contest was, I guess, extremely important to my competitive programming journey.
It marks the end of my four-year competitive programming career. Thinking back on the contest a few hours ago, I remember I was still discussing SG functions, meet-in-middle, linear bases and Gaussian elimination with my teammates. “How is it actually implemented? And how did this idea come about?” Even though I had decided weeks ago that I would retire once this season was over, in the last contest before I retired, knowing full well I might never think about these things again, I still kept on thinking. Now, sitting alone on my bed typing, I think it over carefully and finally understand: I have been in competitive programming for too long, and this kind of thinking has become an everyday habit of mine.
A Plain Account of Four Years
First Year of High School
Four years ago, I started learning the Olympiad in Informatics, and formally began my competitive programming career. Before the summer of 2018 I was just a little brat who could read documentation to write Unity3D programs and had scratched the surface of the .NET CLR. Back then I was very resistant to competitive programming, because I figured that stuff couldn't possibly be any fun, not as fun as writing projects. By chance, I went all by myself to an institution in Hangzhou to train in informatics together with a bunch of elementary and middle school students. Maybe I wanted to prove I wasn't bad at computers, so for the whole ten-day camp I was glued to the computer every day, from nine in the morning to ten at night.
I still remember that the first day was about how to generate random numbers in C++ and write some classic programs; the second day was game theory, and the teacher covered a lot of conclusions in class that the teacher couldn't prove either; after that came dynamic programming and graph theory. I remember it took me a long time to understand the knapsack problem, and it was also very late before I understood what on earth a DP state transition equation actually was. I remember that the Purple Book by Liu Rujia used the model of a directed acyclic graph to describe dynamic programming; back then, how could I have known about the connection between DP's no-aftereffect property and directed acyclic graphs?
The summer days slowly went by, and school was about to start. Looking back now, when I first entered JXNU Affiliated High School I was obviously not ready. I had never seen so many excellent classmates before. At the end of the summer vacation I got to know crazydave (FZOI 2017), the first FZOI senior I met. I still remember the first time I went to the computer lab: on the two rows of desks in S413 at the Binjiang campus there were several monitors, every seat had the personal belongings of one FZOI contestant or another, and a senior who wasn't wearing the school uniform and looked like he was from the international department (XG_Zepto, FZOI 2017) was typing out a greatest-common-divisor function on screen. I still remember the desks had Luogu mugs, keyboard cleaning putty (XG, sorry, I flat-out used up the putty) and all kinds of little gadgets, and the bookcase held national training team papers from past years. At my first evening self-study in the lab I flipped aimlessly through a copy of Introduction to Algorithms; now I really think I was pretty confident back then.
That confidence of course didn't last long. My first monthly exam went pretty badly, and for someone who did this badly even in a regular class to be doing competitions was clearly ridiculous. Unlike the other grind kings at Fuzhong, I didn't care that much about the first monthly exam, because NOIp 2018 was coming up soon. At noon and in the evening I stayed in the lab grinding problems, dreaming of getting a provincial first prize in my first year. During this time, I clearly remember crazydave and XG teaching me sparse tables and binary-lifting LCA; at evening self-study I also got to know lornd (FZOI 2016). lornd was really good to me, and walked me through a lot of algorithms and problems. Although he was already in his third year of high school, he still came to the lab often. The people who stayed in this lab probably all had this kind of love.
What really made my confidence collapse was probably NOIp 2018. After grinding through lots of problems before the contest, I met my Waterloo and got one of the lowest scores in the whole province:

Out of 600 points I only got 128: I couldn't write the unbounded knapsack, on the sign-in problem whose intended solution was greedy I messed around with a segment tree and didn't get full marks, and on another problem I didn't write all the headers and got zero.
That was probably the first mental breakdown of my life: the day the scores came out I kept trying to control my emotions, but the tears didn't stop; I didn't go downstairs to keep attending class, and got yelled at like crazy by two teachers; after that I was afraid of everything around me, because there was nothing I could do well.
Although I don't quite remember, my second exam in regular schoolwork was pretty bad too, I guess. NOIp 2018 was over; lornd went back to studying for the college entrance exam, crazydave didn't do well and temporarily went back to studying for the college entrance exam, and the lab was deserted, with only me and XG left. During this time XG taught me a lot, and besides algorithms and problems, he would often shoot the breeze with me. Through the seniors' chit-chat, I also got to know of DOFY (FZOI 2016), QYQ (FZOI 2016, though his full name is QYQYQYQYQYQ) and bdzxt (FZOI 2016), three great elders. From them I learned what competitions concretely do for getting into university, learned how to CS 1.6, and also heard lots of very romantic stories from their competition careers (and weird stories too, like how DOFY took a year to find out he'd already got a PKU first-tier agreement in his first year of high school), or at least I thought they were quite romantic.
Do I like algorithms? I guess I do. I like cleverly designed DP, and I like complex data structures and graph theory too. Studying and practicing every day, learning lots of things I'd had no concept of before, is an addictive thing. At the same time, compared with the deadly boring life of studying for the college entrance exam, I was also determined to create a competition career of my own.
Before 2018 was over, carrying the Advanced Guide to Algorithm Competitions that crazydave gave me, I followed a few big shots from Jiujiang to Yali Middle School in Changsha; XG and hytzongxuan (FZOI 2017) from Qingshanhu went at the same time too. Back then I really felt the gap between me and the Jiujiang big shots was way too big, and had no idea how to talk with them. Facing all kinds of nasty WC mock problems set by the Yali experts, I only dared to keep my head down and grind through my Advanced Guide to Algorithm Competitions; after all, I had to learn the basics well first. Only later did I gradually realize that among those Jiujiang big shots were EncodeTalker (Jiujiang No. 1 Middle School, 2018 cohort) and OIerC (Jiujiang No. 1 Middle School, 2018 cohort).
Right after I came back from the camp it was New Year's Day, and I made it in time for Fuzhong's New Year's show wearing the Yali school uniform. Because I wore too little when I left Changsha and also ran into snow, I went home after the show and promptly came down with a fever. I remember that when I got back after New Year's and looked at the report card for my third monthly exam, I just fell apart. My chemistry was ridiculously low, and the rest were pretty much done for too; that was probably my worst result ever (haha, that was when I thought this would be my worst result). In the last month, I reined myself in, studied a bit for the college entrance exam, and pulled my grades back up, though only to so-so.
Then it was 2019, the second semester of my first year. To escape the winter vacation homework, I went to train at Zhongshan Memorial Middle School the week before school started, together with crazydave. I remember that time really was a magical experience: contests and upsolving in the lab during the day, catching mice and swatting mosquitoes in the dorm at night, and when I got tired of coding, gazing out the window at the scenery. Zhongshan Memorial's campus is super big; in every direction it's either woods or school buildings. At Jizhong I also got to know the teachers symbol and xc. I remember the first time I talked about my personal situation with symbol, symbol looked at my school-wide ranking and just kept shaking their head, advising me not to continue with competitions; then, after I did a few NOIp mock contests, the first question symbol asked on seeing me was: “Were you lying to me about this school-wide ranking?”
A few weeks after school started, I went back to Fuzhong for a month of regular classes, then stopped classes for another month, all the way to the provincial team selection, because I knew that after this month I probably wouldn't get to see XG and crazydave much anymore. That month I learned quite a lot of provincial-selection tech, and also wrote lots of weird blog posts and problems. Every day, when I wasn't studying on my own, I was getting schooled by XG; that was also the first time I concretely knew how smart a person could be: lots of things were hard as hell, but XG knew them all. Every day I got to the lab and sat there from day till night, and if I wasn't sleepy at noon, played CS. DOFY, QYQ and lornd rarely came anymore, since the college entrance exam was coming up for them too (though QYQ and lornd came pretty often at noon XD).
JXOI 2020 was held a month late, and the final result was: XG and hytzongxuan made the team, crazydave retired, and EncodeTalker was the captain. This was also the first time I saw what a contestant retiring looks like; seeing crazydave retire made me sad for a long time too.
After the provincial selection there was naturally no reason to keep skipping classes, so I went back to the classroom to study for the boring college entrance exam. After the final exams, I went to Zhongshan Memorial to train again. The July camp was all pretty normal, coding problems in the lab every day; I also got to know a few big shots from Shenzhen, and Lu_Anlai (Ganzhou No. 1 Middle School), who sat behind me. The July camp ended, and NOI 2020 began. This year's NOI 2020 was held at Guangzhou No. 2 Middle School. In the end the result couldn't escape QYQ's curse: CU Again, once more.
XG getting bronze was the thing I could least accept back then. He was the smartest active contestant I knew, so why just Cu? XG went back to the classroom, threw his blue school uniform jacket on every Monday morning to scrape through the school's morning assembly, and no longer casually took his phone out at school.
Sigh, my seniors had all retired. My turn now.
Second Year of High School
The August camp was also contests every day, and then watching gods lecture. Back then I really couldn't follow all those data structures nested in DP nested in graph theory, so I just skipped the lectures and coded problems on my own. In the daily contest ranklist, I saw “2019 JXNU Affiliated High School Lu Anlai” (Lu_Anlai, FZOI 2019). What the heck? Wasn't he from Ganzhou No. 1? I asked later, and it turned out he had become my junior. During the Jizhong training, besides me, three guys from Shenzhen and two guys from Ganzhou, my dorm also had my two juniors zzr*2 (little_brush, zzr8178541919, FZOI 2019).
After the August camp, JXNU Affiliated High School hired a young and promising informatics coach; we all called him lcx. I remember I met this young and promising informatics coach at the Starbucks on Bayi Square. Because the competition classes moved to Qingshanhu, and all the competition teachers were at Qingshanhu, I moved to Qingshanhu with them. Every morning from door 13 of the up-direction train at Cuiyuan Road to Metro Building, changing there for Shida South Road, and every evening from Shida South Road to Bayi Square, changing there back to Cuiyuan Road: that was my commute for a year. The three months before CSP-S 2019 were spent grinding problems and doing contests; during this time, under lcx's guidance, I consolidated my fundamentals and gradually became able to knock out lots of problems. I got a lot stronger during that period: from Monday morning to Saturday afternoon I was in the lab grinding problems and doing contests, and on Saturday evenings I kept fighting at the Starbucks at Metro Building until closing time, knocking out 12 problems a day. During the National Day holiday I even skipped the school's make-up military training and gave lectures to the juniors in the lab. The week before CSP-S 2019, I also went to ICPC 2019 Nanchang just for fun, and got a silver medal. Back then I felt I probably wouldn't be too bad.
I had to get some results too.
CSP-S 2019 was in fact very dramatic, and I can't really go into the details. In the end Jiangxi's problems barely separated anyone, but they did successfully separate me from first down to sixth, because my array was too small.
Haha, fuck.
Still, sixth is sixth, so I wanted to keep going for the provincial team. FZOI 2019 had all gone back to studying for the college entrance exam, I was the only one of FZOI 2018 left, and in the lab it was just me and lcx, relying on each other to survive.
Yes, really relying on each other to survive. We moved into a new lab (the Master Teacher Studio). The new lab had a great location, with a full view of the sports field, and you could even watch what was going on on the Beijing–Kowloon Railway, but it really was a bit too cold.
Yes, super cold. Within one month lcx and I came down with fevers one after the other and went home. There was no pandemic back then, but over dinner at Zhangliang on Shida South Road, lcx and I talked about the unexplained pneumonia in Wuhan: “Surely it won't be as serious as SARS.”
Haha, fuck.
Meanwhile, the Ministry of Education also launched the Strong Foundation Plan, and my seniors all had their agreements torn up. I have nothing to say.
Haha, fuck your mother.
Before the pandemic we had locked the lab door, and I truly never expected we would go through so many absurd things in between. The whole country went into lockdown, and my training was switched to remote online training too. My days at home were still pretty unmotivated, but at least I was fairly self-disciplined. Every day I forced myself to get up, controlled the screen time on my Pixel like crazy, allowing just five minutes of social media a day, and still sat from morning till night every day, either grinding provincial-selection tech and problems, or doing contests with hard-as-hell problems on JZOJ (damn, they really were hard, my brain really isn't up to it), forcing myself to fix my way through the problems, sitting until half past eleven every day, then reviewing and summing up.
That period was so painful; it was the closest I have come to depression in my life.
In May we finally got back to school. I kept training in that little lab, and at the same time started teaching the FZOI 2019 juniors all kinds of weird stuff, like Splay, SAM, LCT and whatnot, and also gave a few sessions of selected miscellaneous problems. Actually, in one respect, I really feel guilty: I couldn't leave my juniors more materials and explanations. Remembering how my seniors helped me in my first year, here I was in my second year, not far from retiring myself, and I couldn't give my juniors more help. My intelligence and thinking have always been poor, and it was hard for me to leave my juniors any experience worth learning from. As their senior, I feel I didn't do a very good job, and this is one of the regrets of my competition years.
JXOI 2021 came, the one and only provincial team selection of my life. Although there were some absurd little incidents the day before, the provincial selection came just like that. Joint Paper B wasn't very hard, which suited a brainless contestant like me who can only think in stock tricks. After two days of contests, I finally got my wish: I made Team A of the Jiangxi provincial team, in third place. Later at APIO, I knocked off a Kruskal spanning tree problem and got a silver medal.
I did manage to do something after all.
Next up was NOI 2020.
NOI 2020
To be honest, this part probably won't be that much of a story.
XG_Zepto and crazydave had finished the college entrance exam, and I entered the countdown to retirement. Watching the days of my OI career slip away one by one, I was in agony. I was really afraid of going back to the college entrance exam with a terrible result, and I also really didn't want to let go of my OI days. After starting university, whenever I think back on my OI years, I always feel envious; it really was a time when you could give everything for your passion. Maybe the me who was about to retire felt the same way.
I was leaving: leaving Qingshanhu, where I had lived and studied for a year; leaving Shida South Road, where I had eaten for a year; leaving the metro I had ridden for a year; leaving my lab; leaving my FZOI; leaving my romantic life; leaving what I loved.
I'm so sad.
In the end NOI 2020 ended in a massive crash and burn. On day1, midway through, I changed the name format of the generated program (I changed delicacy to delicacy.out, then spent an hour and a half debugging delicacy with gdb, which led me to change my whole intended solution away, and in the end I had no time to write it) and flat-out failed to sign in; on day2 I came away empty-handed: I had never seen anything like those problems at all, and was tortured in the exam room for 5 hours.
“Stop!” The voice of Chairman Wang Hong announced that my OI career had come to an end.
I retired; I retired empty-handed.

Third Year of High School
There's nothing much to say about my third year: studying for the college entrance exam was boring as hell, my grades swung wildly up and down, and then I ended up at a junior college.
First Year of Undergrad
After getting into the junior college, I stumbled onto the seniors at the School of Software and reported my results, and then cycl, a fourth-year, roped me into a team.
My xCPC career probably wasn't that interesting; after all, I had already been doing competitive programming for so long, so a story of rapid improvement doesn't exist. Training every Tuesday afternoon, three people on three computers, made us bursting with confidence, itching to crush TP at the very next regional. Because of the pandemic we could only compete using OMS's stupid proctoring software. Our results at the few regionals were all pretty mediocre, one silver each at ICPC and CCPC, and then I took home an iron medal at the CCPC Final and retired.
Closing Words
Four years of competitive programming: what did I lose?
I went to a junior college, I lost all my summer and winter vacations, I lost the chance to live like a “normal high schooler”, I lost my mental health for a while, I lost everyone's expectations of me: “Huang Chenxi is a person with no intelligence.”
What did I gain?
I had the good fortune to meet the seniors I consider the most outstanding (XG, crazydave, hytzongxuan, DOFY, QYQ, lornd, cycl, wfy), Coach Liu Chenxu and Teacher Lei Huojun, who cared about their students more than anyone, and the strongest juniors (Lu_Anlai, little_brush, zzr8178541919, yrp, Zhou Yuchuan, Jiajia, pfl, lc, Songsong, Haotian, An Yixuan, IceAge, and so on and so on). I learned that there are so many excellent people in this world, and they have had an indelible influence on me. My logical thinking, the angles from which I approach problems, and my belief in and expectations of myself were all brought to me by them. I have left my life a romantic memory.
I thank them.
I love them.
为什么没有评论