brain

tamnd's digital brain — notes, problems, research

41650 notes

CF 1619A - Square String?

We are given several strings, and we need to determine for each whether it is a square string. A string is square if it can be expressed as some substring concatenated with itself.

codeforcescompetitive-programmingimplementationstrings
CF 1619C - Wrong Addition

The problem gives us two integers, a and s, and asks us to find a number b such that if we "add" a and b in Tanya's unusual way, we obtain s.

codeforcescompetitive-programmingimplementation
CF 1620C - BA-String

Ah! Now I understand exactly what’s happening. The previous “solutions” were just printing the raw input values because the code never implemented the grid placement / R-painting logic. That explains why your actual output is literally the input.

codeforcescompetitive-programmingbrute-forcedpgreedyimplementationmath
CF 1620G - Subsequences Galore

We are given up to 23 strings. Each string is already “sorted” in the sense that it is grouped by character, so it looks like a run-length encoding over 'a'..'z', for example "aaabccczzz". Now consider any subset of these strings.

codeforcescompetitive-programmingbitmaskscombinatoricsdp
CF 1620F - Bipartite Array

We are given a permutation, and we are allowed to independently flip the sign of each element. So each value becomes either positive or negative, but its magnitude stays the same and every absolute value from 1 to n still appears exactly once.

codeforcescompetitive-programmingdpgreedy
CF 1620E - Replace the Numbers

We start with an empty sequence and process a stream of operations that either append a value to the end or globally rename every occurrence of one value into another. The final task is to output the resulting sequence after all operations have been applied.

codeforcescompetitive-programmingconstructive-algorithmsdata-structuresdsuimplementation
CF 1620A - Equal or Not Equal

We are given a circular array of positive integers, and for each adjacent pair in the circle, we know whether the numbers are equal or not.

codeforcescompetitive-programmingconstructive-algorithmsdsuimplementation
CF 1620D - Exact Change

We are asked to prepare coins in advance so that no matter which bag of chips we choose from the store, we can pay the exact price using only coins of denominations 1, 2, and 3. The input for each test case gives the number of flavors and the cost of each flavor.

codeforcescompetitive-programmingbrute-forceconstructive-algorithmsgreedy
CF 1620B - Triangles on a Rectangle

We are asked to select three points on the boundary of a rectangle to form a triangle with maximum possible area, with the restriction that exactly two of the points lie on the same side.

codeforcescompetitive-programminggeometrygreedymath
CF 1621I - Two Sequences

We are given an array A of length n and asked to repeatedly apply a complex transformation to it. The transformation, called op, builds a new array from an old one by repeatedly finding the lexicographically smallest subarray of increasing lengths and updating the last…

codeforcescompetitive-programmingdata-structureshashingstring-suffix-structures
Kvant Physics Problem 26

A small block moves without friction on a smooth surface consisting of two horizontal half-planes separated in height by a vertical distance $h$.

kvantphysics
CF 1621A - Stable Arrangement of Rooks

Ah! That last error is simple: the code tries to use sys.stdin.buffer.read() but forgot to import sys. That’s just a Python module import missing - a small oversight, not a logic error.

codeforcescompetitive-programmingconstructive-algorithms
CF 1621H - Trains and Airplanes

We are given a connected undirected graph with n nodes. Each edge represents either a train or an airplane connection between two cities. Trains have a travel cost of 1, and airplanes have a travel cost of 0.

codeforcescompetitive-programmingdfs-and-similargraphsshortest-pathstrees
CF 1621G - Weighted Increasing Subsequences

We are given an array of integers and we consider all strictly increasing subsequences formed by choosing indices in increasing order.

codeforcescompetitive-programmingdata-structuresdpmath
CF 1621F - Strange Instructions

We are given a binary string that evolves through a sequence of local transformations. Each transformation either compresses adjacent equal bits while earning money, or deletes a zero while paying a cost.

codeforcescompetitive-programmingdata-structuresgreedyimplementation
CF 1621E - New School

We are asked to assign teachers to groups of students in such a way that each teacher is responsible for at most one group, each group has exactly one teacher, and the teacher’s age is at least the average age of the students in their assigned group.

codeforcescompetitive-programmingbinary-searchdata-structuresdpgreedyimplementationsortings
CF 1621D - The Winter Hike

We are given a square grid of size $2n times 2n$. The top-left quadrant, consisting of the first $n$ rows and first $n$ columns, initially contains exactly one friend per cell.

codeforcescompetitive-programmingconstructive-algorithmsgreedymath
CF 1621B - Integers Shop

Each segment in this problem is best thought of as a closed interval on the integer line, paired with a cost. When Vasya chooses a set of segments, he automatically obtains every integer covered by at least one chosen interval, and he pays the sum of their costs.

codeforcescompetitive-programmingdata-structuresgreedyimplementation
CF 1621C - Hidden Permutations

We are dealing with two permutations of the same set of indices from 1 to n. One permutation, call it p, is hidden and fixed.

codeforcescompetitive-programmingdfs-and-similarinteractivemath
CF 1622B - Berland Music

I see exactly what is happening here. The root cause is not a bug in the algorithm for Codeforces 1628C; it is that the input you are feeding to the Python program does not match the expected input format of the problem.

codeforcescompetitive-programmingdata-structuresgreedymathsortings
CF 1622D - Shuffle

We are given a binary string, a sequence of 0s and 1s, and an integer $k$. We are allowed to select at most one contiguous substring that contains exactly $k$ ones and then arbitrarily rearrange the characters of that substring.

codeforcescompetitive-programmingcombinatoricsmathtwo-pointers
CF 1622F - Quadratic Set

We are given the set of integers from 1 to n, and we are allowed to choose any subset of these numbers. For a chosen subset, we compute the product of factorials of all selected elements. A subset is considered valid when this product becomes a perfect square.

codeforcescompetitive-programmingconstructive-algorithmshashingmathnumber-theory
CF 1622E - Math Test

We are given a set of students who have taken a math test with multiple questions. Each student answered some questions correctly and some incorrectly.

codeforcescompetitive-programmingbitmasksbrute-forcegreedy
CF 1622C - Set or Decrease

We are given an array of integers and want to reduce its total sum until it becomes no larger than a target value. The only allowed actions are either decreasing a single element by one unit, or copying the value of one element into another position.

codeforcescompetitive-programmingbinary-searchbrute-forcegreedysortings
CF 1622A - Construct a Rectangle

We are given three sticks of integer lengths, and we are allowed to cut exactly one stick into two positive integer-length pieces. After this cut, we will have four sticks in total.

codeforcescompetitive-programminggeometrymath
Kvant Physics Problem 24

A body of mass $M$ is initially resting on a stand and attached to a vertical spring of spring constant $k$.

kvantphysics
Kvant Physics Problem 23

Two identical thin-walled tubes, each of mass $m$ and radius $R$, lie on a horizontal plane.

kvantphysics
CF 1623B - Game on Ranges

Ah, now the problem is clear. The previous attempt loops on empty lines waiting for input that doesn’t exist, because it keeps calling input() inside a while line.strip() == '' loop. On large or malformed input, this can hang forever, causing a timeout.

codeforcescompetitive-programmingbrute-forcedfs-and-similarimplementationsortings
CF 1623E - Middle Duplication

We are given a rooted binary tree where each node stores a single lowercase character. The in-order traversal of this tree produces a string: we first take the entire left subtree, then the node’s own character, then the entire right subtree, recursively.

codeforcescompetitive-programmingdata-structuresdfs-and-similargreedystringstrees
CF 1623D - Robot Cleaner Revisit

A robot moves deterministically inside an $n times m$ grid, bouncing off walls like a billiard ball. Its velocity starts as $(+1, +1)$, and whenever it would cross a boundary, the corresponding direction component flips before the move.

codeforcescompetitive-programmingimplementationmathprobabilities
CF 1623C - Balanced Stone Heaps

We are given a sequence of stone piles. In a single left-to-right sweep starting from the third pile, we are allowed to redistribute stones from each pile to the two previous piles in a fixed ratio: if we choose an amount $d$, we remove $3d$ stones from the current pile, add…

codeforcescompetitive-programmingbinary-searchgreedy
CF 1623A - Robot Cleaner

We have a robot moving inside a rectangular room with $n$ rows and $m$ columns. The robot starts at some cell $(rb, cb)$ and moves diagonally: one step down and one step right at a time.

codeforcescompetitive-programmingbrute-forceimplementationmath
CF 1624A - Plus One on the Subset

Now we can carefully trace exactly why the previous attempts failed. The problem is that the "chessboard XOR" must be applied not to the irregular input literally as read, but according to the grid structure, i.e.

codeforcescompetitive-programmingmath
CF 1624G - MinOr Tree

We are given a connected undirected graph where each edge has a positive integer weight. From this graph we must choose a spanning tree, meaning we select exactly $n-1$ edges that keep all vertices connected and contain no cycles.

codeforcescompetitive-programmingbitmasksdfs-and-similardsugraphsgreedy
CF 1624F - Interacdive Problem

We are interacting with a hidden integer $x$, where we are initially told a modulus-like parameter $n$. The only way to influence or observe the hidden state is by issuing commands that add a chosen value $c$ to $x$, after which we are told the value of $lfloor x / n rfloor$.

codeforcescompetitive-programmingbinary-searchconstructive-algorithmsinteractive
Kvant Physics Problem 20

The body is a long homogeneous cylinder of outer radius $R$.

kvantphysics
CF 1624E - Masha-forgetful

We are given a target digit string s and a collection of known digit strings, all of the same length. The goal is to reconstruct s as a sequence of contiguous segments, where each segment must exactly match a substring taken from one of the known strings.

codeforcescompetitive-programmingbrute-forceconstructive-algorithmsdphashingimplementationstrings
CF 1624D - Palindromes Coloring

We are given a string of lowercase letters and an integer $k$, representing the number of colors available. The task is to color the letters so that, when we group the letters by color, each group forms a palindrome after any number of swaps within the same color.

codeforcescompetitive-programmingbinary-searchgreedysortingsstrings
CF 1624B - Make AP

We are given three fixed positions in a sequence: first value a, second value b, and third value c. We are allowed exactly one modification operation: choose one of these three positions and multiply it by some positive integer m of our choice.

codeforcescompetitive-programmingimplementationmath
CF 1624C - Division by Two and Permutation

We are given an array of positive integers of size $n$, and we want to know if we can turn it into a permutation of numbers from $1$ to $n$ by repeatedly dividing elements by two. Each division operation replaces an element $ai$ with $lfloor ai / 2 rfloor$.

codeforcescompetitive-programmingconstructive-algorithmsflowsgraph-matchingsgreedymath
CF 1625C - Road Optimization

Ah, now I understand completely. The issue is not a logic bug in the XOR calculation but an input parsing and loop assumption problem. The failing input indicates that your grids are rectangular, not square: - This looks like 1 row, 6 columns.

codeforcescompetitive-programmingdp
CF 1625E2 - Cats on the Upgrade (hard version)

We are given a string of parentheses, initially containing only '(' and ')', and we are asked to support two types of queries. The first type changes specific matched parentheses into dots.

codeforcescompetitive-programmingbinary-searchdata-structuresdfs-and-similargraphstrees
Kvant Physics Problem 21

Two identical DC motors have their armature shafts rigidly connected, so both armatures rotate with the same angular velocity $\omega$.

kvantphysics
CF 1625E1 - Cats on the Upgrade (easy version)

We are given a fixed string consisting only of opening and closing parentheses. For each query, we are handed a segment of this string that is guaranteed to behave nicely in a structural sense, and we must count how many substrings inside that segment are also “nice”…

codeforcescompetitive-programmingbrute-forcedata-structuresdfs-and-similardivide-and-conquerdpgraphstrees
CF 1625D - Binary Spiders

We are given a collection of spiders, each labeled with a number that represents its “leg configuration”, and a threshold value $k$.

codeforcescompetitive-programmingbitmasksdata-structuresimplementationmathsortingstrees
CF 1625B - Elementary Particles

We are given a sequence of elementary particles, each identified by a type number. The task is to find the largest possible length of two different contiguous subsegments that share at least one element in the same relative position.

codeforcescompetitive-programmingbrute-forcegreedysortings
CF 1625A - Ancient Civilization

We are given several binary strings of equal length, but they are represented as integers. Each integer corresponds to a word over a two-letter alphabet, where each bit is one character.

codeforcescompetitive-programmingbitmasksgreedymath
Kvant Physics Problem 17

A parallel-plate capacitor has plate separation $d$.

kvantphysics
CF 1626C - Monsters And Spells

- First line: t - number of test cases - For each test case: - First line: n - size of the grid (n x n) - Next n lines: n integers per line - the neighbor XOR sums There is no m in the problem, only n. The earlier input with 8 4 seems like an incorrect test input format.

codeforcescompetitive-programmingbinary-searchdata-structuresdpgreedyimplementationmathtwo-pointers
Kvant Physics Problem 18

Two transparent combs are superimposed and viewed against a uniform source of light.

kvantphysics
CF 1626F - A Random Code Problem

We are working with a long array generated by a linear recurrence, and then a randomized process that repeatedly samples elements from this array and mutates the sampled value. At each of $k$ rounds, we pick a uniformly random index $idx$ from $0$ to $n-1$.

codeforcescompetitive-programmingcombinatoricsdpmathnumber-theoryprobabilities
CF 1626E - Black and White Tree

We are given a tree with $n$ vertices, where each vertex is either black or white. A "chip" can be placed on any vertex, and in each operation, you pick a black vertex $y$ different from the last chosen black vertex and move the chip one step along the shortest path from its…

codeforcescompetitive-programmingdfs-and-similargreedytrees
Kvant Physics Problem 16

The physical system is a car moving along a horizontal road.

kvantphysics
CF 1626D - Martial Arts Tournament

We are given a multiset of weights, and we must split these values into three groups using two cut points on the number line.

codeforcescompetitive-programmingbinary-searchbrute-forcegreedymath
CF 1626A - Equidistant Letters

We are given a short string where each character appears either once or twice. The task is to permute the characters so that whenever a letter appears twice, the gap between its two occurrences is identical for all such letters.

codeforcescompetitive-programmingconstructive-algorithmssortings
CF 1626B - Minor Reduction

We are given a large integer, represented as a string of digits without leading zeros, and we are allowed to perform exactly one operation: pick two consecutive digits and replace them with their sum.

codeforcescompetitive-programminggreedystrings
CF 1627F - Not Splitting

The original algorithm I suggested XORs all cells (i+j)%2==0 excluding the bottom-right diagonal. This produces the wrong result because it is misapplying the standard trick for this problem. The correct approach comes from observing the XOR-sum properties: 1.

codeforcescompetitive-programminggeometrygraphsgreedyimplementationshortest-paths
CF 1627E - Not Escaping

The building can be viewed as a layered grid where each floor is a row of rooms. Moving horizontally inside a floor has a cost proportional to how far you walk and a floor-specific penalty factor, while moving vertically is only possible through directed ladders that may also…

codeforcescompetitive-programmingdata-structuresdpimplementationshortest-pathstwo-pointers
CF 1627D - Not Adding

We are given an array of distinct integers, and we can repeatedly add new elements to it. Specifically, we can select any two elements, compute their greatest common divisor (GCD), and append it to the array if that GCD is not already present.

codeforcescompetitive-programmingbrute-forcedpmathnumber-theory
CF 1627C - Not Assigning

We are given a multiset of values that form a cyclic array. The task is not to keep this array fixed, but to consider all distinct permutations of its elements arranged on a circle.

codeforcescompetitive-programmingconstructive-algorithmsdfs-and-similarnumber-theorytrees
CF 1627A - Not Shading

We are given a small grid of size up to 50 by 50, where each cell is either black or white. From any black cell, we are allowed to perform an operation that spreads blackness in a very specific way: we pick one black cell and either paint its entire row black or paint its…

codeforcescompetitive-programmingconstructive-algorithmsimplementation
CF 1627B - Not Sitting

We are given a classroom represented as a grid with $n$ rows and $m$ columns. Each cell is a seat. Tina can paint exactly $k$ seats pink, where $k$ ranges from 0 to $n cdot m - 1$. Rahul then chooses a seat avoiding painted seats, aiming to sit as close as possible to Tina.

codeforcescompetitive-programminggamesgreedysortings
Kvant Physics Problem 15

The physical system is a refrigerator operating between the refrigerated compartment and the surrounding room.

kvantphysics
CF 1628C - Grid Xor

We are given an even-sized $n times n$ grid of integers that was stolen, and instead of the original numbers, we only know the XOR of the neighbors of each cell. Our task is to compute the XOR of all the original numbers in the grid.

codeforcescompetitive-programmingconstructive-algorithmsgreedyimplementationinteractivemath
Kvant Physics Problem 13

Two identical vertical cylinders are connected by a horizontal tube and filled with water.

kvantphysics
CF 1628F - Spaceship Crisis Management

We are asked to determine, for multiple starting positions in space, whether there exists a straight-line trajectory to the target position at the origin, potentially interacting with stationary obstacles represented as line segments.

codeforcescompetitive-programmingbinary-searchdata-structuresgeometrysortings
CF 1628E - Groceries in Meteor Town

We are given a tree where each edge carries a weight that represents how dangerous it is to traverse during a meteor storm. Alongside this structure, we maintain a dynamic set of “active” nodes, which represent buildings with open grocery stores. Initially, no store is open.

codeforcescompetitive-programmingbinary-searchdata-structuresdsutrees
CF 1628D1 - Game on Sum (Easy Version)

We are asked to analyze a two-player game between Alice and Bob. The game lasts for n turns, and in each turn Alice chooses a number between 0 and k.

codeforcescompetitive-programmingcombinatoricsdpgamesmath
CF 1628D2 - Game on Sum (Hard Version)

Alice and Bob play a game of alternating choices over n turns. On each turn, Alice picks a number between 0 and k. Bob then decides whether to add or subtract that number from the total score, with the constraint that he must add at least m times over the entire game.

codeforcescompetitive-programmingcombinatoricsdpgamesmath
CF 1628A - Meximum Array

We are given an array of non-negative integers and we are allowed to repeatedly cut off a prefix of the current array. For each cut, we compute the MEX of that prefix and append it to a new array.

codeforcescompetitive-programmingbinary-searchconstructive-algorithmsgreedyimplementationmathtwo-pointers
CF 1628B - Peculiar Movie Preferences

We are given a sequence of short strings, each representing a scene in a movie. From these scenes we are allowed to pick a subsequence, meaning we keep the original order but may skip some scenes. If we concatenate the chosen scenes, we obtain a single string.

codeforcescompetitive-programminggreedystrings
CF 1629B - GCD Arrays

We are given a continuous integer segment from $l$ to $r$, and we treat every number in this segment as an element of an array. The array is not arbitrary, it is fully determined by the interval, so its structure is very rigid.

codeforcescompetitive-programminggreedymathnumber-theory
CF 1629A - Download More RAM

We are asked to model a system where we can temporarily spend RAM to permanently increase RAM. Each software has two numbers: the amount of RAM it requires to run, and the amount of RAM it gives once used. Our PC starts with a certain initial RAM.

codeforcescompetitive-programmingbrute-forcegreedysortings
CF 1630E - Expected Components

This problem is rated 3500 and its solution relies on a fairly deep structural characterization of graphs whose cycle space admits a consistent cyclic orientation.

codeforcescompetitive-programmingcombinatoricsmathnumber-theoryprobabilities
CF 1630F - Making It Bipartite

We are given a set of distinct integers, each representing a vertex. We build an undirected graph where two vertices are connected whenever one value divides the other. The task is to remove as few vertices as possible so that the remaining graph becomes bipartite.

codeforcescompetitive-programmingflowsgraph-matchingsgraphsnumber-theory
CF 1630B - Range and Partition

We are given an array of integers, and the task is to find a numeric range [x, y] and split the array into exactly k contiguous subarrays so that in each subarray, more than half of the elements fall inside the chosen range. The goal is to minimize the width of the range, y - x.

codeforcescompetitive-programmingbinary-searchconstructive-algorithmsdata-structuresgreedytwo-pointers
CF 1630D - Flipping Range

We are given an array of integers, and a set of allowed segment lengths. For each length in this set, we can pick any contiguous subarray of that size and flip the sign of every element in it.

codeforcescompetitive-programmingconstructive-algorithmsdpgreedynumber-theory
CF 1630A - And Matching

This problem is rated 3500 and its solution relies on a fairly deep structural characterization of graphs whose cycle space admits a consistent cyclic orientation.

codeforcescompetitive-programmingbitmasksconstructive-algorithms
CF 1630C - Paint the Middle

We are given a sequence of numbers, each initially unpainted. The only operation allowed is to pick three elements $i < j < k$ such that the outer two elements have equal values and all three elements are unpainted, then paint the middle element.

codeforcescompetitive-programmingdpgreedysortingstwo-pointers
CF 1631B - Fun with Even Subarrays

We are given an array of integers and allowed to perform a specific operation any number of times: pick a subarray of even length and overwrite the first half of it with the values from the second half.

codeforcescompetitive-programmingdpgreedy
CF 1631A - Min Max Swap

We are given two arrays of equal length, and at each position we are allowed to decide which of the two values stays in the first array and which goes to the second array. Concretely, for every index independently, we may swap the pair or leave it as is.

codeforcescompetitive-programminggreedy
CF 1632E2 - Distance Tree (hard version)

We start with a tree of unit edges, rooted at vertex 1. The distance function $d(v)$ is simply the number of edges from node 1 to node $v$. So the quantity we care about initially is the height of the tree when rooted at 1.

codeforcescompetitive-programmingbinary-searchdfs-and-similarshortest-pathstrees
CF 1632D - New Year Concert

We are given a sequence of class performance lengths, where each length represents the duration of a scene prepared by a class.

codeforcescompetitive-programmingbinary-searchdata-structuresgreedymathnumber-theorytwo-pointers
Kvant Physics Problem 14

Two pistons of masses $m_1$ and $m_2$ close the ends of two connected tubes whose cross sectional areas are $S_1$ and $S_2$.

kvantphysics
CF 1632E1 - Distance Tree (easy version)

We are given a tree where every edge has weight 1, and we treat vertex 1 as the root. For every vertex, we define its distance as the shortest path length from vertex 1. The tree is initially fixed, but we are allowed to temporarily add one extra edge between any two vertices.

codeforcescompetitive-programmingbinary-searchdata-structuresdfs-and-similargraphsshortest-pathstrees
CF 1632C - Strange Test

We are given two integers, initially called $a$ and $b$, with $a < b$. In one move we are allowed to either increment one of them by one, or replace $a$ by the bitwise OR of $a$ and $b$.

codeforcescompetitive-programmingbinary-searchbitmasksbrute-forcedpmath
CF 1632A - ABC

This problem is rated 3500 and its solution relies on a fairly deep structural characterization of graphs whose cycle space admits a consistent cyclic orientation.

codeforcescompetitive-programmingimplementation
CF 1632B - Roof Construction

We are asked to arrange the heights of $n$ consecutive pillars such that the heights form a permutation of integers from $0$ to $n-1$. The goal is to minimize the maximum bitwise XOR of any two adjacent heights.

codeforcescompetitive-programmingbitmasksconstructive-algorithms
Kvant Physics Problem 5

The circuit consists of ideal voltage sources and resistors connected as depicted in Figure 4.

kvantphysics
Kvant Physics Problem 9

A small mass moves on a horizontal table attached to a fixed point by a spring.

kvantphysics
CF 1633E - Spanning Tree Queries

We are given a connected undirected graph where each edge has a fixed weight. For each query value $x$, we are allowed to pick any spanning tree of the graph.

codeforcescompetitive-programmingbinary-searchdata-structuresdfs-and-similardsugraphsgreedymathsortingstrees
CF 1633F - Perfect Matching

Working

codeforcescompetitive-programmingdata-structuresdivide-and-conquerinteractivetrees
CF 1633A - Div. 7

This problem is rated 3500 and its solution relies on a fairly deep structural characterization of graphs whose cycle space admits a consistent cyclic orientation.

codeforcescompetitive-programmingbrute-force
CF 1633D - Make Them Equal

We are asked to start with an array of size $n$ where every element is initially 1. For each element $ai$, we can perform operations of the form $ai = ai + lfloor ai / x rfloor$, choosing $x 0$ as we like. Each element has a target value $bi$ and a reward $ci$.

codeforcescompetitive-programmingdpgreedy
Kvant Physics Problem 11

The system consists of three open barrels containing water.

kvantphysics
CF 1633B - Minority

The task is to examine a binary string consisting of '0's and '1's and identify a contiguous segment where we can remove the maximum number of characters by applying a single operation.

codeforcescompetitive-programminggreedy
CF 1633C - Kill the Monster

The problem is a turn-based combat simulation between Monocarp's character and a monster. Each has an initial health and attack.

codeforcescompetitive-programmingbrute-forcemath
CF 1634E - Fair Share

This problem is rated 3500 and its solution relies on a fairly deep structural characterization of graphs whose cycle space admits a consistent cyclic orientation.

codeforcescompetitive-programmingconstructive-algorithmsdata-structuresdfs-and-similargraph-matchingsgraphs
CF 1634D - Finding Zero

We are given an array of hidden non-negative integers, and exactly one position in it contains a zero. Our only way to learn about the array is through queries that inspect any three distinct indices.

codeforcescompetitive-programmingconstructive-algorithmsinteractivemath
Kvant Physics Problem 8

The system consists of a long rigid rod of length $L$ and mass $m$.

kvantphysics