brain
tamnd's digital brain — notes, problems, research
43815 notes
We are given the final board state of a two-player card game after all six turns have already been played. The board consists of three independent locations. At each location, each player may have placed up to four cards, and each card contributes a fixed power value.
Each electronic component belongs to a type, and every type comes with a processing time. There are multiple copies of each type.
We are given a rooted tree with N vertices, where vertex 1 is the root. The task is to assign each vertex v a positive integer label xv such that ancestry in the tree is encoded purely through divisibility: a vertex u is an ancestor of v if and only if xu divides xv.
We are given three different dice. Each die has six faces, but the values on those faces are arbitrary integers between 1 and 1000 and can repeat. A game is played by first letting John choose one die, then Hans chooses one of the remaining two dice.
We are simulating a turn based game on a long binary string where each position either contains a berry or is empty. A move consists of choosing an index $i$ and removing all berries in the fixed length segment from $i$ to $i+3$.
We are given a collection of strings, each string representing a number written in a simplified Roman numeral system. Each character is one of the standard Roman symbols I, V, X, L, C, D, M with fixed values 1, 5, 10, 50, 100, 500, 1000.
We are building a binary sequence day by day, where each position is either zero or one. The first few days are fixed as zero. After that, each new day depends on the structure of what has already been generated.
We are given a set of $n$ hidden items, called dolls. Exactly one doll is special and behaves differently: whenever it is compared with any other doll, the result is always a tie.
We are given an array of flower pots. Each pot has two attributes: a number of seeds and a type label. A move consists of choosing a pot that still contains seeds, removing any positive number of seeds from it, and then performing a global operation that depends on the type of…
We are given a starting value and then a sequence of ovens, each associated with a fixed number. When a cookie passes through an oven, that oven forces the current value either upward to at least the oven’s number or downward to at most the oven’s number.
We are given a large rectangle that is composed of four identical smaller rectangles. Each small rectangle has dimensions $L times W$, and they are arranged in a $2 times 2$ grid to form a big rectangle of size $2L times 2W$.
We are given two sorted sets of integers representing positions of vibrations on a huge number line. We are allowed to perform an operation where we pick a pivot position k, and every vibration strictly to the left of k moves one step further left, every vibration strictly to…
We are given a tree with values on nodes. For any choice of a root, every node induces a subtree, and inside that subtree we imagine choosing any subset of nodes. Each chosen node contributes its value via XOR, so each subset produces one XOR result.
We are given an array of positive integers, and every contiguous subarray contributes a value based on two factors: the least common multiple of all elements in that subarray and the product of its endpoint indices.
We are given a list of forbidden “challenge points” in a two-dimensional integer grid. Each challenge is a pair of coordinates $(Pk, Sk)$, where both values lie between 2 and $2N$.
We are given a circular sweater made of $N$ equally spaced positions. A knitting pattern of length $P$ must be placed repeatedly along this circle.
We are given a single string consisting of upper and lowercase Latin letters. Conceptually, an earlier problem would enumerate all distinct substrings of this string and output each substring together with how many times it appears in the original string.
We are tracking a person’s cash balance over time under two competing forces. Every day starts with an amount of money, and the person immediately spends half of whatever they currently have, rounding the amount spent upward.
We are given a compressed “game log” from a Wordle-like system, but the actual guesses are lost. What remains is only the feedback grid: for each guess and each position, we know whether the character was marked gray or yellow.
We are working on an infinite grid where Carl starts at the origin and must physically walk step by step to a sequence of target coordinates, visiting them in the given order. Each move changes the position by exactly one unit in one of the four cardinal directions.
We are given two sequences representing the order of cards in two face-up decks. Each deck contains exactly $N cdot K$ cards, and the values come from the range $1$ to $N$.
We are given a planar drawing formed by straight fence segments. Each segment connects two grid points, and together all segments form a single connected planar graph with no crossings and no redundant edges.
We are given a rectangular field divided conceptually into unit grid positions, with dimensions $a times b$. We have exactly $N$ identical unit square tiles, and we must place all of them inside this grid. The placement is restricted in two structural ways.
We are given two distinct points on the integer grid, a start point and a target point. Between them lies an axis-aligned rectangular obstacle whose exact coordinates are unknown.
The task is to take a single integer $N$, representing a total number of beats in a musical rhythm, and express it as a sum of smaller building blocks. Each building block must have size either 2 or 3, and together they must sum exactly to $N$.
We are given a tree where a defender starts at a fixed node and an attacker repeatedly chooses a node to “bomb” over several rounds.
We are given a transport system that is essentially a single directed chain of stations from 0 to n − 1. Between station i − 1 and i, there is exactly one road segment with a fixed length, and that segment allows only certain transport modes chosen from a subset of K total…
We have a classroom with seats labeled from 1 to n, and initially each seat is meant for the student with the same number. The final student of interest is student n, who is guaranteed to be a newcomer.
The grid is an $N times M$ board where every cell initially contains crystals except one special empty cell at $(X, Y)$. From that single empty starting point, we are allowed to place a device only on currently empty cells.
We are given a line of students. Each student holds one “lucky number” between 1 and m, so the line can be seen as an array S of length n over m categories. We are allowed to assign a ranking to these m lucky numbers by choosing a permutation of 1 through m.
We are given several independent test cases. In each one, there is a sequence representing rain intensity over consecutive days. Starting from zero, Soyo’s “anticipation value” changes every day based on how much the rain intensity changes compared to the previous day.
Each test case gives a single integer $n$. The task is to split this number into two different positive integers $x$ and $y$ such that their sum equals $n$. If such a pair cannot exist, the output must be two negative ones.
We are asked to construct a rooted tree on the vertices labeled from 1 to n, where 1 is fixed as the root. The structure of the tree is heavily constrained: every edge must go from a smaller label to a larger label, so labels strictly increase along any path from the root.
We are given a permutation that represents stones placed in a line. Each day, the process removes the leftmost remaining stone from the ground and places it on top of a growing stack (a tower).
We start with a pile of identical level-1 entities. The system repeatedly allows a move whenever two entities share the same level i, provided i is not the maximum level k.
We are given a sequence of daily stock prices. You are allowed to pick at most one pair of days, buy on an earlier day and sell on a later day, and you earn profit equal to the increase in price divided by the number of days held.
We are given a rooted tree where node 1 is the root, and each edge has an index according to its input order. Every edge starts in an active state, meaning all nodes are initially fully connected. Each operation consists of two actions.
We are given several independent data sources, each representing a platform that might contribute to a mixed dataset. Each platform contributes a known fraction of the total data, and each platform also has its own probability of being “AI contaminated”.
The task describes five universities and asks us to “choose” one of them, then output its English abbreviation as a single uppercase string. There is no input, so the program does not receive any data to guide the choice at runtime.
We are given a sequence of distinct episodes, each assigned an integer enjoyment value. Two players alternate taking episodes from the remaining pool.
We are given a schedule describing when Sagar is busy, and we need to decide whether Jagjeet’s chosen moment falls inside any of those busy periods. Sagar’s busy pattern starts at time a. After that, his availability alternates in a structured way: every cycle is based on b.
We are given a sequence of queries, each describing a numeric interval $[l, r]$. For every query, we are asked to count how many integers inside that interval have a specific property related to their number of divisors.
We are given a string for each test case, and we need to locate a contiguous substring that contains a specific multiset of letters. The required letters correspond to the word “hardwork”, but not in the usual frequency pattern of the word itself.
We are given a complete grid of cards indexed by suit and rank. For every suit from 1 to n and every rank from 1 to m, exactly one card exists, so the deck forms an n by m matrix. Two players split this entire set into two equal halves.
We are building a growing army that changes over time, and after every update we want to know how long the battle can last if we assign equipment optimally. At any moment there are heroes, each with a health value, and artifacts, each with a durability value.
We are building an array of size $n$, initially filled with zeros. We process $q$ operations one by one. Each operation gives us two distinct indices $xi$ and $yi$.
We are given a string of lowercase letters. Its “score” is computed by splitting it into maximal contiguous segments of identical characters, then summing the square of each segment’s length. Long runs contribute disproportionately because squaring rewards concentration.
We are given a long ordered sequence of events in a game. Each event is either earning a single attribute point or encountering a check that depends on one of two stats, Strength or Intelligence.
We are given a set of fixed points on a number line, including the endpoints 0 and 10^9, which represent existing store locations in a city.
We are given many independent queries. Each query specifies a pair of indices $n$ and $k$, and we are asked to compute a value from a triangular table $C$ that is generated in a nonstandard way. The table is built row by row.
We are given a multiset of cards, each card carrying an integer value. Monocarp builds a sequence by picking cards one by one, removing them from the deck as he takes them.
We are given an array of even length, split conceptually into two equal parts: the left half and the right half. We are allowed to perform exactly one swap, but the swap is heavily constrained.
We start with a collection of balls colored red, yellow, and green, with counts a, b, and c. We are allowed to repeatedly pick any single ball and repaint it into one of the other two colors.
We are given two target strings, one that must end up on the first screen and another that must end up on the second screen. Both screens start empty.
We are given a single sheet and we repeatedly split it using full-length straight cuts. Every cut either goes from left to right across the entire current sheet or from top to bottom across the entire current sheet.
We are given a town modeled as a tree with N locations connected by N − 1 roads. Because it is a tree, there is exactly one simple path between any two places. Each mouse is defined by two special nodes A and B, and it only moves along the unique path between them.
We are given a line of rabbit hutches, each containing some number of rabbits. For each query, we are handed a contiguous segment of this line, and Leonardo is only allowed to operate inside that segment. Each “day” he chooses a pair of distinct hutches inside the segment.
We are given a long chain of identical structural segments. Each segment contains five directed paths, labeled A through E. Every path has a gate somewhere in the middle that allows only a limited number of sheep to pass before it permanently closes.
We are given an array of integers representing daily “cookie offers”. Each interval is a contiguous block of days, and for any chosen interval two different payment rules are applied to the same segment.
We are given two parallel rows of positions, both indexed from 0 to n − 1. The first row is already populated with birds, where multiple birds may start from the same position. The second row is initially empty, but each bird has a fixed target position on that second row.
We are given a single integer written on a cookie tray, and we should think of it as a sequence of digits placed side by side.
We start with two disjoint groups of animals, pigs and giraffes. Initially, each pig may “talk” to some giraffes, and this relationship is symmetric, so a pig is connected to a giraffe if and only if that giraffe is connected back to that pig.
We are given a rectangular grid where each cell contains a non-negative number representing larvae. A hamster starts at the top-left cell and must reach the bottom-right cell. At every step it moves to a neighboring cell that shares an edge, and it never revisits any cell.
We are given a large collection of points on the plane. These points come from repeatedly relocating the corners of a rectangle over several days.
We are given a line of eggs represented by a string. Each position contains a single concrete type, so the string is just a sequence of lowercase letters. Alongside this, we are given a pattern written in a restricted regular-expression language.
We are given several cows on a plane. Each cow starts at a fixed coordinate and occupies a circular region with a given radius. Every cow can move in any direction with speed at most one meter per second, and they all move simultaneously.
Each message consists of several symbols drawn as small 9 by 9 pictures. Every picture encodes one English letter using a semaphore system: a central pivot cell and two “arms” that extend from it in two distinct directions among the eight compass directions.
We are given two natural numbers, but they are not written in decimal form. Instead, each number is encoded using Peano arithmetic, where a number is represented as repeated applications of a successor function applied to zero.
We are given two very large positive integers written in decimal, each potentially up to one million digits. Petra can modify these numbers using a very specific operation: she picks one of the two numbers, adds 1 to it, and simultaneously subtracts 1 from the other number, so…
We are given an $n times m$ grid, and each cell contains only partial information about how many of three unknown languages are spoken there. Every cell is marked either with 1 or 2.
We are given a small number of chocolate faucets, each faucet producing chocolate at a fixed temperature, but with a controllable flow rate constrained to an interval.
We are given a fixed schedule of how a company’s workforce changes over time. Each day, a known number of workers are fired and a known number are hired, and the system guarantees that the number of firings never exceeds the number of currently employed workers.
We are interacting with a system that hides an unknown number of infected people inside a population of fixed size. The only tool we have is a probabilistic group test: we choose a subset size k, and the judge randomly selects k distinct people.
We are given a sequence of songs in the order they were written. Each song has a label, which can only be 1, 2, or 3. We want to count how many contiguous subsequences of these songs form a valid “setlist”.
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.