brain

tamnd's digital brain — notes, problems, research

41797 notes

CF 125D - Two progressions

We are given a sequence of distinct integers in a fixed order. Every element must be assigned to exactly one of two subsequences. Inside each subsequence, the original order must be preserved. The goal is to make both subsequences arithmetic progressions.

codeforcescompetitive-programmingconstructive-algorithmsgreedy
CF 125E - MST Company

We are given a weighted undirected graph whose capital is vertex 1. We must choose a set of roads that connects all cities. Since the chosen graph must be connected and have minimum total weight, the solution will always be a spanning tree whenever a solution exists.

codeforcescompetitive-programmingbinary-searchgraphs
CF 125B - Simple XML

The input is a valid XML-like text built from tags of the form <a and </a, where the tag name is a single lowercase letter. Tags can be nested and multiple XML fragments can appear one after another. The task is not to validate the XML. Validity is already guaranteed.

codeforcescompetitive-programmingimplementation
Kvant Math Problem 655

Consider small cases by simulating the procedure described.

kvantmathematicsolympiad
CF 125C - Hobbits' Party

We have n hobbits and want to create as many party days as possible. Each day corresponds to a guest list, which is some non-empty subset of the hobbits. The guest lists must satisfy two conditions.

codeforcescompetitive-programmingconstructive-algorithmsgreedy
Kvant Math Problem 654

Consider small examples of six natural numbers and examine the divisibility patterns.

kvantmathematicsolympiad
Kvant Math Problem 650

We are asked about sequences of numbers (natural numbers or integers) such that every element in a certain target set (all naturals, all integers, or subsets thereof) can be represented uniquely as a…

kvantmathematicsolympiad
Kvant Math Problem 646

Consider the problem for small values of $n$ to understand the geometric constraints.

kvantmathematicsolympiad
Kvant Math Problem 644

A convex equiangular $n$-gon has exterior angle $2\pi/n$ at every vertex.

kvantmathematicsolympiad
Kvant Math Problem 642

The coefficients are restricted to the set ${-1,0,1}$, and two neighboring coefficients cannot both be nonzero.

kvantmathematicsolympiad
Kvant Math Problem 640

Let the decimal expansion of $x_k$ be

kvantmathematicsolympiad
Kvant Math Problem 637

Consider an equilateral triangle $ABC$ with side length normalized to $1$ for convenience.

kvantmathematicsolympiad
Kvant Math Problem 636

Consider small examples to understand how the set $A$ might grow.

kvantmathematicsolympiad
Kvant Math Problem 628

Consider a spherical triangle with one side of length $120^\circ$.

kvantmathematicsolympiad
Kvant Math Problem 627

For part 1, suppose every natural number appears exactly once.

kvantmathematicsolympiad
Kvant Math Problem 598

I can proceed, but I need the text of problem M598 first.

kvantmathematicsolympiad
Kvant Math Problem 597

The sequence $x_n=1+\frac12+\dots+\frac1n$ is the $n$-th harmonic number.

kvantmathematicsolympiad
Kvant Math Problem 595

Label the vertices of the regular octagon cyclically by

kvantmathematicsolympiad
Kvant Math Problem 594

Let

kvantmathematicsolympiad
Kvant Math Problem 592

Consider a triangle $ABC$ with circumcircle $\Gamma$.

kvantmathematicsolympiad
Kvant Math Problem 590

Consider first the expression $|\cos x| + |\cos 2x|$.

kvantmathematicsolympiad
Kvant Math Problem 589

Let the given vectors be $v_1,\dots,v_n$.

kvantmathematicsolympiad
Kvant Math Problem 587

The operation replaces two numbers $x,y$ by

kvantmathematicsolympiad
Kvant Math Problem 585

The majority are chemists, and chemists are perfectly reliable.

kvantmathematicsolympiad
Kvant Math Problem 584

Suppose such a family of lines exists.

kvantmathematicsolympiad
Kvant Math Problem 558

Let the black sectors have angular lengths $\alpha_1,\dots,\alpha_k$, where each

kvantmathematicsolympiad
Kvant Math Problem 557

Suppose, contrary to the statement, that none of the given numbers is prime.

kvantmathematicsolympiad
Kvant Math Problem 553

Consider a triangle $ABC$ with sides $BC < AC < AB$.

kvantmathematicsolympiad
Kvant Math Problem 537

Let $O$ be the center of the circumcircle of the isosceles triangle $ABC$, and let $M$ be the midpoint of $PQ$.

kvantmathematicsolympiad
Kvant Math Problem 524

Consider the numbers $1978^m - 1$ and $1000^m - 1$ for small values of $m$.

kvantmathematicsolympiad
Kvant Math Problem 512

Compute the first few values of $f$ for small natural numbers greater than $1$.

kvantmathematicsolympiad
Kvant Math Problem 507

We are asked to consider sequences of $n$ distinct natural numbers $a_1 < a_2 < \dots < a_n < 2n$ with $n \ge 6$, and to find bounds for the minimum of their least common multiples and the maximum of…

kvantmathematicsolympiad
Kvant Math Problem 503

The condition

kvantmathematicsolympiad
Kvant Math Problem 499

Consider what it means for a number to be balanced.

kvantmathematicsolympiad
Kvant Math Problem 497

Consider triangle $ABC$ with arbitrary points $A_1$ on $BC$, $B_1$ on $CA$, and $C_1$ on $AB$.

kvantmathematicsolympiad
Kvant Math Problem 495

Each satellite moves along a circular orbit centered at $O$ with constant angular velocity.

kvantmathematicsolympiad
Kvant Math Problem 492

Consider triangle $ABC$ and points $A_1$, $B_1$, $C_1$ on sides $BC$, $CA$, and $AB$, respectively, with cevians $AA_1$, $BB_1$, and $CC_1$ concurrent at $P$.

kvantmathematicsolympiad
Kvant Math Problem 491

Let three consecutive terms be $a,ar,ar^2$, where all terms are integers.

kvantmathematicsolympiad
Kvant Math Problem 488

The recurrence

kvantmathematicsolympiad
Kvant Math Problem 485

The interval is

kvantmathematicsolympiad
Kvant Math Problem 483

Consider a right triangle with legs $a$ and $b$ and hypotenuse $c$, where $c^2 = a^2 + b^2$.

kvantmathematicsolympiad
Kvant Math Problem 481

Let

kvantmathematicsolympiad
Kvant Math Problem 479

Consider a set of distinct natural numbers ${a_1, a_2, \dots, a_n}$ with the property that for any two elements $a_i$ and $a_j$, the sum $a_i + a_j$ is divisible by their difference $a_i - a_j$.

kvantmathematicsolympiad
Kvant Math Problem 476

For the planar statement, the condition that no lattice points lie on the boundary except the vertices means that every side joins two lattice points with relatively prime coordinate differences.

kvantmathematicsolympiad
Kvant Math Problem 474

We begin by examining the properties of perfect numbers modulo small integers.

kvantmathematicsolympiad
Kvant Math Problem 472

Consider a cube of side length $1$ for simplicity.

kvantmathematicsolympiad
Kvant Math Problem 470

We begin by examining the two sums for small values of $n$ to detect patterns.

kvantmathematicsolympiad
Kvant Math Problem 468

Consider four points $A$, $B$, $C$, $D$ in the plane, and the scalar products $\overrightarrow{MA} \cdot \overrightarrow{MB}$ and $\overrightarrow{MC} \cdot \overrightarrow{MD}$ for a variable point $…

kvantmathematicsolympiad
Kvant Math Problem 466

Consider first a smaller version of the problem.

kvantmathematicsolympiad
Kvant Math Problem 463

Consider small examples to understand the problem concretely.

kvantmathematicsolympiad
Kvant Math Problem 461

Consider a small number of weights, for instance $n=2$ or $n=3$, each with distinct masses $w_1<w_2<w_3$.

kvantmathematicsolympiad
Kvant Math Problem 458

Consider the polynomial $x^{10}+a_9x^9+\dots+a_1x+1$ with all coefficients initially unspecified except for the leading and constant terms, which are $1$.

kvantmathematicsolympiad
Kvant Math Problem 457

Let the vertices of the simple closed polygonal line be $A_1,A_2,\dots,A_n$ in cyclic order, and let $e_i=A_iA_{i+1}$, with indices taken modulo $n$.

kvantmathematicsolympiad
Kvant Math Problem 454

Let the dwarfs act in order $1,2,\dots,7$ around the table.

kvantmathematicsolympiad
Kvant Math Problem 451

Consider first the simplest nontrivial configuration of points, namely three points not lying on a line.

kvantmathematicsolympiad
Kvant Math Problem 449

I cannot write a rigorous solution to Kvant problem M449 without the actual problem statement or the diagram.

kvantmathematicsolympiad
Kvant Math Problem 447

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

kvantmathematicsolympiad
Kvant Math Problem 445

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

kvantmathematicsolympiad
Kvant Math Problem 443

Before I begin writing the complete solution, I need the **full textual statement of Kvant problem M443**.

kvantmathematicsolympiad
Kvant Math Problem 441

Let the vertices of the convex $2n$-gon be $A_1,A_2,\dots,A_{2n}$ in cyclic order.

kvantmathematicsolympiad
Kvant Math Problem 439

For part 1, write

kvantmathematicsolympiad
CF 171A - Mysterious numbers - 1

This problem comes from an April Fools contest where the statement intentionally hides the real task. We are given two non-negative integers. The required operation is: 1. Reverse the decimal representation of the second number. 2. Add the result to the first number. 3.

codeforcescompetitive-programming*specialconstructive-algorithms
CF 171H - A polyline

The input contains two numbers. The first number, a, determines the order of a recursively constructed polyline. The second number, b, is an index along that polyline. The picture in the statement is the key.

codeforcescompetitive-programming*specialimplementation
Kvant Math Problem 436

We are asked to partition all pairwise sums of two sets of ten numbers each into ten groups of ten, each with the same total.

kvantmathematicsolympiad
CF 171G - Mysterious numbers - 2

We are given three small positive integers, a1, a2, and a3, each ranging from 1 to 20. The problem asks us to compute a single integer as output based on these three numbers.

codeforcescompetitive-programming*special
CF 171F - ucyhf

We are asked to find a special number associated with a single integer input d, where d represents a divisor or parameter in a number-theoretic sequence.

codeforcescompetitive-programming*specialbrute-forceimplementationnumber-theory
CF 171E - MYSTERIOUS LANGUAGE

This is one of Codeforces' classic "special" problems. Unlike ordinary algorithmic tasks, there is no meaningful input to process and no data structure or optimization challenge to solve. The contest provides access to a language called Secret through the custom test environment.

codeforcescompetitive-programming*special
Kvant Math Problem 434

Consider the sum

kvantmathematicsolympiad
CF 171D - Broken checker

This is one of the most unusual problems on Codeforces. The input is supposed to contain a single integer between 1 and 5. There are only five official test cases. The output must be a single integer between 1 and 3. The crucial detail is that there is no actual task to solve.

codeforcescompetitive-programming*specialbrute-force
Kvant Math Problem 432

Consider the sum of the digits of perfect squares.

kvantmathematicsolympiad
Kvant Math Problem 430

For the planar statement, the number $2$ strongly suggests a relation between the area of a convex figure and the area of a rectangle determined by two orthogonal widths.

kvantmathematicsolympiad
CF 2218A - The 67th Integer Problem

The problem asks us to pick an integer $y$ for a given integer $x$ so that the minimum of $x$ and $y$ is as large as possible. We are given multiple test cases, each consisting of a single integer $x$ between -67 and 67.

codeforcescompetitive-programmingbrute-forcegamesimplementationmath
CF 168A - Wizards and Demonstration

The city has n real residents. Among them, exactly x are wizards, and all of those wizards will attend a demonstration. Nobody else will attend. The administration measures attendance as a percentage of the real city population, which remains n even if the wizards create clones.

codeforcescompetitive-programmingimplementationmath
Kvant Math Problem 427

Let

kvantmathematicsolympiad
Kvant Math Problem 425

Suppose such an $N$ exists.

kvantmathematicsolympiad
Kvant Math Problem 423

The left-hand side contains the three quantities

kvantmathematicsolympiad
Kvant Math Problem 421

Let the cells of the infinite graph paper be indexed by integer coordinates $(x,y)$, where each cell corresponds to one pair of integers.

kvantmathematicsolympiad
Kvant Math Problem 418

For small values of $n$,

kvantmathematicsolympiad
Kvant Math Problem 416

Interpret the drawn segments as the edges of a graph whose vertices are the given points.

kvantmathematicsolympiad
Kvant Math Problem 413

Consider the equation $f(x+a)-f(x)=0$ for a function $f$ continuous on $[0,1]$ with $f(0)=f(1)=0$.

kvantmathematicsolympiad
Kvant Math Problem 411

Consider a triangle with sides $a$, $b$, $c$, and a point inside it through which three segments pass, each parallel to a side and all of equal length $x$.

kvantmathematicsolympiad
Kvant Math Problem 410

Consider the sphere of radius $1$ centered at the origin in $\mathbb{R}^3$, and let the equatorial plane be the $xy$-plane.

kvantmathematicsolympiad
Kvant Math Problem 407

Consider small examples to understand the structure of the problem.

kvantmathematicsolympiad
Kvant Math Problem 405

The condition concerns preservation of adjacency.

kvantmathematicsolympiad
Kvant Math Problem 403

A convex polyhedron has the property that every vertex has even degree.

kvantmathematicsolympiad
Kvant Math Problem 400

Consider small values of $N$ to understand the structure of universal sequences.

kvantmathematicsolympiad
Kvant Math Problem 398

I cannot write a rigorous solution to Kvant problem M398 from the information provided, because the problem statement itself is missing.

kvantmathematicsolympiad
Kvant Math Problem 396

The side length of the equilateral triangle is much larger than the lower bound $1$ imposed on the sides of the desired triangles.

kvantmathematicsolympiad
Kvant Math Problem 393

Let

kvantmathematicsolympiad
Kvant Math Problem 391

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

kvantmathematicsolympiad
Kvant Math Problem 388

I cannot write a rigorous solution to Kvant problem M388 because the problem statement itself is not provided in the conversation.

kvantmathematicsolympiad
Kvant Math Problem 386

I can proceed with that, but I need the text of Kvant Problem M386 to provide the complete solution.

kvantmathematicsolympiad
Kvant Math Problem 383

Consider small examples to understand the problem.

kvantmathematicsolympiad
Kvant Math Problem 381

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

kvantmathematicsolympiad
Kvant Math Problem 379

I can proceed with this framework, but I need the text of Kvant problem M379 in order to produce a rigorous solution.

kvantmathematicsolympiad
Kvant Math Problem 376

Let the black piece start at cell $1$ and the white piece at cell $N$.

kvantmathematicsolympiad
Kvant Math Problem 372

Consider the triangle $ABC$ and the inequality $|AP| + |BP| + |CP| \ge |AC| + |BC|$ for an arbitrary point $P$ in the plane.

kvantmathematicsolympiad
Kvant Math Problem 369

The circle $\gamma$ is centered at the orthocenter $H$ and lies inside the acute triangle $ABC$.

kvantmathematicsolympiad
Kvant Math Problem 368

Choose coordinates so that the three cylinder axes are parallel to the coordinate axes.

kvantmathematicsolympiad
Kvant Math Problem 365

Consider first a simple case of two numbers summing to $1$.

kvantmathematicsolympiad