ICPC 2018
All 11 ICPC problems from 2018, 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. Catch the Plane
Your plane to the ICPC Finals departs in a short time, and the only way to get to the airport is by bus. Unfortunately, some of the bus drivers are considering going on strike, so you do not know whether you can get to the airport on time. Your goal is to p...
B. Comma Sprinkler
As practice will tell you, the English rules for comma placement are complex, frus- trating, and often ambiguous. Many people, even the English, will, in practice, ignore them, and, apply custom rules, or, no rules, at all. Doctor Comma Sprinkler solved thi...
C. Conquer The World
Bwahahahahaha!!! Your nemesis, the dashingly handsome spy Waco Powers, has at last fallen to your secret volcano base’s deathtraps (or so you assume, being a little too busy to witness it firsthand). At long last, you are all set to C ONQUER T HE W ORLD! No...
D. Gem Island
Gem Island is a tiny island in the middle of the Pacific Ocean. Until recently, it was known as one of the poorest, but also most peaceful, places on Earth. Today, it is neither poor nor peaceful. What happened? One sunny morning, not too long ago, all inha...
E. Getting a Jump on Crime
Your friend Robin is a superhero. When you first found out about this, you figured “everybody needs a hobby, and this seems more exciting than stamp collecting,” but now you are really thankful that somebody is doing something about the crime in your hometo...
F. Go with the Flow
In typesetting, a “river” is a string of spaces formed by gaps between words that extends down sev- eral lines of text. For instance, Figure F.1 shows several examples of rivers highlighted in red (text is intentionally blurred to make the rivers more visib...
G. Panda Preserve
Last month, Sichuan province secured funding to establish the Great Panda National Park, a natural preserve for a population of more than 1 800 giant pandas. The park will be surrounded by a polygonal fence. In order for researchers to track the pandas, wir...
H. Single Cut of Failure
The Intrusion and Crime Prevention Company (ICPC) builds intrusion detection systems for homes and businesses. The International Collegiate Programming Contest (in a strange coincidence also known as ICPC) is considering hiring the company to secure the roo...
I. Triangles
For your trip to Beijing, you have brought plenty of puzzle books, many of them containing challenges like the following: how many triangles can be found in Figure I.1? Figure I.1: Illustration of Sample Input 2. While these puzzles keep your interest for a...
J. Uncrossed Knight’s Tour
A well-known puzzle is to “tour” all the squares of an 8 × 8 chessboard using a knight, which is a piece that can move only by jumping one square in one direction and two squares in an orthogonal direction. The knight must visit every square of the chessboa...
K. Wireless is the New Fiber
A new type of unbounded-bandwidth wireless communication has just been tested and proved to be a suitable replacement for the existing, fiber-based communications network, which is struggling to keep up with traffic growth. You have been charged with decidi...