ICPC 2025
All 12 ICPC problems from 2025, 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. A-Skew-ed Reasoning
The following is based on a true story – the names have been changed because. . . well, because you always change names in stories like this one. Professor Taylor Swift is grading a homework assignment on integer skew heaps. A skew heap is a binary tree wit...
B. Blackboard Game
To help her elementary school students understand the concept of prime factorization, Aisha has invented a game for them to play on the blackboard. The rules of the game are as follows. The game is played by two players who alternate their moves. Initially,...
C. Bride of Pipe Stream
The story continues! For several years now, your town has been gifted with an abundance of Flubber, the adorable-but-slightly-flammable-and-toxic-and-acidic-and-sentient-and-mischievous man-made chemi- cal. The search continues for more (or, well, any) uses...
D. Buggy Rover
The International Center for Planetary Cartography (ICPC) uses rovers to explore the surfaces of other planets. As we all know, other planets are flat surfaces which can be perfectly and evenly discretized into a rectangular grid structure. Each cell in thi...
E. Delivery Service
The Intercity Caspian Package Company (ICPC) is starting a delivery service which will deliver pack- ages between various cities near the Caspian Sea. The company plans to hire couriers to carry packages between these cities. Each courier has a home city an...
F. Herding Cats
You are opening a cat cafe in Baku and would like to take a promotional photograph of all the cats sitting in the front window. Unfortunately, getting cats to do what you want is a famously hard problem. But you have a plan: you have bought a collection of...
G. Lava Moat
These pesky armies of good are coming to disturb the quiet and peaceful lands of the goblins again. Building a huge wall didn’t work out that well, and so the goblins are going to turn to the tried and true staple of defense: a moat filled with lava. They w...
H. Score Values
Ever since you arrived at your university, you have been a tireless advocate for introducing the brand-new martial-arts- plus-card-based sport of Contact Bridge to the school (and the world). Finally, after a great deal of (really persistent and annoying) a...
I. Slot Machine
Imperial Chance & Play Casino offers games using a slot machine that has n wheels arranged next to each other. Each of the wheels has n distinct symbols on it, and these symbols appear in the same order on each wheel. Each wheel shows one of its symbols thr...
J. Stacking Cups
You have a collection of n cylindrical cups, where the ith cup is 2i − 1 cm tall. The cups have increasing diameters, such that cup i fits inside cup j if and only if i < j. The base of each cup is 1 cm thick (which makes the smallest cup rather useless as...
K. Treasure Map
After years of searching you have come across Captain Blackbeard’s old map showing where his long- lost treasure is hidden, deep on the ocean floor. The map was once a hypsometric map – that is, it showed the ocean depth for the region around the treasure –...
L. Walking on Sunshine
I’m walking on sunshine, and it don’t feel good – my eyes hurt! Baku has plenty of sunshine. If you walk away from the sun, or at least perpendicular to its rays, it does not shine in your eyes. For this problem assume that the sun shines from the south. Wa...