brain
tamnd's digital brain — notes, problems, research
43815 notes
We are simulating a hash table that supports inserting and deleting items, but insertion is not direct. Each item has a preferred starting position given by its hash value, and if that slot is occupied, the table probes forward in fixed jumps of size m modulo h until it finds…
We are simulating a hash table where each object is assigned a preferred position given by its hash value, but collisions are resolved using a fixed step size. When an object is inserted, we first try its hash position.
We are given an undirected connected graph where cities are nodes and roads are edges. For each merchant, we are also given a pair of cities: a warehouse city and a shop city. The merchant needs to ship goods from the warehouse to the shop using any path in the graph.
The length of daylight at latitude $\varphi$ depends on the declination $\delta$ of the star.
We are given a connected undirected graph of cities linked by roads. Each merchant chooses two cities, one as a source (warehouse) and one as a destination (shop).
We are given an undirected connected graph representing cities and roads. Each road can be removed, and this may or may not break connectivity between two specific cities. Alongside the graph, we are given multiple merchants.
We are given a sequence of non-negative integers representing some kind of “counters” along a line, indexed from 1 to n. The task is to reduce the first k elements of the sequence to zero, for every possible prefix length k (from 1 to n-1).
Consider the first system of inequalities: $1 < x < 2$, $2 < x^2 < 3$, $3 < x^3 < 4$, and so on up to $n < x^n < n+1$.
Consider triangle $ABC$ and a line parallel to $AC$ intersecting $AB$ at $D$ and $BC$ at $E$ such that $|AD| = |BE|$.
We are asked to study sequences of positive numbers $x_0, x_1, x_2, \dots$ with $x_0 = 1$ and $x_0 \ge x_1 \ge x_2 \ge \dots$.
Let the triangle be isosceles with $A_2A_3=a_1$ as the base and $A_1A_2=A_1A_3$.
The given equation is cubic in two variables, $x$ and $y$:
Consider a regular hexagon $ABCDEF$ with vertices labeled consecutively.
Consider small values of $n$ to detect patterns.
Condition (2) resembles a midpoint convexity-type inequality, but in the reversed direction: usually convexity gives $f\left(\frac{x+y}{2}\right)\le \frac{f(x)+f(y)}{2}$, whereas here we have $f\left(…
Let the side lengths be
We are asked to train 8 workers on 5 machines so that any 3 absences still allow operation of all machines.
Let $O$ be the common point which is simultaneously the circumcenter of $\triangle ABC$ and the incenter of $\triangle ABK$.
Let $I=L$ be the incenter.
Consider small values of $n$ first.
For the first statement, choose coordinates so that the bisecting line $l$ is the vertical line $x=0$.
The task is purely existential.
The two inequalities are
The statement is affine in nature.
Let the outer convex quadrilateral be $ABCD$, and let the inner quadrilateral have vertices $P,Q,R,T$.
Let an arithmetic progression of reciprocals be
Consider a tetrahedron with vertices $A$, $B$, $C$, and $D$, and a point $M$ inside it.
The problem gives three numbers $a$, $b$, $c$ in the interval $(0, \frac{\pi}{2})$ satisfying
Begin by examining small examples.
The first statement is a classical rectangle theorem.
Consider first the planar problem with parabolas.
For the first part, write the numbers as $x_1,\dots,x_n$, let $M=\max x_i$ and $m=\min x_i$.
For the first problem, let
Part (1) is the classical two-color complete graph statement.
Let the points be represented by vectors $x_1,\dots,x_n$ from the center of the circle or sphere.
Consider a right circular cylindrical pot with radius $R$ and height $H$.
Consider a polygon in the plane, labeled $A_1 A_2 \dots A_n$.
Let the houses have populations $h_1,h_2,\ldots,h_n$, arranged in nonincreasing order.
Consider first the case of covering a circle of diameter $1$ with strips of paper.
We begin by examining small powers of $31$ modulo powers of $2$ to understand the first part of the problem.
I cannot write a rigorous solution to Kvant problem M732 because the problem statement itself is not present in your message.
The sequence $(a_n)$ is defined recursively by $a_1=0$ and $a_{2n}=a_{2n+1}=n-a_n$.
Consider a parallelepiped with vertex $P$ at the origin, edges along vectors $\vec{a}$, $\vec{b}$, $\vec{c}$ leading to adjacent vertices $A = P + \vec{a}$, $B = P + \vec{b}$, $C = P + \vec{c}$.
Since the perimeter is $2$, we have
The sequence $r_n$ sums the $n$-th powers of the cosines of the angles $\pi/7$, $3\pi/7$, and $5\pi/7$.
Consider two turtles moving at the same speed but in different directions.
Consider the simplest nontrivial cases first.
The function $f$ is defined recursively on nonnegative integers.
Consider small values of $n$ to understand the property.
Consider small values of $n$ and $r$ to detect a pattern.
Let
Consider small values of $N$ to build intuition.
Let the finite set be $M$.
Consider a convex quadrilateral $ABCD$ inscribed in a circle with diagonals $AC$ and $BD$ perpendicular at some point $P$.
The rhombus tiles are the unit lozenges of the triangular lattice.
Let the clubs be represented by sets of students.
Consider two circles with centers $O_1$ and $O_2$ and radii $R_1$ and $R_2$.
The first equation links three expressions of the form $t + \frac{1}{t}$ multiplied by constants 3, 4, and 5.
Let the sides of the acute triangle $LMN$ be
Consider the set of all terminating decimal fractions.
Let the cyclic quadrilateral be $ABCD$, with side lengths
Consider the problem for small $k \times k$ squares.
Let the table have $m$ rows and $n$ columns.
Consider small-scale analogues of the village communication problem.
Consider triangle $ABC$ with arbitrary side lengths $AB=c$, $BC=a$, $CA=b$.
For a convex polygon, the quantity $\dfrac{2S}{P}$ has a geometric meaning.
Let
Let
Let the partition be
Represent each circle by a vertex, and join two vertices when the corresponding circles touch.
Let
The game is equivalent to building a connected graph on $n$ vertices by adding edges one at a time.
We are given a very large Fibonacci-like string, but we are never asked to construct it directly. Instead, we are asked to count how many times each query string appears as a substring inside that Fibonacci string.
We are given a very large string that is not explicitly constructed in the input. Instead, it is defined recursively in the same way as Fibonacci words: the first string is "a", the second is "b", and every later string is obtained by concatenating the previous string with the…
Consider small examples first.
We are given a bipartite graph between men and women. Each allowed edge represents a possible marriage and carries a positive weight that measures how much the audience enjoys that couple.
We are given a bipartite set of characters: $n$ men and $n$ women. Between them there are $k$ possible marriage pairs, and each pair has a positive value representing audience delight if that couple ends up together.
We are choosing a positive integer value $x$, which represents how many “presents per suitcase” the Smart Beaver packs. The total number of suitcases is fixed: for each planet $i$, he carries exactly $ai$ suitcases, so the total number of suitcases is the sum of all $ai$.
The voyage is defined by a fixed sequence of planets. At each planet, the Beaver carries a fixed number of suitcases, and each suitcase contains the same number of presents, denoted by a single unknown value $x$.
We are given a sequence of integers representing a message and another shorter sequence representing a key. Both sequences are over a fixed modular range from 0 to c minus 1, and every addition wraps around modulo c. Encryption is defined as a repeated sliding process.
We begin by computing small powers of $1981$ and observing the sums of their digits.
We are given a sequence of integers that represents a message, and another shorter sequence that acts as a repeating “window update pattern”. The encryption process repeatedly slides this pattern across the message from left to right.
We are given a set of people where some pairs are connected by friendship relations and some pairs are in conflict because they dislike each other.
We are given a set of people, where some pairs are friends and some pairs dislike each other. Friendship forms an undirected graph, and dislike forms another set of forbidden edges. The task is to choose a subset of people such that two constraints hold simultaneously.
We start with n pebbles. At any move, if we currently have x pebbles, we must arrange them into a equal rows of length b, where a 1 and x = a · b. After creating the rows, we keep exactly one row and discard all others. The number of pebbles becomes b.
The game starts with n pebbles. At every move, we must split the current number of pebbles into a equal rows of size b, where a 1 and a b = current. After creating the rows, we keep exactly one row and throw away all others. That means the next number in the sequence becomes b.
Consider an acute triangle $ABC$ with arbitrary points $A_1$ on $BC$, $B_1$ on $AC$, and $C_1$ on $AB$.
We have two chips on an $n times m$ grid. On each turn, the first player moves exactly one non-glued chip by one square in the four-neighbor grid. After that, the second player permanently glues one currently empty square. A chip is allowed to move onto a glued square.
Each operation chooses a non-empty prefix and a non-empty suffix of the current word and swaps their order. If the current word is written as xy, where both x and y are non-empty, the operation transforms it into yx. A useful way to view this operation is as a cyclic rotation.
Label the pucks $A$, $B$, and $C$, and denote their initial positions by the points $A_0$, $B_0$, and $C_0$ of a triangle in the plane.
We are given a weighted tree. Villages correspond to vertices and roads correspond to weighted edges. At any moment, only some villages are "alive". Villages can be added and removed over time.
Codeforces 176D: Hyper String
Let the cyclic quadrilateral be $ABCD$ with diagonals $AC$ and $BD$.
We have several planets. On each planet, every item type has three values: - The price to buy one unit on that planet. - The price at which that planet buys one unit from us. - The number of units available for purchase.
Codeforces 175B: Plane of Tanks: Pro
We are given a string of digits that was formed by writing the scores from three game rounds one after another, without any separators. Originally there were exactly three non-negative integers.
I can’t provide the complete editorial and verified Python solution for this problem from the information available to me alone. This is a very old Codeforces 3000-rated problem, and the accepted solution is quite intricate.
Consider a cyclic quadrilateral $ABCD$ with circumcircle $\Gamma$.
Codeforces 175E: Power Defence
Two tanks start fighting at time 0. Both fire immediately, then continue firing every dt seconds. Each shot may fail to penetrate armor, and if it penetrates, the damage is chosen uniformly from an integer interval.