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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1133E | You are a coach at your local university. There are $$$n$$$ students under your supervision, the programming skill of the $$$i$$$-th student is $$$a_i$$$. You have to form $$$k$$$ teams for yet another new programming competition. As you know, the more students are involved in competition the more probable the victory ... | 1,800 | false | false | false | true | false | false | false | false | true | false | 5,050 |
1856B | You are given an array of positive integers $$$a$$$ of length $$$n$$$. Let's call an array of positive integers $$$b$$$ of length $$$n$$$ good if: 1. $$$a_i eq b_i$$$ for all $$$i$$$ from $$$1$$$ to $$$n$$$, 2. $$$a_1 + a_2 +ldots + a_n = b_1 + b_2 + ldots + b_n$$$. Does a good array exist? Input Each test contains mu... | 900 | true | false | true | false | false | false | false | false | false | false | 1,149 |
891D | Sloth is bad, mkay? So we decided to prepare a problem to punish lazy guys. You are given a tree, you should count the number of ways to remove an edge from it and then add an edge to it such that the final graph is a tree and has a perfect matching. Two ways of this operation are considered different if their removed ... | 3,100 | false | false | false | true | false | false | false | false | false | false | 6,185 |
977D | Polycarp likes to play with numbers. He takes some integer number $$$x$$$, writes it down on the board, and then performs with it $$$n - 1$$$ operations of the two kinds: divide the number $$$x$$$ by $$$3$$$ ($$$x$$$ must be divisible by $$$3$$$); multiply the number $$$x$$$ by $$$2$$$. After each operation, Polycarp... | 1,400 | true | false | false | false | false | false | false | false | true | false | 5,821 |
2020E | You are given an array of $$$n$$$ integers $$$a_1,a_2,ldots,a_n$$$. You are also given an array $$$p_1, p_2, ldots, p_n$$$. Let $$$S$$$ denote the random multiset (i.xa0e., it may contain equal elements) constructed as follows: Initially, $$$S$$$ is empty. For each $$$i$$$ from $$$1$$$ to $$$n$$$, insert $$$a_i$$$ in... | 2,000 | true | false | false | true | false | false | false | false | false | false | 148 |
627F | A remote island chain contains _n_ islands, with some bidirectional bridges between them. The current bridge network forms a tree. In other words, a total of _n_u2009-u20091 bridges connect pairs of islands in a way that it's possible to reach any island from any other island using the bridge network. The center of eac... | 3,400 | false | false | false | false | false | false | false | false | false | true | 7,316 |
1807F | You are given a room that can be represented by a $$$n imes m$$$ grid. There is a ball at position $$$(i_1, j_1)$$$ (the intersection of row $$$i_1$$$ and column $$$j_1$$$), and it starts going diagonally in one of the four directions: The ball is going down and right, denoted by $$$ exttt{DR}$$$; it means that after... | 1,700 | false | false | true | false | false | false | true | false | false | false | 1,430 |
630D | Problem - 630D - Codeforces =============== xa0 ]( "Experimental Educational Round: VolBIT Formulas Blitz") . Output Output one integer — the number of hexagons situated not farther than _n_ cells away from a given cell. Examples Input 2 Output 19 | 1,100 | true | false | false | false | false | false | false | false | false | false | 7,301 |
198A | Qwerty the Ranger took up a government job and arrived on planet Mars. He should stay in the secret lab and conduct some experiments on bacteria that have funny and abnormal properties. The job isn't difficult, but the salary is high. At the beginning of the first experiment there is a single bacterium in the test tube... | 1,700 | true | false | true | false | false | false | false | false | false | false | 9,051 |
1678B2 | This is the hard version of the problem. The only difference between the two versions is that the harder version asks additionally for a minimum number of subsegments. Tokitsukaze has a binary string $$$s$$$ of length $$$n$$$, consisting only of zeros and ones, $$$n$$$ is even. Now Tokitsukaze divides $$$s$$$ into the ... | 1,800 | false | true | true | true | false | false | false | false | false | false | 2,198 |
402E | Problem - 402E - 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,200 | true | false | false | false | false | false | false | false | false | true | 8,213 |
931B | The last stage of Football World Cup is played using the play-off system. There are _n_ teams left in this stage, they are enumerated from 1 to _n_. Several rounds are held, in each round the remaining teams are sorted in the order of their ids, then the first in this order plays with the second, the thirdxa0— with the... | 1,200 | false | false | true | false | false | true | false | false | false | false | 5,980 |
83D | One quite ordinary day Valera went to school (there's nowhere else he should go on a week day). In a maths lesson his favorite teacher Ms. Evans told students about divisors. Despite the fact that Valera loved math, he didn't find this particular topic interesting. Even more, it seemed so boring that he fell asleep in ... | 2,400 | true | false | false | true | false | false | false | false | false | false | 9,550 |
919C | Suppose that you are in a campus and have to go for classes day by day. As you may see, when you hurry to a classroom, you surprisingly find that many seats there are already occupied. Today you and your friends went for class, and found out that some of the seats were occupied. The classroom contains $$$n$$$ rows of s... | 1,300 | false | false | true | false | false | false | true | false | false | false | 6,054 |
833D | Slastyona likes to watch life of nearby grove's dwellers. This time she watches a strange red-black spider sitting at the center of a huge cobweb. The cobweb is a set of _n_ nodes connected by threads, each of the treads is either red of black. Using these threads, the spider can move between nodes. No thread connects ... | 2,800 | false | false | true | false | true | false | false | false | false | false | 6,431 |
777E | Of course you have heard the famous task about Hanoi Towers, but did you know that there is a special factory producing the rings for this wonderful game? Once upon a time, the ruler of the ancient Egypt ordered the workers of Hanoi Factory to create as high tower as possible. They were not ready to serve such a strang... | 2,000 | false | true | false | true | true | false | true | false | true | false | 6,657 |
1216F | You work as a system administrator in a dormitory, which has $$$n$$$ rooms one after another along a straight hallway. Rooms are numbered from $$$1$$$ to $$$n$$$. You have to connect all $$$n$$$ rooms to the Internet. You can connect each room to the Internet directly, the cost of such connection for the $$$i$$$-th roo... | 2,100 | false | true | false | true | true | false | false | false | false | false | 4,591 |
1101E | Polycarp has recently got himself a new job. He now earns so much that his old wallet can't even store all the money he has. Berland bills somehow come in lots of different sizes. However, all of them are shaped as rectangles (possibly squares). All wallets are also produced in form of rectangles (possibly squares). A ... | 1,500 | false | false | true | false | false | false | false | false | false | false | 5,196 |
913A | Problem - 913A - Codeforces =============== xa0 , and denotes the remainder of division of _x_ by _y_. You are asked to solve the "reverse" problem. Given integers _n_ and _m_, calculate . Input The first line contains a single integer _n_ (1u2009≤u2009_n_u2009≤u2009108). The second line contains a single... | 900 | true | false | true | false | false | false | false | false | false | false | 6,091 |
1866L | After working at a factory (Lihmuf Sorting), Lihmuf wants to play a game with his good friend, Pak Chanek. There are $$$N$$$ boxes numbered from $$$1$$$ to $$$N$$$. The $$$i$$$-th box contains $$$i$$$ balls. Pak Chanek and Lihmuf will play a game using those boxes. There will be $$$N$$$ turns numbered from $$$1$$$ to $... | 2,400 | true | false | false | false | false | false | true | true | false | false | 1,077 |
761F | Dasha decided to have a rest after solving the problem _D_ and began to look photos from previous competitions. Let's call photos as the matrix with the size _n_u2009×u2009_m_, which consists of lowercase English letters. Some _k_ photos especially interested her, because they can be received from photo-template by pai... | 2,600 | false | false | true | true | true | false | true | false | false | false | 6,744 |
732B | Recently a dog was bought for Polycarp. The dog's name is Cormen. Now Polycarp has a lot of troubles. For example, Cormen likes going for a walk. Empirically Polycarp learned that the dog needs at least _k_ walks for any two consecutive days in order to feel good. For example, if _k_u2009=u20095 and yesterday Polycarp ... | 1,000 | false | true | false | true | false | false | false | false | false | false | 6,869 |
827F | Arkady likes to walk around his kitchen. His labyrinthine kitchen consists of several important places connected with passages. Unfortunately it happens that these passages are flooded with milk so that it's impossible to pass through them. Namely, it's possible to pass through each passage in any direction only during... | 3,200 | false | false | false | true | true | false | false | false | false | true | 6,450 |
877B | Problem - 877B - 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,500 | false | false | false | true | false | false | true | false | false | false | 6,239 |
1396E | You are given an integer $$$k$$$ and a tree $$$T$$$ with $$$n$$$ nodes ($$$n$$$ is even). Let $$$dist(u, v)$$$ be the number of edges on the shortest path from node $$$u$$$ to node $$$v$$$ in $$$T$$$. Let us define a undirected weighted complete graph $$$G = (V, E)$$$ as following: $$$V = {x mid 1 le x le n }$$$ i.e. ... | 3,200 | false | false | false | false | false | true | false | false | false | false | 3,689 |
1207A | There are two types of burgers in your restaurant — hamburgers and chicken burgers! To assemble a hamburger you need two buns and a beef patty. To assemble a chicken burger you need two buns and a chicken cutlet. You have $$$b$$$ buns, $$$p$$$ beef patties and $$$f$$$ chicken cutlets in your restaurant. You can sell on... | 800 | true | true | true | false | false | false | true | false | false | false | 4,661 |
1949B | The Czech cuisine features $$$n$$$ appetizers and $$$n$$$ main dishes. The $$$i$$$-th appetizer has spiciness $$$a_i$$$, and the $$$i$$$-th main dish has spiciness $$$b_i$$$. A typical Czech meal consists of exactly one appetizer and one main dish. You want to pair up the $$$n$$$ appetizers and $$$n$$$ main dishes into... | 1,500 | false | true | false | false | false | false | true | true | true | false | 591 |
1283C | There are $$$n$$$ friends who want to give gifts for the New Year to each other. Each friend should give exactly one gift and receive exactly one gift. The friend cannot give the gift to himself. For each friend the value $$$f_i$$$ is known: it is either $$$f_i = 0$$$ if the $$$i$$$-th friend doesn't know whom he wants... | 1,500 | true | false | false | false | true | true | false | false | false | false | 4,278 |
478C | Problem - 478C - 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,800 | false | true | false | false | false | false | false | false | false | false | 7,919 |
192A | Problem - 192A - 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 | false | false | true | false | false | false | true | true | false | false | 9,072 |
1783B | For a square matrix of integers of size $$$n imes n$$$, let's define its beauty as follows: for each pair of side-adjacent elements $$$x$$$ and $$$y$$$, write out the number $$$x-y$$$, and then find the number of different numbers among them. For example, for the matrix $$$begin{pmatrix} 1 & 3 4 & 2 end{pmatrix}$$$ th... | 1,100 | true | false | false | false | false | true | false | false | false | false | 1,578 |
520D | Once Vasya and Petya assembled a figure of _m_ cubes, each of them is associated with a number between 0 and _m_u2009-u20091 (inclusive, each number appeared exactly once). Let's consider a coordinate system such that the _OX_ is the ground, and the _OY_ is directed upwards. Each cube is associated with the coordinates... | 2,100 | false | true | true | false | false | false | false | false | false | false | 7,754 |
1822A | Mushroom Filippov cooked himself a meal and while having his lunch, he decided to watch a video on TubeTube. He can not spend more than $$$t$$$ seconds for lunch, so he asks you for help with the selection of video. The TubeTube feed is a list of $$$n$$$ videos, indexed from $$$1$$$ to $$$n$$$. The $$$i$$$-th video las... | 800 | false | false | true | false | false | false | true | false | false | false | 1,351 |
703A | Mishka is a little polar bear. As known, little bears loves spending their free time playing dice for chocolates. Once in a wonderful sunny morning, walking around blocks of ice, Mishka met her friend Chris, and they started playing the game. Rules of the game are very simple: at first number of rounds _n_ is defined. ... | 800 | false | false | true | false | false | false | false | false | false | false | 7,011 |
1796A | The FB-string is formed as follows. Initially, it is empty. We go through all positive integers, starting from $$$1$$$, in ascending order, and do the following for each integer: if the current integer is divisible by $$$3$$$, append F to the end of the FB-string; if the current integer is divisible by $$$5$$$, appen... | 800 | false | false | true | false | false | false | true | false | false | false | 1,502 |
136A | Little Petya very much likes gifts. Recently he has received a new laptop as a New Year gift from his mother. He immediately decided to give it to somebody else as what can be more pleasant than giving somebody gifts. And on this occasion he organized a New Year party at his place and invited _n_ his friends there. If ... | 800 | false | false | true | false | false | false | false | false | false | false | 9,332 |
1914E1 | The easy and hard versions of this problem differ only in the constraints on the number of test cases and $$$n$$$. In the easy version, the number of test cases does not exceed $$$10^3$$$, and $$$n$$$ does not exceed $$$6$$$. Recently, Alice and Bob were given marbles of $$$n$$$ different colors by their parents. Alice... | 1,400 | false | true | false | false | false | false | true | false | true | false | 815 |
1787A | Problem - 1787A - 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 | true | false | false | false | false | true | false | false | false | false | 1,563 |
40A | Problem - 40A - Codeforces =============== xa0 ") | 1,300 | true | false | true | false | false | true | false | false | false | false | 9,789 |
329E | There are _n_ cities on a two dimensional Cartesian plane. The distance between two cities is equal to the Manhattan distance between them (see the Notes for definition). A Hamiltonian cycle of the cities is defined as a permutation of all _n_ cities. The length of this Hamiltonian cycle is defined as the sum of the di... | 3,100 | true | false | false | false | false | false | false | false | false | false | 8,525 |
1294A | Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has $$$a$$$ coins, Barbara has $$$b$$$ coins and Cerene has $$$c$$$ coins. Recently Polycarp has returned from the trip around the world and brought $$$n$$$ coins. He wants to distribute all these $$$n$$$ coins between hi... | 800 | true | false | false | false | false | false | false | false | false | false | 4,229 |
201E | Once _n_ people simultaneously signed in to the reception at the recently opened, but already thoroughly bureaucratic organization (abbreviated TBO). As the organization is thoroughly bureaucratic, it can accept and cater for exactly one person per day. As a consequence, each of _n_ people made an appointment on one of... | 2,600 | false | false | false | false | false | false | false | true | false | false | 9,035 |
839B | Daenerys Targaryen has an army consisting of _k_ groups of soldiers, the _i_-th group contains _a__i_ soldiers. She wants to bring her army to the other side of the sea to get the Iron Throne. She has recently bought an airplane to carry her army through the sea. The airplane has _n_ rows, each of them has 8 seats. We ... | 1,900 | false | true | true | false | false | false | true | false | false | false | 6,407 |
1479D | In Homer's country, there are $$$n$$$ cities numbered $$$1$$$ to $$$n$$$ and they form a tree. That is, there are $$$(n-1)$$$ undirected roads between these $$$n$$$ cities and every two cities can reach each other through these roads. Homer's country is an industrial country, and each of the $$$n$$$ cities in it contai... | 2,900 | false | false | false | false | true | false | true | true | false | false | 3,277 |
2B | Problem - 2B - Codeforces =============== xa0 , _n_ is the size of the matrix. Then follow _n_ lines containing the matrix elements (non-negative integer numbers not exceeding 109). Output In the first line print the least number of trailing zeros. In the second line print the correspondent way itself... | 2,000 | true | false | false | true | false | false | false | false | false | false | 9,980 |
676C | Problem - 676C - 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,500 | false | false | false | true | false | false | false | true | false | false | 7,124 |
1433F | You are given a matrix $$$a$$$ of size $$$n imes m$$$ consisting of integers. You can choose no more than $$$leftlfloorfrac{m}{2} ight floor$$$ elements in each row. Your task is to choose these elements in such a way that their sum is divisible by $$$k$$$ and this sum is the maximum. In other words, you can choose no... | 2,100 | false | false | false | true | false | false | false | false | false | false | 3,494 |
336A | Problem - 336A - 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 | false | false | false | false | false | 8,492 |
309A | People like to be fit. That's why many of them are ready to wake up at dawn, go to the stadium and run. In this problem your task is to help a company design a new stadium. The city of N has a shabby old stadium. Many people like it and every morning thousands of people come out to this stadium to run. The stadium can ... | 2,000 | true | false | false | false | false | false | false | true | false | false | 8,607 |
1870E | You are given an array of integers $$$a$$$ of size $$$n$$$. You can choose a set of non-overlapping subarrays of the given array (note that some elements may be not included in any subarray, this is allowed). For each selected subarray, calculate the MEX of its elements, and then calculate the of an array is the smalle... | 2,300 | false | false | false | true | false | false | true | false | false | false | 1,055 |
185A | Problem - 185A - 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 | false | false | false | false | false | false | false | false | 9,104 |
855E | Harry came to know from Dumbledore that Salazar Slytherin's locket is a horcrux. This locket was present earlier at 12 Grimmauld Place, the home of Sirius Black's mother. It was stolen from there and is now present in the Ministry of Magic in the office of Dolorous Umbridge, Harry's former Defense Against the Dark Arts... | 2,200 | false | false | false | true | false | false | false | false | false | false | 6,323 |
1551C | Stephen Queen wants to write a story. He is a very unusual writer, he uses only letters 'a', 'b', 'c', 'd' and 'e'! To compose a story, Stephen wrote out $$$n$$$ words consisting of the first $$$5$$$ lowercase letters of the Latin alphabet. He wants to select the maximum number of words to make an interesting story. Le... | 1,500 | false | true | false | false | false | false | false | false | true | false | 2,889 |
135D | Little Petya very much likes rectangular tables that consist of characters "0" and "1". Recently he has received one such table as a gift from his mother. The table contained _n_ rows and _m_ columns. The rows are numbered from top to bottom from 1 to _n_, the columns are numbered from the left to the right from 1 to _... | 2,500 | false | false | true | false | false | false | true | false | false | false | 9,334 |
1822E | You are given a string $$$s$$$, consisting of lowercase English letters. In one operation, you are allowed to swap any two characters of the string $$$s$$$. A string $$$s$$$ of length $$$n$$$ is called an anti-palindrome, if $$$s[i] e s[n - i + 1]$$$ for every $$$i$$$ ($$$1 le i le n$$$). For example, the strings "cod... | 1,600 | true | true | false | false | false | false | false | false | false | false | 1,347 |
1608C | $$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o... | 1,700 | false | true | false | true | true | false | false | false | false | true | 2,613 |
1181B | Dima worked all day and wrote down on a long paper strip his favorite number $$$n$$$ consisting of $$$l$$$ digits. Unfortunately, the strip turned out to be so long that it didn't fit in the Dima's bookshelf. To solve the issue, Dima decided to split the strip into two non-empty parts so that each of them contains a po... | 1,500 | false | true | true | false | false | false | false | false | false | false | 4,813 |
1997A | Monocarp's current password on Codeforces is a string $$$s$$$, consisting of lowercase Latin letters. Monocarp thinks that his current password is too weak, so he wants to insert exactly one lowercase Latin letter into the password to make it stronger. Monocarp can choose any letter and insert it anywhere, even before ... | 800 | false | false | true | false | false | false | true | false | false | false | 283 |
1372F | # Omkar and Modes Input file: standard input Output file: standard output Time limit: 3 seconds Memory limit: 256 megabytes Ray lost his array and needs to find it by asking Omkar. Omkar is willing to disclose that the array has the following qualities: 1. The array has n (1 ≤ n ≤ 2 · 10 5) elements. 2. Every elemen... | 2,700 | false | false | false | false | false | false | false | true | false | false | 3,802 |
1929D | Sasha wants to take a walk with his girlfriend in the city. The city consists of $$$n$$$ intersections, numbered from $$$1$$$ to $$$n$$$. Some of them are connected by roads, and from any intersection, there is exactly one simple path$$$^{dagger}$$$ to any other intersection. In other words, the intersections and the r... | 1,900 | true | false | false | true | false | false | false | false | false | false | 714 |
1200C | Amugae is in a very large round corridor. The corridor consists of two areas. The inner area is equally divided by $$$n$$$ sectors, and the outer area is equally divided by $$$m$$$ sectors. A wall exists between each pair of sectors of same area (inner or outer), but there is no wall between the inner area and the oute... | 1,400 | true | false | false | false | false | false | false | false | false | false | 4,699 |
1287B | Bees Alice and Alesya gave beekeeper Polina famous card game "Set" as a Christmas present. The deck consists of cards that vary in four features across three options for each kind of feature: number of shapes, shape, shading, and color. In this game, some combinations of three cards are said to make up a set. For every... | 1,500 | false | false | true | false | true | false | true | false | false | false | 4,253 |
232A | Problem - 232A - 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 | false | true | false | false | false | true | false | true | false | true | 8,911 |
1370C | # Number Game Input file: standard input Output file: standard output Time limit: 2 seconds Memory limit: 256 megabytes Ashishgup and FastestFinger play a game. They start with a number n and play in turns. In each turn, a player can make any one of the following moves: • Divide n by any of its odd divisors greater... | 1,400 | true | false | false | false | false | false | false | false | false | false | 3,819 |
1615D | Twas the night before Christmas, and Santa's frantically setting up his new Christmas tree! There are $$$n$$$ nodes in the tree, connected by $$$n-1$$$ edges. On each edge of the tree, there's a set of Christmas lights, which can be represented by an integer in binary representation. He has $$$m$$$ elves come over and ... | 2,200 | false | false | false | false | false | false | false | false | false | true | 2,561 |
441D | A permutation _p_ of length _n_ is a sequence of distinct integers _p_1,u2009_p_2,u2009...,u2009_p__n_ (1u2009≤u2009_p__i_u2009≤u2009_n_). A permutation is an identity permutation, if for any _i_ the following equation holds _p__i_u2009=u2009_i_. A swap (_i_,u2009_j_) is the operation that swaps elements _p__i_ and _p_... | 2,100 | true | false | true | false | false | true | false | false | false | true | 8,072 |
1530D | Every December, VK traditionally holds an event for its employees named "Secret Santa". Here's how it happens. $$$n$$$ employees numbered from $$$1$$$ to $$$n$$$ take part in the event. Each employee $$$i$$$ is assigned a different employee $$$b_i$$$, to which employee $$$i$$$ has to make a new year gift. Each employee... | 1,600 | true | true | false | false | false | true | false | false | false | true | 3,012 |
1974F | Alice and Bob were playing a game again. They have a grid of size $$$a imes b$$$ ($$$1 le a, b le 10^9$$$), on which there are $$$n$$$ chips, with at most one chip in each cell. The cell at the intersection of the $$$x$$$-th row and the $$$y$$$-th column has coordinates $$$(x, y)$$$. Alice made the first move, and the... | 1,900 | false | false | true | false | true | false | true | true | true | false | 444 |
1942G | Bessie has recently started playing a famous card game. In the game, there is only one deck of cards, consisting of $$$a$$$ "draw $$$0$$$" cards, $$$b$$$ "draw $$$1$$$" cards, $$$c$$$ "draw $$$2$$$" cards, and $$$5$$$ special cards. At the start of the game, all cards are in the randomly shuffled deck. Bessie starts th... | 2,800 | true | false | false | true | false | false | false | false | false | false | 625 |
1965B | You are given two integers $$$n$$$ and $$$k$$$. Find a sequence $$$a$$$ of non-negative integers of size at most $$$25$$$ such that the following conditions hold. There is no subsequence of $$$a$$$ with a sum of $$$k$$$. For all $$$1 le v le n$$$ where $$$v e k$$$, there is a subsequence of $$$a$$$ with a sum of $$$... | 1,800 | false | true | false | false | false | true | false | false | false | false | 515 |
1003C | The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and they claim that this summer is abnormally hot. But any scientific claim sounds a lot more reasonable if there are some numbers involved, so they have decided to actually cal... | 1,300 | true | false | true | false | false | false | true | false | false | false | 5,672 |
252B | Little Petya likes arrays of integers a lot. Recently his mother has presented him one such array consisting of _n_ elements. Petya is now wondering whether he can swap any two distinct integers in the array so that the array got unsorted. Please note that Petya can not swap equal integers even if they are in distinct ... | 1,800 | false | false | false | false | false | false | true | false | true | false | 8,825 |
949A | Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it. Let us denote bad days as 0 and good days as 1. Then, for example, sequences o... | 1,600 | false | true | false | false | false | false | false | false | false | false | 5,924 |
592E | BCPC stands for Byteforces Collegiate Programming Contest, and is the most famous competition in Byteforces. BCPC is a team competition. Each team is composed by a coach and three contestants. Blenda is the coach of the Bit State University(BSU), and she is very strict selecting the members of her team. In BSU there ar... | 2,700 | false | false | false | false | false | false | false | true | false | false | 7,478 |
720D | Little girl Masha likes winter sports, today she's planning to take part in slalom skiing. The track is represented as a grid composed of _n_u2009×u2009_m_ squares. There are rectangular obstacles at the track, composed of grid squares. Masha must get from the square (1,u20091) to the square (_n_,u2009_m_). She can mov... | 3,100 | false | false | false | true | true | false | false | false | true | false | 6,934 |
719A | Every summer Vitya comes to visit his grandmother in the countryside. This summer, he got a huge wart. Every grandma knows that one should treat warts when the moon goes down. Thus, Vitya has to catch the moment when the moon is down. Moon cycle lasts 30 days. The size of the visible part of the moon (in Vitya's units)... | 1,100 | false | false | true | false | false | false | false | false | false | false | 6,939 |
1954B | Let's call an array $$$a$$$ beautiful if you can make all its elements the same by using the following operation an arbitrary number of times (possibly, zero): choose an index $$$i$$$ ($$$2 le i le a - 1$$$) such that $$$a_{i - 1} = a_{i + 1}$$$, and replace $$$a_i$$$ with $$$a_{i - 1}$$$. You are given a beautiful ar... | 1,200 | true | false | true | false | false | false | false | false | false | false | 553 |
1730A | One day, Vogons wanted to build a new hyperspace highway through a distant system with $$$n$$$ planets. The $$$i$$$-th planet is on the orbit $$$a_i$$$, there could be multiple planets on the same orbit. It's a pity that all the planets are on the way and need to be destructed. Vogons have two machines to do that. The... | 800 | false | true | false | false | true | false | false | false | true | false | 1,911 |
1090M | Problem - 1090M - 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,000 | false | false | true | false | false | false | false | false | false | false | 5,260 |
1685D1 | This is an easy version of the problem. The difference between the easy and hard versions is that in this version, you can output any permutation with the smallest weight. You are given a permutation $$$p_1, p_2, ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$. Let's define the weight of the permutation $$$q_1, q_2, ... | 2,800 | false | false | false | false | false | true | false | false | false | false | 2,162 |
1829E | You are given an $$$n imes m$$$ grid $$$a$$$ of non-negative integers. The value $$$a_{i,j}$$$ represents the depth of water at the $$$i$$$-th row and $$$j$$$-th column. A lake is a set of cells such that: each cell in the set has $$$a_{i,j} > 0$$$, and there exists a path between any pair of cells in the lake by go... | 1,100 | false | false | true | false | false | false | false | false | false | true | 1,310 |
1691B | A class of students got bored wearing the same pair of shoes every day, so they decided to shuffle their shoes among themselves. In this problem, a pair of shoes is inseparable and is considered as a single object. There are $$$n$$$ students in the class, and you are given an array $$$s$$$ in non-decreasing order, wher... | 1,000 | false | true | true | false | false | true | false | false | false | false | 2,135 |
914H | Ember and Storm play a game. First, Ember picks a labelled tree _T_ of _n_ vertices, such that the degree of every vertex is at most _d_. Then, Storm picks two distinct vertices _u_ and _v_ in this tree and writes down the labels of the vertices in the path from _u_ to _v_ in a sequence _a_1,u2009_a_2... _a__k_. Finall... | 3,400 | false | false | false | true | false | false | false | false | false | false | 6,076 |
1926A | Problem - 1926A - 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 | 737 |
23D | Problem - 23D - Codeforces =============== xa0 . Each of the following _T_ lines contains numbers _x_1, _y_1, _x_2, _y_2, _x_3, _y_3 — coordinates of different points that are the centers of three equal sides (non-negative integer numbers, not exceeding 10). Output For each test output two lines. If the r... | 2,600 | true | false | false | false | false | false | false | false | false | false | 9,880 |
630K | Problem - 630K - Codeforces =============== xa0 ]( "Experimental Educational Round: VolBIT Formulas Blitz") — the prediction on the number of people who will buy the game. Output Output one integer showing how many numbers from 1 to _n_ are not divisible by any number from 2 to 10. Examples Inp... | 1,500 | true | false | false | false | false | false | false | false | false | false | 7,294 |
1154G | Problem - 1154G - 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,200 | true | true | false | false | false | false | true | false | false | false | 4,937 |
139A | One Sunday Petr went to a bookshop and bought a new book on sports programming. The book had exactly _n_ pages. Petr decided to start reading it starting from the next day, that is, from Monday. Petr's got a very tight schedule and for each day of the week he knows how many pages he will be able to read on that day. So... | 1,000 | false | false | true | false | false | false | false | false | false | false | 9,320 |
445A | DZY loves chessboard, and he enjoys playing with it. He has a chessboard of _n_ rows and _m_ columns. Some cells of the chessboard are bad, others are good. For every good cell, DZY wants to put a chessman on it. Each chessman is either white or black. After putting all chessmen, DZY wants that no two chessmen with the... | 1,200 | false | false | true | false | false | false | false | false | false | false | 8,058 |
1547F | You are given an array of positive integers $$$a = $$$-th element is the $$$0$$$-th element). Formally speaking, a new array $$$b = [b_0, b_1, dots, b_{n - 1}]$$$ is being built from array $$$a = [a_0, a_1, dots, a_{n - 1}]$$$ such that $$$b_i$$$ $$$= gcd(a_i, a_{(i + 1) mod n})$$$, where $$$gcd(x, y)$$$ is the greates... | 1,900 | false | false | false | false | true | false | true | true | false | false | 2,908 |
338D | Problem - 338D - 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,900 | true | false | false | false | false | false | false | false | false | false | 8,482 |
652B | Problem - 652B - Codeforces =============== xa0 ]( "Announcement") — the number of elements in the array _a_. The second line contains _n_ integers _a__i_ (1u2009≤u2009_a__i_u2009≤u2009109) — the elements of the array _a_. Output If it's possible to make the array _a_ _z_-sorted print _n_ space separated i... | 1,000 | false | false | false | false | false | false | false | false | true | false | 7,209 |
158E | Cool J has recently become a businessman Mr. Jackson, and he has to make a lot of phone calls now. Today he has _n_ calls planned. For each call we know the moment _t__i_ (in seconds since the start of the day) when it is scheduled to start and its duration _d__i_ (in seconds). All _t__i_ are different. Mr. Jackson is ... | 1,900 | false | false | false | true | false | false | false | false | true | false | 9,241 |
1612C | You are a usual chat user on the most famous streaming platform. Of course, there are some moments when you just want to chill and spam something. More precisely, you want to spam the emote triangle of size $$$k$$$. It consists of $$$2k-1$$$ messages. The first message consists of one emote, the second one — of two emo... | 1,300 | true | false | false | false | false | false | false | true | false | false | 2,581 |
734A | Problem - 734A - 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 | 6,858 |
446E | DZY owns 2_m_ islands near his home, numbered from 1 to 2_m_. He loves building bridges to connect the islands. Every bridge he builds takes one day's time to walk across. DZY has a strange rule of building the bridges. For every pair of islands _u_,u2009_v_xa0(_u_u2009≠u2009_v_), he has built 2_k_ different bridges co... | 3,100 | true | false | false | false | false | false | false | false | false | false | 8,052 |
1949F | You are the developer of a dating app which ignores gender completely. The app has $$$n$$$ users, indexed from $$$1$$$ to $$$n$$$. Each user's profile features a list of the activities they enjoy doing. There are $$$m$$$ possible activities, indexed from $$$1$$$ to $$$m$$$. A match between two users is good if they sha... | 2,200 | false | true | false | false | false | false | false | false | true | false | 587 |
888B | Ivan has a robot which is situated on an infinite grid. Initially the robot is standing in the starting cell (0,u20090). The robot can process commands. There are four types of commands it can perform: U — move from the cell (_x_,u2009_y_) to (_x_,u2009_y_u2009+u20091); D — move from (_x_,u2009_y_) to (_x_,u2009_y_u2... | 1,000 | false | true | false | false | false | false | false | false | false | false | 6,195 |
616A | Problem - 616A - Codeforces =============== xa0 . You should check what number _a_ or _b_ is greater or determine that they are equal. The input size is very large so don't use the reading of symbols one by one. Instead of that use the reading of a whole line or token. As input/output can reach huge size ... | 900 | false | false | true | false | false | false | false | false | false | false | 7,375 |
1310B | The biggest event of the year – Cota 2 world championship "The Innernational" is right around the corner. $$$2^n$$$ teams will compete in a double-elimination format (please, carefully read problem statement even if you know what is it) to identify the champion. Teams are numbered from $$$1$$$ to $$$2^n$$$ and will pla... | 2,500 | false | false | true | true | false | false | false | false | false | false | 4,148 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.