brain

tamnd's digital brain — notes, problems, research

43815 notes

Kvant Math Problem 1164

Let $\sigma(n)$ denote the sum of all positive divisors of $n$.

kvantmathematicsolympiad
Kvant Math Problem 1163

Let the position of the first turtle at time $t$ be $P(t)$ and the position of the second turtle be $Q(t)$.

kvantmathematicsolympiad
Kvant Math Problem 1162

Consider the Diophantine equation

kvantmathematicsolympiad
Kvant Math Problem 1161

Consider first the configuration of ten identical billiard balls arranged snugly in a triangular container.

kvantmathematicsolympiad
Kvant Math Problem 1160

Consider the situation with only two kangaroos first.

kvantmathematicsolympiad
Kvant Math Problem 1158

We are asked to minimize $(x+y)(x+z)$ under the constraint $xyz(x+y+z)=1$, with $x$, $y$, $z$ positive.

kvantmathematicsolympiad
Kvant Math Problem 1157

Let the three triangles be $T_W,T_R,T_G$, and let $M$ be a point lying in the interior of each of them.

kvantmathematicsolympiad
Kvant Math Problem 1156

There are eight teams, each playing once against every other team, so each team plays $7$ games.

kvantmathematicsolympiad
Kvant Math Problem 1155

A complete solution cannot be written from the information provided.

kvantmathematicsolympiad
Kvant Math Problem 1154

I cannot write a solution to Kvant problem M1154 because the actual problem statement is not present in your message.

kvantmathematicsolympiad
Kvant Math Problem 1152

I do not have the statement of Kvant problem M1152, and the prompt says that only the graphical version is currently available.

kvantmathematicsolympiad
Kvant Math Problem 1151

I cannot write a solution to Kvant problem M1151 from the information provided, because the actual problem statement is missing.

kvantmathematicsolympiad
Kvant Math Problem 1150

For $n=3$ the inequality becomes

kvantmathematicsolympiad
Kvant Math Problem 1149

Consider two rays $p$ and $q$ with vertices $P$ and $Q$, respectively.

kvantmathematicsolympiad
Kvant Math Problem 1148

Consider small values of $a$ and $n$ to understand the pattern.

kvantmathematicsolympiad
Kvant Math Problem 1147

The condition says that every closed path contains an even number of red edges.

kvantmathematicsolympiad
Kvant Math Problem 1146

Place the equilateral triangle $ABC$ in the plane with convenient coordinates.

kvantmathematicsolympiad
Kvant Math Problem 1145

Consider a circle with a point $P$ outside it and two tangents $PB$ and $PC$, forming an angle $\angle BPC > 90^\circ$.

kvantmathematicsolympiad
Kvant Math Problem 1144

Let

kvantmathematicsolympiad
CF 235E - Number Challenge

We are asked to evaluate a large sum over all triples of integers chosen independently from three ranges. Concretely, imagine three slots, where the first slot can be filled with any value from 1 to a, the second from 1 to b, and the third from 1 to c.

codeforcescompetitive-programmingcombinatoricsdpimplementationmathnumber-theory
Kvant Math Problem 1143

Consider first small circular arrangements of weights with integer masses and total mass divisible into parts.

kvantmathematicsolympiad
CF 235D - Graph Game

We are asked to compute the expected total cost of a recursive deletion procedure applied to a connected graph with exactly as many edges as nodes.

codeforcescompetitive-programminggraphs
CF 235B - Let's Play Osu!

Each click in the game independently becomes either a successful hit (O) or a miss (X). For a completed sequence, we split it into maximal consecutive blocks of O. If a block has length L, it contributes L² to the score. The total score is the sum of these squared block lengths.

codeforcescompetitive-programmingdpmathprobabilities
Kvant Math Problem 1142

Consider small tables first.

kvantmathematicsolympiad
CF 234B - Reading

We are asked to help Vasya pick the best hours to read a textbook on a train ride. The train trip lasts for n hours, and each hour has a given light level between 0 and 100. Vasya wants to read for exactly k hours.

codeforcescompetitive-programmingsortings
CF 234C - Weather

We are given a sequence of daily temperatures. We may change any temperature to any other value, and each modified position costs one change. The goal is to make the sequence follow a very specific pattern.

codeforcescompetitive-programmingdpimplementation
Kvant Math Problem 1141

Consider a trapezoid $ABCD$ with $AB$ and $CD$ as the bases, $AB \parallel CD$, and a circle inscribed within it.

kvantmathematicsolympiad
CF 234H - Merging Two Decks

We are given two decks of cards, each with a specific order from top to bottom, and each card is either face up or face down. The first deck has n cards, the second deck has m cards.

codeforcescompetitive-programmingconstructive-algorithmsgreedy
CF 234G - Practice

We have n football players, numbered from 1 to n. Each practice consists of splitting all players into two non-empty teams.

codeforcescompetitive-programmingconstructive-algorithmsdivide-and-conquerimplementation
CF 234F - Fence

We are given a fence made of n vertical boards, each with a specified height. Vasya has two paint colors, red and green, each with a limited total area he can paint. Every board must be painted exactly one color, and the total painted area of each color cannot exceed its limit.

codeforcescompetitive-programmingdp
CF 234E - Champions' League

We are asked to simulate a simplified version of the UEFA Champions League group stage draw. There are n teams, with n divisible by four, each assigned a unique rating. The goal is to divide the teams into groups of four, following a structured "basket" draw procedure.

codeforcescompetitive-programmingimplementation
Kvant Math Problem 1140

Each intersection point is a crossing of two branches.

kvantmathematicsolympiad
CF 234D - Cinema

Vasya has a list of movies and a list of favorite actors. Each movie lists some of its cast, but some actor IDs may be missing (represented by 0).

codeforcescompetitive-programmingimplementation
CF 234A - Lefthanders and Righthanders

We are asked to seat an even number of students, each either left-handed or right-handed, at desks that hold exactly two students. Each desk has a left and a right position.

codeforcescompetitive-programmingimplementation
CF 232C - Doe Graphs

We are asked to compute shortest paths in a family of recursively defined graphs called Doe graphs. Each graph is defined by an order n. The base cases are trivial: D(0) is a single vertex and D(1) is two vertices connected by one edge.

codeforcescompetitive-programmingconstructive-algorithmsdivide-and-conquerdpgraphsshortest-paths
Kvant Math Problem 1139

For a convex polyhedron whose faces are all squares, every face angle equals $90^\circ$.

kvantmathematicsolympiad
CF 232A - Cycles

We are asked to construct an undirected graph with exactly k triangles, where a triangle is a set of three vertices all connected pairwise.

codeforcescompetitive-programmingbinary-searchconstructive-algorithmsgraphsgreedy
Kvant Math Problem 1138

The expression $n^2+n+3\sqrt n$ is not always an integer.

kvantmathematicsolympiad
CF 232E - Quick Tortoise

Codeforces 232E: Quick Tortoise

codeforcescompetitive-programmingbitmasksdivide-and-conquerdp
CF 232D - Fence

We have an array of plank heights. A fence piece is simply a contiguous segment. For a query segment $[l,r]$, we must count how many other segments of the same length match it. Matching has three requirements. The two segments must have equal length. They must be disjoint.

codeforcescompetitive-programmingbinary-searchdata-structuresstring-suffix-structures
Kvant Math Problem 1137

Consider first small polygons.

kvantmathematicsolympiad
Kvant Math Problem 1136

Testing small integer values for $A$, $M$, and $S$ helps to gain intuition about the inequality.

kvantmathematicsolympiad
Kvant Math Problem 1135

Let

kvantmathematicsolympiad
CF 232B - Table

Codeforces 232B: Table

codeforcescompetitive-programmingbitmaskscombinatoricsdpmath
Kvant Math Problem 1134

Consider a right triangle $ABC$ with right angle at $A$ and altitude $AD$.

kvantmathematicsolympiad
CF 231A - Team

Three friends evaluate each contest problem independently. For every problem, we are given three values, each either 0 or 1. A value of 1 means that friend is confident they know how to solve the problem. A value of 0 means they are not confident.

codeforcescompetitive-programmingbrute-forcegreedy
Kvant Math Problem 1133

Consider the sum

kvantmathematicsolympiad
CF 231E - Cactus

We are given a connected undirected graph that is guaranteed to be a vertex cactus. In a vertex cactus, every vertex belongs to at most one simple cycle. Cycles may touch the rest of the graph through articulation points, but two different cycles can never share a vertex.

codeforcescompetitive-programmingdata-structuresdfs-and-similardpgraphstrees
CF 231D - Magic Box

We are asked to compute the sum of numbers visible on a box from a given viewpoint in three-dimensional space. The box is axis-aligned, meaning all edges run along the X, Y, and Z axes. Its minimal corner is at the origin, and the opposite corner is at coordinates $(x1, y1, z1)$.

codeforcescompetitive-programmingbrute-forcegeometry
CF 231B - Magic, Wizardry and Wonders

We are asked to reconstruct an initial sequence of integers given the final result of a repeated transformation. Vasya has n cards, each containing an integer between 1 and l.

codeforcescompetitive-programmingconstructive-algorithmsgreedy
CF 228A - Is your horseshoe on the other hoof?

Valera has exactly four horseshoes. Each horseshoe has a color represented by an integer. For the party, he wants all four horseshoes to have different colors. If some of his horseshoes share the same color, he must buy replacement horseshoes of new colors.

codeforcescompetitive-programmingimplementation
CF 228D - Zigzag

We maintain an array of up to $10^5$ numbers. Two kinds of operations arrive online. The first operation changes a single array element. The second operation asks for a weighted sum on a segment.

codeforcescompetitive-programmingdata-structures
CF 228E - The Road to Berland is Paved With Good Intentions

We have a graph with n cities connected by m undirected roads. Each road either has asphalt (1) or does not (0). The king can pick a city and the workers will toggle the asphalt status on every road incident to that city: asphalted roads become non-asphalted and vice versa.

codeforcescompetitive-programming2-satdfs-and-similardsugraphs
CF 228C - Fractal Detector

We are given an $n times m$ grid where each cell is either white (".") or black (""). Vasya claims to have painted a fractal on some sub-squares of this grid.

codeforcescompetitive-programmingdphashing
Kvant Math Problem 1132

Let

kvantmathematicsolympiad
CF 228B - Two Tables

We have two binary matrices. A shift (x, y) means that cell (i, j) of the first matrix is compared with cell (i + x, j + y) of the second matrix. For a fixed shift, the overlap factor is the sum of products of overlapping cells.

codeforcescompetitive-programmingbrute-forceimplementation
Kvant Math Problem 1131

Consider the case $n=1$ first.

kvantmathematicsolympiad
Kvant Math Problem 1130

Consider first a simple convex polygon, such as a triangle or a square.

kvantmathematicsolympiad
CF 225C - Barcode

Codeforces 225C: Barcode

codeforcescompetitive-programmingdpmatrices
Kvant Math Problem 1129

I cannot write a solution to Kvant problem M1129 because the actual problem statement is not present in the conversation.

kvantmathematicsolympiad
CF 225E - Unsolvable

Codeforces 225E: Unsolvable

codeforcescompetitive-programmingmathnumber-theory
CF 225D - Snake

Codeforces 225D: Snake

codeforcescompetitive-programmingbitmasksdfs-and-similargraphsimplementation
Kvant Math Problem 1128

Consider first the case of a $2 \times 2$ chessboard with two pieces.

kvantmathematicsolympiad
CF 225A - Dice Tower

Codeforces 225A: Dice Tower

codeforcescompetitive-programmingconstructive-algorithmsgreedy
CF 223C - Partial Sums

Codeforces 223C: Partial Sums

codeforcescompetitive-programmingcombinatoricsmathnumber-theory
Kvant Math Problem 1127

I notice that the problem statement itself is not yet provided.

kvantmathematicsolympiad
CF 223B - Two Strings

Codeforces 223B: Two Strings

codeforcescompetitive-programmingdata-structuresdpstrings
Kvant Math Problem 1126

The statement resembles a converse of a familiar fact about equal angles subtending the same segment.

kvantmathematicsolympiad
Kvant Math Problem 1125

I cannot write a solution to Kvant problem M1125 from the information provided, because the actual problem statement is missing.

kvantmathematicsolympiad
Kvant Math Problem 1124

Consider a trapezoid $ABCD$ with bases $AB$ and $CD$, where $AB$ is the shorter base.

kvantmathematicsolympiad
Kvant Math Problem 1123

Label the cells by coordinates $(i,j)$, where $i,j\in\mathbb N$ and $i,j\ge 1$.

kvantmathematicsolympiad
Kvant Math Problem 1122

Let

kvantmathematicsolympiad
Kvant Math Problem 1120

Consider the sequence defined by $a_0 = 0$ and $a_n = P(a_{n-1})$ for $n \ge 1$, where $P(x)$ is a polynomial with integer coefficients and $P(x) > 0$ for $x \ge 0$.

kvantmathematicsolympiad
Kvant Math Problem 1119

Consider first small values of $k$.

kvantmathematicsolympiad
Kvant Math Problem 1118

Expanding the left-hand side gives

kvantmathematicsolympiad
Kvant Math Problem 1117

Let the sides of the given triangle $ABC$ be

kvantmathematicsolympiad
Kvant Math Problem 1116

Consider a rectangle drawn on a square grid where the unit squares are the cells.

kvantmathematicsolympiad
Kvant Math Problem 1115

Consider the first problem.

kvantmathematicsolympiad
Kvant Math Problem 1114

Consider a tetrahedron with vertices $A$, $B$, $C$, $D$ and let $a = AB$ and $b = CD$ be two skew edges.

kvantmathematicsolympiad
Kvant Math Problem 1113

Model the situation as a graph on $21$ vertices, the cities.

kvantmathematicsolympiad
Kvant Math Problem 1112

Starting with the numbers $1$ and $2$ on the board, the rule allows us to produce $ab + a + b$ whenever $a$ and $b$ are present.

kvantmathematicsolympiad
Kvant Math Problem 1111

Consider triangle $ABC$ with acute angles and its circumcircle $\Gamma$.

kvantmathematicsolympiad
Kvant Math Problem 1110

Consider the first few natural numbers and compute the greatest common divisors of all distinct pairs.

kvantmathematicsolympiad
Kvant Math Problem 1109

Let the vertices of an inscribed equilateral triangle be

kvantmathematicsolympiad
Kvant Math Problem 1108

Consider small cases first.

kvantmathematicsolympiad
Kvant Math Problem 1107

The inequality is homogeneous in the ratios of the sides.

kvantmathematicsolympiad
Kvant Math Problem 1106

Consider a convex hexagon $ABCDEF$.

kvantmathematicsolympiad
CF 223E - Planar Graph

We are given a connected planar graph drawn on the plane with no bridges, articulation points, loops, or multiple edges. Each vertex has explicit coordinates, and every edge is a straight line between two vertices that intersects no other edge except at its endpoints.

codeforcescompetitive-programmingflowsgeometrygraphs
CF 223D - Spider

We are asked to find the shortest path a spider can take on a simple polygon from one vertex to another. The polygon can be concave, but it is guaranteed to have no self-intersections, and its vertices are given in counter-clockwise order.

codeforcescompetitive-programminggeometrygraphs
Kvant Math Problem 1105

The problem concerns unfolding a convex polyhedron along straight-line cuts so that its surface lies flat as a single polygon, with specified identifications of points on the boundary.

kvantmathematicsolympiad
CF 223A - Bracket Sequence

We are given a string consisting only of four bracket characters: (, ), [ and ]. The string is not necessarily balanced. Among all substrings of this string, we need to find one that forms a correct bracket sequence.

codeforcescompetitive-programmingdata-structuresexpression-parsingimplementation
Kvant Math Problem 1104

Let

kvantmathematicsolympiad
Kvant Math Problem 1103

Begin with the first part of the problem, which concerns tiling an infinite plane with $1\times 2$ dominoes after some non-overlapping dominoes are already placed.

kvantmathematicsolympiad
CF 222A - Shooshuns and Sequence

We are given a sequence of integers on a blackboard and a position k. A shooshun can perform one operation that appends the k-th element of the current sequence to the end and removes the first element.

codeforcescompetitive-programmingbrute-forceimplementation
Kvant Math Problem 1102

For $n=3$ it is natural to search among classical identities involving sums of three cubes.

kvantmathematicsolympiad
Kvant Math Problem 1100

Consider a finite set of logs lying on a straight riverbank, each forming an angle less than $45^\circ$ with the bank.

kvantmathematicsolympiad
Kvant Math Problem 1099

Consider small examples to gain intuition.

kvantmathematicsolympiad
Kvant Math Problem 1098

Consider the game for small values of $n$.

kvantmathematicsolympiad
Kvant Math Problem 1097

Consider small examples of isosceles triangles whose vertices have integer coordinates.

kvantmathematicsolympiad
Kvant Math Problem 1096

Let the circle have radius $R=\dfrac d2$.

kvantmathematicsolympiad