brain
tamnd's digital brain — notes, problems, research
43815 notes
We are given two nonnegative integers (x) and (y). We must construct two new nonnegative integers (p) and (q) such that no bit is set in both numbers simultaneously, that is, [ p ,&, q = 0.
We are given two types of building blocks: unit-length segments and L-shaped pieces made of two segments joined at a right angle. We need to construct a rectangular grid with dimensions $n times m$ so that every piece is used exactly once.
The value $V = 7frac{1}{16}$ corresponds to the chi-square statistic computed from $k = 11$ categories, as in Eq. (5). The number of degrees of freedom is therefore $nu = k - 1 = 10$.
After sorting the stars by increasing $x$-coordinate, every star appears at a unique horizontal position and also has a unique $y$-coordinate. The geometry is completely determined by the permutation of the $y$-values in this order.
We are given a small system of courses, each currently assigned a priority level from 1 up to k+1. The last level behaves differently: it has no capacity restriction and is the final target state for every course.
We are given an array of integers and can repeatedly pick subarrays of length at least k and reduce every element in that subarray modulo one of two given values p or q. The goal is to minimize the sum of the array after any number of such operations.
The value $V = 7frac{1}{16}$ corresponds to the chi-square statistic computed from $k = 11$ categories, as in Eq. (5). The number of degrees of freedom is therefore $nu = k - 1 = 10$.
The value $V = 7frac{1}{16}$ corresponds to the chi-square statistic computed from $k = 11$ categories, as in Eq. (5). The number of degrees of freedom is therefore $nu = k - 1 = 10$.
We are maintaining a very large square grid that starts completely empty, meaning every cell is white. Over time, we flip some cells to black, one by one, and after each flip we must decide whether the resulting black-white pattern is still “valid” under a global…
Let $BL$ be the internal angle bisector at $B$ meeting $AC$ at $L$, and $AK$ be the internal angle bisector at $A$ meeting $BC$ at $K$.
The value $V = 7frac{1}{16}$ corresponds to the chi-square statistic computed from $k = 11$ categories, as in Eq. (5). The number of degrees of freedom is therefore $nu = k - 1 = 10$.
We are asked to maintain a sequence of integers and repeatedly compute two properties after point updates. Specifically, for a given array a of length n, we want to find, after each update, the largest length k such that there exist two subarrays of length k with identical…
We are given a balanced bracket sequence, meaning every prefix has at least as many opening brackets as closing brackets, and the total numbers match at the end. From this sequence, we choose a non-empty subset of positions.
This is a Type B problem.
The value $V = 7frac{1}{16}$ corresponds to the chi-square statistic computed from $k = 11$ categories, as in Eq. (5). The number of degrees of freedom is therefore $nu = k - 1 = 10$.
Working
We are asked to reverse-engineer a process that generates a sequence by repeatedly inserting an incremented copy of an existing element immediately after that element.
We are given a sequence of integers, and the task revolves around understanding a generative procedure used by an ancient civilization.
The value $V = 7frac{1}{16}$ corresponds to the chi-square statistic computed from $k = 11$ categories, as in Eq. (5). The number of degrees of freedom is therefore $nu = k - 1 = 10$.
Working
Consider three pairs of diametrically opposite points on a sphere, denoted $A, A'$, $B, B'$, $C, C'$, where $O$ is the center of the sphere.
We are tasked with reconstructing a hidden directed acyclic graph with n vertices by asking queries about its paths. Each query gives the k-th path in lexicographical order.
We are tasked with reconstructing an unknown directed acyclic graph using an interactive interface. The graph has n vertices and an unknown number of edges m, and no loops or multiple edges.
The value $V = 7frac{1}{16}$ corresponds to the chi-square statistic computed from $k = 11$ categories, as in Eq. (5). The number of degrees of freedom is therefore $nu = k - 1 = 10$.
We are given an array of integers, and we need to count pairs of indices (i, j) where i < j and the product of the corresponding values equals the distance between the indices: a[i] a[j] = j - i.
We are given a permutation p of length n and an array a of the same length. A permutation is an array of distinct integers from 1 to n, in some order.
We are given a partially filled permutation of size $n$, represented as an array $a$ where zeros indicate unknown positions.
We start with a graph that is already a forest, meaning it is a collection of trees on the vertex set $1 ldots n$. Some edges are present, but the graph is acyclic and possibly disconnected.
Something went wrong. If this issue persists please contact us through our help center at help.openai.com.
We are given a weighted undirected graph. We must choose exactly $n-1$ edges. If those $n-1$ edges form a spanning tree, the choice is forbidden. We want the minimum possible total weight among all choices of $n-1$ edges that do not form a tree.
We are given a string s of parentheses of length n. The task is to consider all non-empty subsequences of s and compute a "score" for each. The score is defined as follows: if the subsequence is not a regular bracket sequence, its score is 0.
We are given a string of parentheses s that is already a valid regular bracket sequence. The task is to find the longest non-empty subsequence t of s that is also a valid regular bracket sequence and is “better” than s.
We are given an array of integers, and we are allowed to reorder it arbitrarily. After fixing an order, we look at every possible split position between prefix and suffix.
We are given a line of rooms connected by doors, where each door has a time at which it opens automatically and each room may contain a key. You start in room 1 at time 0, and the goal is to find the minimum time to reach each subsequent room.
We are given a string made of characters 0, 1, and ?. Each complete version of this string defines a numerical process that generates a sequence of values. We start from c0 = 0. Then we scan the string from left to right.
Every vertex has an edge to the next vertex, and possibly one additional long jump to a larger vertex. The extra edges never cross. If we draw every edge above the number line, no two extra edges form the pattern $ui < uj < vi < vj$. Jerry must move every turn.
We are given an array of integers and asked to find the largest integer $k$ such that the array can be sorted into non-decreasing order by repeatedly swapping any two elements whose difference is at least $k$. If no such $k$ exists, we return $-1$.
We are asked to construct a rearrangement of the numbers from 1 to n such that adjacent elements satisfy a divisibility condition tied to their position. More concretely, we build an array p of length n containing each integer from 1 to n exactly once.
Working
We are given a weighted undirected graph. We must choose exactly $n-1$ edges. If those $n-1$ edges form a spanning tree, the choice is forbidden. We want the minimum possible total weight among all choices of $n-1$ edges that do not form a tree.
A query chooses 50 of the 100 elements and reveals their induced linear order, which determines all pairwise comparisons inside the chosen set.
We are asked to compute the expected beauty of a one-dimensional mosaic of length $n$, where each position is independently colored using one of $m$ colors. The beauty is defined as the square of the number of palindromic subsegments of the mosaic.
We are looking at a random string of length $n$, where each position independently receives one of $m$ colors with equal probability.
We are tasked with distributing a limited number of wishing cards among $n$ friends so that the cumulative happiness of Little A is maximized. Each friend $i$ can carry at most $ai$ cards, and the sum of all cards cannot exceed $k$.
We are given two strings, s and t. The goal is to rearrange the letters of t such that s appears as a subsequence in the resulting string, while making the final string lexicographically as small as possible.
We are asked to construct an array of positive integers of length n such that the XOR of a single contiguous subarray from index l to r is zero, while the XOR of every other non-empty subarray is non-zero.
<Title valuea). If there are currently (="Solution Editorial"m) tabs open, every tab has length [ size="2xl"/<Title value="Problem Understanding" size="text{len} = minleft(b,frac{a}{m}right).
We are given a sequence of integers, and we want to split its elements into several subsequences. Each element must belong to exactly one subsequence, and within each subsequence, consecutive chosen elements must differ by exactly one in value.
We are given an array of integers, and we are allowed to increase individual elements by paying a cost equal to the total number of increments we perform.
We are given a multiset of integers, which is just a collection where elements can repeat. The task is to count how many different multisets can be generated by repeatedly partitioning the original multiset into any number of non-empty groups and then taking one mode from each…
We are given a string of lowercase letters. In one move, we pick a position and overwrite its character with the character immediately to its right. The operation only allows copying from right to left, so information flows strictly in one direction.
We are given a set of values placed around a circle, and we repeatedly compress this circle until only one value remains.
We are given an array of positive integers. For every subarray, we first define a function $f$ that depends on how we optimally split that subarray into consecutive pieces.
We are asked whether a $5\times7$ rectangle can be covered by L-trominoes in several layers so that each cell of the rectangle is covered by the same number of cells from the trominoes.
We are given a polynomial $f(x) = a0 + a1 x + dots + an x^n$, where each coefficient is a non-negative integer and the leading coefficient $an$ is positive. Some coefficients are fixed, others are unknown.
We are given a binary grid of size $n times m$, where each cell contains either 0 or 1. A rectangle in this context is defined not by the usual continuous blocks of 1s, but by the four corner cells: a rectangle $(u,d,l,r)$ exists if and only if the top-left, top-right…
Let
The solution correctly identifies the modified middle-square sequence as a special case of a quadratic congruential sequence modulo $2^e$.
We are given a hidden array of length $2n$. Every number from $1$ to $n$ appears exactly twice, but their order is unknown. We cannot see the array directly.
We are given a target integer $n$, and we want to know whether it is possible to construct some positive integer $x$ such that a specific transformation applied to $x$ and combined with XOR produces exactly $n$.
Consider the population as a finite set of $N$ individuals arranged along a circle.
We are given a hidden sequence of length $2n-1$ that contains every number from $1$ to $n$ exactly twice, except for one special value that appears only once. So the multiset looks like a perfect pairing structure with a single unpaired element. We cannot see the array directly.
We are given a hidden array of length 2n-1 where each number from 1 to n appears exactly twice except for one number, which appears exactly once. Our goal is to determine which number appears only once. We do not need to find its position, only the value.
We are given a one-dimensional line with $n$ people initially at positions $1$ through $n$, and each position $i$ has a value $ai$.
We are given an $n times n$ grid and we must choose a set of black cells. The choice is constrained by three independent-looking counting rules. The first rule fixes how many black cells appear in each row. Row $k$ must contain exactly $ak$ chosen cells.
We are asked to simulate a limited-edition shop where Alice and Bob take turns picking items, but with a twist: we do not control who goes first or in which order they enter. Each item has a value according to us, and Alice and Bob each have a personal ranking of the items.
Let $m = 2^e$ and consider the modified middle-square sequence defined by Coveyou: $X0 text{ given}, qquad X{n+1} = operatorname{middle}(Xn^2 + 2^{e-1} Xn), eqno(4)$ where the function $operatorname{middle}(cdot)$ extracts the middle $2e$ bits of the argument in double precision.
We are given a virtual strip with cells numbered from 1 to $10^9$, where some cells are initially black and the rest are white. Multiple people start from cell 1, and each executes a prefix of a command string composed of two instructions.
We are given a sequence of 2n timestamps representing moments when visitors passed through a single museum door. Each timestamp corresponds either to an entrance or an exit, but the sensor cannot distinguish which.
We are given a set of sliders on a one-dimensional track, each occupying a single position. The sliders are initially ordered left to right, with no overlaps. Each operation attempts to move a particular slider to a target position.
We are working with a rooted tree where every vertex will eventually be assigned either a zero or a one, but the assignment is not fixed. We only know how many zeros must appear overall, while the remaining vertices become ones.
We are given a rooted tree with n vertices, where each vertex must be labeled either 0 or 1. Exactly k vertices are labeled 0, and the remaining n-k are labeled 1. The tree's root is vertex 1, and each other vertex has a specified parent.
We are given a permutation and asked about many contiguous segments of it. For each segment, imagine trying to sort it into increasing order.
Maple has multiple ovens, each producing cakes at a fixed rate per second. She can collect all the cakes from one oven at the end of each second, and she can teleport to any oven, including the one she is already at.
The solution correctly interprets the problem. A "gap of length $r$" is the number of consecutive $U$’s falling outside $[alpha, beta)$ before the next $U$ falls inside that interval.
We are interacting with a text editor whose behavior depends on a hidden parameter $W$, the width of a line. An article is a sequence of word lengths, and the editor lays words into lines greedily: it fills the current line until the next word would overflow $W$, then starts a…
We are given an undirected connected graph where each vertex carries an integer label. Some labels are fixed, while others are unknown and must be chosen from the range $0$ to $V-1$. For any simple path, we define its value as the XOR of all vertex labels along that path.
We are given an interactive editor that wraps words into lines based on a hidden width parameter $W$. Each article is represented as a sequence of word lengths.
Let $p = beta - alpha$ be the probability that a single $Uj$ lies in the interval $[alpha, beta)$, as in equation (4). A gap of length $r$ occurs when $r$ consecutive $U$'s fall outside $[alpha, beta)$, followed by a $U$ inside the interval.
We are asked to construct a permutation of length $n$ that satisfies a positional maximum constraint determined by a binary string $s$ and an integer $k$.
We are given an array of integers, and our goal is to extract the longest possible subsequence that is "neat." A neat subsequence is made by concatenating one or more blocks, where a block is a sequence of identical numbers, and the value of the number equals the length of the…
We are asked to count permutations that produce a given scoring pattern in a dynamic coloring process. Think of it as a row of white cells indexed from 1 to $n$.
We are asked to reconstruct a hidden sequence of parentheses of length $n$ using an interactive oracle. The sequence contains only '(' and ')' characters and is guaranteed to have at least one opening and one closing bracket.
We are given a hidden sequence of parentheses of length n, containing at least one '(' and one ')'. The sequence is regular in the sense that some of its contiguous substrings are valid bracket sequences.
In the original interactive problem there is a hidden bracket sequence consisting of '(' and ')'. We may ask queries about selected positions, and the judge returns the number of regular bracket substrings in the constructed string.
We are given a permutation of length $n$, which means an array containing every integer from $1$ to $n$ exactly once. For each element in this permutation, we are allowed to either leave it as is or replace it with a "mirrored" value defined by $2n - pi$.
We are given an array of integers where each element is either 0, 1, or 2, and a target sum s. Alice wants to start at the first element and move either left or right, step by step, until she reaches the last element.
We are given a set of integer pairs, each representing both a segment on a number line and an edge in a graph. Our goal is to select a subset of these pairs to maximize the difference between the total length of covered integers, called $f(S')$, and the number of nodes that…
The problem can be reframed as follows. Gellyfish faces a group of n monsters, each with a given HP hi. She wants to reduce every monster's HP to exactly 1. She has m rounds of attacks, and in each round a special sword may “shine” with probability p.
In this problem, we have a sequential two-player game with a numeric twist. Each round has a pair of numbers, one from array a and one from array b. There is also a binary string c that decides whose turn it is.
We are given a length-n array that evolves under q operations. Each operation takes two indices x and y, computes the smaller of their current values, and writes that value into a third position z.
We are given two permutations p and q of the numbers 0...n-1. For every position i, we must evaluate all pairs of indices (j, i-j) such that 0 ≤ j ≤ i, and compute $$2^{pj}+2^{q{i-j}}$$ Among all these candidates, we take the maximum and store it in r[i].
We are given an array of positive integers. In one operation, we choose two different positions and replace one value with the gcd of the two values. The process may be repeated as many times as needed.
We are asked to predict the winner of a turn-based duel between two players, Gellyfish and Flower. Each player has a main character and a knight, each with its own health points (HP). Gellyfish has a HP, Flower has b HP, Gellyfish's knight has c HP, and Flower's knight has d HP.
We are given a permutation and asked to count how many of its contiguous segments have a very specific structural property involving order.
We have a permutation and a single allowed operation on four consecutive positions: $$[ai,a{i+1},a{i+2},a{i+3}] rightarrow [a{i+2},a{i+3},ai,a{i+1}]$$ Viewed differently, the element at position $i$ swaps with $i+2$, and the element at position $i+1$ swaps with $i+3$.
We are asked to maximize the "beauty" of a derived array based on an input array. The input array a gives an upper bound on each element of a new array b, which must have the same length. Each element of b satisfies 1 ≤ bi ≤ ai.
We are asked to place all integers from $0$ to $n^2 - 1$ into an $n times n$ grid, each number used exactly once.
We are given two binary strings of equal length. We are allowed to repeatedly apply a structured operation that splits a string into two halves and then either mixes the halves coordinate-wise using XOR, or recurses into both halves and applies the same process independently.
Working