brain
tamnd's digital brain — notes, problems, research
41650 notes
We are given a fixed array of integers. We are allowed to choose a single integer x and apply it to every element using XOR. After this transformation, each original value ai becomes bi = ai XOR x.
We are given a starting integer and a target integer. From the starting value, we are allowed to repeatedly apply one of two transformations: if the current value is even, we may replace it with three halves of itself, and if the value is greater than one, we may reduce it by…
We are given several arrays, and for each one we need to find the shortest contiguous segment that has a strict majority element.
We are given a sequence of monsters that must be defeated strictly from left to right. Each monster has a required strength threshold, and none can be skipped or reordered. We also have a pool of heroes.
We are given a multiset of white boards, each with a fixed integer length, and a very small set of red boards. From these boards we want to form a “mountain shaped” fence. The fence uses exactly one red board, which must be the unique maximum element in the sequence.
Each voter comes with two independent ways to make them support you. You may directly pay a fixed cost to activate any voter.
We are given several independent scenarios. In each scenario, there are an odd number of employees, and each employee has a salary interval from which their final salary must be chosen.
We are given a set of voters, and each voter can be activated in one of two ways. Either we directly pay a fixed cost to convince them, or we can exploit a dependency: if enough other voters are already convinced, they will join for free.
We are given a final string that appeared on a screen after someone pressed keyboard keys one by one. Each key corresponds to a lowercase Latin letter, and each key is either always healthy or always broken during the entire typing process.
We are given a very long decimal string, but the digits are not free to move arbitrarily. The only allowed move is swapping two neighboring digits, and even that swap is restricted: the two digits must have different parity, meaning one is even and the other is odd.
We are given several binary strings and allowed to repeatedly swap characters between any two positions in any strings.
We are given a collection of digit candles, where each digit from 0 to 9 appears a certain number of times. Each candle can be reused infinitely, so the counts do not deplete when we form numbers.
We are given a target area $n$, and we want to build a rectangle whose sides are integers and whose area is exactly $n$. Every valid rectangle corresponds to choosing two integers $a$ and $b$ such that $a cdot b = n$.
We are simulating a social media feed where posts continuously swap positions based on incoming likes. Initially, posts are arranged in a fixed vertical order from top to bottom, with post 1 at the top and post n at the bottom.
We are given a collection of integer segments on a number line. Each segment covers every integer point between its endpoints. A point becomes problematic if it is covered by more than $k$ segments at the same time.
We are given several independent scenarios. In each scenario there is a list of distinct integers representing student skill levels.
We are given two families of straight lines on the plane. The first family consists of lines of the form $y = x + pi$, and the second family consists of lines of the form $y = -x + qj$. Every $pi$ is distinct within its own group, and every $qj$ is distinct within its own group.
We are given a range of integers from l to r, and we need to count ordered pairs (a, b) inside this range such that adding them behaves exactly like XOR. In other words, the usual addition of a and b produces the same result as their bitwise XOR.
We are given two step sizes, a and b. Starting from zero, we paint every nonnegative integer in increasing order, but whether a number becomes white depends on whether it can be reached from already white numbers by repeatedly adding either a or b. Formally, zero starts as white.
We are given a sequence of rock-paper-scissors moves played by Bob. Alongside this, Alice has a fixed inventory of moves: she must play exactly a specified number of Rocks, Papers, and Scissors across all rounds.
We are given a tree where each node must be assigned one of three colors, and each assignment has a cost depending on the chosen color.
Two vertical cylinders of cross-sectional areas $S_1$ and $S_2$ are filled with water between two weightless, frictionless pistons.
A prismatic wooden block of constant square cross-section of side $a$ and length $L$ floats on the surface of water of density $\rho_w$.
We are given several test cases, each consisting of a list of plank heights. Every plank has width 1 and some integer height.
Two large parallel plates of area $S$ are separated by distance $L$, with $L$ much smaller than the lateral dimensions so edge effects are neglected.
We are given a path of length n, where each position is a tile arranged in a straight line. We assign a color to every tile. The constraint is not local adjacency, but global structure tied to divisors of n.
A rigid hemispherical bell of radius $R$ rests on a horizontal table with its rim in tight contact with the table, preventing fluid flow under the rim until lift-off.
A small block of mass $m$ moves without friction on a rigid surface consisting of two horizontal half-planes connected by a smooth spatial transition.
A body of mass $M$ is attached to an ideal spring of stiffness $k$, whose upper end is fixed.
Two identical thin-walled cylindrical tubes of mass $m$ and radius $R$ move on a horizontal rough plane.
Two identical direct current motors are rigidly connected by their shafts, so they share the same angular velocity $\omega$ and produce torques that add algebraically.
A long cylinder of radius $R$ and uniform material density contains a cylindrical hole parallel to its axis.
Two one-dimensional periodic structures represent the combs.
A parallel-plate capacitor with large identical plates of area $A$ is short-circuited, so both plates are connected by an external conducting wire and always remain at the same electric potential.
A refrigerator maintains its internal air at temperature $T_1 = 5^\circ\text{C}$ while it is placed in a room at temperature $T_2 = 20^\circ\text{C}$.
Two pistons of masses $m_1$ and $m_2$ move inside two rigid tubes of cross-sections $S_1$ and $S_2$.
Two identical steel balls of mass $m$ move on rigid, massless rods that constrain motion to circular trajectories of fixed radii $l$ and $2l$.
Three large open barrels contain water and have free surfaces located at fixed heights $H_1$, $H_2$, $H_3$ above a common reference level, with $H_1 > H_2 > H_3$, measured in meters.
A small mass $m$ is attached to a fixed point on a horizontal table by a spring of stiffness $k$.
A grounded conducting sphere of radius $r$ is fixed in vacuum.
A fixed mass $m = 1,\mathrm{kg}$ of an unknown gas is considered under two thermodynamic processes: heating at constant pressure and heating at constant volume.
Two helical springs are made from identical steel wire segments of equal total wire length $L_w$ and identical wire diameter.
Three identical communicating vessels contain water of density $\rho$ in a uniform gravitational field $g$.
We are counting a very specific family of binary search trees built on the keys from 1 to n. The tree structure must satisfy the usual BST ordering, but that is not the main constraint that drives the solution. The real restriction comes from two additional rules.
We are given a timeline of cars entering a tunnel and a separate timeline of the same cars exiting it. Every car appears exactly once in each list, so both sequences are permutations of the same set of identifiers. Inside the tunnel, overtaking is only detectable indirectly.
We are given several kinds of items, where each kind is unlimited in supply. We also have several distinct boxes, each belonging to a different friend, so boxes are labeled and cannot be swapped. For each kind of item, Alice chooses a subset of boxes to place that kind into.
We are given several independent scenarios. In each one, a shop has a list of item prices. The goal is to replace all of these different prices with a single uniform price so that selling all items at this single price does not reduce the total revenue compared to the original…
We are given an undirected graph with up to 100,000 vertices and up to 300,000 edges. The task is to split all vertices into exactly three non-empty groups so that the structure between every pair of groups is perfectly regular.
We are given a closed interval of integers from l to r, and we need to find any number inside this interval whose decimal representation does not repeat any digit. In other words, when writing the number as a string of digits, every character must be unique.
We are given a length-n sequence of questions, and for each position i there is a correct answer h[i]. We construct another sequence a of length n, where each a[i] is chosen independently from 1 to k.
We are given several closed intervals on a number line. Each interval represents a set of integer or real points between its endpoints, and the endpoints themselves are included.
We are asked to construct two positive integers $a$ and $b$ such that they differ by exactly one unit in the sense that $a + 1 = b$. We are not given the numbers themselves. Instead, we are only given the first digit of $a$ and the first digit of $b$.
We are walking in a grid from the top-left cell to the bottom-right cell, moving only right or down. The grid is not empty in a passive sense: some cells contain rocks, and those rocks behave dynamically. When we step into a rock cell, the rock does not block us.
We are given a schedule of TV shows over a sequence of days. Each day broadcasts exactly one show, and if we buy a subscription to a show, we gain access to all of its episodes for the entire timeline.