#math
CF 2222C - Median Partition
CF 2222C - Median Partition Rating: - Tags: dp, math Solve time: 2m 36s Verified: no Solution Setup The simulator maintains a global simulated time variable $CLOCK$ and executes each MIX instruction by dispatching to a routine that models its effect on registers, memory, and timing. The I/O instructions considered here are restricted to devices $16$ and $18$. Device $16$ represents the read-card unit, and device $18$ represents the printer...
CF 2222A - A Wonderful Contest
CF 2222A - A Wonderful Contest Rating: - Tags: brute force, dp, math Solve time: 4m 29s Verified: no Solution Problem Understanding Each problem in the contest is worth at most 100 points. If a problem has $a_i$ subtasks, then every solved subtask contributes $$\frac{100}{a_i}$$ points, and $a_i$ is guaranteed to divide 100. This means every problem contributes one of the values $$0,\ \frac{100}{a_i},\ 2\cdot\frac{100}{a_i},\ \ldots,\ 100.$$ For a contestant,...
CF 1949K - Make Triangle
CF 1949K - Make Triangle Rating: 2800 Tags: constructive algorithms, math Solve time: 2m 29s Verified: yes Solution Problem Understanding We are given a multiset of positive integers and three required group sizes. Every number must belong to exactly one of the three groups, and each group must contain exactly the requested number of elements. After splitting the numbers, we look only at the three group sums. If those sums...
CF 1949E - Damage per Second
CF 1949E - Damage per Second Rating: 2900 Tags: brute force, math Solve time: 1m 7s Verified: no Solution Problem Understanding We are asked to distribute a fixed number of skill points between two attributes: damage per hit and hits per second, in order to minimize the total time to kill a sequence of monsters. Each monster has a health value $h_i$, and the time to kill it is determined...
CF 1949H - Division Avoidance
CF 1949H - Division Avoidance Rating: 3100 Tags: greedy, math Solve time: 5m 53s Verified: no Solution Problem Understanding The process starts with a single cell at (0, 0) . Whenever we divide a cell (x, y) , that cell disappears and produces (x + 1, y) and (x, y + 1) . A division is only legal if neither child is currently present. We are given a finite set...
CF 241B - Friends
CF 241B - Friends Rating: 2700 Tags: binary search, bitmasks, data structures, math Solve time: 2m 23s Verified: no Solution Problem Understanding We have an array of friend attractiveness values. Every unordered pair of distinct friends produces one possible picture, and the value of that picture is the xor of the two attractiveness values. Among all possible pairs, we want to choose exactly m distinct pairs whose xor values have...
CF 38B - Chess
CF 38B - Chess Rating: 1200 Tags: brute force, implementation, math Solve time: 2m Verified: no Solution Problem Understanding We are given the positions of two chess pieces on a standard 8 × 8 board, one rook and one knight. Their starting positions are guaranteed to be safe, meaning the rook does not attack the knight and the knight does not attack the rook. We must place one more knight...
CF 48C - The Race
CF 48C - The Race Rating: 1800 Tags: math Solve time: 1m 54s Verified: yes Solution Problem Understanding We are asked to predict the next petrol station where Vanya will stop, given the stations he has already visited. Vanya drives a car that consumes exactly 10 liters per 100 kilometers, starts with a tank filled with some unknown α liters (α ≥ 10), and stops only when the remaining petrol...