brain
tamnd's digital brain — notes, problems, research
41239 notes
We start with a finite string of parentheses, and then extend it into a doubly infinite sequence by repeating it periodically in both directions.
We are asked to construct an initial ordering of players in a knockout tournament. There are three types of players, Rock, Paper, and Scissors, with fixed counts.
We are given a grid with $n$ rows and $m$ columns, initially completely white. We then paint $k$ disjoint segments on this grid.
We are given a weighted tree rooted at node 1. Some vertices are initially colored red, including the root, and all other vertices are black.
We are given a binary-like sequence, but instead of bits it consists of two labels: PERFECT and NON-PERFECT. The sequence has fixed length n, and exactly m of its positions must be PERFECT while the remaining n - m are NON-PERFECT.
We are given a bipartite system with workers on one side and machines on the other, both of size $N$. Each worker initially knows how to operate some subset of machines. Every day, all workers arrive in an arbitrary order.
We are asked to construct an initial ordering of players in a knockout tournament. There are three types of players, Rock, Paper, and Scissors, with fixed counts.
We are asked to assemble a committee of exactly K people from a pool of N candidates. Each candidate behaves independently, and each one has a known probability Pi of voting “Yes”. A vote is always either Yes or No, so each candidate is a biased coin flip.
We are given a rectangular grid of size $R times C$. Each cell must be filled with one of two diagonal slash types, either / or .
We are asked to design two tiny concurrent programs that share a single boolean register. The register starts at 0 and can be overwritten by instructions that force it to 0 or 1.
We are given a set of asteroids in 3D space. Each asteroid has an initial position and a constant velocity, so its location at time $t$ is a straight line in space. We start on asteroid 0 at time 0, and we want to reach asteroid 1.
We are given a collection of courses that form a prerequisite forest. Each course has a single outgoing edge to its prerequisite, or no prerequisite at all. This guarantees that the structure is a directed forest of rooted trees, where edges point from a node to its parent.
We are given a sequence of days, and on each day we are allowed to perform exactly one action among three choices: we can request a Coding problem set, request a Jamming problem set, or submit the most recently requested problem set that has not yet been submitted.
We are working with an array of 20-bit integers that changes over time through point updates, range operations, and probabilistic bit flips.
We are asked to construct a permutation of the numbers from 1 to n such that there exists a split point where the sum of the prefix equals the sum of the suffix. Among all such valid permutations, we must output the one that is lexicographically smallest.
We are given a binary string and asked to count how many of its contiguous substrings satisfy a fairly strict structural property. A substring is considered valid if it is a palindrome, and if we remove its last character, the remaining prefix is still a palindrome.
We are given two arrays of the same length, and both players ultimately interact with a shared “board” formed from those arrays. Each position holds a number, and once a number is taken it becomes zero and cannot be used again.
We are given a small “currency system” consisting of three coin types: coins worth 1, coins worth 10, and coins worth 100.
We are given a line of stacks, each stack holding some number of blocks. We are allowed to move blocks only between neighboring stacks, and we may also remove blocks from the two ends of the line by pushing them off the table.
We are given a line of islands. Each island has a fruit type and an initial quantity. On every day, a contiguous segment of islands is exposed to visitors; everything outside that segment is unavailable due to storms.
The crash is not coming from the game logic itself but from a broken test harness / input handling layer combined with unsafe assumptions about input structure. From the traceback: the failure happens during assertion setup, not during the algorithmic computation.
We are given a directed graph where each iguana sits on a node from 1 to N, and every node has exactly one outgoing edge defined by the array p. In one time step, every iguana moves simultaneously from i to p[i].
We are given a collection of eggs, and each egg can be used in one of three ways: it can be fried, it can be scrambled, or it can be ignored completely. Each choice yields a different satisfaction value for that egg, and the values are independent across eggs.
We are given a sequence of enemies, each with some health, and a creature with an initial amount of health points. The goal is to decide whether she can defeat every enemy in order while ensuring her own health never drops to zero or below. There are two attack options.
We are given a collection of iguanas, each identified by an ID from 1 to N. Every iguana has two attributes: a number of scales and a number of colors. The goal is to rank these iguanas from best to worst using a pairwise comparison rule, then output the top three.
We are given a deck of 52 cards. Each card is represented by an integer from 1 to 13, where each value appears exactly four times.
We are given a partially played Go board where each cell is either black, white, or empty. For each query, we are asked to imagine placing a single stone of a given color on an empty cell and decide whether that move would immediately result in at least one connected group of…
We are given a directed functional graph: each iguana i has exactly one outgoing edge to p[i], so from every node there is exactly one deterministic next position.
Each egg comes with two independent ways of extracting value: frying it gives one score, scrambling it gives another, and skipping it gives zero contribution. The constraint is that Ivan cannot freely choose all positive options.
We are given a fixed 52-card deck where each position contains a number from 1 to 13, with each value appearing exactly four times. Among these, the cards with value 1 are the aces and are the only cards that matter for winning.
We are given a sequence of enemies lined up along Iggy’s escape path. Each enemy has some amount of health, and Iggy starts with a fixed amount of health as well.
We are given a collection of iguanas, each described by two numbers: the number of scales and the number of camouflage colors. We must rank these iguanas from best to worst and output the top three IDs. The ordering rule is not a simple comparison of two values.
We are given two identical rectangular sheets, each of size $M times N$. We are allowed to cut each sheet into smaller axis-aligned rectangles using straight cuts parallel to the sides.
We are given a sequence of terrain heights that forms a very rigid shape: it starts high, goes down, comes up, goes down again, and finally rises again.
We are looking at an $N times N$ grid of unit cells, where every cell except the southwest corner contains a vertical cylindrical pillar. The observer stands at the exact center of the southwest cell and looks into the grid.
We are planning a continuous path for a point moving from a fixed starting location on the left side of the plane to a fixed ending location on the right side.
The grid describes a map made of open cells, walls, a single start cell, and a single finish cell. Movement is allowed in four directions through open cells, and walls block movement entirely.
We are given a line of rooms numbered from 1 to N. Guests arrive one by one, and each guest must be assigned exactly two adjacent rooms that are both still empty at the moment of assignment. If several adjacent empty pairs exist, one of them is chosen uniformly at random.
We are given a very small regular-expression language over decimal strings and asked to count how many integers in a given interval match it when interpreted as a pattern over their base-10 representation without leading zeros. The expression is not a full general regex engine.
We are given a rectangular grid representing a cake. Some cells already contain uppercase letters, and each letter appears exactly once in the entire grid. Every other cell is empty.
We are simulating a deterministic turn-based fight between two characters with asymmetric control. One side, the dragon, acts first every turn and can choose among four actions that modify either immediate damage or long-term stats.
We are given a fixed recipe that tells us how many grams of each ingredient are required for one serving of a dish. For each ingredient, we also receive several packages, where each package contains a certain number of grams of that ingredient.
We are working on an $N times N$ grid where each cell can either stay empty or contain a model. Models come in three flavors: plus, cross, and a special combined type that contributes more value.
We are given a row of pancakes, each either happy side up or blank side up. We also have a flipper that always flips exactly K consecutive pancakes. Flipping reverses the state of each pancake in that segment.
We are given a long row of stalls where both ends are permanently occupied, and in between there are N empty stalls. People enter one by one, and each person chooses a stall based on how far it is from the nearest occupied stall on both sides.
We are given several independent queries. Each query provides a positive integer $N$. Imagine we are counting upward from 1 to $N$, and for each number we check whether its decimal digits never decrease when read from left to right.
We are given a straight road from west to east. Several horses are already on this road, each starting at a known position and moving east with a fixed maximum speed. These horses are polite in the sense that they never overtake each other.
We are given several types of items that must be arranged on a circle of N positions. Each item type is represented by a letter, and each letter corresponds to a color or a mixture of colors.
We are given a directed graph with up to 100 cities. Between some pairs of cities there are one-way roads with fixed distances, and each city also owns a horse.
We are given a collection of cylindrical pancakes, each described by a radius and a height. We must choose exactly K of them and stack them vertically. The stacking order is fixed once the chosen set is decided: larger radius pancakes go lower, and smaller radius ones go higher.
We are given a full day of 1440 minutes, and two people who must share responsibility for a baby over the entire day.
We are given a collection of independent components, each of which works correctly with some probability. The system succeeds only if at least a threshold number of these components work.
We are given a set of vertical posts placed on a line, each defined by a position on the x-axis and a height. We are allowed to pick two different posts, say one as the “falling” post and one as the “target” post.
We are given a binary array, but instead of seeing it directly, we only receive partial information in the form of short interval constraints. Each constraint says that within a segment of length at most 10, the number of ones is exactly some value.
We are given an unknown string of length $n le 5000$, built from an alphabet of at most 26 characters. We cannot see the string directly. Instead, we can ask queries on any segment $[l, r]$, and the interactor returns how many distinct characters appear in that substring.
We are given an 8 by 8 chessboard where some cells are marked as possible destinations of a single unknown chess move.
We are given a tree of caves. Each cave contains some number of balls. A character starts at a fixed cave and walks through the tree toward a leaf, but at every junction he chooses the next unvisited edge uniformly at random.
We are given several independent test cases. In each one, there is an array of small integers arranged in a line. Each number represents an ingredient, and any cocktail is formed by choosing a contiguous segment of this array.
We are given a production system that bakes pastries using two types of machines. The first machine is special because it has a built-in fatigue cycle: it bakes one item every fixed amount of time, but after producing a fixed batch size, it must rest for a fixed cooldown…
We are given a short message split into words, and we want to decide whether the special keyword “codecup” could have appeared somewhere in that message after transmission errors. The key detail is the error model.
We are given a sorted list of task completion times measured in minutes from the start of training. Each time corresponds to when a single task was solved. These timestamps can be converted into calendar days by grouping every 1440 minutes into a day bucket.
We are told that all berries were originally packed into identical jars, and every jar contains the same number of berries. Each jar contains only one type of berry.
We are assigning each worker a route that consists of two independent choices: a gate in the middle layer and a workstation in the final layer. Every worker starts at their own position, enters exactly one gate, and then exits through the same gate to reach a workstation.
We are given a storage scenario that is mathematically identical to a threshold-finding experiment. There is an unknown limit $x$ such that stacking up to $x$ identical boxes on a pallet is safe, but stacking $x+1$ boxes causes failure.
We are given a standard 9 by 9 Sudoku grid. Some cells already contain digits from 1 to 9, while empty cells are represented by zeros.
We are given a collection of straight walkways drawn on a plane. Each walkway is a finite line segment, and students are only allowed to move along these segments, never through open grass.
We are given a stream of people who need to be placed into identical single-stall restrooms, where each person occupies a stall for exactly one unit of time. There are s stalls, meaning that at any moment up to s people can be inside simultaneously.
We maintain an evolving ranking of teams labeled $T1$ through $Tn$. Initially, the ranking is fixed in increasing index order, so $T1$ is first and $Tn$ is last. Then we process a sequence of match results, where each result states that one team beats another.
We are given a classical linear encryption model where fixed-size blocks of text are transformed by multiplying them with an unknown square matrix.
We are given a fixed alphabet of 37 characters consisting of uppercase English letters, digits, and the space character.
The system consists of three synchronized streams that interact only through a single active “loading position.” One stream is a line of train cars, each with a fixed required capacity.
We are given a rooted family structure described indirectly through parent-to-children listings, and we must answer queries about how two people are related in genealogical terms.
We are given a very small grid of uppercase letters, at most 10 by 10, and we want to know whether a given word can be traced on this grid by walking from cell to cell. The walk starts from any cell and moves in straight line steps on adjacent cells.
Each person in the input owns exactly one object and wants exactly one object. We can think of each person as a directed edge in a graph: from the object they currently have to the object they want.
The grid represents a city split into walkable streets and blocked buildings. On streets there are two kinds of entities: soldiers and turrets. Buildings are impassable and also block vision and movement.
We are given a grid representing a house where each cell can contain a shooter, a wall, a mirror, or empty space. Some cells contain beam shooters that emit continuous laser beams. Each shooter can be in one of two orientations: it either fires horizontally or vertically.
We are given a list of groups, each group having a fixed number of people. Each group must be served in some order, and serving a group consumes whole chocolate packs of size P.
We are given a set of seat assignments on a roller coaster train with positions numbered from front to back. Each ticket says that a specific customer must occupy a specific seat on exactly one ride, and customers may hold multiple tickets, meaning they must appear multiple…
We are given a rectangular canvas, but the coordinates can be extremely large, so we should think of it as an infinite grid restricted to a huge box. Some cells are already fixed with brightness values.
The input describes a directed graph where vertices are friends and edges are communication links. Each ordered pair tells us that one friend can send a single piece of news to another friend.
We are given a directed graph whose vertices are camps and whose edges are hiking tours. Every tour starts at a camp, ends at another camp, takes a fixed number of hours once started, and is only allowed to start at specific hours of the day, repeating every 24 hours.
We are given a string that represents a “googlement”, which is simply a digit string of length at most 9 with a constraint tied to its length. If the string has length $L$, every digit must lie in the range $0$ to $L$, and at least one digit must be nonzero.
We are given a row of storage bins, each bin belonging either to one of five companies or being empty. Each occupied bin contains a positive number of items, and that number is also the cost of moving that bin’s contents elsewhere.
We are given a single array of length C describing how many balls end up in each column after falling through some hidden grid. Initially, one ball is dropped into every column at the top, so there are exactly C balls.
We are given a grid-based toy where balls fall from the top through a lattice of cells. Each column receives exactly one ball. Inside the grid, each cell is either empty or contains a diagonal ramp that redirects a falling ball either down-left or down-right.
We are given a starting point in 3D space, a target point, and up to about 150 special points called teleporters. Movement is not free: the only way to move is to choose a teleporter and perform a constrained jump. Each teleporter imposes a rule based on Manhattan distance.
We are given a binary grid where each cell is either black or white. From this grid, we can repeatedly generate larger grids by replacing every cell with a 2×2 block of identical color.
We are given a collection of fixed “premade” card stacks. Each stack is an ordered sequence from top to bottom, and each card has two attributes: a value and a suit. In a test case, we do not construct stacks from scratch.
We are given several independent test cases. In each test case there are multiple dice, and every die has exactly six positive integers written on its faces. When we place dice in a row, we pick exactly one face from each chosen die to be the “top” value of that die.
We are given a supply of two types of items, red chainsaws and blue chainsaws, and we want to distribute all of them among some number of jugglers.
Each test case gives a starting value and a collection of arithmetic “cards”. Every card is an operation with a fixed operand, and we are allowed to reorder these cards arbitrarily.
We are given several rectangular cookies. Each cookie contributes its perimeter to a total “crispiness score”, and we are allowed to optionally modify each cookie before baking.
We are given a group of robots, a collection of indistinguishable items called bits, and several cashiers. Each robot must be assigned to exactly one cashier, and each cashier can serve at most one robot.
We are given a grid of size R by C where each cell is either empty or contains a chocolate chip. We must cut this grid using exactly H horizontal cuts and exactly V vertical cuts.
We are given a supply of two types of items, red chainsaws and blue chainsaws, and we want to distribute all of them among some number of jugglers.
We are given a collection of metals where metal 1 is special because each gram of it directly counts as one gram of the final answer. Every other metal has exactly one synthesis rule: if we destroy one gram each of two specific metals, we obtain one gram of another metal.
We are given a survey where some people have already answered, and their answers are summarized as counts per language. The total number of respondents is eventually fixed at N, but only a subset of those responses is known.
We are given a supply of two types of items, red chainsaws and blue chainsaws, and we want to distribute all of them among some number of jugglers.
We are given an $N times N$ grid where each cell contains an integer. The absolute value represents a “color”, while the sign represents the “material”. So every cell encodes a single combined label: a signed integer.
We are given a sequence of books, and each book must be read from start to finish before moving to the next one. Each book has a length in pages and a deadline measured in days.