brain
tamnd's digital brain — notes, problems, research
43815 notes
Working
We are given a string s of length n consisting of lowercase letters, and an integer p representing the number of allowed letters from the start of the alphabet, that is, 'a' through chr(ord('a') + p - 1).
We start with a decimal string s. Then a sequence of replacement rules is applied in order. Each rule has the form d - t, meaning every occurrence of digit d is replaced by the string t.
We are given a permutation of the numbers 1...n. For two distinct values a and b, their average is (a+b)/2. Since the permutation contains every integer exactly once, this average is also present whenever a+b is even.
We have a three-stage production pipeline. Every laundry item must first be washed, then immediately transferred to a dryer when washing finishes, then immediately transferred to a folding machine when drying finishes.
We are given a number X and an integer k, and we want to construct a sequence by repeatedly expanding each number into its divisors in increasing order. Formally, we define X0 as a sequence containing just X.
We are given two distinct lowercase words, s and t, and we are asked to determine how s can be transformed into t using specific operations inspired by suffix data structures.
We are asked to compute the minimum number of brush strokes needed to paint a fence of vertical planks. Each plank has a width of 1 meter and an individual height. The brush is exactly 1 meter wide, and it can be applied either vertically or horizontally.
We are tasked with simulating insertions into a hash table with a fixed number of buckets. Each bucket can hold at most one element. The hash function is simple: for a number $x$, the target bucket is $x mod p$. We receive a sequence of numbers and must insert them in order.
Each vertex is incident to exactly two red edges, so the red edges form a $2$-regular subgraph of the edge graph of the polyhedron.
We are given an array of up to $10^5$ integers. We may choose any contiguous subarray and are allowed to modify at most one element inside that subarray, replacing it with any integer we want.
We have an n × m matrix of integers. We must perform exactly k operations. An operation chooses either an entire row or an entire column. The current sum of that row or column is added to our answer, then every element inside it is decreased by p.
The chemicals and reactions form an undirected graph. Each vertex represents a chemical, and an edge between two vertices means those two chemicals react. We start with danger equal to 1. Chemicals are poured one at a time in any order.
We study functions of the form $f_{a,b}(n)=\lfloor an+b\rfloor$ with $a>0$ acting on $\mathbb{N}$.
We are given a tree with n nodes, where each edge has a positive weight. For any two nodes x and y, the function g(x, y) is defined as the maximum weight along the unique path connecting them.
We have a ribbon consisting of positions 1...n. Initially, position i has color i, so every position starts with a distinct color. Two kinds of operations are performed. A paint operation assigns a new color x to every position in a segment [l, r].
The task asks us to compute a sequence c based on two sequences a and b of length n. Sequence a is a permutation of the integers from 1 to n, and b is a binary sequence with exactly d ones, both shuffled in a pseudo-random but reproducible way.
We are given a string of lowercase English letters that Kolya initially owns, and he can append up to k additional characters to the end. The task is to determine the maximum possible length of a tandem repeat in the resulting string.
The tree starts with a single root vertex. Each operation adds one new leaf to an existing vertex. After every addition we must compute the smallest possible value of the following quantity. We color the edges of the tree.
We are asked to simulate a game on an array of positive integers where, at each move, we remove a single element and earn points equal to the minimum of its adjacent elements. After removal, the array closes up and the game continues until all elements are gone.
I can't reliably produce a complete editorial for this problem from first principles without reconstructing the original 3100-rated geometry solution in detail.
The configuration is a complete quadrilateral formed by the four lines $AB, BC, CD, DA$.
We are given a toy made up of n parts connected by m ropes. Each rope connects two distinct parts, and no pair of parts has more than one rope between them. Each part i has an associated energy cost v[i]. The child removes parts one at a time.
The input is not given in the usual structured format with counts. Instead, it is a small text file that alternates between country names and lists of superstitions. A line that does not start with is a country name.
We are given a small list of contest dates. For each date, we must determine whether that calendar day is both the 13th day of its month and a Friday. The answer is simply the number of contest dates satisfying both conditions.
Let $n=\prod p_i^{\alpha_i}$ with all $p_i<100$.
Let $S$ be the set of amounts obtainable with at most $1000$ coins of denominations $a$ and $b$.
Let the value of a completed coloring be the number of edges of the 100-cycle whose endpoints have different colors.
The problem asks whether a circle can be dissected into finitely many pieces whose boundaries consist of line segments and circular arcs, and then reassembled into a square of the same area.
Let the convex polygon be $A_1A_2\ldots A_n$, indexed cyclically.
Each question consists of choosing a line and learning in which of the three sets determined by that line the point $P$ lies: one open half-plane, the other open half-plane, or the line itself.
Let $B$ be the set of black numbers and $W$ the set of white numbers.
Each vector lies in the first quadrant and has length $1$.
Let
Each allowed integer has the form
Suppose the partition consists of finitely many arithmetic progressions
A number is marked if it can be written as a sum of exactly five powers of two, repetitions allowed.
Let
The statement involves a median and an angle bisector meeting at a point.
Let the square have side length $1$.
The condition says that every triangle whose three sides belong to the colored segments contains both colors.
Take a small example, say $p=2$, $q=3$.
Let the given integers be $a_1,\dots,a_{p-1}$, none divisible by $p$.
Let the odd number be
Take a small example, say $a=3$, $b=7$.
Each committee has $80$ members, and there are $16000$ committees.
The equalities
Let
We need a set $A$ of positive integers such that every infinite set $S$ of primes contains, among the squarefree numbers formed from distinct primes of $S$, two numbers with the same number $k\ge2$ of…
Let the acute triangle be $ABC$.
Let
The hypothesis is that a map $F:\mathbb{R}^2\to\mathbb{R}^2$ preserves unit distance, meaning every pair of points at distance $1$ is mapped to a pair of points at distance $1$.
The expression
We seek an infinite set $S \subset \mathbb{N}$ such that no element of $S$ and no finite sum of distinct elements of $S$ is a perfect power $a^k$ with $k \ge 2$.
Each ship occupies an entire row or an entire column of an $n\times n$ board, and different ships are disjoint, so all ships are either rows or columns exclusively.
Let the sofa, suitcase, valise, picture, basket, cardboard box, and dog have weights $S, U, V, P, B, C, D$ respectively.
The first question asks for a three-digit integer $x$ such that $x^3$ ends in $777$, equivalently
Let the fixed isosceles right triangle be placed as a unit right isosceles triangle with vertices $A(0,0)$, $B(1,0)$, $C(0,1)$.
The three semicircles with diameters $AB$, $BC$, $AC$ lie on the same line $AB$, with centers at the midpoints of $AB$, $BC$, and $AC$.
The transformation replaces each term by the average of the other two.
Let the apex of the regular square pyramid be $S$, and let the base square be $ABCD$ with center $O$.
Let $A=(a_{ij})$ be an $m\times n$ matrix.
Label the vertices of a regular $n$-gon by $0,1,\dots,n-1$ in cyclic order.
The requirement that every training session consists of 4 disjoint crews of 4 cosmonauts means that each session partitions the 16 cosmonauts into 4-element subsets.
Let $A={a_1<a_2<a_3<\cdots}$.
Let $ABC$ be the triangle $T_1$ inscribed in a circle with center $O$.
The problem asks for the maximum number of mutually non-attacking kings on an $n\times n$ toroidal board.
For a set of points on a segment, the condition “there exist two points at distance $m$” is equivalent to requiring that the difference set of all chosen coordinates contains every integer $1,2,\dots,…
Let the flies be at positions $P(t),Q(t),R(t)$ on the sides of triangle $ABC$.
A straight line intersects a convex quadrilateral in two points.
Let the hexagon be $ABCDEF$ in convex order with $AB=BC=CD=DE=EF=FA=1$.
We are asked to prove that in any partition of the integers from $1$ to $1985$ into six classes, one class must contain either a triple $a,b,c$ with $a+b=c$ or a pair $a,2a$.
Place the cube of side $2$ in coordinates with center at the origin, so its vertices are $(\pm1,\pm1,\pm1)$ and its inscribed sphere is $x^2+y^2+z^2=1$.
We encode each entry $x_{i,j}\in{\pm1}$ by $a_{i,j}\in\mathbb{F}_2$ via $x_{i,j}=(-1)^{a_{i,j}}$.
The game is played on the edge set of the $n\times n$ square grid graph.
Consider a function $a_{i,j}$ on the integer lattice.
We interpret the problem as asking whether, for every fixed block of $n$ decimal digits $A=a_1a_2\ldots a_n$, there exists an integer $x$ such that the last $n+1$ digits of $x^2$ have the form $A b$,…
Let $a+b=30030$ with $a,b\in \mathbb{N}$.
The configuration consists of two similar triangles $ABC$ and $A_1B_1C_1$, with $A_1 \in BC$, $B_1 \in CA$, $C_1 \in AB$.
We seek to represent an arbitrary positive real number as a sum of nine numbers whose decimal expansions use only digits $0$ and $7$.
Let $P(n,k)=n(n+1)\cdots(n+k-1)$ for $n\ge 2$.
The statement concerns a piggy bank containing coins whose total value is $4$ rubles.
Let $B=60^\circ$ and let $O$ be the incenter of triangle $ABC$.
The kangaroo moves in the integer lattice of the first quadrant with vectors $v_1=(1,-1)$ and $v_2=(-5,7)$, always staying in $x\ge 0$, $y\ge 0$.
For each $k$, the quantity $b_k$ is the average of all products of $k$ distinct elements from $a_1,\ldots,a_n$.
ABMD is a parallelogram, so the vertices satisfy the affine relation $a+m=b+d$, hence $m=a+d-b$.
Let $O_1$ and $O_2$ be the centers of circles $\gamma_1$ and $\gamma_2$, with radii $R_1$ and $R_2$.
Let $P(x)=x^4+ax^3+bx+c$ have four distinct real roots $r_1<r_2<r_3<r_4$.
The configuration is a fixed circular segment determined by a chord $AB$ of a circle with center $O$.
The problem is naturally translated into graph theory.
Start with small $n$.
Let $s(m)$ denote the sum of decimal digits of $m$.
The concurrency of $AA'$, $BB'$, $CC'$ at $P$ together with products $|AP|\cdot|A'P|=t$ suggests a fixed-power relation, which is characteristic of inversion centered at $P$.
Let triangle $ABC$ have sides $a=BC$, $b=CA$, $c=AB$.
We have a collection of cards, each defined by a color and a number between 1 and 5. Borya holds n cards, and while he knows which cards he has, he cannot distinguish between identical cards in terms of position.
Valera has a garden with a number of fruit trees, each producing a specific number of fruits on a particular day. Each fruit becomes collectible on its ripening day and remains fresh only for the next day.
Valera starts with a number $x$ and performs $k$ random operations on it. On each step, he flips a biased coin: with probability $p/100$, he doubles the current number, otherwise he increments it by one.
We are given an $n times m$ grid where every cell must be partitioned into exactly $k$ simple paths. Each path, called a tube, must contain at least two cells and must move only through edge-adjacent cells, never revisiting a cell.
We are given a country with n towns connected by n - 1 roads. Because the number of roads is exactly one less than the number of towns and any town can reach the capital, the road network forms a tree.
We are asked to represent a given positive integer $n$ as a sum of numbers, where each number consists entirely of the digit 1 repeated one or more times.