Competitive Programming

ICPC 2020

All 15 ICPC problems from 2020, each with a statement view, editorial, and C++ implementation.

15 problem pages
15 statement text files
15 statement PDFs
May 21, 2026 most recently updated solution

Problem set

Each entry below goes straight to the public problem page, with the statement, editorial, code, and raw resources kept together.

ICPC 2020

A. Cardiology

A

The Great Cardoni, Master Prestidigitator, has a deck of 21 numbered cards which he uses in a trick as follows: A spectator secretly selects a number between 1 and 21, inclusive, after which Cardoni deals the 21 cards, face-up, row by row in order from 1 to...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

B. The Cost of Speed Limits

B

By the year 3031, the ICPC has become so popular that a whole new town has to be built to house all the World Finals teams. The town is beautifully designed, complete with a road network. Unfortunately, when preparing the budget, the town planners forgot to...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

C. Domes

C

Saint Basil’s Cathedral is the best-known landmark of Moscow and maybe even of all of Russia. Built under Ivan the Terrible in the 16th century, the cathedral is known for its colorful domes. No visit to the city is complete without taking a photo of the fo...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

D. Gene Folding

D

International Cell Processing Company (ICPC) is a world leader in the analysis of genetic sequences. A genetic sequence is a sequence of nucleotides, which in this problem is represented by a string containing only the letters A, C, G, and T in some combina...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

E. Landscape Generator

E

Interactive Creative Players Collective (ICPC) is working on a new computer game for which they want to generate realistic landscapes. One of the ICPC engineers proposed an algorithm inspired by geological processes. The algorithm starts with a flat landsca...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

F. Ley Lines

F

In 1921, the amateur archaeologist Alfred Watkins coined the term “ley lines” to refer to straight lines between numerous places of geographical and historical interest. These lines have often been associated with mysterious and mystical theories, many of w...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

G. Opportunity Cost

G

As with most types of products, buying a new phone can be difficult. One of the main challenges is that there are a lot of different aspects of the phone that you might care about, such as its price, its performance, and how user-friendly the phone is. Typi...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

H. QC QC

H

Innovative Computable Quality Control (ICQC) has developed a ground-breaking new machine for per- forming, well, quality control. Thanks to its novel Deep Intelligence technology, an ICQC quality control (QC) machine can automatically, with 100% accuracy, d...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

I. Quests

I

To relax before competing in the ICPC World Finals, you have decided to play a computer game called Quests. You have played it a number of times already, and now you want to achieve a perfect playthrough—to prepare for your perfect playthrough of the finals...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

J. ’S No Problem

J

The Yllihc Engineering and Technological Institute (YETI), located in northern Snowblovia, has two problems: snow and money. Specifically, they have too much of the former and not enough of the latter. Every winter (and fall and spring, for that matter) the...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

K. Space Walls

K

Place-Y Technology Corp. plans to launch a new space station soon. The company CEO is known for being obsessed with perfection. For example, he insists that all the outer surfaces of the space station are regularly polished and cleaned of what he calls “spa...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

L. Sweep Stakes

L

You may have already won! In fact, you did already win! You won your very own island, in the deepest reaches of the unexplored ocean! Well, mostly unexplored. As it happens, there was a small military base there before you, and when they packed up and flew...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

M. Trailing Digits

M

A large shipment of doodads has just arrived, and each doodad has a suggested retail price of b cents. You’ve noticed that consumers are much more likely to purchase goods when most of the trailing digits are the same. For example, items are more likely to...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

N. What’s Our Vector, Victor?

N

Vector embeddings are a common tool in machine learning systems. Complex real-world concepts (for instance, words in a dictionary) are mapped onto vec- tors of real numbers. If embeddings are trained properly, related concepts remain close together in the v...

TeX C++ Statement text Statement PDF
Open problem page
ICPC 2020

O. Which Planet is This?!

O

It’s the year 2521, and interstellar probes have reached planets in distant solar systems. The Interstellar Consortium of Planet Cartographers (ICPC) has created detailed maps of these planets, and they seem to indicate the existence of alien life! On each...

TeX C++ Statement text Statement PDF
Open problem page