brain
tamnd's digital brain — notes, problems, research
41641 notes
Each component is a point on a plane with integer coordinates, and each point is labeled either as untested, positively tested, or negatively tested. We are asked to assume that some subset of these points are “leaking sources”.
We are asked to arrange a set of film critics in an order that determines how they score a movie, where each critic’s final rating is not only based on their own initial opinion but also on the current average score produced by earlier critics. The process works sequentially.
The system is a rooted tree where every node is a dam, and the root represents the war camp. Each dam has a capacity and a current stored amount of water. Water can be added at exactly one chosen node.
We are given several stacks of coins. In one move, two players jointly choose two different stacks and remove exactly one coin from each of those stacks. They keep doing this until no coins remain anywhere.
We are given the boundary of a simple polygon representing a floor plan. The vertices are listed in clockwise order, and the polygon can have a very large number of vertices, up to half a million.
We are given a nondecreasing sequence of integers, where each value is written in decimal form. The gods want the sequence to stay sorted, meaning each element must remain less than or equal to the next.
We are given a collection of allowed operations defined by an array of distinct positive integers. Each operation picks one of these integers, say ai, and transforms a current value x into the largest multiple of ai that is strictly less than or equal to x.
We are given an array of values, and a stochastic process that repeatedly manipulates it until it becomes empty. At each step, a fair coin decides who acts.
We are given an array and asked to answer many queries about a very specific aggregation over subarrays. For any segment $[l, r]$, we conceptually look at every starting index $i$ inside it, and from each $i$ we consider every ending index $j ge i$ up to $r$.
We are asked to construct a permutation of the numbers from 1 to n such that every adjacent pair in the permutation avoids two specific “bad interactions” defined using a parameter m.
We are asked to decide whether it is possible to construct a number with very rigid structure: it must have exactly n digits, it must be a palindrome, none of its digits can be zero, and the sum of all its digits must be exactly m.
We are given a single array and asked to compute a very large nested sum built from all contiguous subarrays. For every starting index i, we look at every ending index j ≥ i, compute the product of the subarray a[i] ...
We are given a small system of interviewers who repeatedly conduct interviews in groups. Each interview consists of exactly z distinct interviewers, and each interviewer can only participate in at most y interviews per day.
The task describes a repeating training schedule that classifies each day into one of three categories based on textual cues: leg-focused training days, arm-focused training days, and rest days.
We are given a partially constructed sequence representing a knitted scarf. Each position is a color, and some prefix of the scarf is already fixed.
We start with a network of $n$ computers connected by exactly $n-1$ cables, so the structure is a tree. Every computer pair has a known communication demand $c{ij}$, and if we route traffic along the unique path in the current tree, the cost contributed by this pair is $c{ij}$…
We need to construct a synthetic dataset that demonstrates a reversal phenomenon across aggregation. There are two teams, and performance is measured over several categories. For each category, we assign how many problems each team attempted and solved.
We are given two simple polygons, both centered at the origin in the sense that the origin lies strictly inside each of them. The first polygon represents a shape we are allowed to scale uniformly around the origin. The second polygon is a fixed container.
We are given two rectangular character grids. The first grid is a small pattern, and the second grid is a much larger canvas where we want to search for occurrences of that pattern as a contiguous 2D block.
We are given a collection of proteins, each represented by a short identifier and a vector of length $l$. You can think of each protein as a point in a low-dimensional integer space, where each coordinate is between 0 and 9.
We are given a sequence of heights laid out in a single row, representing people in a photograph. We are allowed to remove any subset of these people.
We are given a long sequence of paired observations. Each observation represents a month, where one value is advertising spend and the other is resulting sales. From this data, we repeatedly build a simple predictive model of the form of a straight line mapping spend to sales.
We are controlling a simplified flight controller with four adjustable parameters corresponding to four flaps: north, east, south, and west. Each request gives three desired physical effects: pitch, roll, and yaw.
We are given a start point, a sequence of line segments that represent checkpoints, and a finish point. A runner moves freely in the plane, and their path is measured as Euclidean length.
We are given two strings consisting of lowercase English letters, and we want to construct a third string that “covers” both of them in terms of letter multiplicities.
A bank offers a special high-interest deposit that can only be opened if the deposited amount reaches or exceeds a threshold value b. Philip has a rubles available, and his goal is to maximize how much money he can place into this high-interest deposit.
We are given a process that starts from task 1 and moves through a system that dynamically chooses the next task based on what we previously did. Each task has a score value and also a “jump limit” that affects where the next available task can come from if we skip.
We are given a vending machine with several hidden compartments, each containing some number of cans. There are also the same number of buttons, but the labels are lost, so each button is secretly wired to exactly one compartment via a fixed unknown permutation.
We are given a hidden string of length $n$, built from the first $k$ lowercase Latin letters. We are not given the string directly. Instead, we are given two pieces of information that uniquely determine it.
We are given an array of integers that represents terrain heights along a one-dimensional road. Each position has either surplus sand (positive value) or a deficit that must be filled (negative value).
We are given a collection of machines, and each machine can be configured in one of three productive roles or left unused.
We are given a list of integer sourness values representing candies. Alice is allowed to remove exactly $k$ candies from this list, leaving $n-k$ candies behind.
We are given a tree with one value on each node, representing how many candies sit in that container. The magician is allowed to delete edges, which breaks the tree into connected components.
We are given two axis-aligned squares on a 2D grid. Each square is described by the coordinates of its lower-left corner and a side length.
We are given a rectangular grid that behaves like a small city map. Some cells are roads, some are buildings that block movement, and some contain police officers who look in a fixed direction with limited vision.
We are given a queue of people standing in a fixed initial order from 1 to N. Each person has a workload Ri, representing how much processing time they need at a government office. The office works in rounds.
We are given a binary string consisting only of opening and closing parentheses. From this string, we consider subsequences, meaning we may delete characters without changing the order of the remaining ones.
We are given an interval of integers from a to b, and we need to count how many numbers inside this interval have exactly six positive divisors.
We are dealing with a situation where two baskets of apples exist. One basket contains a known amount $X$, the second contains an unknown positive number $Y$, strictly smaller than $X$.
We are given a rooted tree with vertices numbered from 1 to n, where each vertex except the root has a parent given explicitly. The task is to assign one of k colors to every vertex such that no edge connects two vertices of the same color.
The city is an undirected connected graph where each house is a vertex and each road is an unweighted edge. A postal hub must be placed at exactly one vertex.
We are given a linear sequence of service windows, and at each window there is exactly one possible transformation between documents: if you currently hold a specific document, you may choose to perform a procedure that converts it into another document.
We are given multiple independent scenarios. Each scenario provides three positive integers representing the lengths of three bone fragments left after a fracture.
We are given several independent scenarios. In each one, there are many cookies, each cookie belongs to a type and has a deadline time when it disappears.
We are given a string of lowercase letters representing an SMS message. Pedro is required to shorten it by deleting exactly $n - k$ characters while keeping the relative order of the remaining characters unchanged.
We are given multiple independent test cases. Each test case consists of two strings of equal length, and some positions in both strings may contain unknown characters represented by a question mark.
We are given a grid of size $n times m$ filled with two types of cells, black and white. The goal is to turn every cell into white using a specific operation.
We are given a single integer $n$, and we conceptually evaluate a function $f(n, i)$ for every integer $i$ from 1 up to $n$. Each value of $f(n, i)$ is defined by a procedure that scans integers downward from $i$ to 2 and checks divisibility against $n$.
We start with a collection of positive integers that represent edge lengths of an $n$-dimensional hyper-rectangle. Two aggregate values matter: the sum of all edge lengths and the product of all edge lengths.
There are $m$ marbles, each moving on the real line. Each marble first picks one of $n$ fixed starting positions on the negative side of the axis uniformly at random, independently of all others.
We are asked to construct a compact representation of all binary numbers in a given inclusive interval $[L, R]$. Instead of listing these numbers directly, we must build a directed acyclic graph with a single source and a single sink, where every valid path from source to sink…
We are repeatedly choosing axis-aligned rectangles inside an $n times m$ grid whose corners lie on integer coordinates.
We are given a sequence generated by a linear recurrence modulo a fixed integer $M$. The sequence starts from two initial values $a0$ and $a1$, and every next element is formed by combining the previous two using fixed coefficients $A$ and $B$, then reducing the result modulo…
We are given a sequence of cars that arrive in a fixed order. Each car has a maximum possible speed, and we are allowed to assign each car to one of two lanes. The order of cars inside each lane is the same as the original order, so each lane forms a subsequence.
We are given a square matrix and asked to compute a very specific derived matrix. For every cell $(i, j)$, we conceptually remove row $i$ and column $j$ from the original matrix and compute the determinant of the remaining $(n-1) times (n-1)$ matrix.
We are maintaining a dynamic ordering of $n$ distinct items representing artists in a concert lineup. The lineup is stored as a sequence, and we repeatedly apply operations that depend on positions inside the current sequence. Each operation gives an even number $k$.
We are given a grid with $n$ rows and $m$ columns. For each column $j$, we must choose exactly $aj$ cells to paint black. All other cells remain white. The choices inside each column are free, as long as the number of black cells per column is fixed.
We are given a line of positions representing towers, and for each position we are told how many other towers that tower must be able to “see” or communicate with. Two towers can communicate if, between them, there is no tower strictly higher than both endpoints.
We are given a tree where every operation changes the structure in a very specific way. One type of operation inserts a new vertex and connects it to exactly one existing vertex, effectively creating a new leaf.
We are given a set of distinct integers, and we are allowed to repeatedly apply two operations: bitwise AND and bitwise OR between any two elements. Every time we apply one of these operations, the result must also belong to the set.
We are counting how many multisets of non-negative integers satisfy three simultaneous constraints, but the constraints are expressed in a slightly indirect way. Each multiset has size $n$, so it contains exactly $n$ elements when multiplicities are expanded.
We are given a fridge divided into several independent slots. Each slot already contains some number of cold soda bottles, and each slot also has a fixed maximum capacity.
We are given the complete results of a round-robin tournament among $n$ contestants, but the results are encoded incrementally. For every pair of contestants $i < j$, we know whether contestant $j$ defeated contestant $i$.
The tree describes a system where every node carries a nonnegative “flow value”. Leaves represent independent sources of water and may take any positive integer value. Every internal node represents a confluence, and its value is exactly the sum of the values of its children.
We are simulating a selection process on a circular arrangement of children. The children stand in a fixed clockwise order, and we repeatedly remove one child at a time based on a counting rule defined by a given rhyme, which is just a sequence of words.
We are given three rectangular buildings, each with fixed side lengths, and we are allowed to rotate each rectangle by 90 degrees. The goal is to place all three rectangles on a single larger axis-aligned rectangle such that they do not overlap.
We are given a rectangular chocolate bar made of unit squares arranged in an n by m grid. We repeatedly take a single rectangular piece and split it into two smaller rectangles by making one straight cut, either horizontally or vertically.
Each attendee requests a number of pizza slices, and every requested slice has a specified topping. A pizza shop sells pizzas in only one topping per pizza, and each pizza is always cut into exactly 8 equal slices.
We start with a single string made of lowercase letters. Each letter is not static: it expands into another string according to a fixed substitution table of size 26. If a character is x, it is replaced by the string px.
We are given a tree representing a palace, where each room is a node and corridors are edges. Some rooms are special: exactly the leaves of the tree, those with only one corridor, contain doors. Two groups enter the tree from two different leaves.
We are given a string of digits for each test case and asked to count how many of its contiguous substrings represent integers divisible by 11. Each substring is interpreted as a decimal number, but substrings may start with zero, so leading zeros do not affect divisibility.
We are working with a sequence of strings where each term is constructed from the previous one by describing it in terms of consecutive runs of digits.
We are given a sequence of constraints that come from a hidden permutation of the numbers from 1 to n. Instead of the permutation itself, we receive, for each position i, a value ci that counts how many earlier positions contain values smaller than the value placed at position i.
We are asked to count how many valid “roller coasters” can be formed from a fixed number of segments, where each segment moves one unit horizontally and either goes up or down by one unit vertically.
Each test case gives a shop structured as several independent stacks of items. In each stack, items are arranged in a fixed order from top to bottom, and you are only allowed to access the next item in a stack if you have already bought everything above it.
We start with an empty multiset $S$. Each operation either inserts one occurrence of a number $x$ into $S$, or removes one occurrence of $x$ that is guaranteed to exist.
We are given a long string made of lowercase letters. We are allowed to choose a pattern string T of length three.
We are given a directed graph on up to 500 vertices. Every vertex has the same number of outgoing and incoming edges, and the graph is strongly connected.
We are given a rectangular grid with $n$ rows and $m$ columns, and two kinds of tetromino pieces. Each piece occupies exactly four unit cells, and we are allowed to rotate or reflect each piece arbitrarily before placing it on the grid.
The system is a rooted tree that models an electrical setup. The root is a single socket with a fixed power limit, and every other node is either an electrical device or a power strip.
We are given a scoreboard written in the form A-B, where A represents Alex’s score and B represents the opponent’s score. Both values are single digits from 0 to 9. The system applies a “score illusion” operation that simply swaps the two values.
We are given a sequence of numbers and allowed to perform a fixed number of operations. Each operation chooses a single position and decreases that value by exactly one. After doing this up to k times in total, we want to maximize how many indices become “valleys”.
We are given a single array of odd length. The process runs for exactly half of its length rounded down, and each round always removes the first two elements after allowing a single adjacent swap somewhere in the array.
We are given an array that contains each integer from 1 to n exactly twice, but the order is arbitrary. Think of it as a sequence of 2n labeled cards where every label appears exactly two times. Two players then play a game on this sequence.
We are scheduling actions over a short time horizon of at most 18 steps. At each time step, we must choose exactly one of four skills.
We are working on a one-dimensional number line from 1 to n. On this line there are two types of special points: p starting positions for independent agents (called catworms in the statement), and k teleport portals. There is also a single target position g.
We are simulating a library system where books are stored in a stack and readers interact with the system over a sequence of time-stamped events. The books are initially arranged so that book number 1 is at the bottom and book number n is at the top.
We are tracking how a point light source moves in a horizontal plane while two fixed convex “gates” in space restrict which points on the ground can be illuminated.
We are given a list of positive values $si$, each representing the daily demand of a product type. We must partition these $n$ items into exactly $m$ non-empty groups. For each group $j$, we assign a positive real parameter $kj$. Two quantities are defined from this construction.
We are given a line of n volunteers, each position already partially assigned one of three costume types or left unassigned. The fixed assignments are immutable, while the unassigned positions must be filled using costumes of type a, b, or c.
We are given four kinds of puzzle pieces, labeled A, B, C, and D, with limited quantities of each. Each piece has special edge geometry, and pieces can only be placed next to each other if their touching edges are compatible in a complementary way, meaning one side must “fit…
We are given a sequence of positive integers. For each number $ai$, we must choose a divisor $di$. After making all choices, we look at the product $D = prod di$. Among all possible choices, we only care about those where this product is a perfect square.
We are given a single long string consisting only of uppercase letters. We are allowed to rearrange its characters arbitrarily. After rearranging, we look at how many times the pattern “CCPC” appears as a contiguous substring in the resulting string.
We are given a line of water-filled chambers, each with its own initial water level. All adjacent chambers are separated by gates, and initially every gate is closed, so nothing is connected.
We are given a large rectangular grid where each cell is either usable terrain or blocked terrain. A usable cell can be part of a training course, while a blocked cell cannot.
We are given a directed graph where each node represents an intersection and each edge corresponds to a one-way road in one of the four cardinal directions.
We are given a fixed large interval on a number line, together with several smaller intervals. Each small interval contributes coverage to some portion of the large interval.
We are given a sequential process of “reactions” indexed from 1 to n. At each step i, we assign a value p[i], and this value is constrained from above by a global limit pmax.
We are simulating a bus moving through a sequence of traffic lights. Between intersections, the bus spends a fixed amount of travel time, and at each intersection it may need to wait depending on the current state of a periodic traffic signal.
We are given a sequence of rooms indexed from 1 onward, and we process them strictly in order. While moving through the prefix of rooms, we maintain a single integer value called the current answer. Each room contributes in one of two ways.