brain
tamnd's digital brain — notes, problems, research
43815 notes
A convex quadrilateral is determined by four points in convex position, meaning all four lie on the boundary of their convex hull and no one lies in the convex hull of the other three.
We are given a tree where every vertex is initially colored either white or black. The tree structure is fixed, but we are allowed to perform operations that swap the colors of two endpoints of any edge, and each such swap costs one unit.
We are given a tree with $N$ vertices. We are allowed to remove any subset of edges. Once those edges are removed, the tree splits into connected components. The requirement is that every resulting connected component must have size either $A$ or $B$.
We are given a finite set of integer points in the plane, and we want to construct a small collection of allowed step vectors such that we can build a walk starting from the origin that visits every given point. The walk is a sequence of lattice points starting at $(0,0)$.
We are given a vertical Jenga tower made of $N$ horizontal layers, each layer having three possible block positions. Each position is either present or missing.
We are given a grid of numbers that is supposed to come from an unknown black and white painting. Each cell of the grid is labeled with how many black cells appear in the 3 by 3 neighborhood centered at that position.
We are given a string of length $n$ over an alphabet of size $C$, but instead of working with the string directly, we look at its structure through the KMP prefix-function (failure function).
We are given a regular hexagon of side length $N$, already decomposed into a fixed grid of unit equilateral triangles. The task is to cover the entire region using unit rhombuses, where each rhombus is formed by joining two adjacent unit triangles sharing an edge.
We are given a fixed graph structure built from a chain of equilateral triangles. The vertices are laid out in a straight line, labeled from 1 to $n+2$.
We are given a long string composed only of four characters: b, d, p, and q. This string is printed on a rigid glass object.
We are given a sequence of pitch offsets for piano keys relative to the first key. These values describe the current relative tuning, not the absolute frequencies, but they are consistent in the sense that shifting every key by the same constant would represent a valid…
Place $AB$ as a horizontal segment with $A,B$ fixed and the semicircle $\gamma$ above $AB$.
We are given a sequence of operations over a very large one-dimensional line, where positions can go up to 1e9. Two types of operations are performed online. The first type inserts a wave.
We are asked to fill an $h times w$ grid completely with connected pieces of size five cells. Each piece must be one of the classical pentomino shapes, meaning it is a connected set of five unit squares matching one of the twelve allowed geometric forms up to rotation and…
We are given the boundary of a simple polygon that represents a cake. The polygon is described by its vertices in counterclockwise order, and it has a strong structural property: it is invariant under a 180 degree rotation.
We are given a reference program written as a sequence of tokens, and then multiple query programs. Each program is already tokenized, so we do not deal with raw characters but with a list of strings.
We are given an array of integers representing answers from students sitting in a line. Each query either changes one student’s answer or asks about a contiguous segment of students together with a hypothetical correct answer value x.
We are given a binary string, meaning each position is either 0 or 1, and we are allowed to repeatedly apply a very specific local transformation.
We are given a tree where each node carries two independent pieces of information: a color, either red or blue, and a positive weight.
A tetrahedron has six edges, so for each fixed $k \in {1,2,3,4,5}$ we are distributing edge lengths $a$ and $1$ across the complete graph $K_4$ in a way that can actually arise from a Euclidean embedd…
We are asked to reconstruct a geometric object from partial metric information. There is a square in the plane whose vertices lie on integer coordinates.
The expression is a finite linear combination of shifted cosine functions with positive weights decreasing geometrically.
We maintain a collection of labeled strings. Each string is introduced by a query, and from that moment it behaves like an object with an identifier equal to the time it was inserted. Alongside each string we store a numeric value.
The requirement is to construct infinitely many natural numbers $a$ such that for every natural number $n$, the integer $n^4 + a$ is composite.
The expression is
The functional equation applies a transformation
Assume a tetrahedron with vertices $A,B,C,D$ satisfies the opposite of the claim, meaning that at every vertex the three incident edges fail to form the sides of a triangle.
We are interacting with a sequence of meals that arrive one by one, each carrying a non-negative calorie value. At any moment we may either ignore a meal or take it, but taking it adds it permanently to a current “plate set” whose total calorie sum must never exceed 1000.
We are asked to count how many ways we can wire a system of one-to-one connections between entry portals and exit portals spread across levels 1 to n.
We are given a set of points in the plane, called nails. At any moment we imagine wrapping a tight rubber band around all remaining nails, so the band forms the convex hull of the current set.
We are given a rectangular grid of size $n times m$, initially empty. Moves arrive one by one in a fixed order, and each move paints a previously unpainted cell black. After each move, we need to decide whether that move is allowed to be placed or whether it should be skipped.
We are given a set of points in the plane, with the guarantee that no three are collinear. From this set, we are allowed to choose a non-empty subset and arrange it in a cyclic order.
We are given a partially corrupted description of a sequence that originally came from a simple formula. There is an unknown integer value $k$, and for each index $i$, the intended value is obtained by dividing $k$ by $i$ and rounding to the nearest integer using standard…
We are given a row of $n$ seats and $n$ students. Each student has a preferred seat number, and each student also has a personal dissatisfaction cost parameter.
We are given a line of positions numbered from 0 to n. From each position i there is a fixed “launcher” that sends a ball forward. The distance it moves depends on the ball’s weight x through the expression i + floor(pi / x). A ball always starts at position 0.
We are asked to count how many sequences of length n can be formed using three colors, red, green, and blue, where each position in the sequence is a cube.
We are simulating a constrained walk on a grid that represents a shop. The grid has $n$ rows and $m$ columns, where each cell is either empty or blocked. A person starts in the bottom-left corner of the grid and then follows a long sequence of movement commands.
We are given a special class of integers called practical numbers. A number is practical when every integer from 1 up to that number can be formed as a sum of distinct divisors of the number.
We are given a sequence of distorted 32-bit integer measurements coming from a Martian temperature sensor. The hardware fault is consistent across time: some fixed subset of bit positions has been flipped in every measurement, meaning that for those positions every recorded…
We are given a single long DNA strand composed of the four characters A, C, G, and T. From this strand, we can derive a second strand by applying a fixed pairing rule character by character: A pairs with T, and C pairs with G, and the pairing is symmetric.
We are given a hidden permutation p of length n, meaning each number from 1 to n appears exactly once, but we do not know the order. We can ask queries. Each query is another length-n array q, where each entry is also between 1 and n.
We are working on an infinite grid of integer points. From every lattice point, you can move one step right or one step up for free, because there are standard unit edges in those directions.
We are given an array of integers and we look at all possible contiguous subarrays. For any fixed subarray, we focus on its maximum value and we also count how many times that maximum value appears inside the subarray.
There are several contests running in parallel. Each contest already has some number of participating teams, and you are allowed to distribute an additional pool of teams across these contests however you want.
We start with a fixed base string $S$. Every operation builds new strings by cutting several substrings from $S$ and concatenating them in order.
We are given an integer array and a single operation that can be applied at most once. The operation picks a contiguous segment and adds a fixed value $k$ to every element in that segment.
We are asked to construct an $n times n$ integer matrix using values from $1$ to $2n$, with two simultaneous requirements that interact in a very constrained way. First, every integer in the range $1 dots 2n$ must appear at least once somewhere in the grid.
We are given a large infinite chessboard, but only a small number of cells are occupied by two types of objects: castles and existing obstacles.
We are given a fixed array of integers, and we imagine that every non-negative integer labels a “universe”. In universe j, each original value ai is transformed into ai XOR j, and then we sort these transformed values.
We are given a trading simulation where a player can repeatedly convert money into flour and then convert flour back into money at a better price. The player starts with some amount of gold and has a limited amount of time.
We are given several independent test cases. Each test case consists of a set of closed segments on a number line, and we must assign each segment one of k colors. The restriction is that if two segments share the same color, they must not intersect at any point on the line.
Let $f(x)=ax^2+bx+c$.
We are given an undirected graph with a special structure: every edge belongs to at most one simple cycle. This means the graph is a cactus, so cycles do not overlap except possibly at shared vertices, and if you remove cycle edges appropriately the remaining structure becomes…
We are given an initial array of small positive integers. One operation chooses a positive integer $x$, and then every element of the array is simultaneously replaced by its remainder when divided by $x$.
We are given a directed tree, meaning there are n nodes and n−1 edges, and if we ignore edge directions the graph is connected and acyclic. Each node is labeled either S or F.
We are given a permutation $p$ over numbers from $1$ to $n$. We are allowed to choose another permutation $q$, which is simply an ordering of the same $n$ elements.
We are given a line of positions representing a shelf. Each position is either empty or occupied by a book. The goal is to make every position “clean”, but there is a restriction: a position containing a book cannot be cleaned directly.
We are given a string for each test case and are allowed to permute its characters arbitrarily. After choosing a final arrangement, we examine every prefix of length at least two. The requirement is that none of these prefixes is a palindrome.
We are working on a directed graph where each edge has a weight that should be thought of as a “label” rather than a cost. A path is defined as a sequence of exactly $k$ directed edges starting at a fixed node $s$ and ending at a fixed node $t$.
We are given a set of projects, each labeled from 1 to n, together with a list of dependency rules of the form “project a must be finished before project b can start.
We are given a hidden integer array of length $n$, where every element is between 1 and 100. We do not see the array directly. Instead, we are given the multiset of products formed by every pair of adjacent elements in that array.
We have two groups of agents starting at opposite ends of a one-dimensional corridor that contains exactly one extra empty cell.
We are given a rectangular arrangement of passengers, modeled as an $n times m$ grid. Each cell represents one seat and contains either a definitely infected passenger, a definitely healthy passenger, or an uncertain passenger who is independently infected with probability $1/2$.
We are given several test cases. Each test case provides an integer $n$, and from it we construct a very large index based on a power-of-seven expression: the target index is $7^n$.
We are given a line of stores, each store having a current profit value, which can be positive or negative. The goal is to maximize the total profit after applying at most one global operation called a blue spell and any number of local operations called green spells, with the…
We are given a list of citation counts for a researcher’s papers, already sorted in non-increasing order. Each number represents how many times a particular paper has been cited.
We are given a sequence of coins laid out in a line, where coin k has a fixed value v[k]. We are allowed to pick a subset of these coins, but there is a strict restriction: we cannot pick two coins whose indices differ by exactly one.
We are given two strings, a long text s and a pattern t. We scan every starting position in s where t could fit. For each such position, Tony’s algorithm tries to decide whether the substring is equal to t, but instead of checking all characters, it performs k random probes.
We are given a sequence of integers where each element carries a weight. From this sequence we are allowed to choose any subsequence, meaning we can delete elements while preserving order, and we care about two different quantities computed on that subsequence.
We are given a connected undirected graph where each edge has a weight. For a fixed threshold value $x$, we conceptually “ignore” all edges whose weight is greater than $x$, and only keep edges with weight at most $x$.
We are given a fixed set of points in the plane, and then multiple query points. For each query point, we must choose a line such that the query point lies strictly on one side of the line and every given point lies strictly on the other side.
We start with pebbles labeled from 1 to n, where pebble i has weight i. In each move, two currently available pebbles are selected and passed through one of two devices. One device always returns the lighter of the two inputs, the other always returns the heavier one.
The expression on the right side is quadratic in $x$, while the left side is a product of decimal digits, hence grows at most exponentially in the number of digits but remains extremely constrained di…
We are given a simple undirected graph with up to 300 vertices, where each input edge is guaranteed to exist and no duplicates appear. The graph represents travel routes between countries.
We are given a graph with $n$ nodes where every pair of nodes is potentially connected, but only $m$ of those edges are actually usable. Think of this as a simple undirected graph: each of the $m$ input pairs describes a working two-way road between two countries.
We are given a rectangular grid with $n$ rows and $m$ columns. Each cell contains an integer, and the only operation allowed is to permute values independently inside each column.
We are given an array of size $2n$ representing fighting strengths of $2n$ friends. The task is to split them into two disjoint teams so that every person belongs to exactly one team, and both teams must contain an odd number of members.
We are asked to look at every permutation of numbers from 1 to n, compute how many inversions each permutation contains, and then sum those inversion counts over all permutations.
We are given a string and multiple independent queries. Each query specifies a segment of the string, and we are only allowed to look inside that segment.
We are asked to construct a special kind of permutation of size n. A permutation here means we arrange the numbers from 1 to n exactly once each. The twist is that the permutation must behave like an involution without fixed points.
We are given a starting integer and a deterministic process that repeatedly transforms it. At each step, we take the current number, reverse its decimal representation, average the two values, and round the result down to an integer.
Let the triangle have consecutive integer side lengths.
Each test case describes a very small “production system” that assembles gold cubes from three types of nuggets. Every nugget type has a fixed weight in milligrams, and we are also given a maximum available count for each type.
We are given several independent road segments, each containing a set of existing painted crosswalk stripes. Every stripe is described by its starting position and its width, so each one occupies a continuous interval on a number line. These stripes may overlap or leave gaps.
We are given several test cases. In each case, María owns disks of different colors, and for each color we know how many identical disks she has. She wants to partition all disks into several vertical towers.
We are given several independent test cases. In each one, we receive an even-length list of integers, and we must decide whether it is possible to partition the numbers into pairs such that every pair has the same sum.
We are given several independent test cases. Each test case provides a finite set of distinct integers, and we need to decide whether this set satisfies a very specific structural property involving differences between elements.
Let $m$ be the total number of medals and let $n$ be the number of days.
We are given a geometric construction that can be reinterpreted as a graph problem. There are two families of segments.
We are given a rectangular grid of $n times m$ cells, and we must assign each cell one of two colors. The coloring must satisfy two global conditions at the same time. First, exactly half of the cells must be black and the other half white.
The page is drawn with a fixed set of horizontal guide lines, equally spaced one centimeter apart, and a set of vertical guide lines placed at arbitrary x-coordinates.
We are given a network of villages connected by roads, where each road is initially unusable and becomes usable only after a certain number of hours. All roads “unlock” in parallel according to their own schedules. Once a road is unlocked, it can be used permanently.
We are simulating a system that holds a single countdown timer whose initial value is random. At time zero, the timer is set to a uniformly chosen integer between 1 and T. Time then advances in discrete seconds. Every second, the timer decreases by one.
Testing small configurations clarifies what structure is forced by infinitely many vanishing power sums.
We are given a complete bipartite setup with two groups of size $n$, which we can think of as left vertices indexed by $i$ and right vertices indexed by $j$. An edge between $i$ and $j$ exists only when the XOR of their values, $ai oplus bj$, is at least $k$.
We are given a non-negative integer and asked to express it as a sum of powers of two, but instead of standard binary digits, each bit position can take the value −1, 0, or 1. The contribution of position i is ai · 2^i, and the total sum must equal the given number.
We are given a sequence of goods, each with three attributes: a weight, an initial volume, and a compression factor. We must arrange all goods in a single stack. Once stacked, each item’s final volume is reduced depending on how much total weight is placed above it.
Two players start with piles of chips. In each round they either have no change in position (a draw) or exactly one of them wins the round. A win is not just a point, it can immediately end the game if the winner already has at least as many chips as the opponent.
We are tracking a single evolving value, the rating of a user. The rating starts at a fixed initial value, 1500, and then changes after each of n upcoming contests.
We are given an undirected, connected graph of rooms and passages. Sneaker starts at room 1 and wants to reach room n using as few passages as possible. The graph is simple in the sense that there are no self-loops and no multiple edges between the same pair of rooms.