When you think of computer programmers, you might picture a lone coder, sitting in a cubicle, bathed in flickering light. But you should picture a team — in MIT’s case, a joyous, triumphant team of competitive student programmers, bent on solving incredibly thorny problems faster and more accurately than their competition. The team recently placed No. 1 in the North American Championships of the International Collegiate Programming Contest (ICPC), which means they are now eligible to attend the 46th Annual ICPC World Finals next year.
Here, three of the team’s members — computer science and engineering juniors Ziqian Zhong and MingYang Deng, and mathematics and computer science and engineering senior Anton Trygub — describe what it’s like to compete at the very top tiers of computing.
Q: Many of our readers might have never seen a programming contest before. Tell us a little about the basic rules: what kinds of problems you are faced with, how much time you have to prepare or solve them, and the tools you’re allowed to use.
Zhong: We’re typically faced with 10 to 15 problems and five hours. You can code with Java, Kotlin, Python, and C/C++. Most teams, including us, prefer to use C++, since it is very concise and usually runs faster.
Deng: In ACM-ICPC contests, a team consists of three members while only one computer is available, so on average, a member has only a third of the access to the computer. Besides, problems in a programming contest usually require implementing efficient algorithms and data structures, so we typically spend much of our time thinking about solutions before coding.
Q: Do you typically know anything about your competitors, or have friends on opposing teams? Is there trash-talking in programming competitions? In other words, what’s the social atmosphere like?
Zhong: I personally knew some of my competitors before, and the overall social atmosphere is pretty chill and friendly. We played poker and all kinds of other card games together; I ended up learning two new card games! I guess trash-talking is not so popular here.
Deng: I agree. I made friends with many of my competitors, who are all very nice. People here share the same interests and similar backgrounds. It feels like a community. So there’s no need to be competitive outside the contest.
Trygub: Competitive programming is different from other competitive activities in the sense that you don’t compete directly against someone, as in football, chess, etc. You just need to do as well as you can yourself, so there is no tension between teams. And on the higher level, competitors know each other, as we participate in the same competitions on a regular basis. We are here to make friends and to help the ICPC community develop!
Q: What makes a problem particularly hard to solve, and which problem was the most difficult in the North American Championships, from your perspective?
Zhong: To solve a question, we think and code. Some problems are hard to code, with lots of messy details and casework that is hard to get right. For some other problems it’s hard to figure out the correct solution. Personally, I hate the former kinds of problems (it’s not a typing contest!) and the latter kinds of problems are more popular. Problem H was probably the hardest one and we were the only team that solved it.
Trygub: The problem may be difficult because of different reasons: It might be just heavy implementation with small-to-no thinking, or requiring some knowledge without which you might just give up, or have a lot of messy details. I prefer problems in which the difficulty lies in the thinking part, in something creative. It’s great to read the problem statement and feel “How can this even be solvable?”
Q: Tell me about a solution you felt was particularly creative, or that you were really proud of.
Trygub: I don’t think that any of my solutions were particularly creative, but Problem H was quite interesting to solve. The setup is, again, “How can this even be solvable?”, and then you start looking at some cases and notice some observations, which suddenly add up to the full solution.
Zhong: I don’t remember the details about Problem D but I remember it’s a pretty straightforward problem and requires some counting tricks!
Q: How will you be preparing for the world finals next year — what’s involved in that?
Zhong: I guess we’ll just do more training contests together. There is no secret ingredient. Mainly just practice more.
Deng: We will practice more, during which we will refine our strategies.
Trygub: We will have to listen more to our coach on that one! But yeah, mostly practice.
Q: Over the last few years, teams from China, Russia, and Poland have been particularly dominant in the world finals. Why is that, from your perspective — do different countries have different styles of preparation or competition?
Zhong: I think many teams in Russia and Poland practiced really hard and they have good strategies. I heard that the Red Panda Team from Moscow State University likes to start with the hard problems and leave some easy problems to the final hour. This is not optimal, penalty-wise (the longer you take to solve every problem in total, the larger the penalty), but it probably utilizes the last hour better (the last hour is usually really stressful and it’s hard to get things right). This is pretty different from what we usually pursue.
Trygub: I don’t really think that we should talk about some kind of a trend here, the participants from those countries just happened to be really strong and went to the world finals several times. I hope we can bring a little bit of North America dominance to the finals!
Q: Tell me a little about what competitions like this one have taught you, as a programmer.
Zhong: I think it helps me to code faster and more accurately. In a contest, you don’t have much time to debug once things go south.
Trygub: It helps me to go for the most efficient way to implement something, while keeping it clean, as otherwise I would die debugging.
Deng: It also improves my collaboration skills. In contests like this, you must communicate with your teammates, express your thoughts clearly, work as a team, and believe in each other.