top of page

What is Competitive Programming?


Image courtesy of cpeditor.com


That’s the question. It’s hard to find an accurate definition—some sources reference specific competitions like the USA Computing Olympiad (USACO), whereas others take a more abstract approach. Yet, no matter whom you ask, a common definition persists: devising and implementing algorithms in a timed environment. 


The USACO guide describes “a programming competition” lasting several hours that contains a set of specifically designed problems. Usually, there are only two to four problems, and sometimes there is only one. Each problem is created to challenge and grow your intellectual curiosity and programming skills, and they’re available within our school. In Vestavia’s Competitive Programming Club, programmers participate in competitions like USACO, the American Computer Science League, and more. Anyone who enjoys the idea of learning to code and solve tough problems should consider joining! 


Wait—this isn’t a club advertisement. What does a problem look like? The Code Submission Evaluation System, or CSES, has a problem set that includes the following question: “You are given all numbers between 1 and N, except one. Your task is to find the missing number.”

For example, if N was 5 and the list you were given was 2, 5, 4, 3, then the answer would be 1. This problem is rather elementary but showcases the power of code. A naïve solution might start by creating an array of all zeroes and updating the X-th number to one if I see it in my given list, essentially making a record of every number in the list.  Then, I can examine my array to find what number is still not found. But competitive programming is competitive. It’s in the name. Oftentimes, the most obvious solutions can be improved upon in conciseness, elegance, and efficiency. Take a closer look at the aforementioned problem. Instead of manually and painstakingly checking each and every number, one could sum every given number. Because there must be N numbers, some simple math will tell you the total sum must be (N x (N+1)/2). Thus, by subtracting all the numbers we are given, we can find the one left out. Isn’t that beautiful? There are no loops, arrays, no storage—just clean logic.


That’s the beauty of competitive programming. It’s not just about getting the right answer; it’s about finding better answers. It’s about exploiting patterns, thinking creatively, and challenging yourself to chase perfection. Whether you’re aiming to win a national programming olympiad or just want to get better at thinking like a coder, competitive programming offers something valuable for everyone. Even if you want nothing to do with STEM, just remember that next time you’re faced with a tough problem, there’s probably a clever solution waiting to be discovered.


bottom of page