Problem ID stringlengths 2 6 | Problem Description stringlengths 0 7.52k | Rating float64 800 3.5k | math bool 2
classes | greedy bool 2
classes | implementation bool 2
classes | dp bool 2
classes | data structures bool 2
classes | constructive algorithms bool 2
classes | brute force bool 2
classes | binary search bool 2
classes | sortings bool 2
classes | graphs bool 2
classes | __index_level_0__ int64 3 9.98k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
100E | Problem - 100E - Codeforces =============== xa0 . The following line contains _n_ words. The _i_-th word describes the initial state of lamp number _i_ (see samples for details). The following line contains a single integer _k_ (1u2009≤u2009_k_u2009≤u2009104), the number of times a key is pressed. Then in the... | 1,600 | true | false | false | false | false | false | false | false | false | false | 9,485 |
834B | It's the end of Julyxa0– the time when a festive evening is held at Jelly Castle! Guests from all over the kingdom gather here to discuss new trends in the world of confectionery. Yet some of the things discussed here are not supposed to be disclosed to the general public: the information can cause discord in the kingd... | 1,100 | false | false | true | false | true | false | false | false | false | false | 6,428 |
1777A | An array $$$a$$$ is good if for all pairs of adjacent elements, $$$a_i$$$ and $$$a_{i+1}$$$ ($$$1le i lt n$$$) are of different parity. Note that an array of size $$$1$$$ is trivially good. You are given an array of size $$$n$$$. In one operation you can select any pair of adjacent elements in which both elements are o... | 800 | true | true | false | false | false | false | false | false | false | false | 1,614 |
632D | Problem - 632D - Codeforces =============== xa0 of its elements. Denote LCM as _l_. Find any longest subsequence of _a_ with the value _l_u2009≤u2009_m_. A subsequence of _a_ is an array we can get by erasing some elements of _a_. It is allowed to erase zero or all elements. The LCM of an empty array equals 1... | 2,100 | true | false | false | false | false | false | true | false | false | false | 7,278 |
1800E2 | This is a complex version of the problem. This version has no additional restrictions on the number $$$k$$$. The chief wizard of the Wizengamot once caught the evil wizard Drahyrt, but the evil wizard has returned and wants revenge on the chief wizard. So he stole spell $$$s$$$ from his student Harry. The spellxa0— is ... | 1,500 | false | true | false | false | false | true | true | false | false | true | 1,469 |
1863I | You are given a tree with $$$n$$$ vertices labeled $$$1, 2, ldots, n$$$. The length of a simple path in the tree is the number of vertices in it. You are to select a set of simple paths of length at least $$$2$$$ each, but you cannot simultaneously select two distinct paths contained one in another. Find the largest po... | 3,500 | false | false | false | true | false | true | false | false | false | false | 1,098 |
1578J | The Just Kingdom is ruled by a king and his $$$n$$$ lords, numbered $$$1$$$ to $$$n$$$. Each of the lords is a vassal of some overlord, who might be the king himself, or a different lord closer to the king. The king, and all his lords, are just and kind. Each lord has certain needs, which can be expressed as a certain ... | 3,100 | false | false | false | false | true | false | true | false | false | false | 2,745 |
506D | Mr. Kitayuta has just bought an undirected graph with _n_ vertices and _m_ edges. The vertices of the graph are numbered from 1 to _n_. Each edge, namely edge _i_, has a color _c__i_, connecting vertex _a__i_ and _b__i_. Mr. Kitayuta wants you to process the following _q_ queries. In the _i_-th query, he gives you two ... | 2,400 | false | false | false | false | false | false | true | false | false | true | 7,818 |
1059C | Problem - 1059C - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ... | 1,600 | true | false | false | false | false | true | false | false | false | false | 5,419 |
1523B | While trading on his favorite exchange trader William realized that he found a vulnerability. Using this vulnerability he could change the values of certain internal variables to his advantage. To play around he decided to change the values of all internal variables from $$$a_1, a_2, ldots, a_n$$$ to $$$-a_1, -a_2, ldo... | 1,100 | false | false | false | false | false | true | false | false | false | false | 3,049 |
613D | Meanwhile, the kingdom of K is getting ready for the marriage of the King's daughter. However, in order not to lose face in front of the relatives, the King should first finish reforms in his kingdom. As the King can not wait for his daughter's marriage, reforms must be finished as soon as possible. The kingdom current... | 2,800 | false | false | false | true | false | false | false | false | true | true | 7,384 |
847I | The Berland's capital has the form of a rectangle with sizes _n_u2009×u2009_m_ quarters. All quarters are divided into three types: regular (labeled with the character '.') — such quarters do not produce the noise but are not obstacles to the propagation of the noise; sources of noise (labeled with an uppercase Latin... | 1,900 | true | false | true | false | false | false | false | false | false | false | 6,363 |
1763D | You are given five integers $$$n$$$, $$$i$$$, $$$j$$$, $$$x$$$, and $$$y$$$. Find the number of bitonic permutations $$$B$$$, of the numbers $$$1$$$ to $$$n$$$, such that $$$B_i=x$$$, and $$$B_j=y$$$. Since the answer can be large, compute it modulo $$$10^9+7$$$. A bitonic permutation is a permutation of numbers, such ... | 2,200 | true | false | true | true | false | false | false | false | false | false | 1,730 |
1088A | Problem - 1088A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ... | 800 | false | false | false | false | false | true | true | false | false | false | 5,291 |
1167D | A string is called bracket sequence if it does not contain any characters other than "(" and ")". A bracket sequence is called regular (shortly, RBS) if it is possible to obtain correct arithmetic expression by inserting characters "+" and "1" into this sequence. For example, "", "(())" and "()()" are RBS and ")(" and ... | 1,500 | false | true | false | false | false | true | false | false | false | false | 4,880 |
1385D | You are given a string $$$s[1 dots n]$$$ consisting of lowercase Latin letters. It is guaranteed that $$$n = 2^k$$$ for some integer $$$k ge 0$$$. The string $$$s[1 dots n]$$$ is called $$$c$$$-good if at least one of the following three conditions is satisfied: The length of $$$s$$$ is $$$1$$$, and it consists of the... | 1,500 | false | false | true | true | false | false | true | false | false | false | 3,744 |
729A | Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string _s_ consisting of _n_ lowercase English letters. There is a filler word ogo in Oleg's speech. All words that can be obtained from ogo by adding go several times to the ... | 900 | false | false | true | false | false | false | false | false | false | false | 6,894 |
1368G | # Shifting Dominoes Input file: standard input Output file: standard output Time limit: 2 seconds Memory limit: 512 megabytes Bill likes to play with dominoes. He took an n × m board divided into equal square cells, and covered it with dominoes. Each domino covers two adjacent cells of the board either horizontally ... | 3,200 | false | false | false | false | true | false | false | false | false | true | 3,830 |
120F | One day mum asked Petya to sort his toys and get rid of some of them. Petya found a whole box of toy spiders. They were quite dear to him and the boy didn't want to throw them away. Petya conjured a cunning plan: he will glue all the spiders together and attach them to the ceiling. Besides, Petya knows that the lower t... | 1,400 | false | true | false | true | false | false | false | false | false | false | 9,401 |
1006C | You are given an array $$$d_1, d_2, dots, d_n$$$ consisting of $$$n$$$ integer numbers. Your task is to split this array into three parts (some of which may be empty) in such a way that each element of the array belongs to exactly one of the three parts, and each of the parts forms a consecutive contiguous subsegment (... | 1,200 | false | false | false | false | true | false | false | true | false | false | 5,653 |
2002B | 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 either the first or the last element of her ar... | 1,000 | false | false | false | false | false | true | false | false | false | false | 248 |
731F | Little Vlad is fond of popular computer game Bota-2. Recently, the developers announced the new add-on named Bota-3. Of course, Vlad immediately bought only to find out his computer is too old for the new game and needs to be updated. There are _n_ video cards in the shop, the power of the _i_-th video card is equal to... | 1,900 | true | false | true | false | true | false | true | false | false | false | 6,871 |
1332B | A positive integer is called composite if it can be represented as a product of two positive integers, both greater than $$$1$$$. For example, the following numbers are composite: $$$6$$$, $$$4$$$, $$$120$$$, $$$27$$$. The following numbers aren't: $$$1$$$, $$$2$$$, $$$3$$$, $$$17$$$, $$$97$$$. Alice is given a sequenc... | 1,400 | true | true | false | false | false | true | true | false | false | false | 4,049 |
1253F | You're given a simple, undirected, connected, weighted graph with $$$n$$$ nodes and $$$m$$$ edges. Nodes are numbered from $$$1$$$ to $$$n$$$. There are exactly $$$k$$$ centrals (recharge points), which are nodes $$$1, 2, ldots, k$$$. We consider a robot moving into this graph, with a battery of capacity $$$c$$$, not f... | 2,500 | false | false | false | false | false | false | false | true | false | true | 4,417 |
1060E | Sergey Semyonovich is a mayor of a county city N and he used to spend his days and nights in thoughts of further improvements of Nkers' lives. Unfortunately for him, anything and everything has been done already, and there are no more possible improvements he can think of during the day (he now prefers to sleep at nigh... | 2,000 | false | false | false | true | false | false | false | false | false | false | 5,412 |
1329E | There is a string of length $$$n+1$$$ of characters 'A' and 'B'. The first character and last character of the string are equal to 'A'. You are given $$$m$$$ indices $$$p_1, p_2, ldots, p_m$$$ ($$$0$$$-indexation) denoting the other indices of characters 'A' in the string. Let's denote the minimum distance between two ... | 3,300 | false | true | false | false | false | false | false | true | false | false | 4,061 |
772A | You have _n_ devices that you want to use simultaneously. The _i_-th device uses _a__i_ units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·_a__i_ units of power. The _i_-th device currently has _b__i_ units of power stored. All devices can store an arbitrary amount of powe... | 1,800 | true | false | false | false | false | false | false | true | false | false | 6,692 |
460D | Problem - 460D - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 2,300 | true | false | false | false | false | true | true | false | false | false | 7,998 |
1055B | Alice's hair is growing by leaps and bounds. Maybe the cause of it is the excess of vitamins, or maybe it is some black magic... To prevent this, Alice decided to go to the hairdresser. She wants for her hair length to be at most $$$l$$$ centimeters after haircut, where $$$l$$$ is her favorite number. Suppose, that the... | 1,300 | false | false | true | false | false | false | false | false | false | false | 5,438 |
1704C | There are $$$n$$$ houses numbered from $$$1$$$ to $$$n$$$ on a circle. For each $$$1 leq i leq n - 1$$$, house $$$i$$$ and house $$$i + 1$$$ are neighbours; additionally, house $$$n$$$ and house $$$1$$$ are also neighbours. Initially, $$$m$$$ of these $$$n$$$ houses are infected by a deadly virus. Each morning, Cirno c... | 1,200 | false | true | true | false | false | false | false | false | true | false | 2,053 |
1969C | You are given an integer array $$$a$$$ of length $$$n$$$. You can perform the following operation: choose an element of the array and replace it with any of its neighbor's value. For example, if $$$a=[3, 1, 2]$$$, you can get one of the arrays $$$[3, 3, 2]$$$, $$$[3, 2, 2]$$$ and $$$[1, 1, 2]$$$ using one operation, bu... | 1,700 | false | false | true | true | false | false | false | false | false | false | 490 |
231E | A connected undirected graph is called a vertex cactus, if each vertex of this graph belongs to at most one simple cycle. A simple cycle in a undirected graph is a sequence of distinct vertices _v_1,u2009_v_2,u2009...,u2009_v__t_ (_t_u2009>u20092), such that for any _i_ (1u2009≤u2009_i_u2009<u2009_t_) exists an edge be... | 2,100 | false | false | false | true | true | false | false | false | false | true | 8,912 |
1392E | This is an interactive problem. Omkar has just come across a duck! The duck is walking on a grid with $$$n$$$ rows and $$$n$$$ columns ($$$2 leq n leq 25$$$) so that the grid contains a total of $$$n^2$$$ cells. Let's denote by $$$(x, y)$$$ the cell in the $$$x$$$-th row from the top and the $$$y$$$-th column from the ... | 2,100 | true | false | false | false | false | true | false | false | false | false | 3,712 |
1558F | You have a permutation: an array $$$a = [a_1, a_2, ldots, a_n]$$$ of distinct integers from $$$1$$$ to $$$n$$$. The length of the permutation $$$n$$$ is odd. Consider the following algorithm of sorting the permutation in increasing order. A helper procedure of the algorithm, $$$f(i)$$$, takes a single argument $$$i$$$ ... | 3,300 | false | false | false | false | true | false | false | false | true | false | 2,837 |
41B | Problem - 41B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - so... | 1,400 | false | false | false | false | false | false | true | false | false | false | 9,783 |
1654E | You are given an array of integers $$$a_1, a_2, ldots, a_n$$$. You can do the following operation any number of times (possibly zero): Choose any index $$$i$$$ and set $$$a_i$$$ to any integer (positive, negative or $$$0$$$). What is the minimum number of operations needed to turn $$$a$$$ into an arithmetic progressio... | 2,300 | true | false | false | false | true | false | true | false | false | true | 2,358 |
1850A | Suneet has three digits $$$a$$$, $$$b$$$, and $$$c$$$. Since math isn't his strongest point, he asks you to determine if you can choose any two digits to make a sum greater or equal to $$$10$$$. Output "YES" if there is such a pair, and "NO" otherwise. Input The first line contains a single integer $$$t$$$ ($$$1 leq t ... | 800 | false | false | true | false | false | false | false | false | true | false | 1,182 |
1660E | You are given a binary matrix $$$A$$$ of size $$$n imes n$$$. Rows are numbered from top to bottom from $$$1$$$ to $$$n$$$, columns are numbered from left to right from $$$1$$$ to $$$n$$$. The element located at the intersection of row $$$i$$$ and column $$$j$$$ is called $$$A_{ij}$$$. Consider a set of $$$4$$$ operat... | 1,600 | false | true | true | false | false | true | true | false | false | false | 2,322 |
1904B | You are given an array $$$a$$$ of $$$n$$$ positive integers and a score. If your score is greater than or equal to $$$a_i$$$, then you can increase your score by $$$a_i$$$ and remove $$$a_i$$$ from the array. For each index $$$i$$$, output the maximum number of additional array elements that you can remove if you remov... | 1,100 | false | true | false | true | false | false | false | true | true | false | 889 |
1167G | So we got bored and decided to take our own guess at how would "Inception" production go if the budget for the film had been terribly low. The first scene we remembered was the one that features the whole city bending onto itself: It feels like it will require high CGI expenses, doesn't it? Luckily, we came up with a s... | 3,100 | false | false | false | false | false | false | true | false | false | false | 4,877 |
335A | Piegirl is buying stickers for a project. Stickers come on sheets, and each sheet of stickers contains exactly _n_ stickers. Each sticker has exactly one character printed on it, so a sheet of stickers can be described by a string of length _n_. Piegirl wants to create a string _s_ using stickers. She may buy as many s... | 1,400 | false | true | false | false | false | true | false | true | false | false | 8,498 |
207A3 | The Smart Beaver from ABBYY has once again surprised us! He has developed a new calculating device, which he called the "Beaver's Calculator 1.0". It is very peculiar and it is planned to be used in a variety of scientific problems. To test it, the Smart Beaver invited _n_ scientists, numbered from 1 to _n_. The _i_-th... | 2,000 | false | true | false | false | false | false | false | false | false | false | 9,018 |
464B | Peter had a cube with non-zero length of a side. He put the cube into three-dimensional space in such a way that its vertices lay at integer points (it is possible that the cube's sides are not parallel to the coordinate axes). Then he took a piece of paper and wrote down eight lines, each containing three integers — c... | 2,000 | false | false | false | false | false | false | true | false | false | false | 7,983 |
126D | Fibonacci numbers have the following form: _F_1u2009=u20091,u2009 _F_2u2009=u20092,u2009 _F__i_u2009=u2009_F__i_u2009-u20091u2009+u2009_F__i_u2009-u20092,u2009_i_u2009>u20092. Let's consider some non-empty set _S_u2009=u2009{_s_1,u2009_s_2,u2009...,u2009_s__k_}, consisting of different Fibonacci numbers. Let's find the... | 2,300 | true | false | false | true | false | false | false | false | false | false | 9,374 |
1890A | An array $$$b_1, b_2, ldots, b_n$$$ of positive integers is good if all the sums of two adjacent elements are equal to the same value. More formally, the array is good if there exists a $$$k$$$ such that $$$b_1 + b_2 = b_2 + b_3 = ldots = b_{n-1} + b_n = k$$$. Doremy has an array $$$a$$$ of length $$$n$$$. Now Doremy c... | 800 | false | false | false | false | false | true | false | false | false | false | 959 |
1611E2 | The only difference with E1 is the question of the problem. Vlad built a maze out of $$$n$$$ rooms and $$$n-1$$$ bidirectional corridors. From any room $$$u$$$ any other room $$$v$$$ can be reached through a sequence of corridors. Thus, the room system forms an undirected tree. Vlad invited $$$k$$$ friends to play a ga... | 1,900 | false | true | false | true | false | false | false | false | false | false | 2,586 |
1904C | You are given an array $$$a$$$ of $$$n$$$ positive integers. In one operation, you must pick some $$$(i, j)$$$ such that $$$1leq i < jleq a$$$ and append $$$a_i - a_j$$$ to the end of the $$$a$$$ (i.e. increase $$$n$$$ by $$$1$$$ and set $$$a_n$$$ to $$$a_i - a_j$$$). Your task is to minimize and print the minimum valu... | 1,400 | false | false | false | false | true | false | true | true | true | false | 888 |
474F | Mole is hungry again. He found one ant colony, consisting of _n_ ants, ordered in a row. Each ant _i_ (1u2009≤u2009_i_u2009≤u2009_n_) has a strength _s__i_. In order to make his dinner more interesting, Mole organizes a version of «Hunger Games» for the ants. He chooses two numbers _l_ and _r_ (1u2009≤u2009_l_u2009≤u20... | 2,100 | true | false | false | false | true | false | false | false | false | false | 7,935 |
1408D | There are $$$n$$$ robbers at coordinates $$$(a_1, b_1)$$$, $$$(a_2, b_2)$$$, ..., $$$(a_n, b_n)$$$ and $$$m$$$ searchlight at coordinates $$$(c_1, d_1)$$$, $$$(c_2, d_2)$$$, ..., $$$(c_m, d_m)$$$. In one move you can move each robber to the right (increase $$$a_i$$$ of each robber by one) or move each robber up (increa... | 2,000 | false | false | true | true | true | false | true | true | true | false | 3,633 |
1625E1 | This is the easy version of the problem. The only difference between the easy and the hard versions are removal queries, they are present only in the hard version. "Interplanetary Software, Inc." together with "Robots of Cydonia, Ltd." has developed and released robot cats. These electronic pets can meow, catch mice an... | 2,500 | false | false | false | true | true | false | true | false | false | true | 2,489 |
225A | A dice is a cube, its faces contain distinct integers from 1 to 6 as black points. The sum of numbers at the opposite dice faces always equals 7. Please note that there are only two dice (these dices are mirror of each other) that satisfy the given constraints (both of them are shown on the picture on the left). Alice ... | 1,100 | false | true | false | false | false | true | false | false | false | false | 8,940 |
1463D | You have $$$2n$$$ integers $$$1, 2, dots, 2n$$$. You have to redistribute these $$$2n$$$ elements into $$$n$$$ pairs. After that, you choose $$$x$$$ pairs and take minimum elements from them, and from the other $$$n - x$$$ pairs, you take maximum elements. Your goal is to obtain the set of numbers $$${b_1, b_2, dots, b... | 1,900 | false | true | false | false | false | true | false | true | false | false | 3,370 |
453D | The Elements of Harmony are six supernatural artifacts representing subjective aspects of harmony. They are arguably the most powerful force in Equestria. The inside of Elements of Harmony can be seen as a complete graph with _n_ vertices labeled from 0 to _n_u2009-u20091, where _n_ is a power of two, equal to 2_m_. Th... | 3,000 | false | false | false | true | false | false | false | false | false | false | 8,023 |
673B | There are _n_ problems prepared for the next Codeforces round. They are arranged in ascending order by their difficulty, and no two problems have the same difficulty. Moreover, there are _m_ pairs of similar problems. Authors want to split problems between two division according to the following rules: Problemset of e... | 1,300 | false | true | true | false | false | false | false | false | false | false | 7,132 |
1823A | Consider an array $$$a_1, a_2, dots, a_n$$$ consisting of numbers $$$1$$$ and $$$-1$$$. Define $$$A$$$-characteristic of this array as a number of pairs of indices $$$1 le i < j le n$$$, such that $$$a_i cdot a_j = 1$$$. Find any array $$$a$$$ with given length $$$n$$$ with $$$A$$$-characteristic equal to the given val... | 800 | true | false | false | false | false | true | false | false | false | false | 1,343 |
1038D | There are $$$n$$$ slimes in a row. Each slime has an integer value (possibly negative or zero) associated with it. Any slime can eat its adjacent slime (the closest slime to its left or to its right, assuming that this slime exists). When a slime with a value $$$x$$$ eats a slime with a value $$$y$$$, the eaten slime d... | 1,800 | false | true | true | true | false | false | false | false | false | false | 5,505 |
1012B | Innopolis University scientists continue to investigate the periodic table. There are _n_·_m_ known elements and they form a periodic table: a rectangle with _n_ rows and _m_ columns. Each element can be described by its coordinates (_r_,u2009_c_) (1u2009≤u2009_r_u2009≤u2009_n_, 1u2009≤u2009_c_u2009≤u2009_m_) in the ta... | 1,900 | false | false | false | false | false | true | false | false | false | true | 5,626 |
1184A2 | Problem - 1184A2 - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you -... | 2,100 | false | false | false | false | false | false | true | false | false | false | 4,793 |
1073B | Vasya has got $$$n$$$ books, numbered from $$$1$$$ to $$$n$$$, arranged in a stack. The topmost book has number $$$a_1$$$, the next one — $$$a_2$$$, and so on. The book at the bottom of the stack has number $$$a_n$$$. All numbers are distinct. Vasya wants to move all the books to his backpack in $$$n$$$ steps. During $... | 1,000 | true | false | true | false | false | false | false | false | false | false | 5,352 |
1270G | You are given $$$n$$$ integers $$$a_1, a_2, dots, a_n$$$, such that for each $$$1le i le n$$$ holds $$$i-nle a_ile i-1$$$. Find some nonempty subset of these integers, whose sum is equal to $$$0$$$. It can be shown that such a subset exists under given constraints. If there are several possible subsets with zero-sum, y... | 2,700 | true | false | false | false | false | true | false | false | false | true | 4,338 |
499A | You have decided to watch the best moments of some movie. There are two buttons on your player: 1. Watch the current minute of the movie. By pressing this button, you watch the current minute of the movie and the player automatically proceeds to the next minute of the movie. 2. Skip exactly _x_ minutes of the movie (_x... | 1,000 | false | true | true | false | false | false | false | false | false | false | 7,839 |
549D | The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept. Let's consider a rectangular image that is represente... | 1,900 | false | true | true | false | false | false | false | false | false | false | 7,642 |
1829H | Sadly, the problem setter couldn't think of an interesting story, thus he just asks you to solve the following problem. Given an array $$$a$$$ consisting of $$$n$$$ positive integers, count the number of non-empty subsequences for which the bitwise $$$mathsf{AND}$$$ of the elements in the subsequence has exactly $$$k$$... | 1,700 | true | false | false | true | false | false | false | false | false | false | 1,307 |
825D | You are given two strings _s_ and _t_ consisting of small Latin letters, string _s_ can also contain '?' characters. Suitability of string _s_ is calculated by following metric: Any two letters can be swapped positions, these operations can be performed arbitrary number of times over any pair of positions. Among all re... | 1,500 | false | true | true | false | false | false | false | true | false | false | 6,459 |
143B | For some time the program of rounding numbers that had been developed by the Codeforces participants during one of the previous rounds, helped the citizens of Far Far Away to convert numbers into a more easily readable format. However, as time went by, the economy of the Far Far Away developed and the scale of operatio... | 1,200 | false | false | true | false | false | false | false | false | false | false | 9,301 |
1027F | Problem - 1027F - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ... | 2,400 | false | false | false | false | false | false | false | true | false | true | 5,571 |
2035F | This really says a lot about our society. One day, a turtle gives you a tree with $$$n$$$ nodes rooted at node $$$x$$$. Each node has an initial nonnegative value; the $$$i$$$-th node has starting value $$$a_i$$$. You want to make the values of all nodes equal to $$$0$$$. To do so, you will perform a series of operatio... | 2,500 | false | false | false | true | false | false | true | true | false | false | 56 |
814D | The crowdedness of the discotheque would never stop our friends from having fun, but a bit more spaciousness won't hurt, will it? The discotheque can be seen as an infinite _xy_-plane, in which there are a total of _n_ dancers. Once someone starts moving around, they will move only inside their own movement range, whic... | 2,000 | false | true | false | true | false | false | false | false | false | false | 6,502 |
545A | Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph. There are _n_ toy cars. Each pair collides. The result of a collision can be one of the following: no car turned over, one car turned... | 900 | false | false | true | false | false | false | false | false | false | false | 7,662 |
2018A | You have some cards. An integer between $$$1$$$ and $$$n$$$ is written on each card: specifically, for each $$$i$$$ from $$$1$$$ to $$$n$$$, you have $$$a_i$$$ cards which have the number $$$i$$$ written on them. There is also a shop which contains unlimited cards of each type. You have $$$k$$$ coins, so you can buy at... | 1,600 | true | true | true | false | false | false | true | false | false | false | 163 |
771C | A tree is an undirected connected graph without cycles. The distance between two vertices is the number of edges in a simple path between them. Limak is a little polar bear. He lives in a tree that consists of _n_ vertices, numbered 1 through _n_. Limak recently learned how to jump. He can jump from a vertex to any ver... | 2,100 | false | false | false | true | false | false | false | false | false | false | 6,696 |
1768F | You are given an array of positive integers $$$a_1,a_2,ldots,a_n$$$ of length $$$n$$$. In one operation you can jump from index $$$i$$$ to index $$$j$$$ ($$$1 le i le j le n$$$) by paying $$$min(a_i, a_{i + 1}, ldots, a_j) cdot (j - i)^2$$$ eris. For all $$$k$$$ from $$$1$$$ to $$$n$$$, find the minimum number of eris ... | 2,900 | false | true | false | true | false | false | false | false | false | false | 1,686 |
1768D | You are given a permutation$$$^dagger$$$ $$$p$$$ of length $$$n$$$. In one operation, you can choose two indices $$$1 le i < j le n$$$ and swap $$$p_i$$$ with $$$p_j$$$. Find the minimum number of operations needed to have exactly one inversion$$$^ddagger$$$ in the permutation. $$$^dagger$$$ A permutation is an array c... | 1,800 | false | true | false | false | false | true | false | false | false | true | 1,688 |
895D | At the Byteland State University marks are strings of the same length. Mark _x_ is considered better than _y_ if string _y_ is lexicographically smaller than _x_. Recently at the BSU was an important test work on which Vasya recived the mark _a_. It is very hard for the teacher to remember the exact mark of every stude... | 2,100 | true | false | false | false | false | false | false | false | false | false | 6,167 |
453E | Lord Tirek is a centaur and the main antagonist in the season four finale episodes in the series "My Little Pony: Friendship Is Magic". In "Twilight's Kingdom" (Part 1), Tirek escapes from Tartarus and drains magic from ponies to grow stronger. The core skill of Tirek is called Absorb Mana. It takes all mana from a mag... | 3,100 | false | false | false | false | true | false | false | false | false | false | 8,022 |
746C | The tram in Berland goes along a straight line from the point 0 to the point _s_ and back, passing 1 meter per _t_1 seconds in both directions. It means that the tram is always in the state of uniform rectilinear motion, instantly turning around at points _x_u2009=u20090 and _x_u2009=u2009_s_. Igor is at the point _x_1... | 1,600 | true | false | true | false | false | true | false | false | false | false | 6,815 |
1316B | Vasya has a string $$$s$$$ of length $$$n$$$. He decides to make the following modification to the string: 1. Pick an integer $$$k$$$, ($$$1 leq k leq n$$$). 2. For $$$i$$$ from $$$1$$$ to $$$n-k+1$$$, reverse the substring $$$s[i:i+k-1]$$$ of $$$s$$$. For example, if string $$$s$$$ is qwer and $$$k = 2$$$, below is th... | 1,400 | false | false | true | false | false | true | true | false | true | false | 4,120 |
161E | Polycarpus has _t_ safes. The password for each safe is a square matrix consisting of decimal digits '0' ... '9' (the sizes of passwords to the safes may vary). Alas, Polycarpus has forgotten all passwords, so now he has to restore them. Polycarpus enjoys prime numbers, so when he chose the matrix passwords, he wrote a... | 2,500 | false | false | false | true | false | false | true | false | false | false | 9,226 |
767C | Once at New Year Dima had a dream in which he was presented a fairy garland. A garland is a set of lamps, some pairs of which are connected by wires. Dima remembered that each two lamps in the garland were connected directly or indirectly via some wires. Furthermore, the number of wires was exactly one less than the nu... | 2,000 | false | true | false | false | false | false | false | false | false | true | 6,716 |
1528E | Today is Mashtali's birthday! He received a Hagh tree from Haj Davood as his birthday present! A directed tree is called a Hagh tree iff: The length of the longest directed path in it is exactly $$$n$$$. Every vertex has at most three edges attached to it independent of their orientation. Let's call vertices $$$u$$$... | 2,900 | false | false | false | true | false | false | false | false | false | false | 3,019 |
1973D | This is an interactive problem. Fox gave Cat two positive integers $$$n$$$ and $$$k$$$. She has a hidden array $$$a_1, ldots , a_n$$$ of length $$$n$$$, such that $$$1 leq a_i leq n$$$ for every $$$i$$$. Now they are going to play the following game: For any two integers $$$l, r$$$ such that $$$1 leq l leq r leq n$$$, ... | 2,400 | true | false | false | false | false | false | true | false | false | false | 452 |
639E | Limak is a big polar bear. He prepared _n_ problems for an algorithmic contest. The _i_-th problem has initial score _p__i_. Also, testers said that it takes _t__i_ minutes to solve the _i_-th problem. Problems aren't necessarily sorted by difficulty and maybe harder problems have smaller initial score but it's too lat... | 2,800 | true | true | false | false | false | false | false | true | true | false | 7,253 |
1311C | You want to perform the combo on your opponent in one popular fighting game. The combo is the string $$$s$$$ consisting of $$$n$$$ lowercase Latin letters. To perform the combo, you have to press all buttons in the order they appear in $$$s$$$. I.e. if $$$s=$$$"abca" then you have to press 'a', then 'b', 'c' and 'a' ag... | 1,300 | false | false | false | false | false | false | true | false | false | false | 4,141 |
1768E | Consider a permutation$$$^dagger$$$ $$$p$$$ of length $$$3n$$$. Each time you can do one of the following operations: Sort the first $$$2n$$$ elements in increasing order. Sort the last $$$2n$$$ elements in increasing order. We can show that every permutation can be made sorted in increasing order using only these op... | 2,300 | true | false | false | false | false | false | false | false | false | false | 1,687 |
1539B | Petya once wrote a sad love song and shared it to Vasya. The song is a string consisting of lowercase English letters. Vasya made up $$$q$$$ questions about this song. Each question is about a subsegment of the song starting from the $$$l$$$-th letter to the $$$r$$$-th letter. Vasya considers a substring made up from c... | 800 | false | false | true | true | false | false | false | false | false | false | 2,947 |
243D | One day Petya got a set of wooden cubes as a present from his mom. Petya immediately built a whole city from these cubes. The base of the city is an _n_u2009×u2009_n_ square, divided into unit squares. The square's sides are parallel to the coordinate axes, the square's opposite corners have coordinates (0,u20090) and ... | 2,700 | false | false | false | true | true | false | false | false | false | false | 8,860 |
457D | Problem - 457D - Codeforces =============== xa0 . A player begins by selecting a randomly generated bingo grid (generated uniformly among all available grids). Then _k_ distinct numbers between 1 and _m_ will be called at random (called uniformly among all available sets of _k_ numbers). For each called n... | 2,700 | true | false | false | false | false | false | false | false | false | false | 8,009 |
463B | Caisa solved the problem with the sugar and now he is on the way back to home. Caisa is playing a mobile game during his path. There are (_n_u2009+u20091) pylons numbered from 0 to _n_ in this game. The pylon with number 0 has zero height, the pylon with number _i_ (_i_u2009>u20090) has height _h__i_. The goal of the g... | 1,100 | true | false | true | false | false | false | true | false | false | false | 7,988 |
1118F2 | You are given an undirected tree of $$$n$$$ vertices. Some vertices are colored one of the $$$k$$$ colors, some are uncolored. It is guaranteed that the tree contains at least one vertex of each of the $$$k$$$ colors. There might be no uncolored vertices. You choose a subset of exactly $$$k - 1$$$ edges and remove it f... | 2,700 | false | false | false | true | false | false | false | false | false | false | 5,095 |
1872E | You are given an array of integers $$$a_1, a_2, ldots, a_n$$$, as well as a binary string$$$^{dagger}$$$ $$$s$$$ consisting of $$$n$$$ characters. Augustin is a big fan of data structures. Therefore, he asked you to implement a data structure that can answer $$$q$$$ queries. There are two types of queries: "1 $$$l$$$ ... | 1,500 | false | false | false | true | true | false | false | true | false | false | 1,047 |
1827F | You are given a permutation $$$a_1,a_2,ldots,a_n$$$ of the first $$$n$$$ positive integers. A subarray $$$[l,r]$$$ is called copium if we can rearrange it so that it becomes a sequence of consecutive integers, or more formally, if $$$$$$max(a_l,a_{l+1},ldots,a_r)-min(a_l,a_{l+1},ldots,a_r)=r-l$$$$$$ For each $$$k$$$ in... | 3,500 | false | true | false | false | true | true | false | false | false | false | 1,317 |
1505C | 1,400 | false | false | true | false | false | false | false | false | false | false | 3,150 | |
1625D | Binary Spiders are species of spiders that live on Mars. These spiders weave their webs to defend themselves from enemies. To weave a web, spiders join in pairs. If the first spider in pair has $$$x$$$ legs, and the second spider has $$$y$$$ legs, then they weave a web with durability $$$x oplus y$$$. Here, $$$oplus$$$... | 2,300 | true | false | true | false | true | false | false | false | true | false | 2,490 |
817D | Problem - 817D - Codeforces =============== xa0 , imbalance value is 0; | 1,900 | false | false | false | false | true | false | false | false | true | false | 6,490 |
1669A | Codeforces separates its users into $$$4$$$ divisions by their rating: For Division 1: $$$1900 leq mathrm{rating}$$$ For Division 2: $$$1600 leq mathrm{rating} leq 1899$$$ For Division 3: $$$1400 leq mathrm{rating} leq 1599$$$ For Division 4: $$$mathrm{rating} leq 1399$$$ Given a $$$mathrm{rating}$$$, print in whic... | 800 | false | false | true | false | false | false | false | false | false | false | 2,265 |
909D | You are given a set of points on a straight line. Each point has a color assigned to it. For point _a_, its neighbors are the points which don't have any other points between them and _a_. Each point has at most two neighbors - one from the left and one from the right. You perform a sequence of operations on this set o... | 2,100 | false | true | true | false | true | false | false | false | false | false | 6,109 |
1780D | This is an interactive problem. Kira has a hidden positive integer $$$n$$$, and Hayato needs to guess it. Initially, Kira gives Hayato the value $$$mathrm{cnt}$$$ — the number of unit bits in the binary notation of $$$n$$$. To guess $$$n$$$, Hayato can only do operations of one kind: choose an integer $$$x$$$ and subtr... | 1,800 | false | false | false | false | false | true | false | true | false | false | 1,592 |
1163D | During a normal walk in the forest, Katie has stumbled upon a mysterious code! However, the mysterious code had some characters unreadable. She has written down this code as a string $$$c$$$ consisting of lowercase English characters and asterisks ("*"), where each of the asterisks denotes an unreadable character. Exci... | 2,100 | false | false | false | true | false | false | false | false | false | false | 4,899 |
1218A | You are in charge of the BubbleReactor. It consists of $$$N$$$ BubbleCores connected with $$$N$$$ lines of electrical wiring. Each electrical wiring connects two distinct BubbleCores. There are no BubbleCores connected with more than one line of electrical wiring. Your task is to start the BubbleReactor by starting eac... | 2,800 | false | false | false | true | false | false | false | false | false | true | 4,584 |
1614A | Businessman Divan loves chocolate! Today he came to a store to buy some chocolate. Like all businessmen, Divan knows the value of money, so he will not buy too expensive chocolate. At the same time, too cheap chocolate tastes bad, so he will not buy it as well. The store he came to has $$$n$$$ different chocolate bars,... | 800 | false | true | false | false | false | true | true | false | false | false | 2,570 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.