brain
tamnd's digital brain — notes, problems, research
43815 notes
We are given an array of integers and we are allowed to remove exactly one element at a time. For each removal, we look at the remaining array and ask a very specific question: does there exist an element that is exactly equal to the sum of all the other elements in that…
We are building strings under a very specific constraint: each string must use only the first k lowercase Latin letters, and each of those k letters must appear at least once.
We are given a sequence of independent queries. Each query consists of two integers, and for every pair we must compute their arithmetic sum and output it immediately. There is no dependency between test cases.
The frog moves along a straight number line starting from position 0. Its motion is fully deterministic: it alternates between two fixed step sizes.
We are given a hidden binary array of length $n$. We cannot see the array directly. Instead, we can ask queries on any interval $[l, r]$, and the system returns the number of ones in that segment.
We are dealing with a hidden binary array of length $n$, where each position is either zero or one. The array does not change on its own, but it is modified by our own actions: every time we correctly identify the position of the current $k$-th zero from the left, that…
We are given multiple queries, and each query consists of a single positive integer $n$. For each $n$, we need to count how many numbers in the range from 1 to $n$ have all digits identical in their decimal representation. These “ordinary” numbers have a very rigid structure.
We are building strings of length $m$, but the string itself is not the only object we care about. Along with the string, we also choose two independent ways to split it into consecutive segments. Each segment must correspond exactly to one of the dictionary words.
We are asked to construct two positive integers, call them $x$ and $y$, such that we fully control three properties at once: how many digits $x$ has, how many digits $y$ has, and how many digits their greatest common divisor has.
We are asked to construct a string of length n using only the first k lowercase Latin letters. Among all possible such strings, we want one that minimizes a specific cost function. The cost is defined over adjacent pairs inside the string.
Each test gives a sequence of reviewers arriving one after another. Every reviewer must be sent to one of two identical servers. Each server maintains its own counters of upvotes and downvotes, and these counters influence future decisions only on that same server.
We start with a bipartite graph whose edges arrive online. Each edge must eventually be assigned one of two labels, red or blue. For any vertex, we compare how many incident edges are red versus blue, and we pay the absolute difference of these two counts.
We are working with a tree where every edge is initially present. We are allowed to remove any subset of edges, which splits the tree into several connected components. Each resulting component is still a tree.
We are given two strings, and we imagine taking substrings from each of them and interleaving their characters while preserving internal order inside each substring.
We are asked to count how many ordered pairs of positive integers $(a, b)$ satisfy a single arithmetic constraint that mixes their least common multiple and greatest common divisor.
We are constructing a monotone path from the bottom-left corner of a grid to the top-right corner, but the path is not just a simple sequence of unit steps.
We are given a binary string and we are allowed to delete characters, but with a constraint: any deleted positions must not be adjacent in the original string. After deleting some chosen characters, we concatenate the remaining ones and obtain a shorter string.
We are given a rooted tree where every node except the root has a parent pointer, so the structure is initially encoded as an array a[i] describing the parent of node i.
We are simulating a deterministic elimination process over a queue of animals where each animal has three different strength modes depending on how many consecutive fights it has already won.
We start with a permutation placed on positions from 1 to n. Each position contains a coin with a label, and every coin also has a direction state, initially all facing up.
We are given a set of magnets, each secretly belonging to one of three types: North, South, or a special “inactive” type that produces no magnetic behavior.
We are given a grid that has a very unusual shape: it has n rows and a very large number of columns, from 0 up to 10^6 + 1. Each row contains exactly one obstacle placed at a given column position a[i]. These obstacles block movement through their cells.
We are given an array of trampoline strengths arranged in a line. Each trampoline behaves like a forced jump: if Pekora lands on position i, she is immediately launched to i + S[i].
We are given a multiset of positive integers representing fish weights. We must arrange these values in a permutation, then reveal them one by one. As the sequence unfolds, each revealed value is compared against the maximum value seen so far.
We maintain a fixed collection of strings, each representing a “name”, and each name has an associated value that changes over time.
We are given a binary string where zeros and ones appear in equal quantity, and the length is even. The target configuration is not arbitrary: we want the string to become perfectly alternating, meaning every adjacent pair of characters must differ.
We are choosing a single pack size a for selling cat food cans. Every customer initially wants to buy some number x within a fixed range [l, r].
We are given a binary string where some positions are already fixed as 0 or 1, while others are unknown and written as ?. Each ? must be replaced by either 0 or 1, and this choice determines the final string.
We are given a chessboard where no two rooks initially share a row or a column, so every rook sits in a distinct row and a distinct column.
We are working with a two-player construction game on the numbers from 1 to 2n. One player first partitions these numbers into n disjoint pairs. After that, the second player selects exactly one number from each pair.
We are given a tree where two players start on different vertices. Alice moves first. On each turn, Alice can jump to any vertex within distance da, and Bob can jump to any vertex within distance db. Distance is standard shortest path length in the tree.
We are given a fixed amount of carrying capacity split between two people, you and your follower. Each test case describes a small “loot selection” problem: there are two types of weapons, swords and war axes, each type having a fixed weight per item and a limited stock in…
We are given a binary string s of length 2n - 1. From this string, we look at every contiguous window of length n. There are exactly n such windows, starting at positions 1 through n. Each window represents a candidate string that overlaps heavily with its neighbors.