Competitive programming [000F]
- October 25, 2025
I enjoy recreational competitive programming, especially in Haskell.
- I have solved about 2700 problems on Open Kattis, over 2000 of them in Haskell.
- I've written a series of blog posts about competitive programming in Haskell.
- I am the coach of the Hendrix College competitive programming team.
Presentations on competitive programming
- October 25, 2025
Reference. Haskell for Competitive Programming (invited keynote) [yorgey-zurihac-2025]
- June 9, 2025
- Brent A. Yorgey
- ZuriHac 2025
- Video
Over the past ten years, I have solved over 1700 competitive programming problems in Haskell, just for fun (as well as a few that were not fun). I will give a brief introduction to competitive programming and show off some examples demonstrating the unique benefits of Haskell in this context. We will then have a miniature programming contest, open to all—only Haskell allowed!
Reference. Competitive Programming in Haskell [comprog-haskell-love]
- September 10, 2021
- Brent A. Yorgey
- Haskell Love
- Video
Competitive programming is an exciting mind sport where competitors race to solve difficult programming tasks as quickly as possible, either individually or as part of a team. It requires sharp problem-solving skills, broad knowledge of algorithms and data structures, and (often) developing a good library of reusable code components ahead of time. Most serious competitive programmers use C++, but this is an arena where Haskell can shine: Haskell's strong type system helps prevent stupid mistakes made in the heat of the moment, and its capability for abstraction allows us to develop versatile libraries and solve problems using a minimum of boilerplate. In this talk, I will livecode a solution to a representative challenge, showing off techniques and libraries along the way.
I will also highlight some areas needing work. In some cases, in order to fit within the time limit imposed by the creators of a problem, it is necessary to write code that runs within a small constant multiple of the time taken by a C++ solution. This is possible but difficult; the name of the game is to create libraries of algorithms and data structures that are highly optimized internally but present a flexible and idiomatic interface suitable for use in a contest.
I hope that Haskellers of all skill levels will be able to take away something new, and that some will be convinced to take up a new hobby, or contribute some code!