problem_number stringclasses 123
values | problem_letter stringclasses 33
values | problem_title stringlengths 1 46 | tags stringlengths 2 129 | difficulty stringclasses 41
values | problem_link stringlengths 43 56 | start_time stringclasses 117
values | language stringclasses 2
values | problem_site stringclasses 3
values | description stringlengths 331 6.84k |
|---|---|---|---|---|---|---|---|---|---|
2008 | F | Sakurako's Box | ["combinatorics", "math", "number theory"] | 1400 | https://codeforces.com/problemset/problem/2008/F | 1725201300 | en | codeforces | # Sakurako's Box
## Problem Description
Sakurako has a box with $ n $ balls. Each ball has it's value. She wants to bet with her friend that if the friend randomly picks two balls from the box (it could be two distinct balls, but they may have the same value), the product of their values will be the same as the numbe... |
2008 | E | Alternating String | ["brute force", "data structures", "dp", "greedy", "implementation", "strings"] | 1500 | https://codeforces.com/problemset/problem/2008/E | 1725201300 | en | codeforces | # Alternating String
## Problem Description
Sakurako really loves alternating strings. She calls a string $ s $ of lowercase Latin letters an alternating string if characters in the even positions are the same, if characters in the odd positions are the same, and the length of the string is even.
For example, the st... |
2008 | D | Sakurako's Hobby | ["dp", "dsu", "graphs", "math"] | 1100 | https://codeforces.com/problemset/problem/2008/D | 1725201300 | en | codeforces | # Sakurako's Hobby
## Problem Description
For a certain permutation $ p $ $ ^{\text{โ}} $ Sakurako calls an integer $ j $ reachable from an integer $ i $ if it is possible to make $ i $ equal to $ j $ by assigning $ i=p_i $ a certain number of times.
If $ p=[3,5,6,1,2,4] $ , then, for example, $ 4 $ is reachable fro... |
2008 | C | Longest Good Array | ["binary search", "brute force", "math"] | 800 | https://codeforces.com/problemset/problem/2008/C | 1725201300 | en | codeforces | # Longest Good Array
## Problem Description
Today, Sakurako was studying arrays. An array $ a $ of length $ n $ is considered good if and only if:
- the array $ a $ is increasing, meaning $ a_{i - 1} < a_i $ for all $ 2 \le i \le n $ ;
- the differences between adjacent elements are increasing, meaning $ a_i - a_{i-... |
2008 | B | Square or Not | ["brute force", "math", "strings"] | 800 | https://codeforces.com/problemset/problem/2008/B | 1725201300 | en | codeforces | # Square or Not
## Problem Description
A beautiful binary matrix is a matrix that has ones on its edges and zeros inside.
 Examples of four beautiful binary matrices.Today, Sakurako was playing with a beautiful binar... |
2008 | A | Sakurako's Exam | ["brute force", "constructive algorithms", "greedy", "math"] | 800 | https://codeforces.com/problemset/problem/2008/A | 1725201300 | en | codeforces | # Sakurako's Exam
## Problem Description
Today, Sakurako has a math exam. The teacher gave the array, consisting of $ a $ ones and $ b $ twos.
In an array, Sakurako must place either a '+' or a '-' in front of each element so that the sum of all elements in the array equals $ 0 $ .
Sakurako is not sure if it is pos... |
2007 | C | Dora and C++ | ["math", "number theory"] | 1500 | https://codeforces.com/problemset/problem/2007/C | 1725028500 | en | codeforces | # Dora and C++
## Problem Description
Dora has just learned the programming language C++!
However, she has completely misunderstood the meaning of C++. She considers it as two kinds of adding operations on the array $ c $ with $ n $ elements. Dora has two integers $ a $ and $ b $ . In one operation, she can choose o... |
2007 | B | Index and Maximum Value | ["data structures", "greedy"] | 900 | https://codeforces.com/problemset/problem/2007/B | 1725028500 | en | codeforces | # Index and Maximum Value
## Problem Description
After receiving yet another integer array $ a_1, a_2, \ldots, a_n $ at her birthday party, Index decides to perform some operations on it.
Formally, there are $ m $ operations that she is going to perform in order. Each of them belongs to one of the two types:
- $ \t... |
2007 | A | Dora's Set | ["greedy", "math", "number theory"] | 800 | https://codeforces.com/problemset/problem/2007/A | 1725028500 | en | codeforces | # Dora's Set
## Problem Description
Dora has a set $ s $ containing integers. In the beginning, she will put all integers in $ [l, r] $ into the set $ s $ . That is, an integer $ x $ is initially contained in the set if and only if $ l \leq x \leq r $ . Then she allows you to perform the following operations:
- Sele... |
2006 | F | Dora's Paint | ["brute force", "combinatorics", "constructive algorithms", "graphs", "implementation"] | 3500 | https://codeforces.com/problemset/problem/2006/F | 1725028500 | en | codeforces | # Dora's Paint
## Problem Description
Sadly, Dora poured the paint when painting the class mural. Dora considers the mural as the matrix $ b $ of size $ n \times n $ . Initially, $ b_{i,j} = 0 $ for all $ 1 \le i, j \le n $ .
Dora has only two brushes which have two different colors. In one operation, she can paint ... |
2006 | E | Iris's Full Binary Tree | ["brute force", "data structures", "dfs and similar", "trees"] | 3100 | https://codeforces.com/problemset/problem/2006/E | 1725028500 | en | codeforces | # Iris's Full Binary Tree
## Problem Description
Iris likes full binary trees.
Let's define the depth of a rooted tree as the maximum number of vertices on the simple paths from some vertex to the root. A full binary tree of depth $ d $ is a binary tree of depth $ d $ with exactly $ 2^d - 1 $ vertices.
Iris calls a... |
2006 | D | Iris and Adjacent Products | ["data structures", "greedy", "implementation", "math"] | 2600 | https://codeforces.com/problemset/problem/2006/D | 1725028500 | en | codeforces | # Iris and Adjacent Products
## Problem Description
Iris has just learned multiplication in her Maths lessons. However, since her brain is unable to withstand too complex calculations, she could not multiply two integers with the product greater than $ k $ together. Otherwise, her brain may explode!
Her teacher sets... |
2006 | C | Eri and Expanded Sets | ["data structures", "divide and conquer", "math", "number theory", "two pointers"] | 2300 | https://codeforces.com/problemset/problem/2006/C | 1725028500 | en | codeforces | # Eri and Expanded Sets
## Problem Description
Let there be a set that contains distinct positive integers. To expand the set to contain as many integers as possible, Eri can choose two integers $ x\neq y $ from the set such that their average $ \frac{x+y}2 $ is still a positive integer and isn't contained in the set... |
2006 | B | Iris and the Tree | ["brute force", "data structures", "dfs and similar", "dsu", "math", "trees"] | 1800 | https://codeforces.com/problemset/problem/2006/B | 1725028500 | en | codeforces | # Iris and the Tree
## Problem Description
Given a rooted tree with the root at vertex $ 1 $ . For any vertex $ i $ ( $ 1 < i \leq n $ ) in the tree, there is an edge connecting vertices $ i $ and $ p_i $ ( $ 1 \leq p_i < i $ ), with a weight equal to $ t_i $ .
Iris does not know the values of $ t_i $ , but she know... |
2006 | A | Iris and Game on the Tree | ["constructive algorithms", "dfs and similar", "games", "graphs", "greedy", "trees"] | 1700 | https://codeforces.com/problemset/problem/2006/A | 1725028500 | en | codeforces | # Iris and Game on the Tree
## Problem Description
Iris has a tree rooted at vertex $ 1 $ . Each vertex has a value of $ \mathtt 0 $ or $ \mathtt 1 $ .
Let's consider a leaf of the tree (the vertex $ 1 $ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the... |
2005 | E2 | Subtangle Game (Hard Version) | ["data structures", "dp", "games", "greedy", "implementation"] | 2500 | https://codeforces.com/problemset/problem/2005/E2 | 1726324500 | en | codeforces | # Subtangle Game (Hard Version)
## Problem Description
This is the hard version of the problem. The differences between the two versions are the constraints on all the variables. You can make hacks only if both versions of the problem are solved.
Tsovak and Narek are playing a game. They have an array $ a $ and a ma... |
2005 | E1 | Subtangle Game (Easy Version) | ["dp", "games", "greedy", "implementation"] | 2100 | https://codeforces.com/problemset/problem/2005/E1 | 1726324500 | en | codeforces | # Subtangle Game (Easy Version)
## Problem Description
This is the easy version of the problem. The differences between the two versions are the constraints on all the variables. You can make hacks only if both versions of the problem are solved.
Tsovak and Narek are playing a game. They have an array $ a $ and a ma... |
2005 | D | Alter the GCD | ["binary search", "brute force", "data structures", "divide and conquer", "implementation", "number theory"] | 2400 | https://codeforces.com/problemset/problem/2005/D | 1726324500 | en | codeforces | # Alter the GCD
## Problem Description
You are given two arrays $ a_1, a_2, \ldots, a_n $ and $ b_1, b_2, \ldots, b_n $ .
You must perform the following operation exactly once:
- choose any indices $ l $ and $ r $ such that $ 1 \le l \le r \le n $ ;
- swap $ a_i $ and $ b_i $ for all $ i $ such that $ l \leq i \leq... |
2005 | C | Lazy Narek | ["dp", "implementation", "strings"] | 1800 | https://codeforces.com/problemset/problem/2005/C | 1726324500 | en | codeforces | # Lazy Narek
## Problem Description
Narek is too lazy to create the third problem of this contest. His friend Artur suggests that he should use ChatGPT. ChatGPT creates $ n $ problems, each consisting of $ m $ letters, so Narek has $ n $ strings. To make the problem harder, he combines the problems by selecting some ... |
2005 | B2 | The Strict Teacher (Hard Version) | ["binary search", "greedy", "math", "sortings"] | 1200 | https://codeforces.com/problemset/problem/2005/B2 | 1726324500 | en | codeforces | # The Strict Teacher (Hard Version)
## Problem Description
This is the hard version of the problem. The only differences between the two versions are the constraints on $ m $ and $ q $ . In this version, $ m, q \le 10^5 $ . You can make hacks only if both versions of the problem are solved.
Narek and Tsovak were bus... |
2005 | B1 | The Strict Teacher (Easy Version) | ["greedy", "math", "sortings"] | 1000 | https://codeforces.com/problemset/problem/2005/B1 | 1726324500 | en | codeforces | # The Strict Teacher (Easy Version)
## Problem Description
This is the easy version of the problem. The only differences between the two versions are the constraints on $ m $ and $ q $ . In this version, $ m=2 $ and $ q=1 $ . You can make hacks only if both versions of the problem are solved.
Narek and Tsovak were b... |
2005 | A | Simple Palindrome | ["combinatorics", "constructive algorithms", "greedy", "math"] | 900 | https://codeforces.com/problemset/problem/2005/A | 1726324500 | en | codeforces | # Simple Palindrome
## Problem Description
Narek has to spend 2 hours with some 2-year-old kids at the kindergarten. He wants to teach them competitive programming, and their first lesson is about palindromes.
Narek found out that the kids only know the vowels of the English alphabet (the letters $ \mathtt{a} $ , $ ... |
2004 | G | Substring Compression | ["data structures", "dp", "matrices"] | 3200 | https://codeforces.com/problemset/problem/2004/G | 1723732500 | en | codeforces | # Substring Compression
## Problem Description
Let's define the operation of compressing a string $ t $ , consisting of at least $ 2 $ digits from $ 1 $ to $ 9 $ , as follows:
- split it into an even number of non-empty substrings โ let these substrings be $ t_1, t_2, \dots, t_m $ (so, $ t = t_1 + t_2 + \dots + t_m ... |
2004 | F | Make a Palindrome | ["binary search", "brute force", "data structures", "greedy", "math"] | 2600 | https://codeforces.com/problemset/problem/2004/F | 1723732500 | en | codeforces | # Make a Palindrome
## Problem Description
You are given an array $ a $ consisting of $ n $ integers.
Let the function $ f(b) $ return the minimum number of operations needed to make an array $ b $ a palindrome. The operations you can make are:
- choose two adjacent elements $ b_i $ and $ b_{i+1} $ , remove them, a... |
2004 | E | Not a Nim Problem | ["brute force", "games", "math", "number theory"] | 2100 | https://codeforces.com/problemset/problem/2004/E | 1723732500 | en | codeforces | # Not a Nim Problem
## Problem Description
Two players, Alice and Bob, are playing a game. They have $ n $ piles of stones, with the $ i $ -th pile initially containing $ a_i $ stones.
On their turn, a player can choose any pile of stones and take any positive number of stones from it, with one condition:
- let the... |
2004 | D | Colored Portals | ["binary search", "brute force", "data structures", "graphs", "greedy", "implementation", "shortest paths"] | 1600 | https://codeforces.com/problemset/problem/2004/D | 1723732500 | en | codeforces | # Colored Portals
## Problem Description
There are $ n $ cities located on a straight line. The cities are numbered from $ 1 $ to $ n $ .
Portals are used to move between cities. There are $ 4 $ colors of portals: blue, green, red, and yellow. Each city has portals of two different colors. You can move from city $ i... |
2004 | C | Splitting Items | ["games", "greedy", "sortings"] | 1100 | https://codeforces.com/problemset/problem/2004/C | 1723732500 | en | codeforces | # Splitting Items
## Problem Description
Alice and Bob have $ n $ items they'd like to split between them, so they decided to play a game. All items have a cost, and the $ i $ -th item costs $ a_i $ . Players move in turns starting from Alice.
In each turn, the player chooses one of the remaining items and takes it.... |
2004 | B | Game with Doors | ["brute force", "greedy"] | 1000 | https://codeforces.com/problemset/problem/2004/B | 1723732500 | en | codeforces | # Game with Doors
## Problem Description
There are $ 100 $ rooms arranged in a row and $ 99 $ doors between them; the $ i $ -th door connects rooms $ i $ and $ i+1 $ . Each door can be either locked or unlocked. Initially, all doors are unlocked.
We say that room $ x $ is reachable from room $ y $ if all doors betwe... |
2004 | A | Closest Point | ["implementation", "math"] | 800 | https://codeforces.com/problemset/problem/2004/A | 1723732500 | en | codeforces | # Closest Point
## Problem Description
Consider a set of points on a line. The distance between two points $ i $ and $ j $ is $ |i - j| $ .
The point $ i $ from the set is the closest to the point $ j $ from the set, if there is no other point $ k $ in the set such that the distance from $ j $ to $ k $ is strictly l... |
2003 | F | Turtle and Three Sequences | ["brute force", "data structures", "dp", "greedy", "math", "probabilities", "two pointers"] | 2800 | https://codeforces.com/problemset/problem/2003/F | 1724596500 | en | codeforces | # Turtle and Three Sequences
## Problem Description
Piggy gives Turtle three sequences $ a_1, a_2, \ldots, a_n $ , $ b_1, b_2, \ldots, b_n $ , and $ c_1, c_2, \ldots, c_n $ .
Turtle will choose a subsequence of $ 1, 2, \ldots, n $ of length $ m $ , let it be $ p_1, p_2, \ldots, p_m $ . The subsequence should satisfy... |
2003 | E2 | Turtle and Inversions (Hard Version) | ["brute force", "data structures", "divide and conquer", "dp", "greedy", "math", "two pointers"] | 2700 | https://codeforces.com/problemset/problem/2003/E2 | 1724596500 | en | codeforces | # Turtle and Inversions (Hard Version)
## Problem Description
This is a hard version of this problem. The differences between the versions are the constraint on $ m $ and $ r_i < l_{i + 1} $ holds for each $ i $ from $ 1 $ to $ m - 1 $ in the easy version. You can make hacks only if both versions of the problem are s... |
2003 | E1 | Turtle and Inversions (Easy Version) | ["brute force", "divide and conquer", "dp", "greedy", "math"] | 2600 | https://codeforces.com/problemset/problem/2003/E1 | 1724596500 | en | codeforces | # Turtle and Inversions (Easy Version)
## Problem Description
This is an easy version of this problem. The differences between the versions are the constraint on $ m $ and $ r_i < l_{i + 1} $ holds for each $ i $ from $ 1 $ to $ m - 1 $ in the easy version. You can make hacks only if both versions of the problem are ... |
2003 | D2 | Turtle and a MEX Problem (Hard Version) | ["dfs and similar", "dp", "graphs", "greedy", "implementation", "math"] | 2100 | https://codeforces.com/problemset/problem/2003/D2 | 1724596500 | en | codeforces | # Turtle and a MEX Problem (Hard Version)
## Problem Description
The two versions are different problems. In this version of the problem, you can't choose the same integer twice or more. You can make hacks only if both versions are solved.
One day, Turtle was playing with $ n $ sequences. Let the length of the $ i $... |
2003 | D1 | Turtle and a MEX Problem (Easy Version) | ["greedy", "math"] | 1500 | https://codeforces.com/problemset/problem/2003/D1 | 1724596500 | en | codeforces | # Turtle and a MEX Problem (Easy Version)
## Problem Description
The two versions are different problems. In this version of the problem, you can choose the same integer twice or more. You can make hacks only if both versions are solved.
One day, Turtle was playing with $ n $ sequences. Let the length of the $ i $ -... |
2003 | C | Turtle and Good Pairs | ["constructive algorithms", "greedy", "sortings", "strings"] | 1200 | https://codeforces.com/problemset/problem/2003/C | 1724596500 | en | codeforces | # Turtle and Good Pairs
## Problem Description
Turtle gives you a string $ s $ , consisting of lowercase Latin letters.
Turtle considers a pair of integers $ (i, j) $ ( $ 1 \le i < j \le n $ ) to be a pleasant pair if and only if there exists an integer $ k $ such that $ i \le k < j $ and both of the following two c... |
2003 | B | Turtle and Piggy Are Playing a Game 2 | ["games", "greedy", "sortings"] | 800 | https://codeforces.com/problemset/problem/2003/B | 1724596500 | en | codeforces | # Turtle and Piggy Are Playing a Game 2
## Problem Description
Turtle and Piggy are playing a game on a sequence. They are given a sequence $ a_1, a_2, \ldots, a_n $ , and Turtle goes first. Turtle and Piggy alternate in turns (so, Turtle does the first turn, Piggy does the second, Turtle does the third, etc.).
The ... |
2003 | A | Turtle and Good Strings | ["greedy", "strings"] | 800 | https://codeforces.com/problemset/problem/2003/A | 1724596500 | en | codeforces | # Turtle and Good Strings
## Problem Description
Turtle thinks a string $ s $ is a good string if there exists a sequence of strings $ t_1, t_2, \ldots, t_k $ ( $ k $ is an arbitrary integer) such that:
- $ k \ge 2 $ .
- $ s = t_1 + t_2 + \ldots + t_k $ , where $ + $ represents the concatenation operation. For examp... |
2002 | H | Counting 101 | ["greedy"] | 3500 | https://codeforces.com/problemset/problem/2002/H | 1723386900 | en | codeforces | # Counting 101
## Problem Description
It's been a long summer's day, with the constant chirping of cicadas and the heat which never seemed to end. Finally, it has drawn to a close. The showdown has passed, the gates are open, and only a gentle breeze is left behind.
Your predecessors had taken their final bow; it's ... |
2002 | G | Lattice Optimizing | ["bitmasks", "brute force", "hashing", "meet-in-the-middle"] | 3400 | https://codeforces.com/problemset/problem/2002/G | 1723386900 | en | codeforces | # Lattice Optimizing
## Problem Description
Consider a grid graph with $ n $ rows and $ n $ columns. Let the cell in row $ x $ and column $ y $ be $ (x,y) $ . There exists a directed edge from $ (x,y) $ to $ (x+1,y) $ , with non-negative integer value $ d_{x,y} $ , for all $ 1\le x < n, 1\le y \le n $ , and there als... |
2002 | F2 | Court Blue (Hard Version) | ["brute force", "dp", "math", "number theory"] | 2800 | https://codeforces.com/problemset/problem/2002/F2 | 1723386900 | en | codeforces | # Court Blue (Hard Version)
## Problem Description
This is the hard version of the problem. In this version, it is not guaranteed that $ n=m $ , and the time limit is higher. You can make hacks only if both versions of the problem are solved.
In the court of the Blue King, Lelle and Flamm are having a performance ma... |
2002 | F1 | Court Blue (Easy Version) | ["brute force", "dfs and similar", "dp", "math", "number theory"] | 2600 | https://codeforces.com/problemset/problem/2002/F1 | 1723386900 | en | codeforces | # Court Blue (Easy Version)
## Problem Description
This is the easy version of the problem. In this version, $ n=m $ and the time limit is lower. You can make hacks only if both versions of the problem are solved.
In the court of the Blue King, Lelle and Flamm are having a performance match. The match consists of se... |
2002 | E | Cosmic Rays | ["brute force", "data structures", "dp"] | 2300 | https://codeforces.com/problemset/problem/2002/E | 1723386900 | en | codeforces | # Cosmic Rays
## Problem Description
Given an array of integers $ s_1, s_2, \ldots, s_l $ , every second, cosmic rays will cause all $ s_i $ such that $ i=1 $ or $ s_i\neq s_{i-1} $ to be deleted simultaneously, and the remaining parts will be concatenated together in order to form the new array $ s_1, s_2, \ldots, s... |
2002 | D2 | DFS Checker (Hard Version) | ["binary search", "data structures", "dfs and similar", "graphs", "hashing", "trees"] | 2300 | https://codeforces.com/problemset/problem/2002/D2 | 1723386900 | en | codeforces | # DFS Checker (Hard Version)
## Problem Description
This is the hard version of the problem. In this version, you are given a generic tree and the constraints on $ n $ and $ q $ are higher. You can make hacks only if both versions of the problem are solved.
You are given a rooted tree consisting of $ n $ vertices. T... |
2002 | D1 | DFS Checker (Easy Version) | ["brute force", "data structures", "dfs and similar", "graphs", "hashing", "trees"] | 1900 | https://codeforces.com/problemset/problem/2002/D1 | 1723386900 | en | codeforces | # DFS Checker (Easy Version)
## Problem Description
This is the easy version of the problem. In this version, the given tree is a perfect binary tree and the constraints on $ n $ and $ q $ are lower. You can make hacks only if both versions of the problem are solved.
You are given a perfect binary tree $ ^\dagger $ ... |
2002 | C | Black Circles | ["brute force", "geometry", "greedy", "math"] | 1200 | https://codeforces.com/problemset/problem/2002/C | 1723386900 | en | codeforces | # Black Circles
## Problem Description
There are $ n $ circles on a two-dimensional plane. The $ i $ -th circle is centered at $ (x_i,y_i) $ . Initially, all circles have a radius of $ 0 $ .
The circles' radii increase at a rate of $ 1 $ unit per second.
You are currently at $ (x_s,y_s) $ ; your goal is to reach $ ... |
2002 | B | Removals Game | ["constructive algorithms", "games"] | 1000 | https://codeforces.com/problemset/problem/2002/B | 1723386900 | en | codeforces | # Removals Game
## Problem Description
Alice got a permutation $ a_1, a_2, \ldots, a_n $ of $ [1,2,\ldots,n] $ , and Bob got another permutation $ b_1, b_2, \ldots, b_n $ of $ [1,2,\ldots,n] $ . They are going to play a game with these arrays.
In each turn, the following events happen in order:
- Alice chooses eith... |
2002 | A | Distanced Coloring | ["constructive algorithms", "implementation", "math"] | 800 | https://codeforces.com/problemset/problem/2002/A | 1723386900 | en | codeforces | # Distanced Coloring
## Problem Description
You received an $ n\times m $ grid from a mysterious source. The source also gave you a magic positive integer constant $ k $ .
The source told you to color the grid with some colors, satisfying the following condition:
- If $ (x_1,y_1) $ , $ (x_2,y_2) $ are two distinct ... |
2001 | E2 | Deterministic Heap (Hard Version) | ["combinatorics", "dp", "trees"] | 2900 | https://codeforces.com/problemset/problem/2001/E2 | 1724164500 | en | codeforces | # Deterministic Heap (Hard Version)
## Problem Description
This is the hard version of the problem. The difference between the two versions is the definition of deterministic max-heap, time limit, and constraints on $ n $ and $ t $ . You can make hacks only if both versions of the problem are solved.
Consider a perf... |
2001 | E1 | Deterministic Heap (Easy Version) | ["combinatorics", "dp", "math", "trees"] | 2400 | https://codeforces.com/problemset/problem/2001/E1 | 1724164500 | en | codeforces | # Deterministic Heap (Easy Version)
## Problem Description
This is the easy version of the problem. The difference between the two versions is the definition of deterministic max-heap, time limit, and constraints on $ n $ and $ t $ . You can make hacks only if both versions of the problem are solved.
Consider a perf... |
2001 | D | Longest Max Min Subsequence | ["brute force", "constructive algorithms", "data structures", "greedy", "implementation"] | 1900 | https://codeforces.com/problemset/problem/2001/D | 1724164500 | en | codeforces | # Longest Max Min Subsequence
## Problem Description
You are given an integer sequence $ a_1, a_2, \ldots, a_n $ . Let $ S $ be the set of all possible non-empty subsequences of $ a $ without duplicate elements. Your goal is to find the longest sequence in $ S $ . If there are multiple of them, find the one that mini... |
2001 | C | Guess The Tree | ["binary search", "brute force", "dfs and similar", "divide and conquer", "dsu", "greedy", "interactive", "trees"] | 1500 | https://codeforces.com/problemset/problem/2001/C | 1724164500 | en | codeforces | # Guess The Tree
## Problem Description
This is an interactive problem.
Misuki has chosen a secret tree with $ n $ nodes, indexed from $ 1 $ to $ n $ , and asked you to guess it by using queries of the following type:
- "? a b" โ Misuki will tell you which node $ x $ minimizes $ |d(a,x) - d(b,x)| $ , where $ d(x,y)... |
2001 | B | Generate Permutation | ["constructive algorithms"] | 800 | https://codeforces.com/problemset/problem/2001/B | 1724164500 | en | codeforces | # Generate Permutation
## Problem Description
There is an integer sequence $ a $ of length $ n $ , where each element is initially $ -1 $ .
Misuki has two typewriters where the first one writes letters from left to right, with a pointer initially pointing to $ 1 $ , and another writes letters from right to left with... |
2001 | A | Make All Equal | ["greedy", "implementation"] | 800 | https://codeforces.com/problemset/problem/2001/A | 1724164500 | en | codeforces | # Make All Equal
## Problem Description
You are given a cyclic array $ a_1, a_2, \ldots, a_n $ .
You can perform the following operation on $ a $ at most $ n - 1 $ times:
- Let $ m $ be the current size of $ a $ , you can choose any two adjacent elements where the previous one is no greater than the latter one (In ... |
2000 | H | Ksyusha and the Loaded Set | ["binary search", "brute force", "data structures", "implementation"] | 2200 | https://codeforces.com/problemset/problem/2000/H | 1723560000 | en | codeforces | # Ksyusha and the Loaded Set
## Problem Description
Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $ n $ distinct integers $ a_1, a_2, \ldots, a_n $ .
The set will... |
2000 | G | Call During the Journey | ["binary search", "brute force", "graphs", "greedy", "shortest paths"] | 2100 | https://codeforces.com/problemset/problem/2000/G | 1723560000 | en | codeforces | # Call During the Journey
## Problem Description
You live in a city consisting of $ n $ intersections and $ m $ streets connecting some pairs of intersections. You can travel in either direction on each street. No two streets connect the same pair of intersections, and no street connects an intersection to itself. Yo... |
2000 | F | Color Rows and Columns | ["dp", "greedy", "implementation", "math"] | 1900 | https://codeforces.com/problemset/problem/2000/F | 1723560000 | en | codeforces | # Color Rows and Columns
## Problem Description
You have $ n $ rectangles, the $ i $ -th of which has a width of $ a_i $ and a height of $ b_i $ .
You can perform the following operation an unlimited number of times: choose a rectangle and a cell in it, and then color it.
Each time you completely color any row or c... |
2000 | E | Photoshoot for Gorillas | ["combinatorics", "data structures", "greedy", "math"] | 1400 | https://codeforces.com/problemset/problem/2000/E | 1723560000 | en | codeforces | # Photoshoot for Gorillas
## Problem Description
You really love gorillas, so you decided to organize a photoshoot for them. Gorillas live in the jungle. The jungle is represented as a grid of $ n $ rows and $ m $ columns. $ w $ gorillas agreed to participate in the photoshoot, and the gorilla with index $ i $ ( $ 1 ... |
2000 | D | Right Left Wrong | ["greedy", "implementation", "two pointers"] | 1200 | https://codeforces.com/problemset/problem/2000/D | 1723560000 | en | codeforces | # Right Left Wrong
## Problem Description
Vlad found a strip of $ n $ cells, numbered from left to right from $ 1 $ to $ n $ . In the $ i $ -th cell, there is a positive integer $ a_i $ and a letter $ s_i $ , where all $ s_i $ are either 'L' or 'R'.
Vlad invites you to try to score the maximum possible points by per... |
2000 | C | Numeric String Template | ["data structures", "strings"] | 1000 | https://codeforces.com/problemset/problem/2000/C | 1723560000 | en | codeforces | # Numeric String Template
## Problem Description
Kristina has an array $ a $ , called a template, consisting of $ n $ integers. She also has $ m $ strings, each consisting only of lowercase Latin letters. The strings are numbered from $ 1 $ to $ m $ . She wants to check which strings match the template.
A string $ s... |
2000 | B | Seating in a Bus | ["two pointers"] | 800 | https://codeforces.com/problemset/problem/2000/B | 1723560000 | en | codeforces | # Seating in a Bus
## Problem Description
In Berland, a bus consists of a row of $ n $ seats numbered from $ 1 $ to $ n $ . Passengers are advised to always board the bus following these rules:
- If there are no occupied seats in the bus, a passenger can sit in any free seat;
- Otherwise, a passenger should sit in a... |
2000 | A | Primary Task | ["implementation", "math", "strings"] | 800 | https://codeforces.com/problemset/problem/2000/A | 1723560000 | en | codeforces | # Primary Task
## Problem Description
Dmitry wrote down $ t $ integers on the board, and that is good. He is sure that he lost an important integer $ n $ among them, and that is bad.
The integer $ n $ had the form $ \text{10^x} $ ( $ x \ge 2 $ ), where the symbol ' $ \text{^} $ ' denotes exponentiation.. Something w... |
1999 | G2 | Ruler (hard version) | ["binary search", "interactive", "ternary search"] | 1700 | https://codeforces.com/problemset/problem/1999/G2 | 1722954900 | en | codeforces | # Ruler (hard version)
## Problem Description
This is the hard version of the problem. The only difference between the two versions is that in this version, you can make at most $ \mathbf{7} $ queries.
This is an interactive problem. If you are unsure how interactive problems work, then it is recommended to read [th... |
1999 | G1 | Ruler (easy version) | ["binary search", "interactive"] | 1500 | https://codeforces.com/problemset/problem/1999/G1 | 1722954900 | en | codeforces | # Ruler (easy version)
## Problem Description
This is the easy version of the problem. The only difference between the two versions is that in this version, you can make at most $ \mathbf{10} $ queries.
This is an interactive problem. If you are unsure how interactive problems work, then it is recommended to read [t... |
1999 | F | Expected Median | ["combinatorics", "math"] | 1500 | https://codeforces.com/problemset/problem/1999/F | 1722954900 | en | codeforces | # Expected Median
## Problem Description
Arul has a binary array $ ^{\text{โ}} $ $ a $ of length $ n $ .
He will take all subsequences $ ^{\text{โ }} $ of length $ k $ ( $ k $ is odd) of this array and find their median. $ ^{\text{โก}} $
What is the sum of all these values?
As this sum can be very large, output it m... |
1999 | E | Triple Operations | ["dp", "implementation", "math"] | 1300 | https://codeforces.com/problemset/problem/1999/E | 1722954900 | en | codeforces | # Triple Operations
## Problem Description
On the board Ivy wrote down all integers from $ l $ to $ r $ , inclusive.
In an operation, she does the following:
- pick two numbers $ x $ and $ y $ on the board, erase them, and in their place write the numbers $ 3x $ and $ \lfloor \frac{y}{3} \rfloor $ . (Here $ \lfloor... |
1999 | D | Slavic's Exam | ["greedy", "implementation", "strings"] | 1100 | https://codeforces.com/problemset/problem/1999/D | 1722954900 | en | codeforces | # Slavic's Exam
## Problem Description
Slavic has a very tough exam and needs your help in order to pass it. Here is the question he is struggling with:
There exists a string $ s $ , which consists of lowercase English letters and possibly zero or more "?".
Slavic is asked to change each "?" to a lowercase English ... |
1999 | C | Showering | ["greedy", "implementation"] | 800 | https://codeforces.com/problemset/problem/1999/C | 1722954900 | en | codeforces | # Showering
## Problem Description
As a computer science student, Alex faces a hard challenge โ showering. He tries to shower daily, but despite his best efforts there are always challenges. He takes $ s $ minutes to shower and a day only has $ m $ minutes!
He already has $ n $ tasks planned for the day. Task $ i $ ... |
1999 | B | Card Game | ["brute force", "constructive algorithms", "implementation"] | 1000 | https://codeforces.com/problemset/problem/1999/B | 1722954900 | en | codeforces | # Card Game
## Problem Description
Suneet and Slavic play a card game. The rules of the game are as follows:
- Each card has an integer value between $ 1 $ and $ 10 $ .
- Each player receives $ 2 $ cards which are face-down (so a player doesn't know their cards).
- The game is turn-based and consists exactly of two ... |
1999 | A | A+B Again? | ["implementation", "math"] | 800 | https://codeforces.com/problemset/problem/1999/A | 1722954900 | en | codeforces | # A+B Again?
## Problem Description
Given a two-digit positive integer $ n $ , find the sum of its digits.
## Input Format
The first line contains an integer $ t $ ( $ 1 \leq t \leq 90 $ ) โ the number of test cases.
The only line of each test case contains a single two-digit positive integer $ n $ ( $ 10 \leq n \... |
1998 | E2 | Eliminating Balls With Merging (Hard Version) | ["binary search", "brute force", "data structures", "divide and conquer", "greedy", "implementation"] | 2500 | https://codeforces.com/problemset/problem/1998/E2 | 1723300500 | en | codeforces | # Eliminating Balls With Merging (Hard Version)
## Problem Description
Drink water.
โ Sun Tzu, The Art of Becoming a Healthy Programmer
This is the hard version of the problem. The only difference is that $ x=1 $ in this version. You must solve both versions to be able to hack.
You are given two integers $ n $ a... |
1998 | E1 | Eliminating Balls With Merging (Easy Version) | ["binary search", "brute force", "data structures", "divide and conquer", "greedy"] | 2200 | https://codeforces.com/problemset/problem/1998/E1 | 1723300500 | en | codeforces | # Eliminating Balls With Merging (Easy Version)
## Problem Description
Drink water.
โ Sun Tzu, The Art of Becoming a Healthy Programmer
This is the easy version of the problem. The only difference is that $ x=n $ in this version. You must solve both versions to be able to hack.
You are given two integers $ n $ a... |
1998 | D | Determine Winning Islands in Race | ["data structures", "dp", "graphs", "greedy", "shortest paths"] | 2100 | https://codeforces.com/problemset/problem/1998/D | 1723300500 | en | codeforces | # Determine Winning Islands in Race
## Problem Description
MOOOOOOOOOOOOOOOOO
โ Bessie the Cow, The Art of Racing on Islands
Two of Farmer John's cows, Bessie and Elsie, are planning to race on $ n $ islands. There are $ n - 1 $ main bridges, connecting island $ i $ to island $ i + 1 $ for all $ 1 \leq i \leq n -... |
1998 | C | Perform Operations to Maximize Score | ["binary search", "brute force", "constructive algorithms", "greedy", "implementation"] | 1900 | https://codeforces.com/problemset/problem/1998/C | 1723300500 | en | codeforces | # Perform Operations to Maximize Score
## Problem Description
I see satyam343. I'm shaking. Please more median problems this time. I love those. Please satyam343 we believe in you.
โ satyam343's biggest fan
You are given an array $ a $ of length $ n $ and an integer $ k $ . You are also given a binary array $ b $... |
1998 | B | Minimize Equal Sum Subarrays | ["constructive algorithms", "math", "number theory"] | 1000 | https://codeforces.com/problemset/problem/1998/B | 1723300500 | en | codeforces | # Minimize Equal Sum Subarrays
## Problem Description
It is known that [Farmer John likes Permutations](https://usaco.org/index.php?page=viewproblem2&cpid=1421), but I like them too!
โ Sun Tzu, The Art of Constructing Permutations
You are given a permutation $ ^{\text{โ}} $ $ p $ of length $ n $ .
Find a permuta... |
1998 | A | Find K Distinct Points with Fixed Center | ["constructive algorithms", "implementation", "math"] | 800 | https://codeforces.com/problemset/problem/1998/A | 1723300500 | en | codeforces | # Find K Distinct Points with Fixed Center
## Problem Description
I couldn't think of a good title for this problem, so I decided to learn from LeetCode.
โ Sun Tzu, The Art of War
You are given three integers $ x_c $ , $ y_c $ , and $ k $ ( $ -100 \leq x_c, y_c \leq 100 $ , $ 1 \leq k \leq 1000 $ ).
You need to ... |
1997 | F | Chips on a Line | ["brute force", "combinatorics", "dp", "greedy", "math"] | 2700 | https://codeforces.com/problemset/problem/1997/F | 1722350100 | en | codeforces | # Chips on a Line
## Problem Description
You have $ n $ chips, and you are going to place all of them in one of $ x $ points, numbered from $ 1 $ to $ x $ . There can be multiple chips in each point.
After placing the chips, you can perform the following four operations (in any order, any number of times):
- choose... |
1997 | E | Level Up | ["binary search", "brute force", "data structures", "divide and conquer", "implementation"] | 2200 | https://codeforces.com/problemset/problem/1997/E | 1722350100 | en | codeforces | # Level Up
## Problem Description
Monocarp is playing a computer game. He starts the game being level $ 1 $ . He is about to fight $ n $ monsters, in order from $ 1 $ to $ n $ . The level of the $ i $ -th monster is $ a_i $ .
For each monster in the given order, Monocarp's encounter goes as follows:
- if Monocarp's... |
1997 | D | Maximize the Root | ["binary search", "dfs and similar", "dp", "greedy", "trees"] | 1500 | https://codeforces.com/problemset/problem/1997/D | 1722350100 | en | codeforces | # Maximize the Root
## Problem Description
You are given a rooted tree, consisting of $ n $ vertices. The vertices in the tree are numbered from $ 1 $ to $ n $ , and the root is the vertex $ 1 $ . The value $ a_i $ is written at the $ i $ -th vertex.
You can perform the following operation any number of times (possi... |
1997 | C | Even Positions | ["constructive algorithms", "data structures", "greedy"] | 1100 | https://codeforces.com/problemset/problem/1997/C | 1722350100 | en | codeforces | # Even Positions
## Problem Description
Monocarp had a regular bracket sequence $ s $ of length $ n $ ( $ n $ is even). He even came up with his own way to calculate its cost.
He knows that in a regular bracket sequence (RBS), each opening bracket is paired up with the corresponding closing bracket. So he decided to... |
1997 | B | Make Three Regions | ["constructive algorithms", "two pointers"] | 1100 | https://codeforces.com/problemset/problem/1997/B | 1722350100 | en | codeforces | # Make Three Regions
## Problem Description
There is a grid, consisting of $ 2 $ rows and $ n $ columns. Each cell of the grid is either free or blocked.
A free cell $ y $ is reachable from a free cell $ x $ if at least one of these conditions holds:
- $ x $ and $ y $ share a side;
- there exists a free cell $ z $ ... |
1997 | A | Strong Password | ["brute force", "implementation", "strings"] | 800 | https://codeforces.com/problemset/problem/1997/A | 1722350100 | en | codeforces | # Strong Password
## Problem Description
Monocarp's current password on Codeforces is a string $ s $ , consisting of lowercase Latin letters. Monocarp thinks that his current password is too weak, so he wants to insert exactly one lowercase Latin letter into the password to make it stronger. Monocarp can choose any l... |
1996 | G | Penacony | ["brute force", "data structures", "graphs", "greedy", "hashing"] | 2200 | https://codeforces.com/problemset/problem/1996/G | 1722004500 | en | codeforces | # Penacony
## Problem Description
On Penacony, The Land of the Dreams, there exists $ n $ houses and $ n $ roads. There exists a road between house $ i $ and $ i+1 $ for all $ 1 \leq i \leq n-1 $ and a road between house $ n $ and house $ 1 $ . All roads are bidirectional. However, due to the crisis on Penacony, the ... |
1996 | F | Bomb | ["binary search", "greedy", "math"] | 1900 | https://codeforces.com/problemset/problem/1996/F | 1722004500 | en | codeforces | # Bomb
## Problem Description
Sparkle gives you two arrays $ a $ and $ b $ of length $ n $ . Initially, your score is $ 0 $ . In one operation, you can choose an integer $ i $ and add $ a_i $ to your score. Then, you must set $ a_i $ = $ \max(0, a_i - b_i) $ .
You only have time to perform $ k $ operations before Sp... |
1996 | E | Decode | ["combinatorics", "data structures", "implementation", "math"] | 1600 | https://codeforces.com/problemset/problem/1996/E | 1722004500 | en | codeforces | # Decode
## Problem Description
In a desperate attempt to obtain your waifu favorite character, you have hacked into the source code of the game. After days of struggling, you finally find the binary string that encodes the gacha system of the game. In order to decode it, you must first solve the following problem.
... |
1996 | D | Fun | ["binary search", "brute force", "combinatorics", "math", "number theory"] | 1500 | https://codeforces.com/problemset/problem/1996/D | 1722004500 | en | codeforces | # Fun
## Problem Description
Counting is Fun!
โ satyam343
Given two integers $ n $ and $ x $ , find the number of triplets ( $ a,b,c $ ) of positive integers such that $ ab + ac + bc \le n $ and $ a + b + c \le x $ .
Note that order matters (e.g. ( $ 1, 1, 2 $ ) and ( $ 1, 2, 1 $ ) are treated as different) and ... |
1996 | C | Sort | ["dp", "greedy", "sortings", "strings"] | 1200 | https://codeforces.com/problemset/problem/1996/C | 1722004500 | en | codeforces | # Sort
## Problem Description
You are given two strings $ a $ and $ b $ of length $ n $ . Then, you are (forced against your will) to answer $ q $ queries.
For each query, you are given a range bounded by $ l $ and $ r $ . In one operation, you can choose an integer $ i $ ( $ l \leq i \leq r $ ) and set $ a_i = x $ ... |
1996 | B | Scale | ["greedy", "implementation"] | 800 | https://codeforces.com/problemset/problem/1996/B | 1722004500 | en | codeforces | # Scale
## Problem Description
Tina has a square grid with $ n $ rows and $ n $ columns. Each cell in the grid is either $ 0 $ or $ 1 $ .
Tina wants to reduce the grid by a factor of $ k $ ( $ k $ is a divisor of $ n $ ). To do this, Tina splits the grid into $ k \times k $ nonoverlapping blocks of cells such that e... |
1996 | A | Legs | ["binary search", "math", "ternary search"] | 800 | https://codeforces.com/problemset/problem/1996/A | 1722004500 | en | codeforces | # Legs
## Problem Description
It's another beautiful day on Farmer John's farm.
After Farmer John arrived at his farm, he counted $ n $ legs. It is known only chickens and cows live on the farm, and a chicken has $ 2 $ legs while a cow has $ 4 $ .
What is the minimum number of animals Farmer John can have on his fa... |
1995 | E2 | Let Me Teach You a Lesson (Hard Version) | ["data structures", "dp", "matrices", "two pointers"] | 2900 | https://codeforces.com/problemset/problem/1995/E2 | 1721745300 | en | codeforces | # Let Me Teach You a Lesson (Hard Version)
## Problem Description
This is the hard version of a problem. The only difference between an easy and a hard version is the constraints on $ t $ and $ n $ . You can make hacks only if both versions of the problem are solved.
Arthur is giving a lesson to his famous $ 2 n $ k... |
1995 | E1 | Let Me Teach You a Lesson (Easy Version) | ["2-sat", "data structures", "dp", "matrices", "two pointers"] | 2700 | https://codeforces.com/problemset/problem/1995/E1 | 1721745300 | en | codeforces | # Let Me Teach You a Lesson (Easy Version)
## Problem Description
This is the easy version of a problem. The only difference between an easy and a hard version is the constraints on $ t $ and $ n $ . You can make hacks only if both versions of the problem are solved.
Arthur is giving a lesson to his famous $ 2 n $ k... |
1995 | D | Cases | ["bitmasks", "brute force", "dp", "strings"] | 2300 | https://codeforces.com/problemset/problem/1995/D | 1721745300 | en | codeforces | # Cases
## Problem Description
You're a linguist studying a mysterious ancient language. You know that
1. Its words consist only of the first $ c $ letters of the Latin alphabet.
2. Each word has a case which can be unambiguously determined by its last letter (different letters correspond to different cases). For ex... |
1995 | C | Squaring | ["brute force", "constructive algorithms", "greedy", "implementation", "math", "number theory"] | 1800 | https://codeforces.com/problemset/problem/1995/C | 1721745300 | en | codeforces | # Squaring
## Problem Description
ikrpprpp found an array $ a $ consisting of integers. He likes justice, so he wants to make $ a $ fair โ that is, make it non-decreasing. To do that, he can perform an act of justice on an index $ 1 \le i \le n $ of the array, which will replace $ a_i $ with $ a_i ^ 2 $ (the element ... |
1995 | B2 | Bouquet (Hard Version) | ["binary search", "data structures", "greedy", "math", "sortings", "two pointers"] | 1700 | https://codeforces.com/problemset/problem/1995/B2 | 1721745300 | en | codeforces | # Bouquet (Hard Version)
## Problem Description
This is the hard version of the problem. The only difference is that in this version, instead of listing the number of petals for each flower, the number of petals and the quantity of flowers in the store is set for all types of flowers.
A girl is preparing for her bir... |
1995 | B1 | Bouquet (Easy Version) | ["binary search", "brute force", "greedy", "sortings", "two pointers"] | 1100 | https://codeforces.com/problemset/problem/1995/B1 | 1721745300 | en | codeforces | # Bouquet (Easy Version)
## Problem Description
This is the easy version of the problem. The only difference is that in this version, the flowers are specified by enumeration.
A girl is preparing for her birthday and wants to buy the most beautiful bouquet. There are a total of $ n $ flowers in the store, each of wh... |
1995 | A | Diagonals | ["brute force", "greedy", "implementation", "math"] | 800 | https://codeforces.com/problemset/problem/1995/A | 1721745300 | en | codeforces | # Diagonals
## Problem Description
Vitaly503 is given a checkered board with a side of $ n $ and $ k $ chips. He realized that all these $ k $ chips need to be placed on the cells of the board (no more than one chip can be placed on a single cell).
Let's denote the cell in the $ i $ -th row and $ j $ -th column as $... |
1994 | H | Fortnite | ["combinatorics", "constructive algorithms", "games", "greedy", "hashing", "interactive", "math", "number theory", "strings"] | 3500 | https://codeforces.com/problemset/problem/1994/H | 1721313300 | en | codeforces | # Fortnite
## Problem Description
This is an interactive problem!
Timofey is writing a competition called Capture the Flag (or CTF for short). He has one task left, which involves hacking a security system. The entire system is based on polynomial hashes $ ^{\text{โ}} $ .
Timofey can input a string consisting of lo... |
1994 | G | Minecraft | ["bitmasks", "brute force", "dp", "graphs", "math"] | 2600 | https://codeforces.com/problemset/problem/1994/G | 1721313300 | en | codeforces | # Minecraft
## Problem Description
After winning another Bed Wars game, Masha and Olya wanted to relax and decided to play a new game. Masha gives Olya an array $ a $ of length $ n $ and a number $ s $ . Now Olya's task is to find a non-negative number $ x $ such that $ \displaystyle\sum_{i=1}^{n} a_i \oplus x = s $ ... |
1994 | F | Stardew Valley | ["constructive algorithms", "dfs and similar", "graphs", "trees"] | 2500 | https://codeforces.com/problemset/problem/1994/F | 1721313300 | en | codeforces | # Stardew Valley
## Problem Description
Pelican Town represents $ n $ houses connected by $ m $ bidirectional roads. Some roads have NPCs standing on them. Farmer Buba needs to walk on each road with an NPC and talk to them.
Help the farmer find a route satisfying the following properties:
- The route starts at som... |
1994 | E | Wooden Game | ["bitmasks", "greedy", "math", "trees"] | 2000 | https://codeforces.com/problemset/problem/1994/E | 1721313300 | en | codeforces | # Wooden Game
## Problem Description
You are given a forest of $ k $ rooted trees $ ^{\text{โ}} $ . Lumberjack Timofey wants to cut down the entire forest by applying the following operation:
- Select a subtree $ ^{\text{โ }} $ of any vertex of one of the trees and remove it from the tree.
Timofey loves bitwise oper... |
1994 | D | Funny Game | ["constructive algorithms", "dsu", "graphs", "greedy", "math", "number theory", "trees"] | 1900 | https://codeforces.com/problemset/problem/1994/D | 1721313300 | en | codeforces | # Funny Game
## Problem Description
Vanya has a graph with $ n $ vertices (numbered from $ 1 $ to $ n $ ) and an array $ a $ of $ n $ integers; initially, there are no edges in the graph. Vanya got bored, and to have fun, he decided to perform $ n - 1 $ operations.
Operation number $ x $ (operations are numbered in ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.