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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
260D | The board has got a painted tree graph, consisting of _n_ nodes. Let us remind you that a non-directed graph is called a tree if it is connected and doesn't contain any cycles. Each node of the graph is painted black or white in such a manner that there aren't two nodes of the same color, connected by an edge. Each edg... | 2,100 | false | true | false | false | false | true | false | false | false | true | 8,792 |
316A1 | Special Agent Smart Beaver works in a secret research department of ABBYY. He's been working there for a long time and is satisfied with his job, as it allows him to eat out in the best restaurants and order the most expensive and exotic wood types there. The content special agent has got an important task: to get the ... | 1,100 | false | true | false | false | false | false | false | false | false | false | 8,583 |
1659B | You are given a binary string of length $$$n$$$. You have exactly $$$k$$$ moves. In one move, you must select a single bit. The state of all bits except that bit will get flipped ($$$0$$$ becomes $$$1$$$, $$$1$$$ becomes $$$0$$$). You need to output the lexicographically largest string that you can get after using all ... | 1,300 | false | true | false | false | false | true | false | false | false | false | 2,331 |
103C | After all the events in Orlando we all know, Sasha and Roma decided to find out who is still the team's biggest loser. Thankfully, Masha found somewhere a revolver with a rotating cylinder of _n_ bullet slots able to contain exactly _k_ bullets, now the boys have a chance to resolve the problem once and for all. Sasha ... | 1,900 | false | true | false | false | false | true | false | false | false | false | 9,470 |
1420A | For god's sake, you're boxes with legs! It is literally your only purpose! Walking onto buttons! How can you not do the one thing you were designed for?Oh, that's funny, is it? Oh it's funny? Because we've been at this for twelve hours and you haven't solved it either, so I don't know why you're laughing. You've got on... | 900 | true | false | false | false | false | false | false | false | true | false | 3,580 |
911B | It's New Year's Eve soon, so Ivan decided it's high time he started setting the table. Ivan has bought two cakes and cut them into pieces: the first cake has been cut into _a_ pieces, and the second one — into _b_ pieces. Ivan knows that there will be _n_ people at the celebration (including himself), so Ivan has set _... | 1,200 | false | false | true | false | false | false | true | true | false | false | 6,102 |
1918B | You are given two permutations $$$a$$$ and $$$b$$$ of length $$$n$$$. A permutation is an array of $$$n$$$ elements from $$$1$$$ to $$$n$$$ where all elements are distinct. For example, an array [$$$2,1,3$$$] is a permutation, but [$$$0,1$$$] and [$$$1,3,1$$$] aren't. You can (as many times as you want) choose two indi... | 900 | false | true | true | false | true | true | false | false | true | false | 787 |
991C | After passing a test, Vasya got himself a box of $$$n$$$ candies. He decided to eat an equal amount of candies each morning until there are no more candies. However, Petya also noticed the box and decided to get some candies for himself. This means the process of eating candies is the following: in the beginning Vasya ... | 1,500 | false | false | true | false | false | false | false | true | false | false | 5,743 |
1870H | Problem - 1870H - 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,500 | false | true | false | false | true | false | false | false | false | true | 1,052 |
1905E | In this sad world full of imperfections, ugly segment trees exist. A segment tree is a tree where each node represents a segment and has its number. A segment tree for an array of $$$n$$$ elements can be built in a recursive manner. Let's say function $$$operatorname{build}(v,l,r)$$$ builds the segment tree rooted in t... | 2,400 | true | false | false | true | false | false | false | false | false | false | 879 |
1272B | Recently you have bought a snow walking robot and brought it home. Suppose your home is a cell $$$(0, 0)$$$ on an infinite grid. You also have the sequence of instructions of this robot. It is written as the string $$$s$$$ consisting of characters 'L', 'R', 'U' and 'D'. If the robot is in the cell $$$(x, y)$$$ right no... | 1,200 | false | true | true | false | false | true | false | false | false | false | 4,328 |
607E | Genos has been given _n_ distinct lines on the Cartesian plane. Let be a list of intersection points of these lines. A single point might appear multiple times in this list if it is the intersection of multiple pairs of lines. The order of the list does not matter. Given a query point (_p_,u2009_q_), let be the corresp... | 3,300 | false | false | false | false | false | false | false | true | false | false | 7,415 |
1874F | Problem - 1874F - 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,500 | false | false | false | true | false | false | false | false | false | false | 1,031 |
593A | Andrew often reads articles in his favorite magazine 2Char. The main feature of these articles is that each of them uses at most two distinct letters. Andrew decided to send an article to the magazine, but as he hasn't written any article, he just decided to take a random one from magazine 26Char. However, before sendi... | 1,200 | false | false | true | false | false | false | true | false | false | false | 7,477 |
995B | Allen is hosting a formal dinner party. $$$2n$$$ people come to the event in $$$n$$$ pairs (couples). After a night of fun, Allen wants to line everyone up for a final picture. The $$$2n$$$ people line up, but Allen doesn't like the ordering. Allen prefers if each pair occupies adjacent positions in the line, as this m... | 1,400 | true | true | true | false | false | false | false | false | false | false | 5,725 |
1114E | This is an interactive problem! An arithmetic progression or arithmetic sequence is a sequence of integers such that the subtraction of element with its previous element ($$$x_i - x_{i - 1}$$$, where $$$i ge 2$$$) is constantxa0— such difference is called a common difference of the sequence. That is, an arithmetic prog... | 2,200 | false | false | false | false | false | false | false | true | false | false | 5,130 |
1905C | Given is a string $$$s$$$ of length $$$n$$$. In one operation you can select the lexicographically largest$$$^dagger$$$ subsequence of string $$$s$$$ and cyclic shift it to the right$$$^ddagger$$$. Your task is to calculate the minimum number of operations it would take for $$$s$$$ to become sorted, or report that it n... | 1,400 | false | true | false | false | false | false | false | false | false | false | 881 |
222A | Problem - 222A - 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 | false | false | true | false | false | false | true | false | false | false | 8,952 |
1901E | You are given a tree consisting of $$$n$$$ vertices. A number is written on each vertex; the number on vertex $$$i$$$ is equal to $$$a_i$$$. You can perform the following operation any number of times (possibly zero): choose a vertex which has at most $$$1$$$ incident edge and remove this vertex from the tree. Note th... | 2,200 | false | true | false | true | false | false | false | false | true | true | 905 |
83E | On an IT lesson Valera studied data compression. The teacher told about a new method, which we shall now describe to you. Let {_a_1,u2009_a_2,u2009...,u2009_a__n_} be the given sequence of lines needed to be compressed. Here and below we shall assume that all lines are of the same length and consist only of the digits ... | 2,800 | false | false | false | true | false | false | false | false | false | false | 9,549 |
1613E | There is a grid, consisting of $$$n$$$ rows and $$$m$$$ columns. Each cell of the grid is either free or blocked. One of the free cells contains a lab. All the cells beyond the borders of the grid are also blocked. A crazy robot has escaped from this lab. It is currently in some free cell of the grid. You can send one ... | 2,000 | false | false | false | false | false | false | false | false | false | true | 2,572 |
630F | Problem - 630F - Codeforces =============== xa0 ]( "Experimental Educational Round: VolBIT Formulas Blitz") — the number of potential employees that sent resumes. Output Output one integer — the number of different variants of group composition. Examples Input 7 Output 29 | 1,300 | true | false | false | false | false | false | false | false | false | false | 7,299 |
658A | Limak and Radewoosh are going to compete against each other in the upcoming algorithmic contest. They are equally skilled but they won't solve problems in the same order. There will be _n_ problems. The _i_-th problem has initial score _p__i_ and it takes exactly _t__i_ minutes to solve it. Problems are sorted by diffi... | 800 | false | false | true | false | false | false | false | false | false | false | 7,190 |
1829A | Problem - 1829A - 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 | true | false | false | false | false | false | false | false | 1,314 |
1830C | You are given an integer $$$n$$$ and $$$k$$$ intervals. The $$$i$$$-th interval is $$$[l_i,r_i]$$$ where $$$1 leq l_i leq r_i leq n$$$. Let us call a regular bracket sequence$$$^{dagger,ddagger}$$$ of length $$$n$$$ hyperregular if for each $$$i$$$ such that $$$1 leq i leq k$$$, the substring $$$overline{s_{l_i} s_{l_{... | 2,400 | true | true | false | false | false | false | false | false | true | false | 1,304 |
688B | Problem - 688B - 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 | true | false | false | false | false | true | false | false | false | false | 7,070 |
575F | Bananistan is a beautiful banana republic. Beautiful women in beautiful dresses. Beautiful statues of beautiful warlords. Beautiful stars in beautiful nights. In Bananistan people play this crazy game – Bulbo. There’s an array of bulbs and player at the position, which represents one of the bulbs. The distance between ... | 2,100 | false | true | false | true | false | false | false | false | false | false | 7,547 |
1208D | An array of integers $$$p_{1},p_{2}, ldots,p_{n}$$$ is called a permutation if it contains each number from $$$1$$$ to $$$n$$$ exactly once. For example, the following arrays are permutations: $$$[3,1,2], [1], [1,2,3,4,5]$$$ and $$$[4,3,1,2]$$$. The following arrays are not permutations: $$$[2], [1,1], [2,3,4]$$$. Ther... | 1,900 | false | true | true | false | true | false | false | true | false | false | 4,651 |
1338A | You have an array $$$a$$$ of length $$$n$$$. For every positive integer $$$x$$$ you are going to perform the following operation during the $$$x$$$-th second: Select some distinct indices $$$i_{1}, i_{2}, ldots, i_{k}$$$ which are between $$$1$$$ and $$$n$$$ inclusive, and add $$$2^{x-1}$$$ to each corresponding posit... | 1,500 | true | true | false | false | false | false | false | false | false | false | 4,014 |
763D | Little Timofey has a big treexa0— an undirected connected graph with _n_ vertices and no simple cycles. He likes to walk along it. His tree is flat so when he walks along it he sees it entirely. Quite naturally, when he stands on a vertex, he sees the tree as a rooted tree with the root in this vertex. Timofey assumes ... | 2,900 | false | false | false | false | true | false | false | false | false | true | 6,734 |
1452B | You are asked to watch your nephew who likes to play with toy blocks in a strange way. He has $$$n$$$ boxes and the $$$i$$$-th box has $$$a_i$$$ blocks. His game consists of two steps: 1. he chooses an arbitrary box $$$i$$$; 2. he tries to move all blocks from the $$$i$$$-th box to other boxes. If he can make the same ... | 1,400 | true | true | false | false | false | false | false | true | true | false | 3,420 |
791A | Bear Limak wants to become the largest of bears, or at least to become larger than his brother Bob. Right now, Limak and Bob weigh _a_ and _b_ respectively. It's guaranteed that Limak's weight is smaller than or equal to his brother's weight. Limak eats a lot and his weight is tripled after every year, while Bob's weig... | 800 | false | false | true | false | false | false | false | false | false | false | 6,614 |
1994D | 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 order starting from $$$1$$... | 1,900 | true | true | false | false | false | true | false | false | false | true | 302 |
898A | Problem - 898A - 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... | 800 | true | false | true | false | false | false | false | false | false | false | 6,158 |
1500D | Kostya is extremely busy: he is renovating his house! He needs to hand wallpaper, assemble furniture throw away trash. Kostya is buying tiles for bathroom today. He is standing in front of a large square stand with tiles in a shop. The stand is a square of $$$n imes n$$$ cells, each cell of which contains a small tile... | 2,900 | false | false | false | false | true | false | false | false | true | false | 3,165 |
1464F | You are given a tree. We will consider simple paths on it. Let's denote path between vertices $$$a$$$ and $$$b$$$ as $$$(a, b)$$$. Let $$$d$$$-neighborhood of a path be a set of vertices of the tree located at a distance $$$leq d$$$ from at least one vertex of the path (for example, $$$0$$$-neighborhood of a path is a ... | 3,500 | false | false | false | false | true | false | false | false | false | false | 3,367 |
1083D | The Fair Nut has found an array $$$a$$$ of $$$n$$$ integers. We call subarray $$$l ldots r$$$ a sequence of consecutive elements of an array with indexes from $$$l$$$ to $$$r$$$, i.e. $$$a_l, a_{l+1}, a_{l+2}, ldots, a_{r-1}, a_{r}$$$. No one knows the reason, but he calls a pair of subsegments good if and only if the ... | 3,500 | false | false | true | false | true | false | false | false | false | false | 5,305 |
958B1 | The Resistance is trying to take control over all planets in a particular solar system. This solar system is shaped like a tree. More precisely, some planets are connected by bidirectional hyperspace tunnels in such a way that there is a path between every pair of the planets, but removing any tunnel would disconnect s... | 1,000 | false | false | true | false | false | false | false | false | false | false | 5,890 |
599D | Problem - 599D - 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,900 | true | false | false | false | false | false | true | false | false | false | 7,448 |
1759D | Inflation has occurred in Berlandia, so the store needs to change the price of goods. The current price of good $$$n$$$ is given. It is allowed to increase the price of the good by $$$k$$$ times, with $$$1 le k le m$$$, k is an integer. Output the roundest possible new price of the good. That is, the one that has the m... | 1,400 | false | false | false | false | false | false | true | false | false | false | 1,759 |
1700B | During a daily walk Alina noticed a long number written on the ground. Now Alina wants to find some positive number of same length without leading zeroes, such that the sum of these two numbers is a palindrome. Recall that a number is called a palindrome, if it reads the same right to left and left to right. For exampl... | 1,100 | true | false | true | false | false | true | false | false | false | false | 2,081 |
1617D1 | This is an interactive problem. The only difference between the easy and hard version is the limit on number of questions. There are $$$n$$$ players labelled from $$$1$$$ to $$$n$$$. It is guaranteed that $$$n$$$ is a multiple of $$$3$$$. Among them, there are $$$k$$$ impostors and $$$n-k$$$ crewmates. The number of im... | 1,800 | false | false | true | false | false | true | false | false | false | false | 2,545 |
1970F2 | This afternoon, you decided to enjoy the first days of Spring by taking a walk outside. As you come near the Quidditch field, you hear screams. Once again, there is a conflict about the score: the two teams are convinced that they won the game! To prevent this problem from happening one more time, you decide to get inv... | 2,300 | false | false | true | false | false | false | false | false | false | false | 470 |
675E | Vasya commutes by train every day. There are _n_ train stations in the city, and at the _i_-th station it's possible to buy only tickets to stations from _i_u2009+u20091 to _a__i_ inclusive. No tickets are sold at the last station. Let ρ_i_,u2009_j_ be the minimum number of tickets one needs to buy in order to get from... | 2,300 | false | true | false | true | true | false | false | false | false | false | 7,127 |
529B | Many years have passed, and _n_ friends met at a party again. Technologies have leaped forward since the last meeting, cameras with timer appeared and now it is not obligatory for one of the friends to stand with a camera, and, thus, being absent on the photo. Simply speaking, the process of photographing can be descri... | 1,900 | false | true | false | false | false | false | true | false | true | false | 7,717 |
891B | Problem - 891B - 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,000 | false | true | false | false | false | true | false | false | false | false | 6,187 |
761E | Dasha decided to have a rest after solving the problem. She had been ready to start her favourite activity — origami, but remembered the puzzle that she could not solve. The tree is a non-oriented connected graph without cycles. In particular, there always are _n_u2009-u20091 edges in a tree with _n_ vertices. The puzz... | 2,000 | false | true | false | false | false | true | false | false | false | true | 6,745 |
1572A | You are given a book with $$$n$$$ chapters. Each chapter has a specified list of other chapters that need to be understood in order to understand this chapter. To understand a chapter, you must read it after you understand every chapter on its required list. Currently you don't understand any of the chapters. You are g... | 1,800 | false | false | true | true | true | false | true | true | true | true | 2,782 |
1975E | You are given a tree of $$$n$$$ vertices numbered from $$$1$$$ to $$$n$$$. Initially, all vertices are colored white or black. You are asked to perform $$$q$$$ queries: "u"xa0— toggle the color of vertex $$$u$$$ (if it was white, change it to black and vice versa). After each query, you should answer whether all the b... | 2,100 | false | false | true | false | true | false | false | true | false | false | 438 |
1073E | You are given two integers $$$l$$$ and $$$r$$$ ($$$l le r$$$). Your task is to calculate the sum of numbers from $$$l$$$ to $$$r$$$ (including $$$l$$$ and $$$r$$$) such that each number contains at most $$$k$$$ different digits, and print this sum modulo $$$998244353$$$. For example, if $$$k = 1$$$ then you have to cal... | 2,300 | true | false | false | true | false | false | false | false | false | false | 5,349 |
1831B | You are given two arrays $$$a$$$ and $$$b$$$ both of length $$$n$$$. You will merge$$$^dagger$$$ these arrays forming another array $$$c$$$ of length $$$2 cdot n$$$. You have to find the maximum length of a subarray consisting of equal values across all arrays $$$c$$$ that could be obtained. $$$^dagger$$$ A merge of tw... | 1,000 | false | true | false | false | false | true | false | false | false | false | 1,299 |
1510D | Diana loves playing with numbers. She's got $$$n$$$ cards with positive integer numbers $$$a_i$$$ written on them. She spends her free time multiplying the numbers on the cards. She picks a non-empty subset of the cards and multiplies all the numbers $$$a_i$$$ written on them. Diana is happy when the product of the num... | 2,100 | true | false | false | true | false | false | false | false | false | false | 3,124 |
1929A | Sasha decided to give his girlfriend an array $$$a_1, a_2, ldots, a_n$$$. He found out that his girlfriend evaluates the beauty of the array as the sum of the values $$$(a_i - a_{i - 1})$$$ for all integers $$$i$$$ from $$$2$$$ to $$$n$$$. Help Sasha and tell him the maximum beauty of the array $$$a$$$ that he can obta... | 800 | true | true | false | false | false | true | false | false | true | false | 717 |
1430G | You are given a directed acyclic graph (a directed graph that does not contain cycles) of $$$n$$$ vertices and $$$m$$$ arcs. The $$$i$$$-th arc leads from the vertex $$$x_i$$$ to the vertex $$$y_i$$$ and has the weight $$$w_i$$$. Your task is to select an integer $$$a_v$$$ for each vertex $$$v$$$, and then write a numb... | 2,600 | true | false | false | true | false | false | false | false | false | true | 3,510 |
1109A | Sasha likes programming. Once, during a very long contest, Sasha decided that he was a bit tired and needed to relax. So he did. But since Sasha isn't an ordinary guy, he prefers to relax unusually. During leisure time Sasha likes to upsolve unsolved problems because upsolving is very useful. Therefore, Sasha decided t... | 1,600 | false | false | true | true | false | false | false | false | false | false | 5,155 |
1525F | Monocarp plays a computer game called "Goblins and Gnomes". In this game, he manages a large underground city of gnomes and defends it from hordes of goblins. The city consists of $$$n$$$ halls and $$$m$$$ one-directional tunnels connecting them. The structure of tunnels has the following property: if a goblin leaves a... | 2,800 | false | false | false | true | false | false | true | false | false | false | 3,037 |
1490G | Polycarp was dismantling his attic and found an old floppy drive on it. A round disc was inserted into the drive with $$$n$$$ integers written on it. Polycarp wrote the numbers from the disk into the $$$a$$$ array. It turned out that the drive works according to the following algorithm: the drive takes one positive nu... | 1,900 | true | false | false | false | true | false | false | true | false | false | 3,223 |
780D | Innokenty is a president of a new football league in Byteland. The first task he should do is to assign short names to all clubs to be shown on TV next to the score. Of course, the short names should be distinct, and Innokenty wants that all short names consist of three letters. Each club's full name consist of two wor... | 1,900 | false | true | true | false | false | false | false | false | false | true | 6,645 |
71C | There are _n_ knights sitting at the Round Table at an equal distance from each other. Each of them is either in a good or in a bad mood. Merlin, the wizard predicted to King Arthur that the next month will turn out to be particularly fortunate if the regular polygon can be found. On all vertices of the polygon knights... | 1,600 | true | false | false | true | false | false | false | false | false | false | 9,614 |
1867A | green_gold_dog has an array $$$a$$$ of length $$$n$$$, and he wants to find a permutation $$$b$$$ of length $$$n$$$ such that the number of distinct numbers in the element-wise difference between array $$$a$$$ and permutation $$$b$$$ is maximized. A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distin... | 800 | false | false | false | false | false | true | false | false | true | false | 1,075 |
2027D2 | This is the hard version of this problem. The only difference is that you need to also output the number of optimal sequences in this version. You must solve both versions to be able to hack. You're given an array $$$a$$$ of length $$$n$$$, and an array $$$b$$$ of length $$$m$$$ ($$$b_i > b_{i+1}$$$ for all $$$1 le i <... | 2,200 | false | true | true | true | true | false | false | true | false | false | 106 |
1614D2 | This is the hard version of the problem. The only difference is maximum value of $$$a_i$$$. Once in Kostomuksha Divan found an array $$$a$$$ consisting of positive integers. Now he wants to reorder the elements of $$$a$$$ to maximize the value of the following function: $$$$$$sum_{i=1}^n operatorname{gcd}(a_1, , a_2, ,... | 2,300 | false | false | false | true | false | false | false | false | false | false | 2,566 |
369C | The city Valera lives in is going to hold elections to the city Parliament. The city has _n_ districts and _n_u2009-u20091 bidirectional roads. We know that from any district there is a path along the roads to any other district. Let's enumerate all districts in some way by integers from 1 to _n_, inclusive. Furthermor... | 1,600 | false | false | false | false | false | false | false | false | false | true | 8,356 |
29D | Connected undirected graph without cycles is called a tree. Trees is a class of graphs which is interesting not only for people, but for ants too. An ant stands at the root of some tree. He sees that there are _n_ vertexes in the tree, and they are connected by _n_u2009-u20091 edges so that there is a path between any ... | 2,000 | false | false | false | false | false | true | false | false | false | false | 9,850 |
761A | Problem - 761A - 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 | true | false | true | false | false | true | true | false | false | false | 6,749 |
494B | Problem - 494B - 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,000 | false | false | false | true | false | false | false | false | false | false | 7,857 |
1769D2 | В этой версии задачи игроки начинают играть не только на победу, но и на оптимизацию результата игры для них. Вводится понятие величины важности первого хода, и нужно найти $$$13$$$ раскладов с различными значениями этой величины. Алиса и Боб решили сыграть в карточную игру «Девятка». Пожалуйста, внимательно прочитайте... | 2,200 | false | false | false | false | false | false | true | false | false | false | 1,679 |
1266E | Bob is playing a game of Spaceship Solitaire. The goal of this game is to build a spaceship. In order to do this, he first needs to accumulate enough resources for the construction. There are $$$n$$$ types of resources, numbered $$$1$$$ through $$$n$$$. Bob needs at least $$$a_i$$$ pieces of the $$$i$$$-th resource to ... | 2,100 | false | true | true | false | true | false | false | false | false | false | 4,367 |
1648A | Egor has a table of size $$$n imes m$$$, with lines numbered from $$$1$$$ to $$$n$$$ and columns numbered from $$$1$$$ to $$$m$$$. Each cell has a color that can be presented as an integer from $$$1$$$ to $$$10^5$$$. Let us denote the cell that lies in the intersection of the $$$r$$$-th row and the $$$c$$$-th column a... | 1,400 | true | false | false | false | true | false | false | false | true | false | 2,383 |
1657F | You are given a tree consisting of $$$n$$$ vertices, and $$$q$$$ triples $$$(x_i, y_i, s_i)$$$, where $$$x_i$$$ and $$$y_i$$$ are integers from $$$1$$$ to $$$n$$$, and $$$s_i$$$ is a string with length equal to the number of vertices on the simple path from $$$x_i$$$ to $$$y_i$$$. You want to write a lowercase Latin le... | 2,600 | false | false | false | false | false | false | false | false | false | true | 2,340 |
2013E | Since Mansur is tired of making legends, there will be no legends for this task. You are given an array of positive integer numbers $$$a_1, a_2, ldots, a_n$$$. The elements of the array can be rearranged in any order. You need to find the smallest possible value of the expression $$$$$$gcd(a_1) + gcd(a_1, a_2) + ldots ... | 2,200 | true | true | false | true | false | false | true | false | false | false | 174 |
453C | Twilight Sparkle learnt that the evil Nightmare Moon would return during the upcoming Summer Sun Celebration after one thousand years of imprisonment on the moon. She tried to warn her mentor Princess Celestia, but the princess ignored her and sent her to Ponyville to check on the preparations for the celebration. Twil... | 2,200 | false | false | false | false | false | true | false | false | false | true | 8,024 |
2021E3 | This is the extreme version of the problem. In the three versions, the constraints on $$$n$$$ and $$$m$$$ are different. You can make hacks only if all the versions of the problem are solved. Pak Chanek is setting up internet connections for the village of Khuntien. The village can be represented as a connected simple ... | 2,800 | true | true | false | true | true | false | false | false | false | true | 139 |
1914A | Monocarp is participating in a programming contest, which features $$$26$$$ problems, named from 'A' to 'Z'. The problems are sorted by difficulty. Moreover, it's known that Monocarp can solve problem 'A' in $$$1$$$ minute, problem 'B' in $$$2$$$ minutes, ..., problem 'Z' in $$$26$$$ minutes. After the contest, you dis... | 800 | false | false | true | false | false | false | false | false | false | false | 819 |
56D | There is a string _s_, consisting of capital Latin letters. Let's denote its current length as _s_. During one move it is allowed to apply one of the following operations to it: INSERT _pos_ _ch_ — insert a letter _ch_ in the string _s_ in the position _pos_ (1u2009≤u2009_pos_u2009≤u2009_s_u2009+u20091,u2009_A_u2009≤u... | 2,100 | false | false | false | true | false | false | false | false | false | false | 9,692 |
1811F | Vlad found a flowerbed with graphs in his yard and decided to take one for himself. Later he found out that in addition to the usual graphs, $$$k$$$-flowers also grew on that flowerbed. A graph is called a $$$k$$$-flower if it consists of a simple cycle of length $$$k$$$, through each vertex of which passes its own sim... | 2,100 | false | false | true | false | false | false | false | false | false | true | 1,400 |
1832D1 | The only difference between easy and hard versions is the maximum values of $$$n$$$ and $$$q$$$. You are given an array, consisting of $$$n$$$ integers. Initially, all elements are red. You can apply the following operation to the array multiple times. During the $$$i$$$-th operation, you select an element of the array... | 2,100 | true | true | true | false | false | false | false | true | false | false | 1,295 |
1637C | Andrew has $$$n$$$ piles with stones. The $$$i$$$-th pile contains $$$a_i$$$ stones. He wants to make his table clean so he decided to put every stone either to the $$$1$$$-st or the $$$n$$$-th pile. Andrew can perform the following operation any number of times: choose $$$3$$$ indices $$$1 le i < j < k le n$$$, such t... | 1,200 | false | true | true | false | false | false | false | false | false | false | 2,432 |
948A | Bob is a farmer. He has a large pasture with many sheep. Recently, he has lost some of them due to wolf attacks. He thus decided to place some shepherd dogs in such a way that all his sheep are protected. The pasture is a rectangle consisting of _R_u2009×u2009_C_ cells. Each cell is either empty, contains a sheep, a wo... | 900 | false | false | true | false | false | false | true | false | false | true | 5,925 |
1513F | Problem - 1513F - 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,500 | false | false | false | false | true | true | true | false | true | false | 3,097 |
615A | Problem - 615A - 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... | 800 | false | false | true | false | false | false | false | false | false | false | 7,380 |
750D | One tradition of welcoming the New Year is launching fireworks into the sky. Usually a launched firework flies vertically upward for some period of time, then explodes, splitting into several parts flying in different directions. Sometimes those parts also explode after some period of time, splitting into even more par... | 1,900 | false | false | true | true | true | false | true | false | false | false | 6,790 |
888G | Problem - 888G - Codeforces =============== xa0 — the number of vertices in the graph. The second line contains _n_ integers _a_1, _a_2, ..., _a__n_ (0u2009≤u2009_a__i_u2009<u2009230) — the numbers assigned to the vertices. Output Print one number — the weight of the minimum spanning tree in the graph. Ex... | 2,300 | false | false | false | false | true | true | false | false | false | false | 6,190 |
1706A | You have a sequence $$$a_1, a_2, ldots, a_n$$$ of length $$$n$$$, consisting of integers between $$$1$$$ and $$$m$$$. You also have a string $$$s$$$, consisting of $$$m$$$ characters B. You are going to perform the following $$$n$$$ operations. At the $$$i$$$-th ($$$1 le i le n$$$) operation, you replace either the $$... | 800 | false | true | false | false | false | true | false | false | false | false | 2,040 |
621E | There are _b_ blocks of digits. Each one consisting of the same _n_ digits, which are given to you in the input. Wet Shark must choose exactly one digit from each block and concatenate all of those digits together to form one large integer. For example, if he chooses digit 1 from the first block and digit 2 from the se... | 2,000 | false | false | false | true | false | false | false | false | false | false | 7,347 |
1740B | Pak Chanek has $$$n$$$ two-dimensional slices of cheese. The $$$i$$$-th slice of cheese can be represented as a rectangle of dimensions $$$a_i imes b_i$$$. We want to arrange them on the two-dimensional plane such that: Each edge of each cheese is parallel to either the x-axis or the y-axis. The bottom edge of each ... | 800 | false | true | false | false | false | false | false | false | true | false | 1,846 |
1252L | There are $$$N$$$ cities in the country of Numbata, numbered from $$$1$$$ to $$$N$$$. Currently, there is no road connecting them. Therefore, each of these $$$N$$$ cities proposes a road candidate to be constructed. City $$$i$$$ likes to connect with city $$$A_i$$$, so city $$$i$$$ proposes to add a direct bidirectiona... | 2,300 | false | false | false | false | false | false | false | false | false | true | 4,423 |
1905F | You are given a permutation$$$^{dagger}$$$ $$$p$$$ of length $$$n$$$. We call index $$$x$$$ good if for all $$$y < x$$$ it holds that $$$p_y < p_x$$$ and for all $$$y > x$$$ it holds that $$$p_y > p_x$$$. We call $$$f(p)$$$ the number of good indices in $$$p$$$. You can perform the following operation: pick $$$2$$$ dis... | 2,600 | false | false | false | false | true | false | true | false | false | false | 878 |
1687F | Problem - 1687F - 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,500 | true | false | false | false | false | false | false | false | false | false | 2,152 |
903G | In this problem you will have to deal with a very special network. The network consists of two parts: part _A_ and part _B_. Each part consists of _n_ vertices; _i_-th vertex of part _A_ is denoted as _A__i_, and _i_-th vertex of part _B_ is denoted as _B__i_. For each index _i_ (1u2009≤u2009_i_u2009<u2009_n_) there is... | 2,700 | false | false | false | false | true | false | false | false | false | true | 6,128 |
1970B2 | The only difference between this and the hard version is that $$$a_{1} = 0$$$. After some recent attacks on Hogwarts Castle by the Death Eaters, the Order of the Phoenix has decided to station $$$n$$$ members in Hogsmead Village. The houses will be situated on a picturesque $$$n imes n$$$ square field. Each wizard will... | 2,100 | false | false | false | false | false | true | false | false | false | false | 482 |
1510I | The popular improv website Interpretation Impetus hosts regular improv contests and maintains a rating of the best performers. However, since improv can often go horribly wrong, the website is notorious for declaring improv contests unrated. It now holds a wager before each improv contest where the participants try to ... | 2,700 | true | true | false | false | false | false | false | false | false | false | 3,119 |
1703B | In an ICPC contest, balloons are distributed as follows: Whenever a team solves a problem, that team gets a balloon. The first team to solve a problem gets an additional balloon. A contest has 26 problems, labelled $$$ extsf{A}$$$, $$$ extsf{B}$$$, $$$ extsf{C}$$$, ..., $$$ extsf{Z}$$$. You are given the order of sol... | 800 | false | false | true | false | true | false | false | false | false | false | 2,061 |
1610F | Lee was planning to get closer to Mashtali's heart to proceed with his evil plan(which we're not aware of, yet), so he decided to beautify Mashtali's graph. But he made several rules for himself. And also he was too busy with his plans that he didn't have time for such minor tasks, so he asked you for help. Mashtali's ... | 3,000 | false | false | false | false | false | true | false | false | false | true | 2,595 |
1104B | Problem - 1104B - 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,200 | true | false | true | false | true | false | false | false | false | false | 5,181 |
1106B | Lunar New Year is approaching, and Bob is planning to go for a famous restaurant — "Alice's". The restaurant "Alice's" serves $$$n$$$ kinds of food. The cost for the $$$i$$$-th kind is always $$$c_i$$$. Initially, the restaurant has enough ingredients for serving exactly $$$a_i$$$ dishes of the $$$i$$$-th kind. In the ... | 1,500 | false | false | true | false | true | false | false | false | false | false | 5,174 |
1056C | Don't you tell me what you think that I can be If you say that Arkady is a bit old-fashioned playing checkers, you won't be right. There is also a modern computer game Arkady and his friends are keen on. We won't discuss its rules, the only feature important to this problem is that each player has to pick a distinct he... | 1,700 | false | true | true | false | false | false | false | false | true | false | 5,430 |
1450A | A string $$$b$$$ is a subsequence of a string $$$a$$$ if $$$b$$$ can be obtained from $$$a$$$ by deletion of several (possibly, zero or all) characters. For example, "xy" is a subsequence of "xzyw" and "xy", but not "yx". You are given a string $$$a$$$. Your task is to reorder the characters of $$$a$$$ so that "trygub"... | 800 | false | false | false | false | false | true | false | false | true | false | 3,438 |
1906K | You are playing a deck-building game with your friend. There are $$$N$$$ cards, numbered from $$$1$$$ to $$$N$$$. Card $$$i$$$ has the value of $$$A_i$$$. You want to build two decks; one for you and one for your friend. A card cannot be inside both decks, and it is allowed to not use all $$$N$$$ cards. It is also allo... | 2,500 | true | false | false | false | false | false | false | false | false | false | 867 |
1616G | You are given a directed acyclic graph with $$$n$$$ vertices and $$$m$$$ edges. For all edges $$$a o b$$$ in the graph, $$$a < b$$$ holds. You need to find the number of pairs of vertices $$$x$$$, $$$y$$$, such that $$$x > y$$$ and after adding the edge $$$x o y$$$ to the graph, it has a Hamiltonian path. Input The f... | 3,500 | false | false | false | true | false | false | false | false | false | true | 2,550 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.