
Competitive programming is a
mind sport usually held over the
Internet
The Internet (or internet) is the global system of interconnected computer networks that uses the Internet protocol suite (TCP/IP) to communicate between networks and devices. It is a ''internetworking, network of networks'' that consists ...
or a
local network, involving participants trying to
program according to provided specifications. Contestants are referred to as ''sport programmers''. Competitive programming is recognized and supported by several multinational software and Internet companies, such as
Google
Google LLC () is an American Multinational corporation, multinational technology company focusing on Search Engine, search engine technology, online advertising, cloud computing, software, computer software, quantum computing, e-commerce, ar ...
and
Facebook
Facebook is an online social media and social networking service owned by American company Meta Platforms. Founded in 2004 by Mark Zuckerberg with fellow Harvard College students and roommates Eduardo Saverin, Andrew McCollum, Dustin ...
.
A programming competition generally involves the host presenting a set of
logic
Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the science of deductively valid inferences or of logical truths. It is a formal science investigating how conclusions follow from premis ...
al or
mathematical problem
A mathematical problem is a problem that can be represented, analyzed, and possibly solved, with the methods of mathematics. This can be a real-world problem, such as computing the orbits of the planets in the solar system, or a problem of a more ...
s, also known as
puzzle
A puzzle is a game, problem, or toy that tests a person's ingenuity or knowledge. In a puzzle, the solver is expected to put pieces together ( or take them apart) in a logical way, in order to arrive at the correct or fun solution of the puzzle ...
s, to the contestants (who can vary in number from tens or even hundreds to several thousands), and contestants are required to write
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components.
A computer progra ...
s capable of solving each problem. Judging is based mostly upon number of problems solved and time spent for writing successful solutions, but may also include other factors (quality of output produced, execution time, memory usage, program size, etc.)
History
One of the oldest contests known is the
International Collegiate Programming Contest (ICPC) which originated in the 1970s, and has grown to include 88 countries in its 2011 edition.
From 1990 to 1994,
Owen Astrachan
Owen Astrachan is an American computer scientist and professor of the practice of computer science at Duke University, where he is also the department's director of undergraduate studies. He is known for his work in curriculum development and meth ...
, Vivek Khera and David Kotz ran one of the first distributed, internet-based programming contests inspired by the ICPC.
Interest in competitive programming has grown extensively since 2000, and is strongly connected to the growth of the Internet, which facilitates holding international contests online, eliminating geographical problems.
Overview
The aim of competitive programming is to write
source code
In computing, source code, or simply code, is any collection of code, with or without comment (computer programming), comments, written using a human-readable programming language, usually as plain text. The source code of a Computer program, p ...
of computer programs which are able to solve given problems. A vast majority of problems appearing in programming contests are mathematical or logical in nature. Typical such tasks belong to one of the following categories:
combinatorics
Combinatorics is an area of mathematics primarily concerned with counting, both as a means and an end in obtaining results, and certain properties of finite structures. It is closely related to many other areas of mathematics and has many a ...
,
number theory
Number theory (or arithmetic or higher arithmetic in older usage) is a branch of pure mathematics devoted primarily to the study of the integers and integer-valued functions. German mathematician Carl Friedrich Gauss (1777–1855) said, "Math ...
,
graph theory
In mathematics, graph theory is the study of '' graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of '' vertices'' (also called ''nodes'' or ''points'') which are conn ...
,
algorithmic game theory
Algorithmic game theory (AGT) is an area in the intersection of game theory and computer science, with the objective of understanding and design of algorithms in strategic environments.
Typically, in Algorithmic Game Theory problems, the input t ...
,
computational geometry,
string analysis and
data structure
In computer science, a data structure is a data organization, management, and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the rel ...
s. Problems related to
constraint programming
Constraint programming (CP) is a paradigm for solving combinatorial problems that draws on a wide range of techniques from artificial intelligence, computer science, and operations research. In constraint programming, users declaratively state th ...
and
artificial intelligence
Artificial intelligence (AI) is intelligence—perceiving, synthesizing, and inferring information—demonstrated by machine
A machine is a physical system using Power (physics), power to apply Force, forces and control Motion, moveme ...
are also popular in certain competitions.
Irrespective of the problem category, the process of solving a problem can be divided into two broad steps: constructing an efficient
algorithm
In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
, and implementing the algorithm in a suitable
programming language
A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language.
The description of a programming l ...
(the set of programming languages allowed varies from contest to contest). These are the two most commonly tested skills in programming competitions.
In most contests, the judging is done automatically by host machines, commonly known as judges. Every solution submitted by a contestant is run on the judge against a set of (usually secret) test cases. Normally, contest problems have an all-or-none marking system, meaning that a solution is "Accepted" only if it produces satisfactory results on all test cases run by the judge, and rejected otherwise. However, some contest problems may allow for partial scoring, depending on the number of test cases passed, the quality of the results, or some other specified criteria. Some other contests only require that the contestant submit the output corresponding to given input data, in which case the judge only has to analyze the submitted output data.
Online judges are online environments in which testing takes place. Online judges have ranklists showing users with the biggest number of accepted solutions and/or shortest execution time for a particular problem.
Notable competitions
There are two types of competition formats: short-term and long-term. Each round of short-term competition lasts from 1 to 5 hours. Long-term competitions can last from a few days to a few months.
Short-term
*
International Collegiate Programming Contest (ICPC) – one of the oldest competitions, for students of universities in groups of 3 persons each
*
International Olympiad in Informatics
The International Olympiad in Informatics (IOI) is an annual competitive programming and one of the International Science Olympiads for secondary school students. It is the second largest science olympiad, after International Mathematical Olympi ...
(IOI) – one of the oldest competitions, for secondary school students
*
American Computer Science League
ACSL, or the American Computer Science League, is an international computer science competition among more than 300 schools. Originally founded in 1978 as the Rhode Island Computer Science League, it then became the New England Computer Science Le ...
(ACSL) – computer science competition with written and programming portions, for middle/high school students
*
CodeChef – competition held from 2009, there are three contests held every month and an annual competition called CodeChef SnackDown
*
Codeforces Round – typically two hour contest, held every week
*
Facebook Hacker Cup – competition held from 2011, provided and sponsored by
Facebook
Facebook is an online social media and social networking service owned by American company Meta Platforms. Founded in 2004 by Mark Zuckerberg with fellow Harvard College students and roommates Eduardo Saverin, Andrew McCollum, Dustin ...
*
HackerRank – multiple competitions
*
Gridwars – four competitions held between 2003 and 2004.
*
Google Code Jam
Google Code Jam is an international programming competition hosted and administered by Google. The competition began in 2003. The competition consists of a set of algorithmic problems which must be solved in a fixed amount of time. Competitors ...
– competition held from 2003, provided and sponsored by
Google
Google LLC () is an American Multinational corporation, multinational technology company focusing on Search Engine, search engine technology, online advertising, cloud computing, software, computer software, quantum computing, e-commerce, ar ...
*
IEEEXtreme Programming Competition
IEEEXtreme (often abbreviated as Xtreme) is an annual hackathon and competitive programming challenge in which teams of IEEE
The Institute of Electrical and Electronics Engineers (IEEE) is a 501(c)(3) professional association for electronic ...
[ – annual competition for IEEE Student Members held since 2006 by ]IEEE
The Institute of Electrical and Electronics Engineers (IEEE) is a 501(c)(3) professional association for electronic engineering and electrical engineering (and associated disciplines) with its corporate office in New York City and its operati ...
.
* Topcoder Open (TCO) – Algorithm competition held since 2001 by Topcoder
LeetCode Contests
- Weekly and Biweekly contests, 1.5 hours to solve 4 problems.
In most of the above competitions, since the number of contestants is quite large, competitions are usually organized in several rounds. They usually require online participation in all rounds except the last, which requires onsite participation. A special exception to this is IEEEXtreme, which is a yearly 24-hour virtual programming competition. The top performers at IOI and ICPC receive gold, silver and bronze medals while in the other contests, cash prizes are awarded to the top finishers. Also hitting the top places in the score tables of such competitions may attract interest of recruiters from software and Internet companies.
Long-term
* HackerRank Week of Code
* ICFP Programming Contest – annual 3-day competition held since 1998 by the International Conference on Functional Programming
* Topcoder Marathon Matches
* Codechef Long Challenges - held every month - lasts up to 10 days
Artificial intelligence and machine learning
* Kaggle – data science and machine learning competitions.
* CodeCup – board game AI competition held annually since 2003. Game rules get published in September and the final tournament is held in January.[Lasse Hakulinen]
Survey on Informatics Competitions: Developing Tasks
– Olympiads in Informatics, 2011, Vol. 5, 12–25.[
* Google ]AI Challenge
The AI Challenge was an international artificial intelligence programming contest started by the University of Waterloo Computer Science Club.
Initially the contest was for University of Waterloo students only. In 2010, the contest gained sponsor ...
– bi-annual competitions for students that ran 2009 to 2011.
*Halite
Halite (), commonly known as rock salt, is a type of salt, the mineral (natural) form of sodium chloride ( Na Cl). Halite forms isometric crystals. The mineral is typically colorless or white, but may also be light blue, dark blue, purple, ...
– An AI programming challenge sponsored by Two Sigma, Cornell Tech, and Google.
* Russian AI Cup
Russian AI Cup is the annual championship on programming of an artificial intelligence organized by Mail.Ru Group and My.com.
The Russian AI Cup is carried out in the form of a game for descriptive reasons, clearness and simplicity. Briefly, par ...
– open artificial intelligence programming contest.
* CodinGame – hosts seasonal bot programming competitions.
Contests focusing on open source technologies
*List may be incomplete
Online contest and training resources
The programming community around the world has created and maintained several internet-resources dedicated to competitive programming. They offer standalone contests with or without minor prizes. Also the past archives of problems are a popular resource for training in competitive programming. There are several organizations who host programming competitions on a regular basis. These include:
Benefits and criticism
Participation in programming contests may increase student enthusiasm for computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includin ...
studies. The skills acquired in ICPC-like programming contests also improve career prospects, as they help to pass the "technical interviews", which often require candidates to solve complex programming and algorithmic problems on the spot.
There has also been criticism of competitive programming, particularly from professional software developers.[ One critical point is that many fast-paced programming contests teach competitors bad programming habits and code style (like unnecessary use of macros, lack of OOP abstraction and comments, use of short variable names, etc.).][ Also, by offering only small algorithmic puzzles with relatively short solutions, programming contests like ICPC and IOI don't necessarily teach good software engineering skills and practices, as real software projects typically have many thousands of ]lines of code
Source lines of code (SLOC), also known as lines of code (LOC), is a software metric used to measure the size of a computer program by counting the number of lines in the text of the program's source code. SLOC is typically used to predict the am ...
and are developed by large teams over long periods of time. Peter Norvig
Peter Norvig (born December 14, 1956) is an American computer scientist and Distinguished Education Fellow at the Stanford Institute for Human-Centered AI. He previously served as a director of research and search quality at Google. Norvig is ...
stated that based on the available data, being a winner of programming contests correlated negatively with a programmer's performance at their job at Google (even though contest winners had higher chances of getting hired). Norvig later stated that this correlation was observed on a small data set, but that it could not be confirmed after examining a larger data set
Yet another sentiment is that rather than "wasting" their time on excessive competing by solving problems with known solutions, high-profile programmers should rather invest their time in solving real-world problems.[
]
Literature
* Halim, S., Halim, F. (2013). ''Competitive Programming 3: The New Lower Bound of Programming Contests''. Lulu.
* Laaksonen, A. (2017). ''Guide to Competitive Programming'' (Undergraduate Topics in Computer Science). Cham: Springer International Publishing.
See also
* Computer science competitions
* Code golf
* Hackathon
References
{{Reflist, refs=https://www.atlantis-press.com/proceedings/icaicte-13/8933
External links
;Open-source project for running contests
Contest Management System
Open-source tool in Python to run and manage a programming contest on a server IOI 2012 and IOI 2013.
*
Computer science competitions