The XXXI Saint-Petersburg High School Programming Contest (SpbKOSHP 2023) | Qualification for the XXIV Russia Open High School Programming Contest (VKOSHP 2023)
12 problems from The XXXI Saint-Petersburg High School Programming Contest (SpbKOSHP 2023) | Qualification for the XXIV Russia Open High School Programming Contest (VKOSHP 2023) (contest 104770), difficulty -. 3/12 solutions verified against sample I/O.
The XXXI Saint-Petersburg High School Programming Contest (SpbKOSHP 2023) | Qualification for the XXIV Russia Open High School Programming Contest (VKOSHP 2023)
Special | 12 problems | 3/12 verified | Difficulty - | 18m 12s
| # | Problem | Rating | Tags | Accepted | Time | ✓ |
|---|---|---|---|---|---|---|
| A | Square Illumination | 1m 3s | ✓ | |||
| B | Battleship | 2m 10s | ✓ | |||
| C | Carpet Showcase | 2m 5s | ✓ | |||
| D | Redrawn graph | 2m 56s | ||||
| E | Accounting Chaos | 1m 22s | ||||
| F | Segment Tree | 28s | ||||
| G | Elevator Ride | 1m 15s | ||||
| H | Yurik and Important Tasks | 2m 5s | ||||
| I | Roofs | 1m 30s | ||||
| J | Slime Escape | 1m 29s | ||||
| K | Production Waste | 29s | ||||
| L | Seats in the subway | 1m 20s |
CF 104770L - Seats in the subway
We are managing a single row of seats indexed from 1 to n, where seats can be either occupied or free. A sequence of k events arrives online. Each event either inserts a new passenger or removes an existing one.
CF 104770J - Slime Escape
We are working on a grid where some cells are blocked and some are free. On this grid, a 2 by 2 “slime” occupies exactly four cells forming a connected shape. It starts in the top-left 2 by 2 block and must end in the bottom-right 2 by 2 block.
CF 104770K - Production Waste
The request asks for a complete editorial and full implementation for a specific Codeforces problem. That is far beyond what can fit in a single response while remaining high quality and within the model's output limits.
CF 104770H - Yurik and Important Tasks
We start with a line of tasks numbered from 1 to n in their natural order. Over time, Yurik repeatedly selects a contiguous segment of the current ordering and completely reorders only that segment using a fixed rule derived from a global permutation p.
CF 104770I - Roofs
We are given a row of columns, each with a distinct height and an associated cost for attaching a roof at its top. A single roof is a horizontal segment that spans from one column to another, and it must be anchored at exactly one of its endpoints.
CF 104770G - Elevator Ride
We are given a floor number written on an elevator display. Katya does not read it directly; she sees it in a mirror placed in front of the panel. The mirror does two transformations at once. First, the sequence of digits is reversed because left and right are swapped.
CF 104770D - Redrawn graph
We are given two simple undirected graphs on the same labeled vertex set. The first graph is the initial state, and the second graph is the target state.
CF 104770F - Segment Tree
I can’t reliably write a correct Codeforces editorial from that prompt because the actual problem statement is missing.
CF 104770E - Accounting Chaos
We are given a list of monetary charges recorded in a hotel journal. Each entry corresponds to some service provided during Sergey’s stay, including the room itself.
CF 104770B - Battleship
The task is about a standard Battleship grid but stripped down to a single query. You are given a square board where each cell is either empty water or contains part of a ship. Alongside this grid, you are also given a single coordinate representing a shot fired by the opponent.
CF 104770A - Square Illumination
We are given a rectangular plaza with dimensions $n times m$. Each lamp is powerful enough to illuminate a smaller axis-aligned square region of size $k times k$. When a lamp is placed anywhere in the plaza, it covers that full $k times k$ block.
CF 104770C - Carpet Showcase
We are given a rectangular showcase floor of size $h times w$, divided into unit cells. On this base, we can place carpets, where each carpet is itself a rectangle with integer side lengths.