brain
tamnd's digital brain — notes, problems, research
41650 notes
We are given a set of points on the plane that act as fixed vertices. From these points, we choose any three distinct points to form a triangle. Inside this triangle lies an infinite integer grid of “cows”, one at every lattice point.
We are given a set of points on a plane that serve as possible vertices of a triangle. Every point has even integer coordinates, and no three points are collinear. From these points we choose any triple and form a triangle.
We are looking at a process that lasts for $n$ minutes. Each minute, exactly three new items are added, so after minute $t$, there are $3t$ items available.
We are working with a graph whose vertices are fixed nobles numbered from 1 to n, where the label also represents their strength. Edges represent mutual friendships, and these edges change over time through insertions and deletions.
We are given a directed graph where we start from node 1 and consider all possible directed walks that end at each vertex. A walk can revisit nodes and edges arbitrarily many times.
We are given a one-dimensional strip of length $n$. Some positions on this strip contain air conditioners, each fixed at a known coordinate and each producing its own base temperature.
We are given a sequence $x1, x2, dots, xn$. Our task is to construct another sequence $y1, y2, dots, yn$ such that when we XOR them elementwise, the resulting sequence $$ai = xi oplus yi$$ has a monotone bit-structure: every bit that is set in $ai$ must also be set in $a{i+1}$.
Two programmers are contributing edits to the same file, but their work histories are interleaved in time. We are given two ordered sequences of actions, one for each person. Each action is either an insertion at the end of the file or an edit of an existing line.
We are given a string and we need to decide whether it could have been constructed by a very specific process that builds strings from left to right choices.
We are working on an infinite grid where movement is allowed in four directions: up, down, left, and right, each costing one step. We are given three special cells: a start cell, a target cell, and a forbidden cell that cannot be stepped on.
We are given a multiset of original strings and a second multiset formed after a disturbance process. The disturbance worked in two stages. First, all strings were paired except one special string that stayed unpaired.
Two players give us two arrays of equal length. One array can be modified by repeatedly moving a single unit from one position to another position. Each move removes one from index i and adds one to index j, and the array must remain non-negative after every move.
A single person moves deterministically along a number line: starting from position $x$ at time $0$, his position at time $t$ is exactly $x+t$.
We are given a person who moves deterministically along a number line: starting at position $x$ at time $0$, and then increasing position by exactly one unit per second. So at time $t$, the person is at $x+t$.
We are given $2n$ permutations of size $n$. Each row is a rearrangement of numbers $1$ to $n$. We are promised that there exists a hidden structure behind these rows: they originally came from two intertwined Latin squares of size $n$, but then the rows were shuffled.
We are given a binary string of length $n$, where each position either contains a pawn or is empty. The board is a line, and pawns can move only in a very constrained way: a pawn can “jump” two cells left or right, but only if the intermediate cell is occupied and the…
The input describes a graph that is guaranteed to be a permuted hypercube. This means the graph has exactly $2^n$ vertices, every vertex has degree exactly $n$, and the structure is isomorphic to the standard $n$-dimensional hypercube, but the vertex labels have been…
We are repeatedly running a stochastic process that evolves a small probability distribution over three outcomes. At any moment there are up to three “active” slips, one of which is a terminal success state (the pink slip) and the other two are transient states.
We are given a list of non-negative integers where each value represents how many cars sit on a segment of a road. The “cost” of the whole configuration is defined by comparing every pair of segments and summing the absolute difference of their car counts.
We are given many queries. Each query provides a very large integer $n$, and we consider every integer $i$ from 1 to $n$. For each $i$, we define a function $f(i)$ as the smallest positive integer that fails to divide $i$.
We are effectively watching a number grow from l to r by repeatedly adding one, and we want to measure how “violent” each increment is in terms of decimal digit changes.
We are given a row of stones, each stone having a distinct strength value. In one move, we are allowed to remove only one of the two boundary stones, either the leftmost or the rightmost remaining stone.
We are given a grid where some cells are forced to be zero and the rest are flexible cells that may take any non-negative integer value.
We are given a sequence b which is claimed to come from a hidden process involving another array a. The process builds a step by step in odd lengths: at step i, we look at the first 2i-1 elements of a, compute their median, and store it as b[i].
We are given a binary string made only of the characters D and K. For every prefix of this string, we want to determine how finely we can split that prefix into contiguous pieces such that every piece has the same internal balance between D and K.
We are given a short lowercase string and asked to find a very specific “missing pattern” inside it. The task is to identify the shortest possible string over lowercase letters that does not appear anywhere as a contiguous substring of the given input.
We are given a small set of distinct integers and are allowed to add new distinct integers to it. The goal is to build a final set such that it satisfies a very strong closure property: whenever we pick any two numbers from the set, the absolute difference between them must…
We can view the situation as a two-layer directed routing process between two bipartite sets of nodes. One set corresponds to sights in Saratov, the other to sights in Engels.
We are given a small grid of biome “types”, where each type is identified by a pair of parameters coming from a fixed $n times m$ table. Some of these pairs exist and are assigned a unique integer identifier, while others are unavailable.
We are working with a grid of uppercase letters, but the alphabet is extremely small: only the first five letters appear.
We are given a fixed collection of strings, all of the same length, and we are asked to answer many queries about a slightly longer string. Each stored string has length $m$. Each query string has length $m+1$.
We are given a circular arrangement of sweets labeled from 1 to n. Each sweet is either “liked” or “not liked”. Anya performs a deterministic process that removes sweets one by one from the circle. The process has two phases in every test case.
Vika arrives in Bertown on a fixed day $k$. She has several friends, and each friend offers a single continuous interval of days during which she can stay at their home.
We are given several test cases, each consisting of a sorted array of distinct integers. Think of these numbers as fixed points on a number line. A query point $y$ is chosen, and a function returns the closest point in the array to $y$ based on absolute distance.
We are given a multiset of strings that all come from a single unknown string of length $n$. For every length $k$ from $1$ to $n-1$, we are given exactly two strings of that length, and each of those two strings is either a prefix or a suffix of the hidden string.
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.