---
id: intro
title: Introduction to Competitive Programming
author: Nathan Wang, Benjamin Qi, Darren Yao
description: What is competitive programming? Let's take a look!
---

A [programming competition](https://en.wikipedia.org/wiki/Competitive_programming) generally lasts for several hours and consists of a set of problems. These problems are not open problems; they have already been solved by the problem writers and testers and are designed to be solved in the short timeframe of a contest. In general, each problem in competitive programming is solved with a two-step process: 

 1. coming up with the algorithm, which involves problem solving skills and intuition
 2. implementing the algorithm, which requires programming skills to translate the algorithm into working code.

For each problem, you submit the completed code to a grader, which checks the answers calculated by your program against a set of predetermined test cases. For each problem, you are given a time limit (usually 2 seconds) and a memory limit (usually 256 [megabytes](https://en.wikipedia.org/wiki/Megabyte)) that your program must satisfy.

For those of you with experience in software development, note that competitive programming is quite different, as the goal is to write programs that compute the correct answer, run quickly, and can be implemented quickly. Note that nowhere was maintainability of code mentioned. You don't need to bother documenting your code because it only needs to be readable to you during the contest.

<!-- <optional-content title="More Information"> -->

<resources embedded>
   <resource source="William Lin" title="Video - What is Competitive Programming?" url="https://www.youtube.com/watch?time_continue=1&v=ueNT-w7Oluw" starred> </resource>
   <resource source="Kamil Debowski" title="Video - Interview with a Competitive Programmer" url="https://www.youtube.com/watch?v=F4rykKLcduI" starred> </resource>
   <resource source="CPH" title="1 - Introduction" starred>algorithms & programming contests</resource>
   <resource source="IUSACO" title="1 - The Beginning" starred></resource>
   <resource source="PAPS" title="1 - Algorithms & Problems">examples of algorithms</resource>
</resources>

[Task](https://open.kattis.com/contests/mcpc19open/problems/basketballoneonone) that was mentioned in Kamil's video.

<!-- </optional-content> -->

## USACO Contest Format

The [USA Computing Olympiad](http://www.usaco.org/index.php?page=contests) is a national programming competition that occurs four times a year, with December, January, February, and US Open (March) contests. The regular contests are four hours long, and the US Open is five hours long. Each contest contains three problems. Solutions are evaluated and scored against a set of predetermined test cases that are not visible to the student. Scoring is out of 1000 points, with each problem being weighted equally (\~333 points). There are four divisions of contests: Bronze, Silver, Gold, and Platinum. After each contest, students who meet the contest-dependent cutoff for promotion will compete in the next division for future contests.
