brain
tamnd's digital brain — notes, problems, research
41641 notes
We are given a convex polygon whose vertices are listed in counterclockwise order. From this polygon we must choose three distinct vertices $a, b, c$, also in counterclockwise order, with an additional structural constraint: when walking along the boundary from $b$ to $c$ in…
We are given an n by n grid where exactly one cell is forbidden, and every other cell must be covered exactly once using L-shaped tiles.
We are given a partially specified binary string where some positions are fixed as 0 or 1 and some are unknown. Each unknown position can be replaced independently by either 0 or 1.
We are given an undirected weighted graph. Each edge carries a 60-bit weight. For any walk between two vertices, we compute a single value by taking the bitwise AND of all edge weights along that walk. A walk is considered good if this AND value is at least a given threshold V.
We are given three standard six-sided dice. Each face carries a number of pips from 1 to 6. Some faces are considered “red faces” and the rest “black faces”. Specifically, faces showing 1 and 4 are red, while faces showing 2, 3, 5, and 6 are black.
We are given a large axis-aligned rectangle from the origin to the point $(n, m)$. Inside this rectangle, there are a number of forbidden lattice points.
We are given an array of integers, and we use it to define a graph on indices. Every index is a vertex, and we connect two vertices i and j when a specific arithmetic condition between their indices and values holds.
We are given a collection of closed intervals on a number line. Each interval also has a binary label, red or blue. We want to count how many subsets of these intervals can be chosen such that no chosen red interval overlaps a chosen blue interval.
We start with a single integer and are allowed to transform it using two reversible-looking digit operations in base $k$. One operation appends a digit in base $k$, meaning we multiply the number by $k$ and add a chosen remainder less than $k$.
Each test case describes a team of people, where every person has a running speed and a weight. The team is allowed to form pairs where one person carries exactly one other person on their back, and a person can either be carrying someone, being carried, or doing nothing.
We are given a rooted tree with nodes labeled from 0 to n, where 0 is the root. Each edge currently has no label, but every node has at most 26 children, so in principle we can assign lowercase letters to outgoing edges from any node without conflict.
We are given a company that starts with some employees of different occupations, where each occupation type has a current number of available workers. On top of this initial workforce, there are multiple building projects available.
Each order in this problem arrives with a deadline day and a required quantity of products. The factory produces a fixed number of products every day starting from day one, and there is no initial inventory.
We are working on a grid where every cell contains a value. A player moves through this grid and “collects” values from cells they visit. Movement is restricted: from any cell, you may move right, left, or down, but never up.
We are asked to construct an integer sequence that starts from a fixed value and grows strictly. The twist is not in the growth itself, but in how the differences between consecutive elements behave under XOR.
We are given a binary string $y$ and an integer $k$. We need to construct another binary string $x$ such that two conditions are satisfied simultaneously. First, $x$ must represent a binary number that is not smaller than $y$.
We are given a grid with exactly two rows and n columns. Each cell contains a non-negative integer. We must construct a walk that starts at the top-left cell (1,1) and ends at the bottom-right cell (2,n).
We are working on an infinite square grid where every cell starts out white. We then choose exactly n cells and repaint them red. The grid is considered as a graph where each cell connects to its four neighbors by unit edges.
We are given three integers for each query: a starting value a, a multiplier b, and a modulus target d. We are allowed to choose a non-negative integer k, and we want the smallest such k that makes two separate divisibility conditions true at the same time.
We are given a sequence of independent observations, each representing a lake and the number of fish in it. For every lake, we must decide whether Kaitokid can safely visit it. Safety is defined in a very strict way: a lake is acceptable only when it contains no fish at all.
We are given a set of machines, each with a fixed capacity, and a collection of applications where each application consists of several identical pods that must be placed onto these machines.
We are placing points with integer coordinates on an infinite grid, and we want to fit at least $K$ distinct grid points inside or on the boundary of a circle centered at the origin.
We are dealing with sequences of length $n$ formed under a very specific rule. The sequence always starts at 1. At every next position, the value either continues the previous value plus one, or it resets back to 1.
We are given two sequences of length $n$. The first sequence represents the smoothies Naseem actually bought, and the second sequence represents what each friend would ideally like to receive.
We are given a rectangular grid of size $n times m$, where each cell contains either 0 or 1. In one move, we are allowed to choose exactly one cell that currently contains a 1. Once chosen, every cell that shares an edge or a corner with it becomes 1.
We are given a long decimal string and asked to cut it into several contiguous pieces. Every character of the string must belong to exactly one piece, and each piece is interpreted as a non-negative integer (leading zeros are allowed and the number is not normalized).
We are working with an $n times n$ grid where each cell can either be empty or contain a pearl with an integer size. The grid is updated through a sequence of operations, where each operation either places a pearl in a cell, replaces an existing one, or removes it.
We are given a binary array and a fixed window size. In one move, we choose any contiguous segment of exactly $k$ elements and flip every value inside it, turning zeros into ones and ones into zeros.
We are given a permutation p of size n. From this permutation we construct a large list of permutations: we take every permutation of 1..n that is lexicographically greater than or equal to p, sort them in lexicographic order, and concatenate them into a single sequence A.
We are given an array of integers. Two players select disjoint subsets of indices from this array. Abdulrahman is allowed to pick up to $P$ indices, and Hazem is allowed to pick up to $Q$ indices.
We are given a tree with a designated root. The task is to assign a permutation of the vertices, meaning each vertex receives a unique integer from 1 to n, so that labels strictly increase along every root-to-leaf direction.
We are given several independent test cases. In each one, we start with an array of problem difficulties. We are allowed to delete any subset of these values, but we must leave at least one element behind.
We are given several test cases. In each test case, a sequence of points lies on a horizontal line, ordered from left to right. Each point has a color.
We are given a line of students, each student labeled by a class number. The process repeatedly removes two students of the same class, and each removal contributes the distance between their current positions in the line right before removal.
We are given a connected undirected simple graph representing a village, where intersections are nodes and roads are edges. For each query, two distinct nodes are fixed, one is the starting house A and the other is the destination house B.
We are given several independent test cases. In each test case, we observe a set of points on a plane, where each point has a fixed x-coordinate and an observed y-coordinate.
We are given an $N times M$ board where each cell is either black or white. The task is to assign to every cell exactly one of three operations.
We are given a rooted tree where every vertex except the root has exactly one parent, so all edges naturally point away from vertex 1.
We are given a string laid out on a number line, where each position contains a single uppercase letter. Turning this string into a palindrome requires changing some characters so that position i matches position N−i+1 for all i.
We are given an array of integers, and we are allowed to freely permute its elements. After choosing an ordering, we assign a “beauty score” to the resulting sequence by counting how many positions are locally good in a weak sense: an index contributes if its value is not…
We are given a grid of size $N times M$ where each cell is either black or white. The grid we see is not necessarily the original configuration. Instead, the grid may have been transformed by a special operation applied multiple times.
We are given a directed relationship between lawyers. Each relationship says that one lawyer trusts another, and this trust has a very specific operational meaning: if lawyer B trusts lawyer A, then A provides a defense for B.
We are given a long sequence made only of the values 1, 2, and 3. From this sequence, we want to extract as many disjoint triples of indices as possible, where each triple uses three different positions and respects the order of indices.
We are given an undirected tree with $n$ vertices. We are allowed to choose a root, but with the restriction that the root cannot be a leaf. Once a root is fixed, every vertex $v$ has a value $f(v)$ defined recursively from the leaves upward.
We are counting how many ways to choose three integers, one for each army type, such that each chosen value lies inside its own interval, and the XOR of all three chosen values has a special property. More concretely, we pick values $a1, a2, a3$, where $ai in [li, ri]$.
We are given a line of players, each sitting in a fixed seat from left to right, and each player has a rating value.
We are given several independent test cases. In each one, there is a list of positive integers. We are allowed to insert exactly one additional integer into this list.
We are given an integer array and asked to count how many contiguous subarrays have a special property: if you multiply all elements inside the subarray, the resulting product has an odd number of divisors.
We are given a sequence of letters, where each letter is already assigned to a destination company. At the same time, we also have envelopes, and each envelope has a fixed company written on it, matching the same sequence structure.
We start with a coin at coordinate (0, 0) on an infinite integer grid. Time progresses in discrete steps starting from 1. At each step i, we choose any integer xi, and then the coin moves in a constrained way depending on whether the step is odd or even.
We are given a sequence of independent test cases. Each test case contains a single integer representing a student's original score on a 0 to 10 scale.
We are given several independent strings, and for each string we must compute a single integer value that depends on the structure of how letters appear in sequence.
We are given a single string consisting only of digits, with length at most 100. The task is to decide whether this string satisfies a very specific symmetry condition and output a simple yes or no verdict.
We are given two complete descriptions of relationships among the same set of organizations, but the organizations are named in one description and numbered in the other.
We are given a one-dimensional landscape, where each position stores an integer height. From this array, we define connectivity not by adjacency alone, but by a height constraint: two neighboring positions can be traversed only if their heights differ by at most one.
We are given a building with four rooms labeled A, B, C, and D, connected by exactly three corridors. Each corridor is a physical passage between two rooms, and every time a person moves through a corridor from one room to the other, a log entry is recorded as a pair…
We are given a collection of sock types, where each type contains a number of identical socks grouped in pairs. Type i contributes exactly 2·k[i] individual socks, all indistinguishable within that type.
We are working with shapes formed on an infinite grid using exactly $k$ unit squares. Each shape must be connected through edge-adjacency, meaning we can move between squares only if they share a full side.
We are given several sticks, each with an integer length, and we must organize them into a geometric construction that ultimately produces a triangle-like shelter.
The geometry starts from a fixed parallelogram described by two generating vectors. If we denote the origin as point A, then any point inside the shape can be uniquely written using two parameters along those vectors.
We are given a directed graph where vertices represent events and directed edges represent allowed time transitions. From an event A, we can reach event B if there is a directed path from A to B.
Each test case contains two collections of lowercase words. The first collection is the Wah-List, which contains every word that must appear after the encrypted message has been decoded. The second collection is the encrypted message itself.
We are given an undirected tree, meaning a connected graph with $n$ nodes and exactly $n-1$ edges. Each node represents a restaurant, and each restaurant must be assigned a positive integer label representing a “theme”. The assignment must satisfy two constraints.
We are given a long array representing a tweet, where each element is an integer from 1 to 300. We are also given a shorter pattern array called the slur.
We are given an integer $b$. We consider all integer solutions $(a, c)$ such that $a^2 + b^2 = c^2$ and $0 le a le c$. Each solution corresponds to a circular necklace of $c$ beads, each bead being either “red” (Andromedal) or “blue”.
We are given an undirected graph of planets connected by bidirectional teleporters. Each teleporter allows instant movement between two planets, and it is the only way to travel. Several commanders start on distinct planets.
We are given three powers of two, determined by exponents $a$, $b$, and $c$, and we form the integer $$x = 2^a + 2^b - 2^c.$$ The value is guaranteed to be positive, and the exponents $a$ and $b$ are different.
We are given a sequence of integers that represent financial transactions recorded over time. We must split this sequence into exactly three contiguous, non-empty parts. Each part corresponds to a “month” in which we sum all values inside that segment.
The picture contains a single tree drawn on square cells. The trunk is always one cell wide and runs vertically through the whole tree. The tree has beauty n, which means there are exactly n branches on each side of the trunk.
We are given three lengths. Two of them describe the lengths of logs used in construction: one type of log has length a and another has length b, with a < b. The third number c is the total length of a single wooden beam that must be cut into pieces.
We are given a segment of consecutive integers from $A$ to $B$, inclusive. Two people are counting inside this segment with different rules: one counts how many numbers are divisible by $K$, the other counts how many numbers are divisible by $M$.
We are given a large integer written on a board. A sequence of operations is applied until the number becomes zero. Each operation depends entirely on the digits currently present in the number.
We are given a sequence of numbers representing what each participant announces in a game. The goal is to identify numbers that appear exactly once in the entire sequence. Among those uniquely occurring numbers, we select the smallest value and output it as the winner.
Three numbers remain on the board, in their original order, after one element was erased from an arithmetic progression of four integers. We must restore the missing number and also report where it belongs so that the four resulting numbers form an arithmetic progression.
We are given three types of tickets: yellow, red, and blue. These tickets can be converted upward in a strict hierarchy. Ten blue tickets can be exchanged into one red ticket, and ten red tickets can be exchanged into one yellow ticket.
We are given a street with houses numbered from 1 to n. A character walks along the street twice, placing posters on houses according to divisibility rules. On the first pass, every house whose index is divisible by a is selected.
We are given a line of claims stacked from top to bottom, numbered by their original positions. The boss repeatedly processes the pile in fixed groups of three actions.
We are asked to count integers in the range from 1 to n that satisfy two conditions at the same time. First, the number must be even. Second, when we write that number in binary, the number of set bits, meaning the number of ones in its binary representation, must also be even.
We are working with a linear sequence of TV channels labeled from 1 to N. Lisa starts on some channel P and wants to reach another channel U using a remote control with two buttons. Each button has two behaviors depending on how it is pressed.
We are given a straight horizontal road modeled as the x-axis. Timofey places a metal detector at two different positions on this line. First he stands at the origin and sets the detector range to a value r₁, then he moves to position x = a and sets the range to r₂.
The task is to compute the total duration of a training session that is composed of repeated work blocks separated by rest periods. Each training session consists of $N$ identical sets. One set takes a fixed amount of time given in minutes and seconds.
We are working in a machine model where all arithmetic is performed using 32-bit unsigned integers. That means every result is reduced modulo $2^{32}$ whenever it exceeds the representable range.
The grid describes a black-and-white image where most cells are background and the remaining cells belong to an airplane. Every airplane cell is labeled with a digit from 0 to 9, and all cells sharing the same digit form a single “zone type”.
We are given several independent scenarios on a 2D integer plane. In each scenario, a robot starts at a coordinate $I = (x1, y1)$ and must reach a target coordinate $F = (x2, y2)$.
We are given a binary cellular automaton of fixed length. Each configuration is a row of C cells, where each cell is either 0 or 1.
We are given several independent sequences of points in the plane, where each sequence describes a fixed route that must be followed in order. Each route is a list of coordinates $(x1, y1), (x2, y2), dots, (xn, yn)$, and we only care about movements between consecutive points.
We are given several independent test cases. Each test case describes a sequence of building heights along a one-way street. The city wants to transform this sequence so that as we move from left to right, the heights never decrease.
The statement you pasted is truncated, so there isn’t enough information to reconstruct the actual problem. Right now we only see the title “Fechas de entrenamiento” and empty Input/Output sections.
We are given several independent test cases. In each one, there is an array of values placed on nodes, which we can think of as flowers carrying some amount of pollen.
We are given a graph on $n$ people. Each input edge between two people means there was some declaration between them, but the content of the declaration has been lost.
We are given a robot moving on an infinite integer grid. It starts at a given coordinate and must reach a target coordinate while avoiding a set of blocked grid points that cannot be stepped on.
We are given an array of weights, and we must split these values into exactly $k$ non-empty groups, where each weight belongs to exactly one group. For any group, its cost is defined as the difference between the largest and smallest value inside that group.
The task gives a single integer $m$ and asks us to compute a derived value that depends only on this number. Although the statement text is heavily corrupted, the samples define the entire behavior: for $m = 1$ the answer is $1$, for $m = 2$ the answer is $2$, and for $m = 5$…
We are given a single line of input consisting of an arbitrary string. The task is to output one integer derived from this string. No further constraints, rules, or transformations are specified in the visible statement.
We are given an undirected structure with $n$ nodes described by $n-1$ edges, which guarantees the structure is a tree.
The input to this problem is deliberately uninformative: it is always the same fixed string, and it does not influence the answer in any meaningful way.
The task reduces to reading a single line of text from standard input and producing a fixed response regardless of what that line contains. The input is not interpreted as data with structure or meaning, it is only present to mimic a typical interactive or textual problem format.
The task is intentionally degenerate. You are given a single fixed input string, and no matter how it is read or processed, the only requirement is to output one integer. There is no variability in the input content across test cases.
We are given a circle of n cards labeled from 1 to n. Initially every card is black. We are allowed to perform a sequence of operations, and each operation permanently paints one black card red.
We are given an array of integers, and we are allowed to repeatedly modify individual elements using bit-level operations. In one operation, we pick a single element and either turn off one set bit in its binary representation or turn on two bits that are currently zero.