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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1227D1 | This is the easier version of the problem. In this version $$$1 le n, m le 100$$$. You can hack this problem only if you solve and lock both problems. You are given a sequence of integers $$$a=[a_1,a_2,dots,a_n]$$$ of length $$$n$$$. Its subsequence is obtained by removing zero or more elements from the sequence $$$a$$... | 1,600 | false | true | false | false | true | false | false | false | false | false | 4,541 |
208E | Polycarpus got hold of a family relationship tree. The tree describes family relationships of _n_ people, numbered 1 through _n_. Each person in the tree has no more than one parent. Let's call person _a_ a 1-ancestor of person _b_, if _a_ is the parent of _b_. Let's call person _a_ a _k_-ancestor (_k_u2009>u20091) of ... | 2,100 | false | false | false | false | true | false | false | true | false | false | 8,997 |
683D | Problem - 683D - Codeforces =============== xa0 times. The final piece of the chocolate bar should be whole, and breaks are made along the line of slices' section for the whole length of the current piece. Input The first line contains the positive integer _q_ (1u2009≤u2009_q_u2009≤u2009100) — the number of choco... | 1,400 | true | false | false | false | false | false | false | false | false | false | 7,090 |
1433B | There is a bookshelf which can fit $$$n$$$ books. The $$$i$$$-th position of bookshelf is $$$a_i = 1$$$ if there is a book on this position and $$$a_i = 0$$$ otherwise. It is guaranteed that there is at least one book on the bookshelf. In one move, you can choose some contiguous segment $$$[l; r]$$$ consisting of books... | 800 | false | true | true | false | false | false | false | false | false | false | 3,498 |
1904A | Lunchbox is done with playing chess! His queen and king just got forked again! In chess, a fork is when a knight attacks two pieces of higher value, commonly the king and the queen. Lunchbox knows that knights can be tricky, and in the version of chess that he is playing, knights are even trickier: instead of moving $$... | 900 | false | false | true | false | false | false | true | false | false | false | 890 |
1797C | This is an interactive problem. Li Ming and Li Hua are playing a game. Li Hua has a chessboard of size $$$n imes m$$$. Denote $$$(r, c)$$$ ($$$1le rle n, 1le cle m$$$) as the cell on the $$$r$$$-th row from the top and on the $$$c$$$-th column from the left. Li Ming put a king on the chessboard and Li Hua needs to gues... | 1,600 | false | true | false | false | false | true | false | false | false | false | 1,494 |
1800C1 | This is an easy version of the problem. It differs from the hard one only by constraints on $$$n$$$ and $$$t$$$. There is a deck of $$$n$$$ cards, each of which is characterized by its power. There are two types of cards: a hero card, the power of such a card is always equal to $$$0$$$; a bonus card, the power of suc... | 1,000 | false | true | false | false | true | false | false | false | false | false | 1,473 |
1670C | While searching for the pizza, baby Hosssam came across two permutations $$$a$$$ and $$$b$$$ of length $$$n$$$. Recall that a permutation is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutatio... | 1,400 | true | false | true | false | true | false | false | false | false | true | 2,255 |
893E | Problem - 893E - 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 | true | false | false | true | false | false | false | false | false | false | 6,177 |
1762B | An array $$$b$$$ of $$$m$$$ positive integers is good if for all pairs $$$i$$$ and $$$j$$$ ($$$1 leq i,j leq m$$$), $$$max(b_i,b_j)$$$ is divisible by $$$min(b_i,b_j)$$$. You are given an array $$$a$$$ of $$$n$$$ positive integers. You can perform the following operation: Select an index $$$i$$$ ($$$1 leq i leq n$$$) ... | 1,100 | false | false | true | false | false | true | false | false | true | false | 1,739 |
838E | You are given an strictly convex polygon with _n_ vertices. It is guaranteed that no three points are collinear. You would like to take a maximum non intersecting path on the polygon vertices that visits each point at most once. More specifically your path can be represented as some sequence of distinct polygon vertice... | 2,300 | false | false | false | true | false | false | false | false | false | false | 6,410 |
1936C | You are at a dueling arena. You also possess $$$n$$$ Pokémons. Initially, only the $$$1$$$-st Pokémon is standing in the arena. Each Pokémon has $$$m$$$ attributes. The $$$j$$$-th attribute of the $$$i$$$-th Pokémon is $$$a_{i,j}$$$. Each Pokémon also has a cost to be hired: the $$$i$$$-th Pokémon's cost is $$$c_i$$$. ... | 2,400 | false | true | true | false | true | false | false | false | true | true | 666 |
1979B | You are given two distinct non-negative integers $$$x$$$ and $$$y$$$. Consider two infinite sequences $$$a_1, a_2, a_3, ldots$$$ and $$$b_1, b_2, b_3, ldots$$$, where $$$a_n = n oplus x$$$; $$$b_n = n oplus y$$$. Here, $$$x oplus y$$$ denotes the [bitwise XOR]( operation of integers $$$x$$$ and $$$y$$$. For example, ... | 1,000 | false | true | false | false | false | false | false | false | false | false | 415 |
717A | Problem - 717A - Codeforces =============== xa0 . Input The first line of the input contains three integers _k_, _l_ and _r_ (1u2009≤u2009_k_u2009≤u2009200, 1u2009≤u2009_l_u2009≤u2009_r_u2009≤u20091018). Output Output a single number: the number of ways to select _k_ different tours of the same length, mo... | 2,900 | true | false | false | false | false | false | false | false | false | false | 6,952 |
1891E | The boy Smilo is learning algorithms with a teacher named Brukhovich. Over the course of the year, Brukhovich will administer $$$n$$$ exams. For each exam, its difficulty $$$a_i$$$ is known, which is a non-negative integer. Smilo doesn't like when the greatest common divisor of the difficulties of two consecutive exams... | 2,500 | true | true | true | false | false | false | true | false | true | false | 953 |
1375B | # Neighbor Grid Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 256 megabytes You are given a grid with n rows and m columns, where each cell has a non-negative integer written on it. We say the grid is good if for each cell the following condition holds: if it has a number... | 1,200 | false | true | false | false | false | true | false | false | false | false | 3,786 |
1213E | You are given two strings $$$s$$$ and $$$t$$$ both of length $$$2$$$ and both consisting only of characters 'a', 'b' and 'c'. Possible examples of strings $$$s$$$ and $$$t$$$: "ab", "ca", "bb". You have to find a string $$$res$$$ consisting of $$$3n$$$ characters, $$$n$$$ characters should be 'a', $$$n$$$ characters sh... | 1,900 | false | false | false | false | false | true | true | false | false | false | 4,614 |
1839C | You have a sequence $$$a_1, a_2, ldots, a_n$$$ of length $$$n$$$, each element of which is either $$$0$$$ or $$$1$$$, and a sequence $$$b$$$, which is initially empty. You are going to perform $$$n$$$ operations. On each of them you will increase the length of $$$b$$$ by $$$1$$$. On the $$$i$$$-th operation you choose... | 1,300 | false | false | false | false | false | true | false | false | false | false | 1,256 |
946G | Problem - 946G - 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 | true | true | false | false | false | false | false | 5,926 |
1220E | Alex decided to go on a touristic trip over the country. For simplicity let's assume that the country has $$$n$$$ cities and $$$m$$$ bidirectional roads connecting them. Alex lives in city $$$s$$$ and initially located in it. To compare different cities Alex assigned each city a score $$$w_i$$$ which is as high as inte... | 2,200 | false | true | false | true | false | false | false | false | false | true | 4,569 |
1006E | In this problem you will have to help Berland army with organizing their command delivery system. There are $$$n$$$ officers in Berland army. The first officer is the commander of the army, and he does not have any superiors. Every other officer has exactly one direct superior. If officer $$$a$$$ is the direct superior... | 1,600 | false | false | false | false | false | false | false | false | false | true | 5,651 |
611B | Problem - 611B - Codeforces =============== xa0 ]( "Announcement") xa0— the first year and the last year in Limak's interval respectively. Output Print one integerxa0– the number of years Limak will count in his chosen interval. Examples Input 5 10 Output 2 Input 2015 2015 Output 1 Input 100 105 Outpu... | 1,300 | false | false | true | false | false | false | true | false | false | false | 7,400 |
1672H | You have a binary string $$$a$$$ of length $$$n$$$ consisting only of digits $$$0$$$ and $$$1$$$. You are given $$$q$$$ queries. In the $$$i$$$-th query, you are given two indices $$$l$$$ and $$$r$$$ such that $$$1 le l le r le n$$$. Let $$$s=a[l,r]$$$. You are allowed to do the following operation on $$$s$$$: 1. Choos... | 2,700 | false | true | false | false | true | true | false | false | false | false | 2,237 |
1040A | A group of $$$n$$$ dancers rehearses a performance for the closing ceremony. The dancers are arranged in a row, they've studied their dancing moves and can't change positions. For some of them, a white dancing suit is already bought, for some of them — a black one, and for the rest the suit will be bought in the future... | 1,000 | false | true | false | false | false | false | false | false | false | false | 5,497 |
1970E1 | Harry Potter is hiking in the Alps surrounding Lake Geneva. In this area there are $$$m$$$ cabins, numbered 1 to $$$m$$$. Each cabin is connected, with one or more trails, to a central meeting point next to the lake. Each trail is either short or long. Cabin $$$i$$$ is connected with $$$s_i$$$ short trails and $$$l_i$$... | 1,800 | false | false | false | true | false | false | false | false | false | false | 474 |
383C | Iahub likes trees very much. Recently he discovered an interesting tree named propagating tree. The tree consists of _n_ nodes numbered from 1 to _n_, each node _i_ having an initial value _a__i_. The root of the tree is node 1. This tree has a special property: when a value _val_ is added to a value of node _i_, the v... | 2,000 | false | false | false | false | true | false | false | false | false | false | 8,296 |
1016F | There are $$$n$$$ cities in the country of Berland. Some of them are connected by bidirectional roads in such a way that there exists exactly one path, which visits each road no more than once, between every pair of cities. Each road has its own length. Cities are numbered from $$$1$$$ to $$$n$$$. The travelling time b... | 2,600 | false | false | false | true | false | false | false | false | false | false | 5,607 |
1704A | AquaMoon has two binary sequences $$$a$$$ and $$$b$$$, which contain only $$$0$$$ and $$$1$$$. AquaMoon can perform the following two operations any number of times ($$$a_1$$$ is the first element of $$$a$$$, $$$a_2$$$ is the second element of $$$a$$$, and so on): Operation 1: if $$$a$$$ contains at least two elements... | 800 | false | true | false | false | false | true | false | false | false | false | 2,055 |
965E | Arkady's code contains $$$n$$$ variables. Each variable has a unique name consisting of lowercase English letters only. One day Arkady decided to shorten his code. He wants to replace each variable name with its non-empty prefix so that these new names are still unique (however, a new name of some variable can coincide... | 2,200 | false | true | false | true | true | false | false | false | false | false | 5,838 |
1923C | An array $$$a$$$ of length $$$m$$$ is considered good if there exists an integer array $$$b$$$ of length $$$m$$$ such that the following conditions hold: 1. $$$sumlimits_{i=1}^{m} a_i = sumlimits_{i=1}^{m} b_i$$$; 2. $$$a_i eq b_i$$$ for every index $$$i$$$ from $$$1$$$ to $$$m$$$; 3. $$$b_i > 0$$$ for every index $$$... | 1,400 | false | true | false | false | false | true | false | false | false | false | 750 |
214A | Problem - 214A - 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 | false | false | false | false | true | false | false | false | 8,983 |
681E | Dima is living in a dormitory, as well as some cockroaches. At the moment 0 Dima saw a cockroach running on a table and decided to kill it. Dima needs exactly _T_ seconds for aiming, and after that he will precisely strike the cockroach and finish it. To survive the cockroach has to run into a shadow, cast by round pla... | 2,500 | false | false | false | false | false | false | false | false | true | false | 7,099 |
38C | The blinds are known to consist of opaque horizontal stripes that can be rotated thus regulating the amount of light flowing in the room. There are _n_ blind stripes with the width of 1 in the factory warehouse for blind production. The problem is that all of them are spare details from different orders, that is, they ... | 1,400 | false | false | false | false | false | false | true | false | false | false | 9,806 |
696C | As we all know Barney's job is "PLEASE" and he has not much to do at work. That's why he started playing "cups and key". In this game there are three identical cups arranged in a line from left to right. Initially key to Barney's heart is under the middle cup. Then at one turn Barney swaps the cup in the middle with an... | 2,000 | true | false | true | true | false | false | false | false | false | false | 7,039 |
1703E | You are given a square grid with $$$n$$$ rows and $$$n$$$ columns. Each cell contains either $$$0$$$ or $$$1$$$. In an operation, you can select a cell of the grid and flip it (from $$$0 o 1$$$ or $$$1 o 0$$$). Find the minimum number of operations you need to obtain a square that remains the same when rotated $$$0^{... | 1,200 | false | false | true | false | false | false | false | false | false | false | 2,058 |
901A | Sasha is taking part in a programming competition. In one of the problems she should check if some rooted trees are isomorphic or not. She has never seen this problem before, but, being an experienced participant, she guessed that she should match trees to some sequences and then compare these sequences instead of tree... | 1,500 | false | false | false | false | false | true | false | false | false | false | 6,141 |
533B | One Big Software Company has _n_ employees numbered from 1 to _n_. The director is assigned number 1. Every employee of the company except the director has exactly one immediate superior. The director, of course, doesn't have a superior. We will call person _a_ a subordinates of another person _b_, if either _b_ is an ... | 2,000 | false | false | false | true | false | false | false | false | false | true | 7,706 |
1552H | Let us call a point of the plane admissible if its coordinates are positive integers less than or equal to $$$200$$$. There is an invisible rectangle such that: its vertices are all admissible; its sides are parallel to the coordinate axes; its area is strictly positive. Your task is to guess the perimeter of this r... | 3,300 | false | false | false | false | false | false | false | true | false | false | 2,877 |
455C | Andrew plays a game called "Civilization". Dima helps him. The game has _n_ cities and _m_ bidirectional roads. The cities are numbered from 1 to _n_. Between any pair of cities there either is a single (unique) path, or there is no path at all. A path is such a sequence of distinct cities _v_1,u2009_v_2,u2009...,u2009... | 2,100 | false | false | false | true | false | false | false | false | false | false | 8,017 |
38G | On a cold winter evening our hero Vasya stood in a railway queue to buy a ticket for Codeforces championship final. As it usually happens, the cashier said he was going to be away for 5 minutes and left for an hour. Then Vasya, not to get bored, started to analyze such a mechanism as a queue. The findings astonished Va... | 2,300 | false | false | false | false | true | false | false | false | false | false | 9,802 |
1203D1 | The only difference between easy and hard versions is the length of the string. You are given a string $$$s$$$ and a string $$$t$$$, both consisting only of lowercase Latin letters. It is guaranteed that $$$t$$$ can be obtained from $$$s$$$ by removing some (possibly, zero) number of characters (not necessary contiguou... | 1,600 | false | true | true | false | false | false | false | false | false | false | 4,680 |
1250K | There are $$$n$$$ lectures and $$$m$$$ seminars to be conducted today at the Faculty of Approximate Sciences. The $$$i$$$-th lecture starts at $$$a_i$$$ and ends at $$$b_i$$$ (formally, time of the lecture spans an interval $$$[a_i, b_i)$$$, the right bound is exclusive). The $$$j$$$-th seminar starts at $$$p_j$$$ and ... | 3,100 | false | false | false | false | false | false | false | false | false | true | 4,445 |
1715E | Stanley lives in a country that consists of $$$n$$$ cities (he lives in city $$$1$$$). There are bidirectional roads between some of the cities, and you know how long it takes to ride through each of them. Additionally, there is a flight between each pair of cities, the flight between cities $$$u$$$ and $$$v$$$ takes $... | 2,400 | false | true | false | true | true | false | false | false | false | true | 1,989 |
115B | You have a garden consisting entirely of grass and weeds. Your garden is described by an _n_u2009×u2009_m_ grid, with rows numbered 1 to _n_ from top to bottom, and columns 1 to _m_ from left to right. Each cell is identified by a pair (_r_,u2009_c_) which means that the cell is located at row _r_ and column _c_. Each ... | 1,500 | false | true | false | false | false | false | false | false | true | false | 9,427 |
1178A | Alice is the leader of the State Refactoring Party, and she is about to become the prime minister. The elections have just taken place. There are $$$n$$$ parties, numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th party has received $$$a_i$$$ seats in the parliament. Alice's party has number $$$1$$$. In order to become t... | 800 | false | true | false | false | false | false | false | false | false | false | 4,830 |
1601E | Students of one unknown college don't have PE courses. That's why $$$q$$$ of them decided to visit a gym nearby by themselves. The gym is open for $$$n$$$ days and has a ticket system. At the $$$i$$$-th day, the cost of one ticket is equal to $$$a_i$$$. You are free to buy more than one ticket per day. You can activate... | 2,900 | false | true | false | true | true | false | false | false | false | false | 2,647 |
523D | A social network for dogs called DH (DogHouse) has _k_ special servers to recompress uploaded videos of cute cats. After each video is uploaded, it should be recompressed on one (any) of the servers, and only after that it can be saved in the social network. We know that each server takes one second to recompress a one... | 1,600 | false | false | true | false | true | false | false | false | false | false | 7,743 |
1488C | There is a street that can be represented as an array of length $$$n$$$. There are two policemen patrolling a street: the first one is standing at the point $$$x$$$ of the street and the second one is standing at the point $$$y$$$ of the street. During one minute, both policemen can decide what to do (independently): m... | 1,900 | true | false | false | false | false | false | true | true | false | false | 3,237 |
863D | You are given an array _a_ of size _n_, and _q_ queries to it. There are queries of two types: 1 _l__i_ _r__i_ — perform a cyclic shift of the segment [_l__i_,u2009_r__i_] to the right. That is, for every _x_ such that _l__i_u2009≤u2009_x_u2009<u2009_r__i_ new value of _a__x_u2009+u20091 becomes equal to old value of ... | 1,800 | false | false | true | false | true | false | false | false | false | false | 6,291 |
1369C | Lee just became Master in Codeforces, and so, he went out to buy some gifts for his friends. He bought $$$n$$$ integers, now it's time to distribute them between his friends rationally... Lee has $$$n$$$ integers $$$a_1, a_2, ldots, a_n$$$ in his backpack and he has $$$k$$$ friends. Lee would like to distribute all int... | 1,400 | true | true | false | false | false | false | false | false | true | false | 3,825 |
1899G | A tree is a connected graph without cycles. A permutation is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in any order. For example, $$$[5, 1, 3, 2, 4]$$$ is a permutation, but $$$[2, 1, 1]$$$ is not a permutation (as $$$1$$$ appears twice in the array) and $$$[1, 3, 2, 5]$$$ is also not a p... | 1,900 | false | false | false | false | true | false | false | false | true | false | 916 |
1950D | Let's call a number a binary decimal if it is a positive integer and all digits in its decimal notation are either $$$0$$$ or $$$1$$$. For example, $$$1,010,111$$$ is a binary decimal, while $$$10,201$$$ and $$$787,788$$$ are not. Given a number $$$n$$$, you are asked whether or not it is possible to represent $$$n$$$ ... | 1,100 | false | false | true | true | false | false | true | false | false | false | 578 |
1346D | Polycarp is developing an RPG game where the main character fights monsters and searches for treasure in dungeons. Now Polycarp is making one of the dungeons the character can explore. The dungeon consists of $$$n$$$ rooms connected by $$$m$$$ two-way tunnels, and it is possible to reach every room from every other roo... | 1,600 | false | true | false | false | false | false | false | false | false | true | 3,976 |
1237D | Your favorite music streaming platform has formed a perfectly balanced playlist exclusively for you. The playlist consists of $$$n$$$ tracks numbered from $$$1$$$ to $$$n$$$. The playlist is automatic and cyclic: whenever track $$$i$$$ finishes playing, track $$$i+1$$$ starts playing automatically; after track $$$n$$$ ... | 2,000 | false | false | true | false | true | false | false | true | false | false | 4,508 |
1355A | Let's define the following recurrence: $$$$$$a_{n+1} = a_{n} + minDigit(a_{n}) cdot maxDigit(a_{n}).$$$$$$ Here $$$minDigit(x)$$$ and $$$maxDigit(x)$$$ are the minimal and maximal digits in the decimal representation of $$$x$$$ without leading zeroes. For examples refer to notes. Your task is calculate $$$a_{K}$$$ for ... | 1,200 | true | false | true | false | false | false | true | false | false | false | 3,931 |
283A | Bessie and the cows are playing with sequences and need your help. They start with a sequence, initially containing just the number 0, and perform _n_ operations. Each operation is one of the following: 1. Add the integer _x__i_ to the first _a__i_ elements of the sequence. 2. Append an integer _k__i_ to the end of the... | 1,600 | false | false | true | false | true | true | false | false | false | false | 8,703 |
793G | Oleg the bank client solves an interesting chess problem: place on _n_u2009×u2009_n_ chessboard the maximum number of rooks so that they don't beat each other. Of course, no two rooks can share the same cell. Remind that a rook standing in the cell (_a_,u2009_b_) beats a rook standing in the cell (_x_,u2009_y_) if and ... | 3,400 | false | false | false | false | true | false | false | false | false | false | 6,601 |
336C | Vasily the bear has got a sequence of positive integers _a_1,u2009_a_2,u2009...,u2009_a__n_. Vasily the Bear wants to write out several numbers on a piece of paper so that the beauty of the numbers he wrote out was maximum. The beauty of the written out numbers _b_1,u2009_b_2,u2009...,u2009_b__k_ is such maximum non-ne... | 1,800 | false | true | true | false | false | false | true | false | false | false | 8,490 |
233B | Problem - 233B - 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,400 | true | false | false | false | false | false | true | true | false | false | 8,905 |
272D | Problem - 272D - 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 | true | false | 8,743 |
1500F | In the house where Krosh used to live, he had $$$n$$$ cupboards standing in a line, the $$$i$$$-th cupboard had the height of $$$h_i$$$. Krosh moved recently, but he wasn't able to move the cupboards with him. Now he wants to buy $$$n$$$ new cupboards so that they look as similar to old ones as possible. Krosh does not... | 3,500 | false | false | false | true | false | false | false | false | false | false | 3,163 |
1593A | The elections in which three candidates participated have recently ended. The first candidate received $$$a$$$ votes, the second one received $$$b$$$ votes, the third one received $$$c$$$ votes. For each candidate, solve the following problem: how many votes should be added to this candidate so that he wins the electio... | 800 | true | false | false | false | false | false | false | false | false | false | 2,686 |
864D | Ivan has an array consisting of _n_ elements. Each of the elements is an integer from 1 to _n_. Recently Ivan learned about permutations and their lexicographical order. Now he wants to change (replace) minimum number of elements in his array in such a way that his array becomes a permutation (i.e. each of the integers... | 1,500 | true | true | true | false | false | false | false | false | false | false | 6,284 |
1860C | Alice and Bob are playing a game. They have a permutation $$$p$$$ of size $$$n$$$ (a permutation of size $$$n$$$ is an array of size $$$n$$$ where each element from $$$1$$$ to $$$n$$$ occurs exactly once). They also have a chip, which can be placed on any element of the permutation. Alice and Bob make alternating moves... | 1,400 | false | true | false | true | true | false | false | false | false | false | 1,123 |
1702E | Polycarp was recently given a set of $$$n$$$ (number $$$n$$$xa0— even) dominoes. Each domino contains two integers from $$$1$$$ to $$$n$$$. Can he divide all the dominoes into two sets so that all the numbers on the dominoes of each set are different? Each domino must go into exactly one of the two sets. For example, i... | 1,600 | false | false | false | false | false | false | false | false | false | true | 2,066 |
1592F2 | The difference between the versions is in the costs of operations. Solution for one version won't work for another! Alice has a grid of size $$$n imes m$$$, initially all its cells are colored white. The cell on the intersection of $$$i$$$-th row and $$$j$$$-th column is denoted as $$$(i, j)$$$. Alice can do the follo... | 2,800 | false | true | false | false | false | true | false | false | false | false | 2,687 |
461A | Appleman and Toastman play a game. Initially Appleman gives one group of _n_ numbers to the Toastman, then they start to complete the following tasks: Each time Toastman gets a group of numbers, he sums up all the numbers and adds this sum to the score. Then he gives the group to the Appleman. Each time Appleman gets... | 1,200 | false | true | false | false | false | false | false | false | true | false | 7,996 |
682A | Problem - 682A - 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,100 | true | false | false | false | false | true | false | false | false | false | 7,098 |
2001E1 | This is the easy version of the problem. The difference between the two versions is the definition of deterministic max-heap, time limit, and constraints on $$$n$$$ and $$$t$$$. You can make hacks only if both versions of the problem are solved. Consider a perfect binary tree with size $$$2^n - 1$$$, with nodes numbere... | 2,400 | true | false | false | true | false | false | false | false | false | false | 251 |
1081B | Chouti and his classmates are going to the university soon. To say goodbye to each other, the class has planned a big farewell party in which classmates, teachers and parents sang and danced. Chouti remembered that $$$n$$$ persons took part in that party. To make the party funnier, each person wore one hat among $$$n$$... | 1,500 | false | false | true | false | false | true | false | false | false | false | 5,322 |
698D | Bearland is a dangerous place. Limak can’t travel on foot. Instead, he has _k_ magic teleportation stones. Each stone can be used at most once. The _i_-th stone allows to teleport to a point (_ax__i_,u2009_ay__i_). Limak can use stones in any order. There are _n_ monsters in Bearland. The _i_-th of them stands at (_mx_... | 2,600 | true | false | false | false | false | false | true | false | false | false | 7,030 |
1845F | There is a pool of length $$$l$$$ where $$$n$$$ swimmers plan to swim. People start swimming at the same time (at the time moment $$$0$$$), but you can assume that they take different lanes, so they don't interfere with each other. Each person swims along the following route: they start at point $$$0$$$ and swim to poi... | 2,800 | true | false | false | true | false | false | false | false | false | false | 1,209 |
837B | The flag of Berland is such rectangular field _n_u2009×u2009_m_ that satisfies following conditions: Flag consists of three colors which correspond to letters 'R', 'G' and 'B'. Flag consists of three equal in width and height stripes, parralel to each other and to sides of the flag. Each stripe has exactly one color.... | 1,600 | false | false | true | false | false | false | true | false | false | false | 6,420 |
216A | Problem - 216A - 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 | true | false | false | false | false | false | false | false | 8,976 |
1217E | Let's define a balanced multiset the following way. Write down the sum of all elements of the multiset in its decimal representation. For each position of that number check if the multiset includes at least one element such that the digit of the element and the digit of the sum at that position are the same. If that ho... | 2,300 | true | true | true | false | true | false | false | false | false | false | 4,586 |
311D | While learning Computational Geometry, Tiny is simultaneously learning a useful data structure called segment tree or interval tree. He has scarcely grasped it when comes out a strange problem: Given an integer sequence _a_1,u2009_a_2,u2009...,u2009_a__n_. You should run _q_ queries of two types: 1. Given two integers ... | 2,600 | true | false | false | false | true | false | false | false | false | false | 8,599 |
6D | This is simplified version of the problem used on the original contest. The original problem seems to have too difiicult solution. The constraints for input data have been reduced. Polycarp likes to play computer role-playing game «Lizards and Basements». At the moment he is playing it as a magician. At one of the last... | 2,600 | false | false | false | true | false | false | true | false | false | false | 9,962 |
453B | Problem - 453B - 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 | true | false | false | false | 8,025 |
417C | One day, at the "Russian Code Cup" event it was decided to play football as an out of competition event. All participants was divided into _n_ teams and played several matches, two teams could not play against each other more than once. The appointed Judge was the most experienced member — Pavel. But since he was the w... | 1,400 | false | false | true | false | false | true | false | false | false | true | 8,155 |
896E | — I... I survived. — Welcome home, Chtholly. — I kept my promise... — I made it... I really made it! After several days of fighting, Chtholly Nota Seniorious miraculously returned from the fierce battle. As promised, Willem is now baking butter cake for her. However, although Willem is skilled in making dessert, he rar... | 3,100 | false | false | false | false | true | false | false | false | false | false | 6,161 |
173E | A club wants to take its members camping. In order to organize the event better the club directors decided to partition the members into several groups. Club member _i_ has a responsibility value _r__i_ and an age value _a__i_. A group is a non-empty subset of club members with one member known as group leader. A group... | 2,600 | false | false | false | false | true | false | false | false | true | false | 9,169 |
68C | For some experiments little Petya needs a synchrophasotron. He has already got the device, all that's left is to set the fuel supply. Fuel comes through a system of nodes numbered from 1 to _n_ and connected by pipes. Pipes go from every node with smaller number to every node with greater number. Fuel can only flow thr... | 2,200 | false | false | false | false | false | false | true | false | false | false | 9,629 |
835B | Problem - 835B - 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,100 | false | true | false | false | false | false | false | false | false | false | 6,426 |
1498E | This is an interactive problem. Remember to flush your output while communicating with the testing program. You may use fflush(stdout) in C++, system.out.flush() in Java, stdout.flush() in Python or flush(output) in Pascal to flush the output. If you use some other programming language, consult its documentation. You m... | 2,200 | false | true | false | false | false | false | true | false | true | true | 3,177 |
300D | Vasily the bear has got a large square white table of _n_ rows and _n_ columns. The table has got a black border around this table. The example of the initial table at _n_ = 5. Vasily the bear wants to paint his square table in exactly _k_ moves. Each move is sequence of actions: 1. The bear chooses some square inside... | 2,300 | false | false | false | true | false | false | false | false | false | false | 8,632 |
924E | Olya wants to buy a custom wardrobe. It should have _n_ boxes with heights _a_1,u2009_a_2,u2009...,u2009_a__n_, stacked one on another in some order. In other words, we can represent each box as a vertical segment of length _a__i_, and all these segments should form a single segment from 0 to without any overlaps. Some... | 2,700 | false | true | false | true | false | false | false | false | false | false | 6,013 |
106A | There is a card game called "Durak", which means "Fool" in Russian. The game is quite popular in the countries that used to form USSR. The problem does not state all the game's rules explicitly — you can find them later yourselves if you want. To play durak you need a pack of 36 cards. Each card has a suit ("S", "H", "... | 1,000 | false | false | true | false | false | false | false | false | false | false | 9,461 |
626D | Andrew and Jerry are playing a game with Harry as the scorekeeper. The game consists of three rounds. In each round, Andrew and Jerry draw randomly without replacement from a jar containing _n_ balls, each labeled with a distinct positive integer. Without looking, they hand their balls to Harry, who awards the point to... | 1,800 | false | false | false | true | false | false | true | false | false | false | 7,325 |
436E | Everyone who has played Cut the Rope knows full well how the gameplay is organized. All levels in the game are divided into boxes. Initially only one box with some levels is available. Player should complete levels to earn stars, collecting stars opens new box with levels. Imagine that you are playing Cut the Rope for ... | 2,600 | false | true | false | false | true | false | false | false | false | false | 8,093 |
1301B | Dark is going to attend Motarack's birthday. Dark decided that the gift he is going to give to Motarack is an array $$$a$$$ of $$$n$$$ non-negative integers. Dark created that array $$$1000$$$ years ago, so some elements in that array disappeared. Dark knows that Motarack hates to see an array that has two adjacent ele... | 1,500 | false | true | false | false | false | false | false | true | false | false | 4,193 |
1468M | You are given $$$n$$$ sets of integers. The $$$i$$$-th set contains $$$k_i$$$ integers. Two sets are called similar if they share at least two common elements, i.u2009e. there exist two integers $$$x$$$ and $$$y$$$ such that $$$x e y$$$, and they both belong to each of the two sets. Your task is to find two similar se... | 2,300 | false | false | true | false | true | false | false | false | false | true | 3,340 |
120I | Vasya has been collecting transport tickets for quite a while now. His collection contains several thousands of tram, trolleybus and bus tickets. Vasya is already fed up with the traditional definition of what a lucky ticket is. Thus, he's looking for new perspectives on that. Besides, Vasya cannot understand why all t... | 2,200 | false | true | false | false | false | false | false | false | false | false | 9,398 |
859F | It's another Start[c]up, and that means there are T-shirts to order. In order to make sure T-shirts are shipped as soon as possible, we've decided that this year we're going to order all of the necessary T-shirts before the actual competition. The top _C_ contestants are going to be awarded T-shirts, but we obviously d... | 2,800 | false | true | false | false | false | false | false | false | false | false | 6,303 |
1266C | Let $$$a$$$ be a matrix of size $$$r imes c$$$ containing positive integers, not necessarily distinct. Rows of the matrix are numbered from $$$1$$$ to $$$r$$$, columns are numbered from $$$1$$$ to $$$c$$$. We can construct an array $$$b$$$ consisting of $$$r + c$$$ integers as follows: for each $$$i in [1, r]$$$, let ... | 1,400 | true | true | false | false | false | true | false | false | false | false | 4,369 |
1433G | You are a mayor of Berlyatov. There are $$$n$$$ districts and $$$m$$$ two-way roads between them. The $$$i$$$-th road connects districts $$$x_i$$$ and $$$y_i$$$. The cost of travelling along this road is $$$w_i$$$. There is some path between each pair of districts, so the city is connected. There are $$$k$$$ delivery r... | 2,100 | false | false | false | false | false | false | true | false | false | true | 3,493 |
1450F | To help those contestants who struggle a lot in contests, the headquarters of Codeforces are planning to introduce Division 5. In this new division, the tags of all problems will be announced prior to the round to help the contestants. The contest consists of $$$n$$$ problems, where the tag of the $$$i$$$-th problem is... | 2,400 | false | true | false | false | false | true | false | false | false | false | 3,432 |
1726D | You are given a connected, undirected and unweighted graph with $$$n$$$ vertices and $$$m$$$ edges. Notice the limit on the number of edges: $$$m le n + 2$$$. Let's say we color some of the edges red and the remaining edges blue. Now consider only the red edges and count the number of connected components in the graph.... | 2,000 | false | false | false | false | false | true | true | false | false | true | 1,930 |
919E | Problem - 919E - 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,100 | true | false | false | false | false | false | false | false | false | false | 6,052 |
1942C1 | This is the easy version of the problem. The only difference between the two versions is the constraint on $$$y$$$. In this version $$$y = 0$$$. You can make hacks only if both versions are solved. Bessie has received a birthday cake from her best friend Elsie, and it came in the form of a regular polygon with $$$n$$$ ... | 1,300 | true | true | false | false | false | false | false | false | false | false | 630 |
1551A | Polycarp must pay exactly $$$n$$$ burles at the checkout. He has coins of two nominal values: $$$1$$$ burle and $$$2$$$ burles. Polycarp likes both kinds of coins equally. So he doesn't want to pay with more coins of one type than with the other. Thus, Polycarp wants to minimize the difference between the count of coin... | 800 | true | true | false | false | false | false | false | false | false | false | 2,892 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.