brain
tamnd's digital brain — notes, problems, research
41777 notes
We are given a permutation of the numbers from 1 to n, but some elements have been replaced with -1. The permutation has no fixed points, meaning no element is in its original position.
given a permutation of the Problem Understanding We are given a permutation of numbers from 1 to n. the numbers from 1 to n. ImagineImagine running bubble sort on this permutation running ordinary bubble sort on this.
We are asked to count the number of bricks that get painted by both Iahub and Floyd in a specific range. The bricks are numbered with consecutive integers starting from 1.
The input is a string representing a sum where every number is either 1, 2, or 3, and the numbers are separated by plus signs. For example, the string 3+2+1+3 represents four summands. Xenia can only evaluate the expression if the numbers appear in non-decreasing order.
We have a circular city with n houses arranged clockwise along a ringroad. Each house has a unique number from 1 to n, and traffic flows only clockwise. Xenia starts at house 1 and has m tasks to complete in a specific order, each task located at a house number a[i].
We are given a row of n horses, initially numbered from 1 to n from left to right. Xenia performed at most three operations on the row.
We start with an array whose length is exactly $2^n$. The final value is produced by repeatedly combining adjacent elements. The first level uses bitwise OR, the next level uses bitwise XOR, then OR again, then XOR again, alternating until only one number remains.
Xenia has access to some subset of weights from 1 through 10 kilograms. For every weight type marked as available, she may use that weight any number of times. She places weights one at a time onto a balance scale.
We have an n × m grid. Every cell contains one shoe, and every shoe pair number appears exactly twice in the whole grid. A configuration is considered tidy when the two shoes belonging to every pair occupy adjacent cells. Adjacency is by a shared side, not a corner.
We have a dressing room represented as a rectangular grid of size n by m, where each cell contains a single shoe. Every shoe belongs to a pair, and each pair appears exactly twice in the grid.
The figure describes a standard cyclic filling of an $n\times n$ table with the numbers $1,2,\dots,n$ in such a way that each row is a cyclic shift of the previous one.
The 64 marked points are the centers of the squares of an $8\times 8$ grid, hence they can be identified as
Let $f_1(x)=x^2+p_1x+q_1$ and $f_2(x)=x^2+p_2x+q_2$.
Let
The given conditions state that the vectors $(x,y)$ and $(u,v)$ both lie on the unit circle and are orthogonal with respect to the standard dot product since $xu+yv=0$.
Let
We seek an arithmetic progression
Each number $x$ can be written uniquely as $x = \lfloor x \rfloor + t$, where $t \in (0,1)$.
We are given a source string s. We are interested only in substrings that appear inside s, and we count each distinct substring once, regardless of how many times it occurs. A substring is considered good if it satisfies every rule.
Let $ab=cd$.
The problem presents an image encoded as a 2D grid of integers where 0 represents the background and 1 represents a sun, including its rays. Each sun consists of a central ellipse (or circle) and a number of rays protruding from it.
We are given an array of integers of size n, and a sequence of m operations of three possible types. The first type replaces a single element in the array with a new value. The second type queries the sum of a range where each element is weighted by Fibonacci numbers.
Work is carried out in the residue field $\mathbb{F}_p$, where $p$ is odd, so $2$ is invertible.
We have a line of n students, each holding a distinct ball numbered from 1 to n. Students can swap their balls with each other, but each student has a limit on the total number of throws they can participate in.
We are given a pattern string describing a decimal code. Some positions already contain fixed digits. Some positions contain ?, meaning any digit may be placed there. Some positions contain letters from A to J. Each letter represents a digit, but with two constraints.
A number is powerful when every prime divisor appears with exponent at least $2$, so each such number has the form
Let the tetrahedron be $ABCD$, where $ABC$ is the base.
Let $A,B,C$ be a nondegenerate triangle with side lengths $BC=a$, $CA=b$, $AB=c$.
The first expression can be expanded into a difference of two homogeneous cyclic sums:
Introduce position vectors for the vertices $A,B,C,D$ in the plane.
The initial stack is the periodic sequence of length $4n$ with pattern $G,R,B,Y$ repeating every four cards, so every consecutive block of four cards contains all four colors exactly once.
We are given the complete graph on $n$ vertices with each edge oriented in exactly one direction.
Let $M$ be a convex polygon with area $S$.
Consider the first equation, $3^{x+1} + 100 = 7^{x-1}$.
For the first two equations, small natural numbers $x$ and $y$ can be tested directly.
The condition says that every point of the boundary of the square lies within distance $\tfrac12$ of the polygonal line $L$.
Model the airline network as a connected undirected graph.
Let the entries of the table be integers, and neighboring cells differ by at most $1$.
Let
The statement asks for a natural number with a specified property, not for all such numbers.
The equation is
Consider a convex quadrilateral $ABCD$ and construct squares externally on its sides $AB$, $BC$, $CD$, and $DA$, with centers $P$, $Q$, $R$, $T$ respectively.
Consider a square $ABCD$ and a parallelogram $PQRS$ that circumscribes it, with each vertex of the square touching a different side of the parallelogram.
The operation affects the two endpoints of an edge.
Consider an arbitrary acute-angled triangle $\triangle ABC$.
Consider a triangle $ABC$ and a point $M$ which is simultaneously the centroid, incenter, and orthocenter.
Computing the first few terms of the sequence $(x_i)$ modulo small integers may reveal patterns.
The statement concerns only the directions of the vectors, since scaling a nonzero vector does not change its angle with another vector.
Let
Consider small examples first.
Consider first the simplest case, $n=2$, with two circles inside a larger circle $\mathit\Gamma$.
Let
Let the cyclic quadrilateral be $ABCD$, and let its diagonals $AC$ and $BD$ intersect at $P$.
Introduce
Place coordinates on the board by identifying each square with the pair $(i,j)$, where $1\le i,j\le n$.
Let the lines through $O$ be $l_1,\dots,l_{1979}$.
Starting from $0$ and $1$, the first new number that can be obtained is $\frac12$, since the mean of $0$ and $1$ is $\frac12$.
Let
Let $BC=a$, and place the triangle in coordinates
We are given two arrays: one long array a of size up to 150,000, and a shorter array b of length up to 150,000 but used as a multiset that we may permute and temporarily “consume”. A threshold value h is also given.
We are given a point at the origin and another point $(x, y)$ that defines a rectangle aligned with the coordinate axes.
We are given a strictly increasing sequence of positive integers. The task is to choose a subset of these numbers such that the beauty of the subset is maximized.
For a fixed position of the cover, let $C$ be the convex cover and let $H$ be the hole.
The problem presents a geometric pattern generated on a coordinate plane and asks for the number of ways to sequentially paint this pattern with a given number of colors. Instead of thinking about coordinates, we can abstract the problem into combinatorial structures.
The expression
We are asked to count binary strings containing exactly n zeros and m ones that can be reduced to a single bit g after applying a sequence of specific "modifications." A modification takes the last two characters of a string and replaces them with a single new character.
Vasily has painted two rows of circles on the plane, each row containing m circles of the same radius R. The first row lies on the line y = 0 and the second on y = 2R.
We are dealing with a two-column grid of arbitrary height r, where each cell initially represents water. Two cities take turns reclaiming cells to turn them into land, but there is a restriction: reclaiming a cell blocks the three neighboring cells in the opposite column from…
A heptagon has $7$ vertices and $14$ diagonals.
We are given a single string made of lowercase letters. From this string, we are allowed to delete characters while keeping the remaining characters in order, and we are interested only in the resulting subsequences that are palindromes. The task is twofold.
Let $x=a^2,\; y=b^2,\; z=c^2,\; w=d^2$.
We are given a list of pies with positive prices and a store promotion: for each pie you pay full price for, you can take another pie that is strictly cheaper for free. The goal is to determine the minimum total amount you must spend to acquire all pies.
We are asked to relate two counting schemes over a sequence of randomly sized skyscrapers. Imagine a row of skyscrapers with random heights, where the height of each building follows a geometric distribution with probability $2^{-i}$ for height $i$.
We are given a collection of axis-aligned rectangles with integer coordinates, and we are allowed to pick any subset of them.
We are asked to help Piegirl buy sheets of stickers to construct a target string s. Each sheet contains exactly n stickers, and all stickers on a sheet are predetermined by the string we choose for that sheet.
Let the square be partitioned into a regular grid of $n \times n$ congruent squares, each of side length $1/n$.
We are asked to analyze a situation with coins of denominations that are powers of three: 1, 3, 9, 27, and so on. A buyer wants to pay an exact amount n but cannot do so because he lacks the right combination of coins.
We are given an $n times n$ grid with some blocked cells. Gerald is allowed to place chips only on the boundary cells, but corners are forbidden starting positions.
The expression
We are given a set of candidate points in the plane, and we must choose exactly three of them to serve as centers of three identical circles. All three circles must have the same radius, and they are allowed to touch but not overlap in their interiors.
We are given a rectangular grid of numbers with $n$ rows and $m$ columns. Each cell contains a non-negative integer. The "property" of the table is defined as the minimum value among the four corner cells.
A dissection of a convex polygon into regular polygons means that every piece is an equilateral triangle, a square, or a regular polygon of higher order, all glued edge-to-edge without overlap.
We are asked to construct a large collection of 8-digit strings, where each string is a “ticket”. Each ticket is considered valid if it is possible to insert arithmetic operations between its digits and fully parenthesize the resulting expression so that the final value…
We are given a list of numbers placed on a line, where each position represents a law and its value represents how “useful” or “valuable” it is. We must select exactly two contiguous blocks of fixed length k.
The sequence is defined by iteration of an integer polynomial $P$ satisfying $P(x)>x$ for all natural $x$.
We are given a collection of orders. From these, we must select exactly $p$ orders that will be enforced. Each chosen order has two effects: if the chairperson complies with it, it contributes some amount of “damage” measured by $ai$, and if she refuses, it causes…
We are given a string p, which acts as a container, and a target message s that we want to extract. To do this, we must construct a binary key q of length k.
We are asked to analyze a network of missile silos connected by underground passages, each guarded by a certain number of droids. The silos form a highly structured network: for any subset of silos of size k, there is exactly one silo connected directly to all of them.
The game can be thought of as a circle of n players taking turns performing one of two actions, denoted by 'a' for elbow and 'b' for nod. Vasya, at index 0, wants to maximize the number of times he can drink a glass of juice.
We are given a permutation of the numbers from 1 to n, but the permutation is not just data, it defines a fixed ordering of “beavers in a line”. Each number appears exactly once, but the position of each value changes over time due to swaps.
Two intersecting circles partition the plane into exactly three bounded regions: the common lens $R_0$, the two asymmetric caps $R_1$ and $R_2$ lying respectively in the first and second circle but ou…
We are given a linear sequence of trees, each carrying an integer value that represents how aesthetically pleasing that tree is. We are allowed to remove any subset of these trees, keeping the remaining ones in their original order.
The problem gives a directed graph where vertices represent locations and edges represent streets between them. Every street has two pieces of information: where it goes, and a fixed sequence of “visions”, which is just a list of vertices.
We are asked to model Neo's “deja vu” experiences as paths in a directed graph. The graph nodes represent shops, and directed edges represent streets. Each edge carries a sequence of visions, which is a list of shop indices that Neo sees when traveling that edge.
We are asked to simulate the movement of a vehicle, the Beaveractor, inside a square campus. The campus is a grid from (0,0) to (b,b).
A ticket is a length-$k$ word over the alphabet ${0,1,\dots,9}$.
We are asked to simulate the movement of a “Beaveractor” on a square campus of size b×b. The campus contains several arrows that act like teleportation instructions: whenever the Beaveractor reaches an arrow, it immediately changes its direction to match the arrow and…
We are asked to simulate the motion of a "Beaveractor" on a square campus of size $b times b$. The campus contains a set of directional arrows, each either horizontal or vertical, which force the Beaveractor to change its motion direction when it crosses them.
We are asked to reduce a positive integer to zero by repeatedly subtracting one of its digits. On each step, you must choose any digit that is present in the current number and subtract it. The goal is to minimize the number of subtraction operations needed to reach zero.
We begin with small values of $n$ to understand the structure.