2022-2023 Saint-Petersburg Open High School Programming Contest (SpbKOSHP 22)
12 problems from 2022-2023 Saint-Petersburg Open High School Programming Contest (SpbKOSHP 22) (contest 104010), difficulty -. 12/12 solutions verified against sample I/O.
2022-2023 Saint-Petersburg Open High School Programming Contest (SpbKOSHP 22)
Special | 12 problems | 12/12 verified | Difficulty - | 11m 53s
| # | Problem | Rating | Tags | Accepted | Time | ✓ |
|---|---|---|---|---|---|---|
| A | Rain Diary | 2m 4s | ✓ | |||
| B | Magnetic Games | 50s | ✓ | |||
| C | Campfire Riddle | 39s | ✓ | |||
| D | The Tree | 42s | ✓ | |||
| E | Just Like Pickle | 47s | ✓ | |||
| F | Lazy to Win | 47s | ✓ | |||
| G | The Length of the Sequence | 50s | ✓ | |||
| H | Pines | 1m 6s | ✓ | |||
| I | Circus Performance | 43s | ✓ | |||
| J | Square Running | 1m 1s | ✓ | |||
| K | Pick a Pair | 1m 8s | ✓ | |||
| L | Shifting Roads | 1m 16s | ✓ |
CF 104010L - Shifting Roads
We are given a collection of straight road segments in the plane. Each road is just a line segment with real geometry: two endpoints in 2D, and the segment is the asphalt between them. From these segments we must choose exactly three.
CF 104010K - Pick a Pair
We are given an even number of words, all of identical length, and we want to pair them up. A pair is considered valid for a chosen value $k$ if the two words share a common prefix of length at least $k$.
CF 104010J - Square Running
We are dealing with a rectangular arena that contains a smaller rectangular grass field in its center. Around this grass field, there are multiple concentric rectangular “lanes”.
CF 104010H - Pines
We are given a line of positions that will contain alternating objects: a pine, then a lamp, then a pine, then a lamp, and so on. Since there are n lamps, there are n + 1 pines placed at the pine positions.
CF 104010I - Circus Performance
We are given a collection of acrobats, each described by two attributes: a height-like value $ai$ and a weight-like value $bi$. We need to arrange all acrobats in a line, producing a permutation of indices.
CF 104010G - The Length of the Sequence
We are given a target value $S$, and we must construct a contiguous interval of integers $[l, r]$, where $0 le l le r le 10^{18}$. If we write all integers from $l$ to $r$ in decimal form and concatenate them without separators, we obtain a single long string.
CF 104010F - Lazy to Win
We are given a sequence of problem scores laid out in a fixed order. Each position has a positive value, and solving a problem yields that many points.
CF 104010E - Just Like Pickle
We are standing at position zero on an infinite number line and want to reach some target coordinate $x$, which can be positive, negative, or zero. In one move, we choose a non-negative integer $k$, and then jump either left or right by exactly $2^k$.
CF 104010A - Rain Diary
We are given a strictly convex polygon, and we imagine choosing a point inside it. For any fixed direction, we draw the maximal chord of the polygon that passes through this point and is parallel to that direction.
CF 104010B - Magnetic Games
We are given an $n times m$ grid. One unknown cell contains a magnet. Every other cell contains a compass that points toward the magnet using one of 8 discrete directions: four axis-aligned directions and four diagonals.
CF 104010D - The Tree
We are working with an infinite complete binary tree where every node has a left child and a right child. Initially, every node is uncolored. We receive two kinds of operations.
CF 104010C - Campfire Riddle
We are given a group of $n$ people. Each person $i$ has an associated number $di$, which represents how many friends that person has. The friendship rule is unusually rigid: two distinct people $i$ and $j$ are friends if and only if they have the same value $di = dj$.