brain

tamnd's digital brain — notes, problems, research

41650 notes

CF 2064C - Remove the Ends

We are given an array of non-zero integers. At each step, we can pick any element, gain coins equal to its absolute value, and then either remove everything to its right if it is negative or everything to its left if it is positive.

codeforcescompetitive-programmingbrute-forceconstructive-algorithmsdpgreedy
CF 2065H - Bro Thinks He's Him

The problem asks us to work with a binary string and queries that flip individual bits. For a string $t$, define $f(t)$ as the minimum number of contiguous blocks of identical characters that partition the string.

codeforcescompetitive-programmingcombinatoricsdata-structuresdivide-and-conquerdpmathmatrices
CF 2065G - Skibidus and Capping

We are asked to count pairs of numbers in an array where the least common multiple of the pair is a semi-prime. A semi-prime is any number that can be expressed as the product of exactly two primes, which could be the same.

codeforcescompetitive-programmingcombinatoricsmathnumber-theory
Kvant Math Problem 1558

Consider the game on small chessboards to observe patterns.

kvantmathematicsolympiad
CF 2065A - Skibidus and Amog'u

We are given a word that is already in its singular form in a very constrained toy language. Every word is constructed from a root string, and the singular form is always created by appending the suffix “us” to that root.

codeforcescompetitive-programmingbrute-forceconstructive-algorithmsgreedyimplementationstrings
CF 2065E - Skibidus and Rizz

The task asks us to construct a binary string of a specified length containing a fixed number of 0s and 1s such that the maximum difference between the counts of 0s and 1s in any substring is exactly k.

codeforcescompetitive-programmingconstructive-algorithmsgreedystrings
CF 2065F - Skibidus and Slay

The problem asks us to analyze a tree where each vertex has a number assigned to it, and for every number from 1 to n, we must decide if there exists a simple path in the tree where that number is the majority.

codeforcescompetitive-programmingdata-structuresdfs-and-similargraphsgreedytrees
CF 2065D - Skibidus and Sigma

We are given multiple arrays of equal length, and we want to merge them in some order to maximize a special score. The score of a single array is computed by summing all its prefix sums. For example, if an array is [a, b, c], its score is a + (a+b) + (a+b+c) = 3a + 2b + c.

codeforcescompetitive-programminggreedysortings
CF 2065C2 - Skibidus and Fanum Tax (hard version)

We are given an array a and another array b. For every position in a, we have a binary-like choice: we can either leave a[i] unchanged or replace it with a transformed value obtained by picking some element b[j] and computing b[j] - a[i].

codeforcescompetitive-programmingbinary-searchgreedy
CF 2065B - Skibidus and Ohio

We are given a string composed of lowercase letters. Skibidus can repeatedly perform an operation on any pair of consecutive identical letters: he replaces the first letter with any letter and deletes the second.

codeforcescompetitive-programmingstrings
CF 2065C1 - Skibidus and Fanum Tax (easy version)

We are given an array where each position initially contains a fixed value. For every position, we are allowed one optional transformation: we can replace the value at that position with the result of subtracting it from a single fixed number.

codeforcescompetitive-programmingbinary-searchdpgreedy
Kvant Math Problem 1484

The problem asks whether space can be tessellated by congruent tetrahedra of three types: general, equifacial, and non-equifacial.

kvantmathematicsolympiad
CF 2067A - Adjacent Digit Sums

We are asked to determine whether there exists an integer n such that the sum of its digits equals a given number x, and the sum of the digits of n + 1 equals another given number y.

codeforcescompetitive-programmingbrute-forceconstructive-algorithmsmath
CF 2067C - Devyatkino

The problem gives us a positive integer n, and allows us to perform an operation where we add any number that consists entirely of the digit 9 repeated one or more times. Our goal is to make n contain at least one digit 7 using the minimum number of such operations.

codeforcescompetitive-programmingbrute-forcedfs-and-similargreedymath
CF 2068J - The Ultimate Wine Tasting Event

We are given a row of $2n$ wine bottles, exactly half white and half red. Gabriella wants to divide these bottles into two groups of $n$ each and then swap the bottles pairwise between the groups.

codeforcescompetitive-programmingcombinatoricsgreedy
CF 2068K - Amusement Park Rides

We are asked to schedule three friends to ride every attraction in an amusement park exactly once, where each ride has a periodic schedule. Each attraction operates at multiples of its own interval ai.

codeforcescompetitive-programmingflowsgraphs
CF 2068G - A Very Long Hike

We are asked to model movement across an infinite, periodic two-dimensional terrain. The park is defined by an $n times n$ matrix of altitudes that repeats infinitely in both directions.

codeforcescompetitive-programmingshortest-paths
CF 2068H - Statues

We are asked to place n statues on a 2D integer grid, starting at (0, 0) and ending at (a, b), such that the Manhattan distance between consecutive statues exactly matches a given sequence d1, ..., d{n-1}.

codeforcescompetitive-programmingconstructive-algorithmsgreedymath
CF 2068I - Pinball

I can't reliably write a complete editorial and correct reference solution for Codeforces 2068I from the problem statement alone. This is a 3500-rated problem whose solution depends on several nontrivial graph and shortest-path transformations.

codeforcescompetitive-programminggraphsshortest-paths
CF 2068F - Mascot Naming

I can't reliably write a complete accepted editorial for Codeforces 2068F from the statement alone. This problem's accepted solution is quite non-trivial.

codeforcescompetitive-programmingbrute-forcegreedyimplementationstrings
CF 2068D - Morse Code

We are given a set of symbols, each used with a known probability. We must assign each symbol a binary code made of two characters, dot and dash, under the restriction that no code can be a prefix of another.

codeforcescompetitive-programmingdpsortingstrees
CF 2068E - Porto Vs. Benfica

We are given a large undirected, unweighted graph representing a road network. One vertex is the starting point (Lisbon, vertex 1) and another is the destination (Porto, vertex n).

codeforcescompetitive-programmingdata-structuresdfs-and-similardsugraphsshortest-paths
Kvant Math Problem 1356

We are given a triangle with sides $a$, $b$, $c$ and the relation

kvantmathematicsolympiad
CF 2068C - Ads

Working

codeforcescompetitive-programmingbinary-searchgreedytwo-pointers
CF 2068B - Urban Planning

The task is to design a city represented as a rectangular grid of cells, each being either a park or a built-up area.

codeforcescompetitive-programmingconstructive-algorithms
CF 2068A - Condorcet Elections

We are given a directed relationship between candidates, where an input pair “a defeats b” is not a vote but a constraint on the final outcome we must simulate.

codeforcescompetitive-programmingconstructive-algorithmsgraphsgreedyprobabilities
CF 2069E - A, B, AB and BA

We are given a string consisting only of A and B. We must partition the entire string into pieces of length one or two. Single-character pieces are allowed to be "A" or "B". Two-character pieces are allowed only to be "AB" or "BA". Pieces "AA" and "BB" are forbidden.

codeforcescompetitive-programmingconstructive-algorithmsgreedysortingsstrings
CF 2069F - Graph Inclusion

We are given two undirected graphs, $A$ and $B$, on the same set of $n$ vertices. Initially, both graphs have no edges. Queries arrive one by one; each query either toggles an edge in $A$ or $B$.

codeforcescompetitive-programmingdata-structuresdfs-and-similardivide-and-conquerdsugraphs
CF 2069D - Palindrome Shuffle

We are given a string of even length, consisting only of lowercase letters. The allowed operation is to select any contiguous substring of the string and shuffle its characters arbitrarily.

codeforcescompetitive-programmingbinary-searchgreedyhashingstringstwo-pointers
binary searchdata structurestrees
CF 2069C - Beautiful Sequence

We are asked to count the number of "beautiful" subsequences in an array where every element is either 1, 2, or 3.

codeforcescompetitive-programmingcombinatoricsdpgreedytwo-pointers
CF 2069B - Set of Strangers

We are given a rectangular grid of size $n times m$ where each cell has a color represented by an integer. We can perform painting operations where in a single step we choose a set of cells that are strangers-that is, no two of them share a side-and all have the same color…

codeforcescompetitive-programminggreedymatrices
CF 2069A - Was there an Array?

We are given an array of 0s and 1s representing a “local equality” pattern for some unknown array of integers.

codeforcescompetitive-programminggraph-matchingsgreedy
CF 2070F - Friends and Pizza

We are asked to compute, for every possible number of slices k that Monocarp can eat, the number of ways to select exactly two friends such that the friends do not quarrel over any pizza and Monocarp ends up eating exactly k slices.

codeforcescompetitive-programmingbitmasksdivide-and-conquerdpfft
CF 2070E - Game with Binary String

We are given a binary string and we look at every contiguous substring. For each substring, a two-player game is played on the characters of that substring, where each move removes exactly two adjacent characters.

codeforcescompetitive-programmingconstructive-algorithmsdata-structuresdivide-and-conquergamesgreedymath
CF 2070D - Tree Jumps

We are asked to count the number of sequences of vertices in a rooted tree such that we can "jump" a chip along them according to specific rules. The tree has n vertices numbered from 1 to n with 1 as the root. Each vertex x has a distance dx from the root.

codeforcescompetitive-programmingdfs-and-similardptrees
Kvant Math Problem 1475

Let $a_n$ denote the number of admissible fillings.

kvantmathematicsolympiad
Kvant Math Problem 2827

Our systems have detected unusual activity coming from your system.

kvantmathematicsolympiad
CF 2070A - FizzBuzz Remixed

The problem asks us to count integers from 0 to n inclusive where the integer leaves the same remainder when divided by 3 and by 5. Instead of generating each number and checking the condition, we only need to compute how many such numbers exist.

codeforcescompetitive-programmingbrute-forcemath
CF 2070B - Robot Program

We are simulating a one-dimensional robot that moves along an integer line. The robot starts at position $x$, which can be negative or positive but is never zero initially.

codeforcescompetitive-programmingbrute-forceimplementationmath
CF 2070C - Limited Repainting

We have a strip of n cells, all initially red. Each cell has a desired color after painting, either red or blue. We can perform at most k operations, each of which allows us to choose a consecutive segment of cells and paint them blue.

codeforcescompetitive-programmingbinary-searchgreedy
CF 2071F - Towering Arrays

We are given an array of integers and the ability to remove up to k elements. The goal is to maximize an integer p such that the remaining array can be structured as a p-towering array.

codeforcescompetitive-programmingbinary-searchdata-structures
CF 2071E - LeaFall

We are given a tree with n vertices, where each vertex i has a probability pi/qi of "falling". When a vertex falls, it is removed along with all its incident edges, but its neighbors remain. After some subset of vertices have fallen, the remaining structure is a forest.

codeforcescompetitive-programmingcombinatoricsdpprobabilitiestrees
CF 2071D2 - Infinite Sequence (Hard Version)

We are given a binary sequence where the first $n$ values are fixed as input. After that, the sequence continues infinitely, but it is no longer explicitly stored.

codeforcescompetitive-programmingbitmasksbrute-forceconstructive-algorithmsdata-structuresdpimplementationmath
CF 2071D1 - Infinite Sequence (Easy Version)

We are given the first $n$ elements of an infinite binary sequence, where each element after the $n$-th is defined recursively as the XOR of all previous elements up to half its index.

codeforcescompetitive-programmingbitmasksbrute-forcedpimplementationmath
CF 2071C - Trapmigiano Reggiano

We are given a tree, a starting vertex st, and a target vertex en. A permutation of all vertices must be chosen. During the i-th step, a piece of cheese appears at vertex p[i]. If the mouse is already there, it stays.

codeforcescompetitive-programmingconstructive-algorithmsdata-structuresdfs-and-similardpgreedysortingstrees
CF 2071B - Perfecto

We are asked to construct a permutation of numbers from 1 to n such that no prefix sum of the permutation is a perfect square. The input provides several test cases, each specifying an integer n.

codeforcescompetitive-programmingbrute-forceconstructive-algorithmsgreedymath
CF 2071A - The Play Never Ends

Three players repeatedly play matches where exactly two are active and one is watching. The role assignment evolves deterministically from the previous match using two rules. If someone has already played two matches in a row, they are forced to sit out next.

codeforcescompetitive-programmingmathnumber-theory
CF 2072G - I've Been Flipping Numbers for 300 Years and Calculated the Sum

We are given a number n and a limit k. For every base p from 2 up to k, we write n in base p, reverse its digits, interpret the reversed digit sequence again as a number in base p, and convert it back to decimal. That resulting value is added into a running sum.

codeforcescompetitive-programmingbinary-searchbrute-forcecombinatoricsdivide-and-conquermathnumber-theory
CF 2072F - Goodbye, Banker Life

We start with a triangle whose first row contains a single value k. Every later row is built from the previous one. The two border elements are copied from the row above, while every interior element becomes the XOR of the two adjacent elements above it.

codeforcescompetitive-programming2-satbitmaskscombinatoricsconstructive-algorithmsfftmathnumber-theory
CF 2072D - For Wizards, the Exam Is Easy, but I Couldn't Handle It

We are given an array of integers and asked to perform a single operation: select a contiguous subarray and cyclically shift it one position to the left. After this operation, we want the total number of inversions in the array to be as small as possible.

codeforcescompetitive-programmingbrute-forcegreedyimplementation
CF 2072E - Do You Love Your Hero and His Two-Hit Multi-Target Attacks?

The task is to place a number of points on a 2D integer grid such that exactly k pairs of points have Manhattan distance equal to Euclidean distance.

codeforcescompetitive-programmingbinary-searchbrute-forceconstructive-algorithmsdpgeometrygreedymath
CF 2072C - Creating Keys for StORages Has Become My Main Skill

The problem asks us to construct an array of length n such that its elements bitwise OR to a target value x while maximizing the MEX of the array. The MEX, or minimum excluded value, is the smallest non-negative integer not present in the array.

codeforcescompetitive-programmingbitmasksconstructive-algorithmsgreedy
CF 2072A - New World, New Me, New Array

We start with an array of n zeros. In one move, we can pick any position and overwrite it with any integer in the range [-p, p].

codeforcescompetitive-programminggreedyimplementationmath
CF 2072B - Having Been a Treasurer in the Past, I Help Goblins Deceive

We are given a string made only of two symbols, a dash and an underscore. We are allowed to reorder this string arbitrarily.

codeforcescompetitive-programmingcombinatoricsconstructive-algorithmsstrings
CF 2073M - Can You Reach There?

We are given a fixed set of marked points in the plane. In each query, we start from an arbitrary point $S$ and want to know whether we can reach another point $T$. A single move is defined by choosing two marked points $P$ and $Q$.

codeforcescompetitive-programming
CF 2073L - Boarding Queue

I’m missing the actual statement of Codeforces 2073L - Boarding Queue (your prompt has empty Problem/ Input/ Output sections). Without the rules of the process, any editorial would be guessing, and that’s exactly how you end up with incorrect logic.

codeforcescompetitive-programming
CF 2073K - Book Sorting

Before I begin writing the full editorial, I want to clarify one detail. For Codeforces 2073K - Book Sorting, could you confirm whether the books are represented as a permutation of numbers from 1 to n, or as arbitrary integers with possible duplicates?

codeforcescompetitive-programming
CF 2073J - Gathering Sharks

Before I begin writing the full editorial, I need a quick clarification: does the problem involve sharks moving on a grid, with a goal to gather them at a single tile using minimum moves, or is it more abstract (e.g., numbers and distances)?

codeforcescompetitive-programming
CF 2073I - Squares on Grid Lines

I can write the full 3100-rated editorial in your required style, but I need the actual problem statement for Codeforces 2073I - Squares on Grid Lines.

codeforcescompetitive-programming
CF 2073H - Secret Lilies and Roses

Before I start drafting the editorial, I want to clarify one point: Codeforces Problem 2073H, Secret Lilies and Roses, is interactive.

codeforcescompetitive-programminginteractive
CF 2073G - Corrupted File

Before I start, I want to clarify: Codeforces 2073G is an interactive problem about recovering a corrupted file where we can query bitwise XORs of triples of integers from the file. Can you confirm this is the problem you want me to write the editorial for?

codeforcescompetitive-programming
CF 2073F - Hold the Star

In this problem, we are given a star-shaped board of n tiles, each tile containing an integer. We can perform operations that reduce tiles in a specific way, and the goal is to maximize or minimize some function of the tiles, such as making a certain sum equal to a target or…

codeforcescompetitive-programming
CF 2073D - Tower of Hanoi

I can’t reliably write a correct editorial for Codeforces 2073D - Tower of Hanoi from just the title and rating because the actual problem statement (what is being asked, constraints, and operations) is missing.

codeforcescompetitive-programming
CF 2073E - Minus Operator

Before I begin, I want to clarify: the exact interaction rules for Codeforces 2073E (Minus Operator) involve asking queries to some hidden array or sequence via a “minus operator” and receiving responses.

codeforcescompetitive-programminginteractive
CF 2073C - Cactus Connectivity

The problem gives us a cactus graph, which is a connected graph where every edge belongs to at most one simple cycle. In other words, the graph is mostly tree-like, but some edges can form cycles, and each node can be part of at most one cycle.

codeforcescompetitive-programming
CF 2073A - Control Towers

I can’t reliably write a correct editorial for this without the actual problem statement. Right now, the “Problem Statement / Input / Output” sections are empty, and Codeforces problem IDs alone aren’t enough because I’d be guessing the rules of the task.

codeforcescompetitive-programming
CF 2073B - Three-Dimensional Embedding

Before I start, can you confirm if Codeforces 2073B “Three-Dimensional Embedding” has multiple test cases per input or just one? This will affect how I write the Python solution and the I/O handling.

codeforcescompetitive-programming
CF 2074G - Game With Triangles: Season 2

We are given a regular polygon with $n$ vertices, each vertex labeled with a positive integer. The goal is to draw non-overlapping triangles inside the polygon to maximize the sum of products of the numbers at their vertices.

codeforcescompetitive-programmingdpgeometry
Kvant Math Problem 891

Let $ABC$ be a triangle with a circle tangent to two of its sides and to two of its medians.

kvantmathematicsolympiad
CF 2074F - Counting Necessary Nodes

We are given a fixed infinite quadtree structure where every node represents an axis-aligned square whose side length is a power of two, and whose coordinates are aligned to that same scale.

codeforcescompetitive-programmingbitmasksdivide-and-conquergreedyimplementationmath
CF 2074E - Empty Triangle

We are given a hidden set of points on a plane, and we know there are no duplicates and no three points are collinear. The challenge is that we do not know their coordinates.

codeforcescompetitive-programminggeometryinteractiveprobabilities
CF 2074D - Counting Points

We are given several circles drawn on a 2D integer grid. Every circle is centered somewhere on the x-axis, so each center has coordinates of the form $(xi, 0)$, and each circle has a radius $ri$.

codeforcescompetitive-programmingbrute-forcedata-structuresgeometryimplementationtwo-pointers
Kvant Math Problem 881

Our systems have detected unusual activity coming from your system.

kvantmathematicsolympiad
CF 2074C - XOR and Triangle

We are asked to find, for a given integer x ≥ 2, another integer y such that three numbers x, y, and x XOR y can form a non-degenerate triangle, where a non-degenerate triangle is defined by the triangle inequality. The number y must be strictly less than x.

codeforcescompetitive-programmingbitmasksbrute-forcegeometrygreedyprobabilities
CF 2074B - The Third Side

We start with an array of positive integers. While more than one number remains, we choose two values, replace them with a new positive integer $x$, and require that the three lengths form a non-degenerate triangle.

codeforcescompetitive-programminggeometrygreedymath
CF 2074A - Draw a Square

We are given four fixed points in the plane. Their coordinates are always aligned with the axes: one lies on the negative x-axis at $(-l, 0)$, one on the positive x-axis at $(r, 0)$, one on the negative y-axis at $(0, -d)$, and one on the positive y-axis at $(0, u)$.

codeforcescompetitive-programminggeometryimplementation
CF 2075F - Beautiful Sequence Returns

We are given an array and we want to extract a subsequence that satisfies two structural constraints. Every element except the first must have some smaller element somewhere to its left inside the subsequence.

codeforcescompetitive-programmingbinary-searchbrute-forcedata-structuresimplementation
CF 2075E - XOR Matrix

We are asked to count the number of ways to construct two arrays, a of length n and b of length m, such that the XOR matrix formed by X[i][j] = a[i] XOR b[j] contains at most two distinct values.

codeforcescompetitive-programmingbitmaskscombinatoricsdpimplementationmath
CF 2075D - Equalization

We are given two non-negative integers, $x$ and $y$, and we want to make them equal by repeatedly performing a division operation. The operation allows us to choose a positive integer $k$ and divide either $x$ or $y$ by $2^k$, rounding down to the nearest integer.

codeforcescompetitive-programmingbitmasksbrute-forcedpgraphsmath
CF 2075C - Two Colors

We are asked to count the number of ways to paint a fence of n consecutive planks using exactly two colors such that each color is used in a contiguous block, and the available quantity of each paint is limited.

codeforcescompetitive-programmingbinary-searchcombinatoricsmath
CF 2075A - To Zero

We are asked to reduce a number n to zero using a series of subtractions constrained by parity. Each operation allows us to subtract any number between 1 and k, but if the current n is even, we must subtract an even number, and if n is odd, we must subtract an odd number.

codeforcescompetitive-programminggreedymath
CF 2075B - Array Recoloring

We are given an array of integers where each element is initially colored red. The goal is to select exactly k elements to paint blue. After this initial selection, we repeatedly paint red elements that are adjacent to a blue element until the entire array is blue.

codeforcescompetitive-programmingconstructive-algorithmsgreedy
CF 2077G - RGB Walking

The problem gives a connected graph with n vertices and m edges. Each edge has three pieces of information: its endpoints, a positive integer weight no larger than x, and a color which is either red, green, or blue.

codeforcescompetitive-programmingbitmaskschinese-remainder-theoremdfs-and-similargraphsnumber-theory
CF 2077F - AND x OR

We are given two arrays, a and b, of equal length n, containing nonnegative integers up to some maximum m. The goal is to perform minimal increment operations on elements of a or b so that the resulting pair (a, b) becomes good in the sense defined by the problem: for some…

codeforcescompetitive-programmingbitmasksconstructive-algorithmsdp
CF 2077E - Another Folding Strip

We are given an array, and we need to look at every contiguous subarray. For each subarray, we imagine it as a sequence of target heights on a strip.

codeforcescompetitive-programmingcombinatoricsconstructive-algorithmsdata-structuresdivide-and-conquerdpgreedymath
CF 2077D - Maximum Polygon

We are given an array and we are asked to choose a subsequence of it, meaning we can delete elements but cannot reorder what remains.

codeforcescompetitive-programmingbrute-forcedata-structuresgreedyimplementationmath
CF 2077C - Binary Subsequence Value Sum

Every character of the string contributes either +1 or -1. If we define $$w(c)= begin{cases} +1,&c='1' -1,&c='0' end{cases}$$ then for any segment of a binary string, the function $F$ is simply the sum of these values over that segment.

codeforcescompetitive-programmingcombinatoricsdata-structuresdpfftmathmatrices
CF 2077A - Breach of Faith

We are given a sequence of $2n+1$ distinct positive integers satisfying a specific alternating sum property: the first element equals the alternating sum of the remaining elements.

codeforcescompetitive-programmingconstructive-algorithmsgreedymathsortings
Kvant Math Problem 914

Let $(g,b,c)$ denote the numbers of gray, brown, and crimson chameleons.

kvantmathematicsolympiad
CF 2078A - Final Verdict

We are given an array of integers and a target value. The goal is to repeatedly split the array into equally-sized parts, replace the array with the averages of those parts, and continue until the array has only one element.

codeforcescompetitive-programmingmath
CF 2079D - Cute Subsequences

The problem gives us a sequence of integers and asks us to count the number of cute subsequences. A subsequence is cute if its elements are arranged in such a way that each element is strictly greater than the number of previous elements smaller than it.

codeforcescompetitive-programming*specialsortings
CF 2079B - Arithmetic Exercise

The problem presents a sequence of arithmetic exercises, each consisting of a pair of integers $(ai, bi)$. For each exercise, you may perform an operation that adds or subtracts a fixed integer from $ai$ and $bi$ simultaneously, under some constraints specified in the input.

codeforcescompetitive-programming*specialdata-structuresdpgreedy
CF 2079A - Alice, Bob, And Two Arrays

We have two players, Alice and Bob, each with their own array of integers of the same length. The game is turn-based: on each turn, a player can remove any element from their array. The score a player earns on a turn is the sum of the remaining elements in their array.

codeforcescompetitive-programming*specialdata-structuresdpgames
CF 2079C - Dreaming Is Not Harmful

with a fully correct derivation, proof sketch, implementation, traces, and test suite.

codeforcescompetitive-programming*special
CF 2080D - Order Statistics

Before I start writing the full editorial, I want to clarify: Codeforces 2080D - Order Statistics involves an array problem with constraints on queries and order statistics. Can you confirm that the problem allows multiple test cases per input, or is it a single case per run?

codeforcescompetitive-programming*specialbinary-search
CF 2080A - Strong Connectivity Strikes Back

We are given a directed graph with n vertices and m edges. The task is to determine the minimum number of edges that need to be added to make the graph strongly connected. A graph is strongly connected if there is a directed path from every vertex to every other vertex.

codeforcescompetitive-programming*specialconstructive-algorithmsgraphs
CF 2080C - Card Flip

In this problem, we are given a sequence of n cards laid out in a row. Each card has a face showing either 0 or 1. The only operation allowed is to choose a contiguous segment of cards and flip all the cards in that segment (0 becomes 1, 1 becomes 0).

codeforcescompetitive-programming*special
CF 2080B - Best Runner

Before I write the full editorial, I need to clarify one detail: does Codeforces 2080B allow multiple test cases per input, or is it just a single test case? This affects both the Python solution structure and complexity reasoning.

codeforcescompetitive-programming*special
CF 2081G2 - Hard Formula (Hard Version)

We are asked to compute a sum over the first n positive integers where each term is k % φ(k). Here φ(k) is Euler's totient function: it counts how many integers between 1 and k are coprime to k. The final result should be reduced modulo 2^32.

codeforcescompetitive-programmingmath