News & Events
Eric Zhang and Franklyn Wang know all about programming on the biggest competitive stages. As a high-school student, Zhang (A.B. ‘23) served on the U.S. team for the International Olympiad in Informatics, earning a pair of gold medals.
Wang (A.B./S.M. ‘22) finished fifth in the U.S. Computing Olympiad, just missing out on making the U.S. team for the international competition.
So as the final minutes ticked down at the International Collegiate Programming Contest (ICPC) World Finals, Wang felt the pressure of his last coding competition. Wang, Zhang and Moses Mayer (A.B. ‘23) were the three members of the Harvard Computing Contest Club (HC3) competing in Moscow, and they were trying to solve a problem that had stumped the best teams in the world.
With about four minutes to go in a five-hour competition, and after 17 wrong attempts, HC3 became the only team to solve Problem N, as it was known.
“This was my last programming competition ever,” said Wang, who’s concentrating in mathematics and pursuing a master’s in computer science. “Since I was the one who solved the hardest problem in the last four minutes of a five-hour contest, that part felt really great for me.”
It was a fitting end for Wang’s competitive coding career. The solution helped HC3 tie for 13th overall, and third among North American teams.
“There are a lot of very, very smart people here,” said Zhang, who’s concentrating in CS and math at the Harvard John A. Paulson School of Engineering and Applied Sciences (SEAS). “Some of these competitive programmers have very large trophy cases, so it felt really great to be among these people who are some of the best of the best. I was personally really excited by our results.”
The ICPC World Finals consisted of 15 problems, of which HC3 solved nine. Fifty-eight teams from all over the world had to solve as many problems as they could by writing computer algorithms, which judges would then test.
Each problem was first framed as a real-world challenge, such as predicting where to stand to photograph the colorful domes of St. Basil’s Cathedral in Russia in a specific order, or deciding which phone to buy based on a combination of cost, performance and user-friendliness.
“Every team of three people gets its own table to sit at, and they’re pretty well separated,” Wang said. “It’s not that loud, but it’s also not that quiet. We’re all huddled around each other, talking about how to work through the problems.”
Problem N challenged coders to design an algorithm to recommend ice cream flavors.
Zhang didn’t remember the flavor (pun intended) of the challenge, but definitely remembered its mathematical and programming requirements.
“You needed to make several very non-obvious observations about the structure of the problem,” Zhang said. “It looked like this extremely complex application of this very advanced optimization technique, which is not feasible to implement in five hours. But if you think about the problem for a little bit longer, cast aside the initial first glance that it’s too hard, you can perhaps make this observation that the problem reduces down to a much simpler standard algorithm. And then it becomes a linear algebra problem.”
Eighteen attempts later, HC3 came up with the right solution.
“You want to find the minimum norms solution to a linear system of equations,” Wang said. “This is a very standard problem, but if you haven’t seen it before you’re unlikely to come up with it on the spot.”
HC3 placed second at Regionals and third at Nationals to advance to the World Finals. Both qualifying competitions took place in 2019, but the World Finals were delayed to October 2021 due to the pandemic. Pranay Tankala (A.B. ‘21, S.M. ‘22) helped HC3 through the qualifying rounds, but Mayer filled in at Worlds.
“The ICPC is a pretty unique event,” Zhang said. “It’s the biggest gathering of competitive programmers in the world. It’s really quite relaxing to just hang out with these people. They come from all over the world, and it’s very cool to meet all these people with the same interests.”
Both coders joined HC3 as freshmen, having known about the ICPC through their competitive high-school careers. Wang compared competitive programming to traditional athletics, referring to the activity as “sport programming.”
“This idea of solving algorithmic problems is really exciting, because it distills down the essence of the creative problem-solving you need to explore the limits of computation,” Zhang said. “Competitive programming in particular was a really fun and engaging way to not only explore these kinds of tricky problems, but do it in a very fast-paced environment with a community of a lot of other people who like it as well.
Wang and Zhang have learned numerous lessons about emotional resilience and motivation from their time as competitive programmers. It’s also made them faster, more efficient coders, and given them a methodical approach to problem-solving that directly applies to their schoolwork and potential careers.
“It’s definitely encouraged me to try to excel in everything I do,” Wang said. “It’s shown me that if I can excel in one thing, I can potentially excel in everything else as well.”
HC3 has a long history of qualifying for and performing well at the World Finals. The team placed third and took home gold medal honors as recently as 2016. HC3’s coaches are Chris Tanner, Lecturer on Computational Science at SEAS, Yingying Wu, Postdoctoral Fellow at the Harvard University Center of Mathematical Sciences and Applications, and Bob Walton (A.B. ‘66, Ph.D. ‘95)
Wang’s time with HC3 is almost over, but he wants to make sure new students get the same positive experience out of competitive programming that he did. He designed the problem set for the upcoming Selection Programming Contest for the 2022-23 team, which will take place later this month.
“It’s been a really fun community,” Wang said. “Most of my best friends I made through this community, so I value that a lot. There’s something that’s very unique about the experience of spending so much time getting better at this type of challenge.”
Cutting-edge science delivered direct to your inbox.
Join the Harvard SEAS mailing list.
Matt Goisman | email@example.com