Divide by Zero 2018 and Codeforces Round 474 (Div. 1 + Div. 2, combined)
4 problems from Divide by Zero 2018 and Codeforces Round 474 (Div. 1 + Div. 2, combined) (contest 960), difficulty 1200-2900. 3/4 solutions verified against sample I/O.
Divide by Zero 2018 and Codeforces Round 474 (Div. 1 + Div. 2, combined)
Div. 1+2 | 4 problems | 3/4 verified | Difficulty 1200-2900 | 6m 51s
| # | Problem | Rating | Tags | Accepted | Time | ✓ |
|---|---|---|---|---|---|---|
| A | Check the string | 1200 | implementation | 8,786 | 1m 4s | ✓ |
| B | Minimize the error | 1500 | data-structures, greedy, sortings | 12,382 | 1m 14s | ✓ |
| E | Alternating Tree | 2300 | combinatorics, dfs-and-similar, divide-and-conquer | 2,269 | 2m 1s | |
| G | Bandit Blues | 2900 | combinatorics, dp, fft | 1,201 | 2m 32s | ✓ |
CF 960G - Bandit Blues
We are given a permutation of the numbers from 1 to N, and we simulate a simple “record-breaking” process on it. We start with a virtual value 0.
CF 960E - Alternating Tree
We are given a tree with a value attached to every node. Between any two nodes $u$ and $v$, there is exactly one simple path, and we assign a score to that directed path by taking the node values along the path and alternating their signs, starting with a positive sign at the…
CF 960B - Minimize the error
We are working with two integer arrays of equal length. Each position contributes independently to a total “error”, where the error of an index is the square of the difference between the two values at that index.
CF 960A - Check the string
We are given a string made only of the characters a, b, and c. This string is claimed to have been constructed in a very specific way: it starts with one or more a characters, then some b characters are appended, and finally some c characters are appended at the end.