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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
195B | Problem - 195B - 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... | 1,300 | true | false | true | false | true | false | false | false | false | false | 9,062 |
1749F | You are given a tree consisting of $$$n$$$ vertices. Initially, each vertex has a value $$$0$$$. You need to perform $$$m$$$ queries of two types: 1. You are given a vertex index $$$v$$$. Print the value of the vertex $$$v$$$. 2. You are given two vertex indices $$$u$$$ and $$$v$$$ and values $$$k$$$ and $$$d$$$ ($$$d ... | 2,800 | false | false | false | false | true | false | false | false | false | false | 1,786 |
70C | In Walrusland public transport tickets are characterized by two integers: by the number of the series and by the number of the ticket in the series. Let the series number be represented by _a_ and the ticket number β by _b_, then a ticket is described by the ordered pair of numbers (_a_,u2009_b_). The walruses believe ... | 2,200 | false | false | false | false | true | false | false | true | true | false | 9,619 |
840D | Problem - 840D - 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,500 | false | false | false | false | true | false | false | false | false | false | 6,400 |
1735A | Your working week consists of $$$n$$$ days numbered from $$$1$$$ to $$$n$$$, after day $$$n$$$ goes day $$$1$$$ again. And $$$3$$$ of them are days off. One of the days off is the last day, day $$$n$$$. You have to decide when the other two are. Choosing days off, you pursue two goals: No two days should go one after ... | 800 | true | true | false | false | false | true | false | false | false | false | 1,880 |
69D | Anton and Dasha like to play different games during breaks on checkered paper. By the 11th grade they managed to play all the games of this type and asked Vova the programmer to come up with a new game. Vova suggested to them to play a game under the code name "dot" with the following rules: On the checkered paper a c... | 1,900 | false | false | false | true | false | false | false | false | false | false | 9,623 |
1914F | BerSoft is the biggest IT corporation in Berland. There are $$$n$$$ employees at BerSoft company, numbered from $$$1$$$ to $$$n$$$. The first employee is the head of the company, and he does not have any superiors. Every other employee $$$i$$$ has exactly one direct superior $$$p_i$$$. Employee $$$x$$$ is considered to... | 1,900 | false | true | false | true | false | false | false | false | false | false | 813 |
66B | Little Petya often travels to his grandmother in the countryside. The grandmother has a large garden, which can be represented as a rectangle 1u2009Γu2009_n_ in size, when viewed from above. This rectangle is divided into _n_ equal square sections. The garden is very unusual as each of the square sections possesses its... | 1,100 | false | false | true | false | false | false | true | false | false | false | 9,640 |
1107G | Vasya got really tired of these credits (from problem F) and now wants to earn the money himself! He decided to make a contest to gain a profit. Vasya has $$$n$$$ problems to choose from. They are numbered from $$$1$$$ to $$$n$$$. The difficulty of the $$$i$$$-th problem is $$$d_i$$$. Moreover, the problems are given i... | 2,400 | false | false | false | true | true | true | false | true | false | false | 5,163 |
1324B | You are given an array $$$a$$$ consisting of $$$n$$$ integers. Your task is to determine if $$$a$$$ has some subsequence of length at least $$$3$$$ that is a palindrome. Recall that an array $$$b$$$ is called a subsequence of the array $$$a$$$ if $$$b$$$ can be obtained by removing some (possibly, zero) elements from $... | 1,100 | false | false | false | false | false | false | true | false | false | false | 4,098 |
1077F2 | The only difference between easy and hard versions is the constraints. Vova likes pictures with kittens. The news feed in the social network he uses can be represented as an array of $$$n$$$ consecutive pictures (with kittens, of course). Vova likes all these pictures, but some are more beautiful than the others: the $... | 2,100 | false | false | false | true | true | false | false | false | false | false | 5,331 |
1968E | Problem - 1968E - 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 | false | false | false | false | false | true | false | false | false | false | 496 |
1198D | Problem - 1198D - 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,300 | false | false | false | true | false | false | false | false | false | false | 4,706 |
1454B | There is a game called "Unique Bid Auction". You can read more about it here: (though you don't have to do it to solve this problem). Let's simplify this game a bit. Formally, there are $$$n$$$ participants, the $$$i$$$-th participant chose the number $$$a_i$$$. The winner of the game is such a participant that the num... | 800 | false | false | true | false | false | false | false | false | false | false | 3,407 |
1476B | You have a statistic of price changes for one product represented as an array of $$$n$$$ positive integers $$$p_0, p_1, dots, p_{n - 1}$$$, where $$$p_0$$$ is the initial price of the product and $$$p_i$$$ is how the price was increased during the $$$i$$$-th month. Using these price changes you are asked to calculate t... | 1,300 | true | true | false | false | false | false | true | true | false | false | 3,296 |
2004G | Problem - 2004G - 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 - ... | 3,200 | false | false | false | true | true | false | false | false | false | false | 225 |
1969E | You are given an integer array $$$a$$$ of length $$$n$$$. A subarray of $$$a$$$ is one of its contiguous subsequences (i.u2009e. an array $$$[a_l, a_{l+1}, dots, a_r]$$$ for some integers $$$l$$$ and $$$r$$$ such that $$$1 le l < r le n$$$). Let's call a subarray unique if there is an integer that occurs exactly once i... | 2,400 | false | true | false | true | true | false | false | true | false | false | 488 |
1774D | ChthollyNotaSeniorious received a special gift from AquaMoon: $$$n$$$ binary arrays of length $$$m$$$. AquaMoon tells him that in one operation, he can choose any two arrays and any position $$$pos$$$ from $$$1$$$ to $$$m$$$, and swap the elements at positions $$$pos$$$ in these arrays. He is fascinated with this game,... | 1,600 | false | true | true | false | false | true | true | false | false | false | 1,641 |
1023E | This is an interactive problem. Bob lives in a square grid of size $$$n imes n$$$, with rows numbered $$$1$$$ through $$$n$$$ from top to bottom, and columns numbered $$$1$$$ through $$$n$$$ from left to right. Every cell is either allowed or blocked, but you don't know the exact description of the grid. You are given... | 2,100 | false | false | false | false | false | true | false | false | false | false | 5,586 |
6E | There are several days left before the fiftieth birthday of a famous Berland's writer Berlbury. In this connection the local library decided to make an exposition of the works of this famous science-fiction writer. It was decided as well that it is necessary to include into the exposition only those books that were pub... | 1,900 | false | false | false | false | true | false | false | true | false | false | 9,961 |
75A | Problem - 75A - 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,000 | false | false | true | false | false | false | false | false | false | false | 9,591 |
172C | There is a bus stop near the university. The lessons are over, and _n_ students come to the stop. The _i_-th student will appear at the bus stop at time _t__i_ (all _t__i_'s are distinct). We shall assume that the stop is located on the coordinate axis _Ox_, at point _x_u2009=u20090, and the bus goes along the ray _Ox_... | 1,500 | false | false | true | false | false | false | false | false | true | false | 9,176 |
312A | One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ... | 1,100 | false | false | true | false | false | false | false | false | false | false | 8,597 |
1037B | You are given an array $$$a$$$ of $$$n$$$ integers and an integer $$$s$$$. It is guaranteed that $$$n$$$ is odd. In one operation you can either increase or decrease any single element by one. Calculate the minimum number of operations required to make the median of the array being equal to $$$s$$$. The median of the a... | 1,300 | false | true | false | false | false | false | false | false | false | false | 5,515 |
1863G | Problem - 1863G - 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,800 | true | false | false | true | false | false | false | false | false | true | 1,100 |
173D | The Trinitarian kingdom has exactly _n_u2009=u20093_k_ cities. All of them are located on the shores of river Trissisipi, which flows through the whole kingdom. Some of the cities are located on one side of the river, and all the rest are on the other side. Some cities are connected by bridges built between them. Each ... | 2,500 | false | true | true | false | false | true | false | false | false | true | 9,170 |
725A | In a new version of the famous Pinball game, one of the most important parts of the game field is a sequence of _n_ bumpers. The bumpers are numbered with integers from 1 to _n_ from left to right. There are two types of bumpers. They are denoted by the characters '<' and '>'. When the ball hits the bumper at position ... | 1,000 | false | false | true | false | false | false | false | false | false | false | 6,907 |
1188A2 | Note that this is the second problem of the two similar problems. You can hack this problem if you solve it. But you can hack the previous problem only if you solve both problems. You are given a tree with $$$n$$$ nodes. In the beginning, $$$0$$$ is written on all edges. In one operation, you can choose any $$$2$$$ dis... | 2,500 | false | false | true | false | false | true | false | false | false | false | 4,758 |
696F | Barney has finally found the one, a beautiful young lady named Lyanna. The problem is, Lyanna and Barney are trapped in Lord Loss' castle. This castle has shape of a convex polygon of _n_ points. Like most of castles in Demonata worlds, this castle has no ceiling. Barney and Lyanna have an escape plan, but it requires ... | 3,300 | false | false | false | false | false | false | false | true | false | false | 7,036 |
1787B | Given an integer $$$n$$$. Consider all pairs of integer arrays $$$a$$$ and $$$p$$$ of the same length such that $$$n = prod a_i^{p_i}$$$ (i.e. $$$a_1^{p_1}cdot a_2^{p_2}cdotldots$$$) ($$$a_i>1;p_i>0$$$) and $$$a_i$$$ is the product of some (possibly one) distinct prime numbers. For example, for $$$n = 28 = 2^2cdot 7^1 ... | 1,100 | true | true | false | false | false | false | false | false | false | false | 1,562 |
200C | Any resemblance to any real championship and sport is accidental. The Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal rules of the local championship: the team that kicked most balls in the enemy's goal area wins the game; the victory gives 3 ... | 1,800 | false | false | true | false | false | false | true | false | false | false | 9,042 |
500C | New Year is coming, and Jaehyun decided to read many books during 2015, unlike this year. He has _n_ books numbered by integers from 1 to _n_. The weight of the _i_-th (1u2009β€u2009_i_u2009β€u2009_n_) book is _w__i_. As Jaehyun's house is not large enough to have a bookshelf, he keeps the _n_ books by stacking them vert... | 1,600 | true | true | true | false | false | true | false | false | false | false | 7,835 |
1239B | This is a harder version of the problem. In this version, $$$n le 300,000$$$. Vasya is an experienced developer of programming competitions' problems. As all great minds at some time, Vasya faced a creative crisis. To improve the situation, Petya gifted him a string consisting of opening and closing brackets only. Pety... | 2,500 | false | false | true | false | false | false | false | false | false | false | 4,495 |
993B | Two participants are each given a pair of distinct numbers from 1 to 9 such that there's exactly one number that is present in both pairs. They want to figure out the number that matches by using a communication channel you have access to without revealing it to you. Both participants communicated to each other a set o... | 1,900 | false | false | false | false | false | false | true | false | false | false | 5,733 |
1910H | Problem - 1910H - Codeforces =============== xa0 ]( --- Finished β Languages The following languages are only available languages for the problems from the contest Kotlin Heroes: Episode 9 (Unrated, T-Shirts + Prizes!): Kotlin 1.7.20 Kotlin 1.9.21 β Virtual participation Virtual contest is a way to take par... | 2,400 | false | false | false | false | true | false | false | true | false | false | 840 |
304A | Problem - 304A - 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... | 1,200 | true | false | false | false | false | false | true | false | false | false | 8,618 |
298A | There is a straight snowy road, divided into _n_ blocks. The blocks are numbered from 1 to _n_ from left to right. If one moves from the _i_-th block to the (_i_u2009+u20091)-th block, he will leave a right footprint on the _i_-th block. Similarly, if one moves from the _i_-th block to the (_i_u2009-u20091)-th block, h... | 1,300 | false | true | true | false | false | false | false | false | false | false | 8,639 |
1635E | There are $$$n$$$ cars on a coordinate axis $$$OX$$$. Each car is located at an integer point initially and no two cars are located at the same point. Also, each car is oriented either left or right, and they can move at any constant positive speed in that direction at any moment. More formally, we can describe the $$$... | 2,200 | false | true | false | false | false | true | false | false | true | true | 2,436 |
1931B | There are $$$n$$$ containers of water lined up, numbered from left to right from $$$1$$$ to $$$n$$$. Each container can hold any amount of water; initially, the $$$i$$$-th container contains $$$a_i$$$ units of water. The sum of $$$a_i$$$ is divisible by $$$n$$$. You can apply the following operation any (possibly zero)... | 800 | false | true | false | false | false | false | false | false | false | false | 700 |
878E | A sequence of _n_ integers is written on a blackboard. Soon Sasha will come to the blackboard and start the following actions: let _x_ and _y_ be two adjacent numbers (_x_ before _y_), then he can remove them and write _x_u2009+u20092_y_ instead of them. He will perform these operations until one number is left. Sasha ... | 3,300 | false | false | false | true | false | false | false | false | false | false | 6,230 |
474C | Captain Marmot wants to prepare a huge and important battle against his enemy, Captain Snake. For this battle he has _n_ regiments, each consisting of 4 moles. Initially, each mole _i_ (1u2009β€u2009_i_u2009β€u20094_n_) is placed at some position (_x__i_,u2009_y__i_) in the Cartesian plane. Captain Marmot wants to move s... | 2,000 | false | false | false | false | false | false | true | false | false | false | 7,938 |
1849E | Problem - 1849E - 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,300 | false | false | false | true | true | false | false | true | false | false | 1,184 |
1157G | You are given a binary matrix $$$a$$$ of size $$$n imes m$$$. A binary matrix is a matrix where each element is either $$$0$$$ or $$$1$$$. You may perform some (possibly zero) operations with this matrix. During each operation you can inverse the row of this matrix or a column of this matrix. Formally, inverting a row... | 2,200 | false | false | false | false | false | true | true | false | false | false | 4,916 |
1794D | The prime factorization of a positive integer $$$m$$$ is the unique way to write it as $$$displaystyle m=p_1^{e_1}cdot p_2^{e_2}cdot ldots cdot p_k^{e_k}$$$, where $$$p_1, p_2, ldots, p_k$$$ are prime numbers, $$$p_1 < p_2 < ldots < p_k$$$ and $$$e_1, e_2, ldots, e_k$$$ are positive integers. For each positive integer ... | 1,900 | true | false | false | true | false | false | false | false | false | false | 1,511 |
357A | At the beginning of the school year Berland State University starts two city school programming groups, for beginners and for intermediate coders. The children were tested in order to sort them into groups. According to the results, each student got some score from 1 to _m_ points. We know that _c_1 schoolchildren got ... | 1,000 | false | true | true | false | false | false | true | false | false | false | 8,406 |
675C | There are _n_ banks in the city where Vasya lives, they are located in a circle, such that any two banks are neighbouring if their indices differ by no more than 1. Also, bank 1 and bank _n_ are neighbours if _n_u2009>u20091. No bank is a neighbour of itself. Vasya has an account in each bank. Its balance may be negati... | 2,100 | false | true | false | false | true | true | false | false | true | false | 7,129 |
1290C | There are $$$n$$$ lamps on a line, numbered from $$$1$$$ to $$$n$$$. Each one has an initial state off ($$$0$$$) or on ($$$1$$$). You're given $$$k$$$ subsets $$$A_1, ldots, A_k$$$ of $$${1, 2, dots, n}$$$, such that the intersection of any three subsets is empty. In other words, for all $$$1 le i_1 < i_2 < i_3 le k$$$... | 2,400 | false | false | false | false | false | false | false | false | false | true | 4,244 |
722F | You are given _n_ sequences. Each sequence consists of positive integers, not exceeding _m_. All integers in one sequence are distinct, but the same integer may appear in multiple sequences. The length of the _i_-th sequence is _k__i_. Each second integers in each of the sequences are shifted by one to the left, i.e. i... | 2,800 | false | false | true | false | true | false | false | false | false | false | 6,921 |
1750D | You are given two integers $$$n$$$ and $$$m$$$ and an array $$$a$$$ of $$$n$$$ integers. For each $$$1 le i le n$$$ it holds that $$$1 le a_i le m$$$. Your task is to count the number of different arrays $$$b$$$ of length $$$n$$$ such that: $$$1 le b_i le m$$$ for each $$$1 le i le n$$$, and $$$gcd(b_1,b_2,b_3,...,b_... | 1,800 | true | false | false | false | false | false | false | false | false | false | 1,782 |
933A | A dragon symbolizes wisdom, power and wealth. On Lunar New Year's Day, people model a dragon with bamboo strips and clothes, raise them with rods, and hold the rods high and low to resemble a flying dragon. A performer holding the rod low is represented by a 1, while one holding it high is represented by a 2. Thus, the... | 1,800 | false | false | false | true | false | false | false | false | false | false | 5,971 |
1932D | Two players are playing an online card game. The game is played using a 32-card deck. Each card has a suit and a rank. There are four suits: clubs, diamonds, hearts, and spades. We will encode them with characters 'C', 'D', 'H', and 'S', respectively. And there are 8 ranks, in increasing order: '2', '3', '4', '5', '6',... | 1,400 | false | true | true | false | false | false | false | false | false | false | 691 |
749D | There are _n_ people taking part in auction today. The rules of auction are classical. There were _n_ bids made, though it's not guaranteed they were from different people. It might happen that some people made no bids at all. Each bid is define by two integers (_a__i_,u2009_b__i_), where _a__i_ is the index of the per... | 2,000 | false | false | false | false | true | false | false | true | false | false | 6,795 |
639D | Codeforces is a wonderful platform and one its feature shows how much someone contributes to the community. Every registered user has contributionxa0β an integer number, not necessarily positive. There are _n_ registered users and the _i_-th of them has contribution _t__i_. Limak is a little polar bear and he's new int... | 2,400 | false | true | false | false | true | false | false | false | true | false | 7,254 |
924A | There is a rectangular grid of _n_ rows of _m_ initially-white cells each. Arkady performed a certain number (possibly zero) of operations on it. In the _i_-th operation, a non-empty subset of rows _R__i_ and a non-empty subset of columns _C__i_ are chosen. For each row _r_ in _R__i_ and each column _c_ in _C__i_, the ... | 1,300 | false | true | true | false | false | false | false | false | false | false | 6,017 |
373B | Problem - 373B - 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... | 1,600 | true | false | true | false | false | false | false | true | false | false | 8,337 |
37D | When Petya has free from computer games time, he attends university classes. Every day the lessons on Petyaβs faculty consist of two double classes. The floor where the lessons take place is a long corridor with _M_ classrooms numbered from 1 to _M_, situated along it. All the students of Petyaβs year are divided into ... | 2,300 | true | false | false | true | false | false | false | false | false | false | 9,810 |
251E | Little Petya likes trees a lot. Recently his mother has presented him a tree with 2_n_ nodes. Petya immediately decided to place this tree on a rectangular table consisting of 2 rows and _n_ columns so as to fulfill the following conditions: 1. Each cell of the table corresponds to exactly one tree node and vice versa,... | 3,000 | false | false | true | true | false | false | false | false | false | false | 8,827 |
164D | Problem - 164D - Codeforces =============== xa0 so that the diameter of the set of the remaining _n_u2009-u2009_k_ points were as small as possible. The diameter of a set of points is the maximum pairwise distance between the points of the set. The diameter of a one point set equals zero. Input The first ... | 3,100 | false | false | false | false | false | false | true | true | false | false | 9,207 |
1601A | You are given array $$$a_1, a_2, ldots, a_n$$$, consisting of non-negative integers. Let's define operation of "elimination" with integer parameter $$$k$$$ ($$$1 leq k leq n$$$) as follows: Choose $$$k$$$ distinct array indices $$$1 leq i_1 < i_2 < ldots < i_k le n$$$. Calculate $$$x = a_{i_1} ~ & ~ a_{i_2} ~ & ~ ldo... | 1,300 | true | true | false | false | false | false | false | false | false | false | 2,651 |
1186D | Vus the Cossack has $$$n$$$ real numbers $$$a_i$$$. It is known that the sum of all numbers is equal to $$$0$$$. He wants to choose a sequence $$$b$$$ the size of which is $$$n$$$ such that the sum of all numbers is $$$0$$$ and each $$$b_i$$$ is either $$$lfloor a_i floor$$$ or $$$lceil a_i ceil$$$. In other words, $... | 1,500 | true | true | false | false | false | true | false | false | false | false | 4,769 |
366A | Nothing has changed since the last round. Dima and Inna still love each other and want to be together. They've made a deal with Seryozha and now they need to make a deal with the dorm guards... There are four guardposts in Dima's dorm. Each post contains two guards (in Russia they are usually elderly women). You can br... | 1,100 | false | false | true | false | false | false | false | false | false | false | 8,370 |
1840E | You are given two strings of equal length $$$s_1$$$ and $$$s_2$$$, consisting of lowercase Latin letters, and an integer $$$t$$$. You need to answer $$$q$$$ queries, numbered from $$$1$$$ to $$$q$$$. The $$$i$$$-th query comes in the $$$i$$$-th second of time. Each query is one of three types: block the characters at ... | 1,600 | false | false | true | false | true | false | false | false | false | false | 1,249 |
583B | Robot Doc is located in the hall, with _n_ computers stand in a line, numbered from left to right from 1 to _n_. Each computer contains exactly one piece of information, each of which Doc wants to get eventually. The computers are equipped with a security system, so to crack the _i_-th of them, the robot needs to colle... | 1,200 | false | true | true | false | false | false | false | false | false | false | 7,511 |
1491I | After realizing that Zookeeper is just a duck, the animals have overthrown Zookeeper. They now have to decide a new ruler among themselves through a fighting tournament of the following format: Initially, animal $$$0$$$ is king, while everyone else queues up with animal $$$1$$$ at the front of the queue and animal $$$n... | 3,500 | false | false | false | false | true | false | true | false | false | false | 3,214 |
500E | Celebrating the new year, many people post videos of falling dominoes; Here's a list of them: ainta, who lives in a 2D world, is going to post a video as well. There are _n_ dominoes on a 2D Cartesian plane. _i_-th domino (1u2009β€u2009_i_u2009β€u2009_n_) can be represented as a line segment which is parallel to the _y_-... | 2,300 | false | false | false | true | true | false | false | false | false | false | 7,833 |
930E | Arkady and Kirill visited an exhibition of rare coins. The coins were located in a row and enumerated from left to right from 1 to _k_, each coin either was laid with its obverse (front) side up, or with its reverse (back) side up. Arkady and Kirill made some photos of the coins, each photo contained a segment of neigh... | 2,900 | true | false | false | true | true | false | false | false | false | false | 5,982 |
958E2 | Princess Heidi decided to give orders to all her _K_ Rebel ship commanders in person. Unfortunately, she is currently travelling through hyperspace, and will leave it only at _N_ specific moments _t_1,u2009_t_2,u2009...,u2009_t__N_. The meetings with commanders must therefore start and stop at those times. Namely, each... | 2,200 | false | true | false | true | false | false | false | true | true | false | 5,882 |
1633A | You are given an integer $$$n$$$. You have to change the minimum number of digits in it in such a way that the resulting number does not have any leading zeroes and is divisible by $$$7$$$. If there are multiple ways to do it, print any of them. If the given number is already divisible by $$$7$$$, leave it unchanged. I... | 800 | false | false | false | false | false | false | true | false | false | false | 2,452 |
1025A | Panic is rising in the committee for doggo standardizationxa0β the puppies of the new brood have been born multi-colored! In total there are 26 possible colors of puppies in the nature and they are denoted by letters from 'a' to 'z' inclusive. The committee rules strictly prohibit even the smallest diversity between do... | 900 | false | false | true | false | false | false | false | false | true | false | 5,583 |
724A | Problem - 724A - 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... | 1,000 | false | false | true | false | false | false | false | false | false | false | 6,914 |
590D | A top-secret military base under the command of Colonel Zuev is expecting an inspection from the Ministry of Defence. According to the charter, each top-secret military base must include a top-secret troop that should... well, we cannot tell you exactly what it should do, it is a top secret troop at the end. The proble... | 2,300 | false | false | false | true | false | false | false | false | false | false | 7,486 |
36A | Problem - 36A - Codeforces =============== xa0 and Codeforces Beta Round #36") ") ") ") ") ") β amount of days during which Vasya checked if there were any signals. The second line contains _n_ characters 1 or 0 β the record Vasya kept each of those _n_ days. Itβs guaranteed that the g... | 1,300 | false | false | true | false | false | false | false | false | false | false | 9,818 |
1083B | Recently, the Fair Nut has written $$$k$$$ strings of length $$$n$$$, consisting of letters "a" and "b". He calculated $$$c$$$xa0β the number of strings that are prefixes of at least one of the written strings. Every string was counted only one time. Then, he lost his sheet with strings. He remembers that all written s... | 2,000 | false | true | false | false | false | false | false | false | false | false | 5,307 |
1339B | You have array of $$$n$$$ numbers $$$a_{1}, a_{2}, ldots, a_{n}$$$. Rearrange these numbers to satisfy $$$a_{1} - a_{2} le a_{2} - a_{3} le ldots le a_{n-1} - a_{n}$$$, where $$$x$$$ denotes absolute value of $$$x$$$. It's always possible to find such rearrangement. Note that all numbers in $$$a$$$ are not necessarily ... | 1,200 | false | false | false | false | false | true | false | false | true | false | 4,008 |
1904D2 | This is the hard version of the problem. The only differences between the two versions of this problem are the constraints on $$$n$$$ and the time limit. You can make hacks only if all versions of the problem are solved. You are given two arrays $$$a$$$ and $$$b$$$ of length $$$n$$$. You can perform the following opera... | 1,800 | false | true | true | false | true | true | false | false | true | false | 886 |
514C | Watto, the owner of a spare parts store, has recently got an order for the mechanism that can process strings in a certain way. Initially the memory of the mechanism is filled with _n_ strings. Then the mechanism should be able to process queries of the following type: "Given string _s_, determine if the memory of the ... | 2,000 | false | false | false | false | true | false | false | true | false | false | 7,778 |
883K | Mayor of city S just hates trees and lawns. They take so much space and there could be a road on the place they occupy! The Mayor thinks that one of the main city streets could be considerably widened on account of lawn nobody needs anyway. Moreover, that might help reduce the car jams which happen from time to time on... | 1,800 | false | true | true | false | false | true | false | false | false | false | 6,217 |
799C | Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. There are _n_ available fountains, for each fountain its beauty and cost are known. There are two types of money in the game: coins and diamonds, so each fountain cost can be either in coins or diamonds. No money changes between the types are all... | 1,800 | false | false | true | false | true | false | false | true | false | false | 6,574 |
1257B | Recently Petya walked in the forest and found a magic stick. Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer: 1. If the chosen number $$$a$$$ is even, then the spell will turn it into $$$frac{3a}{2}$... | 1,000 | true | false | false | false | false | false | false | false | false | false | 4,400 |
1189C | Consider a sequence of digits of length $$$2^k$$$ $$$[a_1, a_2, ldots, a_{2^k}]$$$. We perform the following operation with it: replace pairs $$$(a_{2i+1}, a_{2i+2})$$$ with $$$(a_{2i+1} + a_{2i+2})bmod 10$$$ for $$$0le i<2^{k-1}$$$. For every $$$i$$$ where $$$a_{2i+1} + a_{2i+2}ge 10$$$ we get a candy! As a result, we... | 1,400 | true | false | true | true | true | false | false | false | false | false | 4,751 |
1463B | You are given an array $$$[a_1, a_2, dots, a_n]$$$ such that $$$1 le a_i le 10^9$$$. Let $$$S$$$ be the sum of all elements of the array $$$a$$$. Let's call an array $$$b$$$ of $$$n$$$ integers beautiful if: $$$1 le b_i le 10^9$$$ for each $$$i$$$ from $$$1$$$ to $$$n$$$; for every pair of adjacent integers from the ... | 1,400 | false | true | false | false | false | true | false | false | false | false | 3,372 |
2009G2 | This is the hard version of the problem. In this version, it is guaranteed that $$$r geq l+k-1$$$ for all queries. For an arbitrary array $$$b$$$, Yunli can perform the following operation any number of times: Select an index $$$i$$$. Set $$$b_i = x$$$ where $$$x$$$ is any integer she desires ($$$x$$$ is not limited t... | 2,200 | false | false | false | true | true | false | false | true | false | false | 193 |
164C | One remarkable day company "X" received _k_ machines. And they were not simple machines, they were mechanical programmers! This was the last unsuccessful step before switching to android programmers, but that's another story. The company has now _n_ tasks, for each of them we know the start time of its execution _s__i_... | 2,400 | false | false | false | false | false | false | false | false | false | true | 9,208 |
1426C | Initially, you have the array $$$a$$$ consisting of one element $$$1$$$ ($$$a = [1]$$$). In one move, you can do one of the following things: Increase some (single) element of $$$a$$$ by $$$1$$$ (choose some $$$i$$$ from $$$1$$$ to the current length of $$$a$$$ and increase $$$a_i$$$ by one); Append the copy of some ... | 1,100 | true | false | false | false | false | true | false | true | false | false | 3,537 |
1592D | This is an interactive problem! In the last regional contest Hemose, ZeyadKhattab and YahiaSherif β members of the team Carpe Diem β did not qualify to ICPC because of some unknown reasons. Hemose was very sad and had a bad day after the contest, but ZeyadKhattab is very wise and knows Hemose very well, and does not wa... | 2,300 | true | false | true | false | false | false | false | true | false | false | 2,690 |
294B | Problem - 294B - 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... | 1,700 | false | true | false | true | false | false | false | false | false | false | 8,655 |
1842G | Yet another random problem. Tenzing has an array $$$a$$$ of length $$$n$$$ and an integer $$$v$$$. Tenzing will perform the following operation $$$m$$$ times: 1. Choose an integer $$$i$$$ such that $$$1 leq i leq n$$$ uniformly at random. 2. For all $$$j$$$ such that $$$i leq j leq n$$$, set $$$a_j := a_j + v$$$. Tenzi... | 2,800 | true | false | false | true | false | false | false | false | false | false | 1,233 |
665B | Ayush is a cashier at the shopping center. Recently his department has started a ''click and collect" service which allows users to shop online. The store contains _k_ items. _n_ customers have already used the above service. Each user paid for _m_ items. Let _a__ij_ denote the _j_-th item in the _i_-th person's order.... | 1,400 | false | false | false | false | false | false | true | false | false | false | 7,160 |
1776A | One of the SWERC judges has a dog named Boy. Besides being a good competitive programmer, Boy loves fresh air, so she wants to be walked at least twice a day. Walking Boy requires $$$120$$$ consecutive minutes. Two walks cannot overlap, but one can start as soon as the previous one has finished. Boy before and after ge... | 800 | false | true | false | false | false | false | false | false | false | false | 1,628 |
177C2 | To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smart Beaver wants to invite only those of his friends who are connected by friends... | 1,500 | false | false | false | false | false | false | true | false | false | true | 9,149 |
1775D | Mars is home to an unusual species of spidersxa0β Binary spiders. Right now, Martian scientists are observing a colony of $$$n$$$ spiders, the $$$i$$$-th of which has $$$a_i$$$ legs. Some of the spiders are friends with each other. Namely, the $$$i$$$-th and $$$j$$$-th spiders are friends if $$$gcd(a_i, a_j) e 1$$$, i... | 1,800 | true | false | false | false | false | false | false | false | false | true | 1,631 |
767E | Student Arseny likes to plan his life for _n_ days ahead. He visits a canteen every day and he has already decided what he will order in each of the following _n_ days. Prices in the canteen do not change and that means Arseny will spend _c__i_ rubles during the _i_-th day. There are 1-ruble coins and 100-ruble notes i... | 2,400 | false | true | false | false | false | false | false | false | false | false | 6,714 |
1602A | You are given a string $$$s$$$. You need to find two non-empty strings $$$a$$$ and $$$b$$$ such that the following conditions are satisfied: 1. Strings $$$a$$$ and $$$b$$$ are both subsequences of $$$s$$$. 2. For each index $$$i$$$, character $$$s_i$$$ of string $$$s$$$ must belong to exactly one of strings $$$a$$$ or ... | 800 | false | false | true | false | false | false | false | false | false | false | 2,645 |
322B | Problem - 322B - 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... | 1,600 | true | false | false | false | false | false | false | false | false | false | 8,545 |
869A | Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up with a new game as a substitute. The game works as follows. A positive integer _n_ is decided first. Both Koyomi and Karen independently choose _n_ distinct positive integers, denote... | 1,100 | false | false | true | false | false | false | true | false | false | false | 6,266 |
682D | After returned from forest, Alyona started reading a book. She noticed strings _s_ and _t_, lengths of which are _n_ and _m_ respectively. As usual, reading bored Alyona and she decided to pay her attention to strings _s_ and _t_, which she considered very similar. Alyona has her favourite positive integer _k_ and beca... | 1,900 | false | false | false | true | false | false | false | false | false | false | 7,095 |
986E | Let the main characters of this problem be personages from some recent movie. New Avengers seem to make a lot of buzz. I didn't watch any part of the franchise and don't know its heroes well, but it won't stop me from using them in this problem statement. So, Thanos and Dr. Strange are doing their superhero and supervi... | 2,800 | true | false | false | false | true | false | true | false | false | false | 5,768 |
1783G | You are given a tree of $$$n$$$ vertices and $$$n - 1$$$ edges. The $$$i$$$-th vertex has an initial weight $$$a_i$$$. Let the distance $$$d_v(u)$$$ from vertex $$$v$$$ to vertex $$$u$$$ be the number of edges on the path from $$$v$$$ to $$$u$$$. Note that $$$d_v(u) = d_u(v)$$$ and $$$d_v(v) = 0$$$. Let the weighted di... | 2,800 | false | false | true | false | true | false | false | false | false | false | 1,573 |
409H | , separated by a single space. Output Output the sum of the given integers. | 1,500 | false | false | true | false | false | true | true | false | false | false | 8,184 |
44F | Anfisa the monkey got disappointed in word processors as they aren't good enough at reflecting all the range of her emotions, that's why she decided to switch to graphics editors. Having opened the BerPaint, she saw a white rectangle _W_u2009Γu2009_H_ in size which can be painted on. First Anfisa learnt to navigate the... | 2,700 | false | false | false | false | false | false | false | false | false | true | 9,764 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.