ICPC 2021
All 12 ICPC problems from 2021, 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. Crystal Crosswind
You are part of a scientific team developing a new technique to image crystal structures at the molecular level. The technique involves blowing a very fine wind over the surface of the crystal at various angles to detect boundaries (indicated by molecules t...
B. Dungeon Crawler
Alice and Bob are in charge of testing a new escape room! In this escape room, customers are trapped in a dungeon and have to explore the entire area. The dungeon consists of n rooms connected by exactly n−1 corridors. It is possible to travel between any p...
C. Fair Division
After sailing the Seven Seas and raiding many ships, Cap’n Red and his crew of fellow pirates are finally ready to divide their loot. According to ancient traditions, the crew stands in a circle ordered by a strict pirate hierarchy. Cap’n Red starts by taki...
D. Guardians of the Gallery
Your local art gallery is about to host an exciting new exhibition of sculptures by world-renowned artists, and the gallery expects to attract thousands of visitors. Unfortunately, the exhibition might also attract the wrong kind of visitors, namely burglar...
E. Hand of the Free Marked
There is a fairly well-known mentalism trick known as the Fitch Cheney trick. From a deck of n playing cards, k are selected uniformly at random and given to an assistant while the magician is out of the room. The assistant places k − 1 of the selected card...
F. Islands from the Sky
You might never have heard of the island group of Iceepeecee, but that suits their inhabitants just fine. Located in a remote part of the South Pacific, they are truly off the beaten track, without any regular air or sea traffic, and they have remained a tr...
G. Mosaic Browsing
The International Center for the Preservation of Ceramics (ICPC) is searching for motifs in some ancient mosaics. According to the ICPC’s definition, a mosaic is a rectangular grid where each grid square contains a colored tile. A motif is similar to a mosa...
H. Prehistoric Programs
Archaeologists have discovered exciting clay tablets in deep layers of Alutila Cave. Nobody was able to decipher the script on the tablets, ex- cept for two symbols that seem to describe nested structures not unlike opening and closing parentheses in LISP....
I. Spider Walk
Charlotte the spider sits at the center of her spiderweb, which consists of a series of silken straight strands that go from the center to the outer boundary of the web. Charlotte’s web also has bridges, each of which connects two adjacent strands. The two...
J. Splitstream
A splitstream system is an acyclic network of nodes that processes finite sequences of numbers. There are two types of nodes (illustrated in Figure J.1): • A split node takes a sequence of numbers as input and dis- tributes them alternatingly to its two out...
K. Take On Meme
The Internet can be so fickle. You work for a small ad agency, Mimi’s Mammoth Memes. Your ad campaigns are very cheap, and rely on the hope of producing the next hit viral meme. Unfortunately, the last four hundred or so memes have failed to take off, despi...
L. Where Am I?
Who am I? What am I? Why am I? These are all difficult questions that have kept philosophers reliably busy over the past millennia. But when it comes to “Where am I?”, then, well, modern smartphones and GPS satellites have pretty much taken the excitement o...