Codeforces Round 502 (in memory of Leopoldo Taravilse, Div. 1 + Div. 2)
8 problems from Codeforces Round 502 (in memory of Leopoldo Taravilse, Div. 1 + Div. 2) (contest 1017), difficulty 800-3300. 6/8 solutions verified against sample I/O.
Codeforces Round 502 (in memory of Leopoldo Taravilse, Div. 1 + Div. 2)
Div. 1+2 | 8 problems | 6/8 verified | Difficulty 800-3300 | 18m 34s
| # | Problem | Rating | Tags | Accepted | Time | ✓ |
|---|---|---|---|---|---|---|
| A | The Rank | 800 | implementation | 21,583 | 1m 30s | ✓ |
| B | The Bits | 1200 | implementation, math | 9,623 | 1m 47s | ✓ |
| C | The Phone Number | 1600 | constructive-algorithms, greedy | 6,470 | 1m 29s | ✓ |
| D | The Wu | 1900 | bitmasks, brute-force, data-structures | 3,953 | 1m 36s | ✓ |
| E | The Supersonic Rocket | 2400 | geometry, hashing, strings | 1,092 | 2m 20s | ✓ |
| F | The Neutral Zone | 2500 | brute-force, math | 944 | 3m 31s | ✓ |
| G | The Tree | 3200 | data-structures | 1,210 | 2m 16s | |
| H | The Films | 3300 | brute-force | 184 | 4m 5s |
CF 1017H - The Films
We are given a shelf containing an ordered sequence of films, where each film has a “type” or ending label from 1 to m. This initial sequence is fixed and indexed from 1 to n.
CF 1017G - The Tree
We are working with a rooted tree where vertex 1 is the root, and every node is initially colored white. Over time, we apply three kinds of operations that either flip colors, reset parts of the tree, or ask for the current color of a node.
CF 1017F - The Neutral Zone
We are asked to evaluate a number-theoretic sum over all integers from 1 to $n$, where each integer contributes a value defined through its prime factorization. For a number $x$, we factor it as a product of primes $x = prod pi^{ai}$.
CF 1017E - The Supersonic Rocket
Each engine is a finite set of points in the plane, and we are allowed to rigidly move each set independently before they interact. Rigid motion here means we can translate and rotate a set arbitrarily, but not deform it.
CF 1017D - The Wu
We are given a collection of binary strings, all of the same fixed length $n le 12$. Each string in this collection appears with multiplicity, so duplicates matter. Alongside this, every position $i$ has a non-negative weight $wi$.
CF 1017B - The Bits
We are given two binary strings of equal length. You are allowed to pick any two positions in the first string and swap their bits. The second string stays fixed.
CF 1017A - The Rank
We are given a class of students, each identified by a unique integer id starting from 1. Every student has four exam scores corresponding to different subjects. The task is to rank all students by their total score across the four subjects.
CF 1017C - The Phone Number
We are given a number $n$, and we must construct a permutation of the integers from $1$ to $n$. Among all such permutations, we are asked to minimize a quantity defined on the permutation. This quantity is the sum of two classical subsequence measures.