brain
tamnd's digital brain — notes, problems, research
41777 notes
We are given a positive integer n representing a "magic number" from the Julya calendar. The Smart Beaver can reduce n to zero by repeatedly subtracting one of its digits. For instance, if n = 24, the Beaver could subtract 2 or 4, producing 22 or 20 respectively.
We start with a non-negative integer n. In one operation, we look at the decimal representation of the current number, choose any digit that appears in it, and subtract that digit from the number.
We are given a permutation of n beavers, each with a unique ID from 1 to n. A high-tech machine can shave beavers in consecutive ID intervals, but only if the permutation contains all IDs in that interval in increasing order, not necessarily consecutively in positions.
We are given a linear sequence of trees, each with an integer esthetic appeal. The task is to remove some trees so that three conditions hold. First, the sum of the remaining trees' appeals is maximized.
We are given a small rectangular grid representing a cake. Each cell is either an ordinary cake cell (.) or contains a strawberry (S).
Let $S$ be a subset of ${a_1,\dots,a_n}$ and write $s(S)$ for its sum.
We have a graph with n cities and no roads initially. Some pairs of cities are forbidden, meaning we are not allowed to build a road directly between them. We must add the smallest possible number of roads so that two conditions hold.
We are given a rectangular grid representing the forest. Some cells are blocked by trees, one cell contains our starting position S, one cell contains the exit E, and some cells contain digits. A digit cell represents that many other breeders standing there initially.
For small primes the structure is very rigid.
The original graph is very restricted. Every vertex has degree at most two, which means every connected component is either a simple path or a simple cycle. We must build another graph on the same set of vertices.
The configuration imposes five independent parallelism relations between each side of a convex pentagon and a diagonal.
We are asked to design a placement of rocks on an n × n grid such that activating a single rock produces at least x sounds. Each rock has a fixed movement direction - up, down, left, or right - and rocks move until they hit either a wall or another rock.
Write $x=n+t$ with $n=[x]\in\mathbb{Z}$ and $t={x}\in[0,1)$.
We have an n × n grid. Some cells are usable (.), while some cells are forbidden (E). A spell may only be cast on a usable cell. When we cast a spell on cell (r, c), every cell in row r and every cell in column c becomes purified.
We need to construct an increasing sequence of n positive integers such that no later element is divisible by any earlier element. The input contains a single number n. We must output any sequence of length n satisfying two conditions.
Let $ABCD$ be a tetrahedron.
We are given a digit string a and an integer k. The actual plate is not a itself, but the string obtained by concatenating a with itself k times. From this long string, we may delete any subset of positions, except that we are not allowed to delete every digit.
We have n positive segment lengths. Their total sum is d, which is also the destination point on the number line. A route is simply an ordering of these lengths. While following a route, we keep a running prefix sum.
We are given a 2D grid with n rows and m columns. Each cell is either empty, where we can place a tower, or a hole, where no tower can be built.
We are given a binary array, every element is either 0 or 1. We must choose exactly one contiguous segment and flip every value inside it. A flip changes 0 to 1 and 1 to 0. After performing this single operation, we want the resulting array to contain as many ones as possible.
The object is a closed polygonal line drawn on the surface of a unit cube, with the condition that every face of the cube contains at least one entire segment of the polygonal line.
We are asked to simulate a process of turning cells in a cylindrical grid from sea into land, one by one, while ensuring that a sea path connecting the top row to the bottom row always exists.
The transformation replaces each entry in a row by the frequency of that value in the same row.
We are given the exact number of football games that must be played, and we need to find every possible initial number of teams that produces exactly that many games under a specific tournament format.
Let the circle have center $O$ and radius $R$.
Let $A,B,C$ be the angles of $\triangle ABC$.
Let the positions of the three pedestrians at time $t$ be represented by vectors $A(t), B(t), C(t)$ in the plane.
An infinite decimal expansion determines an infinite sequence of digits, hence an infinite word over the alphabet ${0,1,\dots,9}$.
Assume such a configuration exists and consider the finite set of triangles.
Place the square in a coordinate system with algebraic convenience so that perpendicularity can be tested by a dot product condition.
Let $M_0$ and $M_1$ be convex polygons.
Each circle contributes boundary pieces only where it is the lowest among the $N$ radii in some direction, since the intersection of disks can be described as the set of points satisfying $d(x,O_i)\le…
Each edge of the convex polyhedron is oriented, so the 1-skeleton becomes an orientation of a connected planar graph embedded on the sphere.
The outer parallelogram $P_1$ admits an affine normalization to a unit square without changing incidence relations such as “lying on a side” and “being parallel to fixed directions.
An $n$-digit number is a sequence of digits $d_1d_2\ldots d_n$ where $d_1 \in {1,\dots,9}$ and $d_i \in {0,\dots,9}$ for $i \ge 2$.
Let $O = AC \cap BD$ in the trapezoid $ABCD$ with $AB \parallel CD$.
We are given a finite or otherwise fixed collection of forbidden words over the alphabet ${a,b,c}$, each forbidden word having length at least $2$, and all forbidden words having pairwise distinct len…
Let $\gamma_n = \angle C_{n+1} C_n O$.
Let the triangle have vertices $A_1,A_2,A_3$.
Let the total weight be $S$, and suppose the $N$ weights are partitioned into $K$ piles each of sum $T$, so $S = KT$.
Consider small convex polygons whose diagonals are defined as segments joining non-adjacent vertices.
The configuration involves a convex hexagon with side lengths bounded below or above and three “long” diagonals connecting every second vertex.
For small values, direct checking clarifies the constraint.
The game is played on the graph of an $n\times n$ chessboard, where vertices are squares and edges correspond to standard knight moves $(\pm2,\pm1)$ and $(\pm1,\pm2)$.
Consider the circle through three consecutive vertices $A_{i-1},A_i,A_{i+1}$.
Let the centers of the spheres be $O_1$ and $O_2$, with radii $R_1$ and $R_2$.
Let the given points be $O$, $I$, and $I_a$, where $O$ is the circumcenter, $I$ the incenter, and $I_a$ one of the excenters of triangle $ABC$.
The condition says no color appears more than $\frac{n}{2}$ times.
Let the triangle be $ABC$ with circumcenter $O$.
For a triple of points $A,B,C$, the condition that the triangle is obtuse means that one of the three angles exceeds $90^\circ$, equivalently one of the three opposite-side inequalities of the form
Let the parallelogram be mapped by an affine transformation to the unit square, since affine maps preserve parallelism, ratios of areas, and the condition of a point lying on a segment.
Let the four points be $A,B,C,D$ in space, not lying in one plane.
We interpret the situation as a simple undirected graph on $N$ vertices, where each vertex represents a person and each edge represents a mutual acquaintance.
Let $f(x)=ax^{2}+bx+c$ and assume the equation $f(x)=x$ has no real roots.
Let the digits of the infinite sequence be $a_1,a_2,a_3,\dots$, where each $a_i \in {0,1,\dots,9}$.
Let $ABCD$ be a cyclic quadrilateral with diagonals $AC$ and $BD$ intersecting at $P$.
Let $A$ and $B$ be fixed, and let $l$ be a fixed line through $A$ not containing $B$.
The expression is a finite alternating sum of simple fractions with shifts in the denominator.
The wire must be bent into the full frame of a cube of side $10$, which is the 1-skeleton of a cube graph with $8$ vertices and $12$ edges, each of length $10$.
Let $A$ be the vertex of the angle whose bisector contains $P$.
A regular hexagon of side length $1$ provides three natural directions of equal unit segments forming angles of $60^\circ$.
Each row contains $n$ numbers arranged increasingly, so the $k$-th column consists of the $k$-th smallest element in each row.
Let $A_1$ and $A_2$ be the sets of participants of the two trips, and let $B_i \subset A_i$ be the boys in the $i$-th trip.
Let
We are asked to find a sequence of node disarmaments for a circular system of size n where node 0 is special. Node 0 must appear twice: first at the start and last at the end. Every other node must appear exactly once.
Each monster type has one or more split rules. Applying a rule consumes one monster of that type and produces two things: First, some number of diamonds. Second, a multiset of new monsters.
Each value from 1 to n appears exactly once in both permutations. For a value v, let: - posP[v] be its position in the first permutation. - posQ[v] be its position in the second permutation.
We are asked to construct a tournament graph of n vertices with a specific connectivity property. A tournament graph is a directed graph where every pair of distinct vertices has exactly one directed edge between them.
We are asked to color every small cube inside a larger cube of size k × k × k using exactly two colors, black and white, with a specific local neighbor condition. Each small cube must have exactly two neighboring cubes of the same color.
The task describes a dancing room where every performance involves exactly one boy and exactly one girl. The participants start with no prior experience, and during each dance at least one of the two people must be dancing for the first time.
We are given three independent supplies of items, each representing flowers of a fixed color. From these supplies we can form bouquets in two fundamentally different ways.
We are given two sets of cards, one belonging to Jiro and one belonging to Ciel. Jiro’s cards come in two types, Attack and Defense, each with a strength value. Ciel’s cards are simpler: every one of her cards is an Attack card with a given strength.
We are given a tree with up to 100,000 nodes, and we must assign each node a letter from 'A' to 'Z'. These letters represent ranks, where 'A' is the strongest and 'Z' is the weakest.
We are given a line of people from position 1 to position n, and we must split this line into exactly k contiguous groups. Each group corresponds to a gondola ride and contains consecutive people in the queue.
We have a square board of size n by n, where n is always an odd number. Each cell contains an integer, which may be positive or negative.
We are asked to determine whether a robot moving on a 2D plane can reach a target point (a, b). The robot starts at the origin (0, 0) and follows a sequence of moves encoded in a string.
We are given a single integer written in decimal form, and we must decide whether it can be constructed by repeatedly placing one of three fixed building blocks next to each other: 1, 14, and 144.
We are maintaining a growing collection of open intervals on the number line. Each time a new interval is added, it becomes a node in an implicit directed graph.
We are given a binary string that we interpret as an integer, and from it we construct a fixed pairing between two ordered sets of size $2^n$.
We are given a sequence of trees with strictly increasing heights. Each tree can be cut down one unit at a time using a chainsaw. The chainsaw requires recharging after each cut, and the recharge cost depends on which trees have already been fully cut.
We are asked to maintain a dynamic set of intervals and answer reachability queries between them. Each interval is represented by two integers $(x, y)$ where $x < y$. Intervals are added one by one, and each new interval is guaranteed to be strictly longer than all previous ones.
We are given a single string and we repeatedly compress certain patterns inside it. The only pattern that matters is a substring that consists of two identical halves placed back to back, so a segment of the form X + X, where X is any non-empty string.
We are given a permutation of the numbers from 1 to n arranged in a line. Each position represents a “psycho” with a unique strength value, and the line evolves in discrete rounds. In one round, every psycho compares himself with the person immediately to his right.
We are asked to simulate the dispersal of ants on a two-dimensional integer grid. Initially, all n ants are placed at the origin (0, 0).
We are given a set of n vessels, each capable of holding up to v liters of water. Some vessels are connected by tubes that allow water to be transferred in integer amounts.
We have a two-dimensional integer grid representing a forest. Each cell can be empty or contain a tree. The Princess starts at a cell (vx, vy) and her Shadow starts at (sx, sy).
We are given a set of integers from 1 to n. Two players alternate turns, and each move consists of selecting a number that has not been eliminated yet.
We are given two integers, $x$ and $y$, and a target threshold $m$. A pair is considered m-perfect if at least one of the two numbers is greater than or equal to $m$.
The problem asks us to count how many numeric codes match a hint string that can contain fixed digits, wildcards, and letters representing digit equality constraints. Each character in the hint string represents a position in the safe code. A question mark ?
We are given a main string $s$ and several constraints, each constraint consists of a pattern string $p$ and a numeric interval $[l, r]$.
We are asked to count the number of distinct substrings of a string s that satisfy a set of occurrence-based rules.
The task is to analyze a binary image where 0 represents the background and 1 represents a sun or its rays. Each sun consists of a central ellipse (which may be rotated) and several rays extending outward as line segments from the ellipse’s boundary.
The input is a pixel grid made of two values, where one value represents empty background and the other represents ink belonging to drawn objects.
We are maintaining an array that changes over time through point updates and range updates, while also answering range queries.
We are given an array of integers, and we need to process a sequence of operations that modify the array or query it in a special way. There are three types of operations: direct assignment of a value to an element, range sums weighted by Fibonacci numbers, and range increments.
We are given a line of students, each initially holding a distinct labeled ball from 1 to n. The only operation allowed is choosing two different students and swapping the balls they currently hold.
We are given a line of students, each initially holding a distinct labeled ball. The only operation allowed is to pick two students and swap the balls they currently hold.
We are given a queue of n beavers, each numbered from 1 to n. Each beaver either knows who should be immediately in front of them, represented as a[i] (the number of that beaver), or does not know, represented as 0.
We are given a structure of people standing in a queue, but the queue is not fully known. Each person either clearly knows who stands immediately in front of them or does not know that information at all.
We have an array of integers and a sequence of operations. One operation changes a single position to a new value. Another operation adds the same number to every element in the array. The third operation asks for the current value at a specific position.