ICPC 2020
All 15 ICPC problems from 2020, each with a statement view, editorial, and C++ implementation.
Problem set
Each entry below goes straight to the public problem page, with the statement, editorial, code, and raw resources kept together.
A. Cardiology
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...
B. The Cost of Speed Limits
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...
C. Domes
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...
D. Gene Folding
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...
E. Landscape Generator
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...
F. Ley Lines
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...
G. Opportunity Cost
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...
H. QC QC
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...
I. Quests
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...
J. ’S No Problem
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...
K. Space Walls
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...
L. Sweep Stakes
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...
M. Trailing Digits
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...
N. What’s Our Vector, Victor?
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...
O. Which Planet is This?!
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...