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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
939C | In distant future on Earth day lasts for _n_ hours and that's why there are _n_ timezones. Local times in adjacent timezones differ by one hour. For describing local time, hours numbers from 1 to _n_ are used, i.e. there is no time "0 hours", instead of it "_n_ hours" is used. When local time in the 1-st timezone is 1 ... | 1,600 | false | false | false | false | false | false | false | true | false | false | 5,942 |
1954C | You are given two integers $$$x$$$ and $$$y$$$ of the same length, consisting of digits from $$$1$$$ to $$$9$$$. You can perform the following operation any number of times (possibly zero): swap the $$$i$$$-th digit in $$$x$$$ and the $$$i$$$-th digit in $$$y$$$. For example, if $$$x=73$$$ and $$$y=31$$$, you can swap ... | 1,200 | true | true | false | false | false | false | false | false | false | false | 552 |
246E | Polycarpus got hold of a family tree. The found tree describes the family relations of _n_ people, numbered from 1 to _n_. Every person in this tree has at most one direct ancestor. Also, each person in the tree has a name, the names are not necessarily unique. We call the man with a number _a_ a 1-ancestor of the man ... | 2,400 | false | false | false | true | true | false | false | true | true | false | 8,844 |
687C | Pari wants to buy an expensive chocolate from Arya. She has _n_ coins, the value of the _i_-th coin is _c__i_. The price of the chocolate is _k_, so Pari will take a subset of her coins with sum equal to _k_ and give it to Arya. Looking at her coins, a question came to her mind: after giving the coins to Arya, what val... | 1,900 | false | false | false | true | false | false | false | false | false | false | 7,074 |
1276B | There are $$$n$$$ cities in Berland and some pairs of them are connected by two-way roads. It is guaranteed that you can pass from any city to any other, moving along the roads. Cities are numerated from $$$1$$$ to $$$n$$$. Two fairs are currently taking place in Berland β they are held in two different cities $$$a$$$ ... | 1,900 | false | false | false | false | false | false | false | false | false | true | 4,314 |
2003E1 | This is an easy version of this problem. The differences between the versions are the constraint on $$$m$$$ and $$$r_i < l_{i + 1}$$$ holds for each $$$i$$$ from $$$1$$$ to $$$m - 1$$$ in the easy version. You can make hacks only if both versions of the problem are solved. Turtle gives you $$$m$$$ intervals $$$[l_1, r_... | 2,600 | true | true | false | true | false | false | true | false | false | false | 234 |
180C | Problem - 180C - 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 | false | false | false | true | false | false | false | false | false | false | 9,120 |
18A | Problem - 18A - Codeforces =============== xa0 ]( --- Finished β Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - so... | 1,500 | false | false | false | false | false | false | true | false | false | false | 9,905 |
845F | Polycarp owns a shop in the capital of Berland. Recently the criminal activity in the capital increased, so Polycarp is thinking about establishing some better security in the storehouse of his shop. The storehouse can be represented as a matrix with _n_ rows and _m_ columns. Each element of the matrix is either . (an ... | 2,500 | false | false | false | true | false | false | false | false | false | false | 6,379 |
365B | Problem - 365B - 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 | false | true | false | false | false | false | false | false | false | 8,371 |
1509C | The student council is preparing for the relay race at the sports festival. The council consists of $$$n$$$ members. They will run one after the other in the race, the speed of member $$$i$$$ is $$$s_i$$$. The discrepancy $$$d_i$$$ of the $$$i$$$-th stage is the difference between the maximum and the minimum running sp... | 1,800 | false | true | false | true | false | false | false | false | false | false | 3,128 |
1545B | Cirno gave AquaMoon a chessboard of size $$$1 imes n$$$. Its cells are numbered with integers from $$$1$$$ to $$$n$$$ from left to right. In the beginning, some of the cells are occupied with at most one pawn, and other cells are unoccupied. In each operation, AquaMoon can choose a cell $$$i$$$ with a pawn, and do eit... | 1,900 | true | false | false | false | false | false | false | false | false | false | 2,921 |
259B | Little Elephant loves magic squares very much. A magic square is a 3u2009Γu20093 table, each cell contains some positive integer. At that the sums of integers in all rows, columns and diagonals of the table are equal. The figure below shows the magic square, the sum of integers in all its rows, columns and diagonals eq... | 1,100 | false | false | true | false | false | false | true | false | false | false | 8,796 |
1056H | You successfully found poor Arkady near the exit of the station you've perfectly predicted. You sent him home on a taxi and suddenly came up with a question. There are $$$n$$$ crossroads in your city and several bidirectional roads connecting some of them. A taxi ride is a path from some crossroads to another one witho... | 3,200 | false | false | false | false | true | false | false | false | false | false | 5,425 |
172A | Polycarpus has _n_ friends in Tarasov city. Polycarpus knows phone numbers of all his friends: they are strings _s_1,u2009_s_2,u2009...,u2009_s__n_. All these strings consist only of digits and have the same length. Once Polycarpus needed to figure out Tarasov city phone code. He assumed that the phone code of the city... | 800 | false | false | true | false | false | false | true | false | false | false | 9,178 |
870B | You are given an array _a_1,u2009_a_2,u2009...,u2009_a__n_ consisting of _n_ integers, and an integer _k_. You have to split the array into exactly _k_ non-empty subsegments. You'll then compute the minimum integer on each subsegment, and take the maximum integer over the _k_ obtained minimums. What is the maximum poss... | 1,200 | false | true | false | false | false | false | false | false | false | false | 6,260 |
242C | The black king is standing on a chess field consisting of 109 rows and 109 columns. We will consider the rows of the field numbered with integers from 1 to 109 from top to bottom. The columns are similarly numbered with integers from 1 to 109 from left to right. We will denote a cell of the field that is located in the... | 1,800 | false | false | false | false | false | false | false | false | false | true | 8,866 |
1618D | You are given an array $$$a$$$ of $$$n$$$ integers, and another integer $$$k$$$ such that $$$2k le n$$$. You have to perform exactly $$$k$$$ operations with this array. In one operation, you have to choose two elements of the array (let them be $$$a_i$$$ and $$$a_j$$$; they can be equal or different, but their position... | 1,300 | true | true | false | true | false | false | false | false | false | false | 2,539 |
698C | While creating high loaded systems one should pay a special attention to caching. This problem will be about one of the most popular caching algorithms called LRU (Least Recently Used). Suppose the cache may store no more than _k_ objects. At the beginning of the workflow the cache is empty. When some object is queried... | 2,400 | true | false | false | true | false | false | false | false | false | false | 7,031 |
994A | You are locked in a room with a door that has a keypad with 10 keys corresponding to digits from 0 to 9. To escape from the room, you need to enter a correct code. You also have a sequence of digits. Some keys on the keypad have fingerprints. You believe the correct code is the longest not necessarily contiguous subseq... | 800 | false | false | true | false | false | false | false | false | false | false | 5,728 |
1698F | Input Each test contains multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 leq t leq 100$$$)xa0β the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $$$n$$$ ($$$1 le n le 500$$$)xa0β the length of array $$$a$$$ and $$$b$$$. ... | 2,800 | true | false | true | false | false | true | false | false | false | true | 2,089 |
32E | Victor and Peter are playing hide-and-seek. Peter has hidden, and Victor is to find him. In the room where they are playing, there is only one non-transparent wall and one double-sided mirror. Victor and Peter are points with coordinates (_x__v_,u2009_y__v_) and (_x__p_,u2009_y__p_) respectively. The wall is a segment ... | 2,400 | false | false | true | false | false | false | false | false | false | false | 9,834 |
1773G | Genie is taking part in an intellectual game. The game consists of $$$n$$$ questions, and there are $$$m$$$ participants numbered from $$$1$$$ to $$$m$$$. Genie is the participant number $$$1$$$. For each question $$$i$$$ and participant $$$j$$$, it is known whether the participant will answer the question correctly or... | 2,800 | true | false | false | true | false | false | false | false | false | false | 1,650 |
203E | Valera came to Japan and bought many robots for his research. He's already at the airport, the plane will fly very soon and Valera urgently needs to bring all robots to the luggage compartment. The robots are self-propelled (they can potentially move on their own), some of them even have compartments to carry other rob... | 2,300 | false | true | false | false | false | false | false | false | true | false | 9,028 |
309B | Advertising has become part of our routine. And now, in the era of progressive technologies, we need your ideas to make advertising better! In this problem we'll look at a simplified version of context advertising. You've got a text, consisting of exactly _n_ words. A standard advertising banner has exactly _r_ lines, ... | 2,100 | false | false | false | true | false | false | false | false | false | false | 8,606 |
45D | Problem - 45D - Codeforces =============== xa0 ]( --- Finished β Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - so... | 1,900 | false | true | false | false | false | false | false | false | true | false | 9,756 |
1371C | Anna is a girl so brave that she is loved by everyone in the city and citizens love her cookies. She is planning to hold a party with cookies. Now she has $$$a$$$ vanilla cookies and $$$b$$$ chocolate cookies for the party. She invited $$$n$$$ guests of the first type and $$$m$$$ guests of the second type to the party.... | 1,300 | true | true | true | false | false | false | false | false | false | false | 3,812 |
203C | Valera's lifelong ambition was to be a photographer, so he bought a new camera. Every day he got more and more clients asking for photos, and one day Valera needed a program that would determine the maximum number of people he can serve. The camera's memory is _d_ megabytes. Valera's camera can take photos of high and ... | 1,400 | false | true | false | false | false | false | false | false | true | false | 9,030 |
1750G | We call an array $$$a$$$ of length $$$n$$$ fancy if for each $$$1 < i le n$$$ it holds that $$$a_i = a_{i-1} + 1$$$. Let's call $$$f(p)$$$ applied to a permutation$$$^dagger$$$ of length $$$n$$$ as the minimum number of subarrays it can be partitioned such that each one of them is fancy. For example $$$f([1,2,3]) = 1$$... | 3,300 | true | false | false | true | false | false | false | false | false | false | 1,779 |
347A | You want to arrange _n_ integers _a_1,u2009_a_2,u2009...,u2009_a__n_ in some order in a row. Let's define the value of an arrangement as the sum of differences between all pairs of adjacent integers. More formally, let's denote some arrangement as a sequence of integers _x_1,u2009_x_2,u2009...,u2009_x__n_, where sequen... | 1,300 | false | false | true | false | false | true | false | false | true | false | 8,444 |
1472B | Alice and Bob received $$$n$$$ candies from their parents. Each candy weighs either 1 gram or 2 grams. Now they want to divide all candies among themselves fairly so that the total weight of Alice's candies is equal to the total weight of Bob's candies. Check if they can do that. Note that candies are not allowed to be... | 800 | true | true | false | true | false | false | false | false | false | false | 3,323 |
1886F | Monocarp is the most famous thief in Berland. This time, he decided to steal two diamonds. Unfortunately for Monocarp, there are $$$n$$$ cameras monitoring the diamonds. Each camera has two parameters, $$$t_i$$$ and $$$s_i$$$. The first parameter determines whether the camera is monitoring the first diamond only ($$$t_... | 3,300 | false | true | false | false | true | false | false | false | false | false | 972 |
851B | Problem - 851B - 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 | false | false | false | false | 6,344 |
1634C | People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world. β Pedro Domingos You work for a well-known department store that uses leading technologies and employs mechanistic workxa0β that is, robots! The department yo... | 1,000 | false | false | false | false | false | true | false | false | false | false | 2,444 |
1005E1 | You are given a permutation $$$p_1, p_2, dots, p_n$$$. A permutation of length $$$n$$$ is a sequence such that each integer between $$$1$$$ and $$$n$$$ occurs exactly once in the sequence. Find the number of pairs of indices $$$(l, r)$$$ ($$$1 le l le r le n$$$) such that the value of the median of $$$p_l, p_{l+1}, dot... | 1,800 | false | false | false | false | false | false | false | false | true | false | 5,658 |
1993B | Given an array $$$a$$$ of $$$n$$$ positive integers. In one operation, you can pick any pair of indexes $$$(i, j)$$$ such that $$$a_i$$$ and $$$a_j$$$ have distinct parity, then replace the smaller one with the sum of them. More formally: If $$$a_i < a_j$$$, replace $$$a_i$$$ with $$$a_i + a_j$$$; Otherwise, replace ... | 1,100 | false | true | false | false | false | true | false | false | false | false | 311 |
335E | A number of skyscrapers have been built in a line. The number of skyscrapers was chosen uniformly at random between 2 and 314! (314 factorial, a very large number). The height of each skyscraper was chosen randomly and independently, with height _i_ having probability 2u2009-u2009_i_ for all positive integers _i_. The ... | 2,800 | true | false | false | true | false | false | false | false | false | false | 8,494 |
2035A | Red was ejected. They were not the imposter. There are $$$n$$$ rows of $$$m$$$ people. Let the position in the $$$r$$$-th row and the $$$c$$$-th column be denoted by $$$(r, c)$$$. Number each person starting from $$$1$$$ in row-major order, i.e., the person numbered $$$(r-1)cdot m+c$$$ is initially at $$$(r,c)$$$. The ... | 800 | true | false | true | false | false | false | false | false | false | false | 61 |
832D | Misha and Grisha are funny boys, so they like to use new underground. The underground has _n_ stations connected with _n_u2009-u20091 routes so that each route connects two stations, and it is possible to reach every station from any other. The boys decided to have fun and came up with a plan. Namely, in some day in th... | 1,900 | false | false | false | false | false | false | false | false | false | true | 6,436 |
1472A | For the New Year, Polycarp decided to send postcards to all his $$$n$$$ friends. He wants to make postcards with his own hands. For this purpose, he has a sheet of paper of size $$$w imes h$$$, which can be cut into pieces. Polycarp can cut any sheet of paper $$$w imes h$$$ that he has in only two cases: If $$$w$$$ ... | 800 | true | true | false | false | false | false | false | false | false | false | 3,324 |
513A | Problem - 513A - Codeforces =============== xa0 ]( "16140") | 800 | true | false | false | false | false | true | false | false | false | false | 7,793 |
676B | Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne glasses to construct a small pyramid. The height of the pyramid is _n_. The top level consists of only 1 glass, that stands on 2 glasses on the second level (... | 1,500 | true | false | true | false | false | false | false | false | false | false | 7,125 |
101E | Little Gerald and his coach Mike play an interesting game. At the beginning of the game there is a pile consisting of _n_ candies and a pile consisting of _m_ stones. Gerald and Mike move in turns, Mike goes first. During his move Mike checks how many candies and stones Gerald has eaten. Let Gerald eat _a_ candies and ... | 2,500 | false | false | false | true | false | false | false | false | false | false | 9,475 |
245B | Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format: <protocol>://<domain>.ru[/<context>] where: <protocol> can equal either "http" (without the quotes) or "ftp" (without the quotes)... | 1,100 | false | false | true | false | false | false | false | false | false | false | 8,855 |
1461B | Holidays are coming up really soon. Rick realized that it's time to think about buying a traditional spruce tree. But Rick doesn't want real trees to get hurt so he decided to find some in an $$$n imes m$$$ matrix consisting of "*" and ".". To find every spruce first let's define what a spruce in the matrix is. A set ... | 1,400 | false | false | true | true | false | false | true | false | false | false | 3,385 |
343D | Mad scientist Mike has constructed a rooted tree, which consists of _n_ vertices. Each vertex is a reservoir which can be either empty or filled with water. The vertices of the tree are numbered from 1 to _n_ with the root at vertex 1. For each vertex, the reservoirs of its children are located below the reservoir of t... | 2,100 | false | false | false | false | true | false | false | false | false | true | 8,460 |
1993C | There is an apartment consisting of $$$n$$$ rooms, each with its light initially turned off. To control the lights in these rooms, the owner of the apartment decided to install chips in the rooms so that each room has exactly one chip, and the chips are installed at different times. Specifically, these times are repres... | 1,400 | true | false | true | false | false | false | false | false | false | false | 310 |
1579D | An important meeting is to be held and there are exactly $$$n$$$ people invited. At any moment, any two people can step back and talk in private. The same two people can talk several (as many as they want) times per meeting. Each person has limited sociability. The sociability of the $$$i$$$-th person is a non-negative... | 1,400 | false | true | false | false | false | true | false | false | false | true | 2,738 |
855C | Harry, Ron and Hermione have figured out that Helga Hufflepuff's cup is a horcrux. Through her encounter with Bellatrix Lestrange, Hermione came to know that the cup is present in Bellatrix's family vault in Gringott's Wizarding Bank. The Wizarding bank is in the form of a tree with total _n_ vaults where each vault ha... | 2,000 | false | false | false | true | false | false | false | false | false | false | 6,325 |
361A | Problem - 361A - 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 | true | false | false | false | false | 8,389 |
1930D1 | This is the easy version of the problem. The only difference between the two versions is the constraint on $$$t$$$ and $$$n$$$. You can make hacks only if both versions of the problem are solved. For a binary$$$^dagger$$$ pattern $$$p$$$ and a binary string $$$q$$$, both of length $$$m$$$, $$$q$$$ is called $$$p$$$-goo... | 1,800 | false | true | false | true | false | false | true | false | false | false | 708 |
1801G | Philip is very fond of tasks on the lines. He had already solved all the problems known to him, but this was not enough for him. Therefore, Philip decided to come up with his own task. To do this, he took the string $$$t$$$ and a set of $$$n$$$ strings $$$s_1$$$, $$$s_2$$$, $$$s_3$$$, ..., $$$s_n$$$. Philip has $$$m$$$... | 3,400 | false | false | false | false | true | false | false | false | false | false | 1,460 |
883C | Only _T_ milliseconds left before the start of well-known online programming contest Codehorses Round 2017. Polycarp needs to download B++ compiler to take part in the contest. The size of the file is _f_ bytes. Polycarp's internet tariff allows to download data at the rate of one byte per _t_0 milliseconds. This tarif... | 2,300 | false | false | true | false | false | false | false | true | false | false | 6,225 |
1227E | The Berland Forest can be represented as an infinite cell plane. Every cell contains a tree. That is, contained before the recent events. A destructive fire raged through the Forest, and several trees were damaged by it. Precisely speaking, you have a $$$n imes m$$$ rectangle map which represents the damaged part of t... | 2,200 | false | false | false | false | false | false | false | true | false | true | 4,539 |
368A | Sereja owns a restaurant for _n_ people. The restaurant hall has a coat rack with _n_ hooks. Each restaurant visitor can use a hook to hang his clothes on it. Using the _i_-th hook costs _a__i_ rubles. Only one person can hang clothes on one hook. Tonight Sereja expects _m_ guests in the restaurant. Naturally, each gue... | 1,000 | false | false | true | false | false | false | false | false | false | false | 8,360 |
1367D | # Task On The Board Input file: standard input Output file: standard output Time limit: 2 seconds Memory limit: 256 megabytes Polycarp wrote on the board a string s containing only lowercase Latin letters (β aβ-β zβ). This string is known for you and given in the input. After that, he erased some letters from the st... | 1,800 | false | true | true | false | false | true | false | false | true | false | 3,840 |
1031E | You are given an array $$$a$$$ of length $$$n$$$ that consists of zeros and ones. You can perform the following operation multiple times. The operation consists of two steps: 1. Choose three integers $$$1 le x < y < z le n$$$, that form an arithmetic progression ($$$y - x = z - y$$$). 2. Flip the values $$$a_x, a_y, a_... | 2,600 | false | false | false | false | false | true | false | false | false | false | 5,544 |
1924F | This is an interactive problem! Mr. 1048576 is one of those faculty who hates wasting his time in taking class attendance. Instead of taking attendance the old-fashioned way, he decided to try out something new today. There are $$$n$$$ students in his class, having roll numbers $$$1$$$ to $$$n$$$. He knows that exactly... | 3,500 | false | false | false | true | false | true | false | false | false | false | 741 |
1973F | For $$$k$$$ positive integers $$$x_1, x_2, ldots, x_k$$$, the value $$$gcd(x_1, x_2, ldots, x_k)$$$ is the greatest common divisor of the integers $$$x_1, x_2, ldots, x_k$$$xa0β the largest integer $$$z$$$ such that all the integers $$$x_1, x_2, ldots, x_k$$$ are divisible by $$$z$$$. You are given three arrays $$$a_1,... | 3,100 | false | false | true | true | false | false | true | false | false | false | 450 |
1154D | There is a robot staying at $$$X=0$$$ on the $$$Ox$$$ axis. He has to walk to $$$X=n$$$. You are controlling this robot and controlling how he goes. The robot has a battery and an accumulator with a solar panel. The $$$i$$$-th segment of the path (from $$$X=i-1$$$ to $$$X=i$$$) can be exposed to sunlight or not. The ar... | 1,500 | false | true | false | false | false | false | false | false | false | false | 4,940 |
1334A | Polycarp has recently created a new level in this cool new game Berlio Maker 85 and uploaded it online. Now players from all over the world can try his level. All levels in this game have two stats to them: the number of plays and the number of clears. So when a player attempts the level, the number of plays increases ... | 1,200 | true | false | true | false | false | false | false | false | false | false | 4,037 |
1781E | You have a rectangular grid of height $$$2$$$ and width $$$10^9$$$ consisting of unit cells. There are $$$n$$$ rectangles placed on this grid, and the borders of these rectangles pass along cell borders. The $$$i$$$-th rectangle covers all cells in rows from $$$u_i$$$ to $$$d_i$$$ inclusive and columns from $$$l_i$$$ t... | 2,300 | false | true | true | false | true | false | true | true | false | false | 1,584 |
1905A | Gridlandia has been hit by flooding and now has to reconstruct all of it's cities. Gridlandia can be described by an $$$n imes m$$$ matrix. Initially, all of its cities are in economic collapse. The government can choose to rebuild certain cities. Additionally, any collapsed city which has at least one vertically neig... | 800 | true | false | false | false | false | true | false | false | false | false | 883 |
1716A | Problem - 1716A - 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 | true | false | false | false | false | false | false | false | false | 1,987 |
1406D | You are given a sequence of $$$n$$$ integers $$$a_1, a_2, ldots, a_n$$$. You have to construct two sequences of integers $$$b$$$ and $$$c$$$ with length $$$n$$$ that satisfy: for every $$$i$$$ ($$$1leq ileq n$$$) $$$b_i+c_i=a_i$$$ $$$b$$$ is non-decreasing, which means that for every $$$1<ileq n$$$, $$$b_igeq b_{i-1}... | 2,200 | true | true | false | false | true | true | false | false | false | false | 3,643 |
486C | Nam is playing with a string on his computer. The string consists of _n_ lowercase English letters. It is meaningless, so Nam decided to make the string more beautiful, that is to make it be a palindrome by using 4 arrow keys: left, right, up, down. There is a cursor pointing at some symbol of the string. Suppose that ... | 1,700 | false | true | true | false | false | false | true | false | false | false | 7,893 |
1494E | You are given a directed graph consisting of $$$n$$$ vertices. Each directed edge (or arc) labeled with a single character. Initially, the graph is empty. You should process $$$m$$$ queries with it. Each query is one of three types: "$$$+$$$ $$$u$$$ $$$v$$$ $$$c$$$"xa0β add arc from $$$u$$$ to $$$v$$$ with label $$$c$... | 2,400 | false | false | false | false | true | true | false | false | false | true | 3,198 |
1705B | Mark is cleaning a row of $$$n$$$ rooms. The $$$i$$$-th room has a nonnegative dust level $$$a_i$$$. He has a magical cleaning machine that can do the following three-step operation. Select two indices $$$i<j$$$ such that the dust levels $$$a_i$$$, $$$a_{i+1}$$$, $$$dots$$$, $$$a_{j-1}$$$ are all strictly greater than... | 900 | false | true | true | false | false | true | false | false | false | false | 2,045 |
1473C | You have a sequence $$$a$$$ with $$$n$$$ elements $$$1, 2, 3, dots, k - 1, k, k - 1, k - 2, dots, k - (n - k)$$$ ($$$k le n < 2k$$$). Let's call as inversion in $$$a$$$ a pair of indices $$$i < j$$$ such that $$$a[i] > a[j]$$$. Suppose, you have some permutation $$$p$$$ of size $$$k$$$ and you build a sequence $$$b$$$ ... | 1,500 | true | false | false | false | false | true | false | false | false | false | 3,315 |
1404A | A bitstring is a string consisting only of the characters 0 and 1. A bitstring is called $$$k$$$-balanced if every substring of size $$$k$$$ of this bitstring has an equal amount of 0 and 1 characters ($$$frac{k}{2}$$$ of each). You are given an integer $$$k$$$ and a string $$$s$$$ which is composed only of characters ... | 1,500 | false | false | true | false | false | false | false | false | false | false | 3,653 |
1765F | Monocarp is planning on opening a chemistry lab. During the first month, he's going to distribute solutions of a certain acid. First, he will sign some contracts with a local chemistry factory. Each contract provides Monocarp with an unlimited supply of some solution of the same acid. The factory provides $$$n$$$ contr... | 2,200 | false | false | false | true | false | false | false | false | false | false | 1,712 |
1839A | You are given two integers $$$n$$$ and $$$k$$$. An array $$$a_1, a_2, ldots, a_n$$$ of length $$$n$$$, consisting of zeroes and ones is good if for all integers $$$i$$$ from $$$1$$$ to $$$n$$$ both of the following conditions are satisfied: at least $$$lceil frac{i}{k} ceil$$$ of the first $$$i$$$ elements of $$$a$$$... | 800 | true | true | true | false | false | false | false | false | false | false | 1,258 |
1801B | Little Sasha has two friends, whom he wants to please with gifts on the Eighth of March. To do this, he went to the largest shopping center in the city. There are $$$n$$$ departments in the mall, each of which has exactly two stores. For convenience, we number the departments with integers from $$$1$$$ to $$$n$$$. It i... | 1,800 | false | true | false | false | true | false | false | false | true | false | 1,465 |
552B | Problem - 552B - 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 | 7,626 |
1418B | You are given an array $$$a$$$, consisting of $$$n$$$ integers. Each position $$$i$$$ ($$$1 le i le n$$$) of the array is either locked or unlocked. You can take the values on the unlocked positions, rearrange them in any order and place them back into the unlocked positions. You are not allowed to remove any values, a... | 1,300 | false | true | false | false | false | false | false | false | true | false | 3,593 |
1933D | Given an array $$$a_1, a_2, ldots, a_n$$$, determine whether it is possible to rearrange its elements into $$$b_1, b_2, ldots, b_n$$$, such that $$$b_1 bmod b_2 bmod ldots bmod b_n eq 0$$$. Here $$$x bmod y$$$ denotes the remainder from dividing $$$x$$$ by $$$y$$$. Also, the modulo operations are calculated from left ... | 1,200 | true | true | false | false | false | true | false | false | true | false | 684 |
699A | There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. _n_ particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles located in the same point. The coordinates of the particles coincide with the dis... | 1,000 | false | false | true | false | false | false | false | false | false | false | 7,027 |
1753F | Little Misha goes to the programming club and solves nothing there. It may seem strange, but when you find out that Misha is filming a Minecraft series, everything will fall into place... Misha is inspired by Manhattan, so he built a city in Minecraft that can be imagined as a table of size $$$n imes m$$$. $$$k$$$ stu... | 3,500 | false | false | false | false | false | false | true | false | false | false | 1,771 |
1675D | You are given a rooted tree consisting of $$$n$$$ vertices. Vertices are numbered from $$$1$$$ to $$$n$$$. Any vertex can be the root of a tree. A tree is a connected undirected graph without cycles. A rooted tree is a tree with a selected vertex, which is called the root. The tree is specified by an array of parents $... | 1,300 | false | false | true | false | false | false | false | false | false | true | 2,219 |
898E | Ann and Borya have _n_ piles with candies and _n_ is even number. There are _a__i_ candies in pile with number _i_. Ann likes numbers which are square of some integer and Borya doesn't like numbers which are square of any integer. During one move guys can select some pile with candies and add one candy to it (this cand... | 1,600 | false | true | false | false | false | true | false | false | false | false | 6,154 |
1554C | You are given two integers $$$n$$$ and $$$m$$$. Find the $$$operatorname{MEX}$$$ of the sequence $$$n oplus 0, n oplus 1, ldots, n oplus m$$$. Here, $$$oplus$$$ is the = 3$$$, and $$$operatorname{MEX}(1, 2021) = 0$$$. Input The first line contains a single integer $$$t$$$ ($$$1 le t le 30,000$$$) xa0β the number of tes... | 1,800 | false | true | true | false | false | false | false | true | false | false | 2,864 |
436D | Have you ever played Pudding Monsters? In this task, a simplified one-dimensional model of this game is used. Imagine an infinite checkered stripe, the cells of which are numbered sequentially with integers. Some cells of the strip have monsters, other cells of the strip are empty. All monsters are made of pudding, so ... | 2,800 | false | false | false | true | false | false | false | false | false | false | 8,094 |
2030A | While exploring the jungle, you have bumped into a rare orangutan with a bow tie! You shake hands with the orangutan and offer him some food and water. In return... The orangutan has gifted you an array $$$a$$$ of length $$$n$$$. Using $$$a$$$, you will construct two arrays $$$b$$$ and $$$c$$$, both containing $$$n$$$ ... | 800 | true | true | false | false | false | true | false | false | true | false | 88 |
883I | Evlampiy has found one more cool application to process photos. However the application has certain limitations. Each photo _i_ has a contrast _v__i_. In order for the processing to be truly of high quality, the application must receive at least _k_ photos with contrasts which differ as little as possible. Evlampiy alr... | 1,900 | false | false | false | true | false | false | false | true | false | false | 6,219 |
518A | Vitaly is a diligent student who never missed a lesson in his five years of studying in the university. He always does his homework on time and passes his exams in time. During the last lesson the teacher has provided two strings _s_ and _t_ to Vitaly. The strings have the same length, they consist of lowercase English... | 1,600 | false | false | false | false | false | true | false | false | false | false | 7,768 |
1637D | You are given two arrays $$$a$$$ and $$$b$$$, both of length $$$n$$$. You can perform the following operation any number of times (possibly zero): select an index $$$i$$$ ($$$1 leq i leq n$$$) and swap $$$a_i$$$ and $$$b_i$$$. Let's define the cost of the array $$$a$$$ as $$$sum_{i=1}^{n} sum_{j=i + 1}^{n} (a_i + a_j)^... | 1,800 | true | true | false | true | false | false | false | false | false | false | 2,431 |
257E | The _m_-floor (_m_u2009>u20091) office of international corporation CodeForces has the advanced elevator control system established. It works as follows. All office floors are sequentially numbered with integers from 1 to _m_. At time _t_u2009=u20090, the elevator is on the first floor, the elevator is empty and nobody... | 2,200 | false | false | true | false | true | false | false | false | false | false | 8,803 |
1203A | There are $$$n$$$ students standing in a circle in some order. The index of the $$$i$$$-th student is $$$p_i$$$. It is guaranteed that all indices of students are distinct integers from $$$1$$$ to $$$n$$$ (i.u2009e. they form a permutation). Students want to start a round dance. A clockwise round dance can be started i... | 1,000 | false | false | true | false | false | false | false | false | false | false | 4,683 |
1975I | This is the way it always was. This is the way it always will be. All will be forgotten again soon... Jellyfish is playing a one-player card game called "Slay the Spire". There are $$$n$$$ cards in total numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th card has power $$$c_i$$$. There is a binary string $$$s$$$ of lengt... | 3,500 | false | false | false | true | false | false | false | false | false | false | 434 |
1216D | There were $$$n$$$ types of swords in the theater basement which had been used during the plays. Moreover there were exactly $$$x$$$ swords of each type. $$$y$$$ people have broken into the theater basement and each of them has taken exactly $$$z$$$ swords of some single type. Note that different people might have take... | 1,300 | true | false | false | false | false | false | false | false | false | false | 4,594 |
335B | Problem - 335B - Codeforces =============== xa0 containing only lowercase English letters. Output If _s_ contains a palindrome of length exactly 100 as a subsequence, print any palindrome of length 100 which is a subsequence of _s_. If _s_ doesn't contain any palindromes of length exactly 100, print a pal... | 1,900 | false | false | false | true | false | true | false | false | false | false | 8,497 |
1623A | A robot cleaner is placed on the floor of a rectangle room, surrounded by walls. The floor consists of $$$n$$$ rows and $$$m$$$ columns. The rows of the floor are numbered from $$$1$$$ to $$$n$$$ from top to bottom, and columns of the floor are numbered from $$$1$$$ to $$$m$$$ from left to right. The cell on the inters... | 800 | true | false | true | false | false | false | true | false | false | false | 2,505 |
177A2 | Problem - 177A2 - Codeforces =============== xa0 separated by single spaces β the elements of the given matrix. The input limitations for getting 30 points are: 1u2009β€u2009_n_u2009β€u20095 The input limitations for getting 100 points are: 1u2009β€u2009_n_u2009β€u2009101 Output Print a single integer β the... | 800 | false | false | true | false | false | false | false | false | false | false | 9,153 |
1804B | Ethan runs a vaccination station to help people combat the seasonal flu. He analyses the historical data in order to develop an optimal strategy for vaccine usage. Consider there are $$$n$$$ patients coming to the station on a particular day. The $$$i$$$-th patient comes at the moment $$$t_i$$$. We know that each of th... | 1,000 | false | true | true | false | false | false | false | false | false | false | 1,456 |
1993E | Given a matrix $$$a$$$ of size $$$n imes m$$$, each cell of which contains a non-negative integer. The integer lying at the intersection of the $$$i$$$-th row and the $$$j$$$-th column of the matrix is called $$$a_{i,j}$$$. Let's define $$$f(i)$$$ and $$$g(j)$$$ as the $$$ for each $$$1 le j le m$$$; or Select any co... | 2,700 | false | false | true | true | false | true | false | false | false | false | 308 |
534C | Polycarp has _n_ dice _d_1,u2009_d_2,u2009...,u2009_d__n_. The _i_-th dice shows numbers from 1 to _d__i_. Polycarp rolled all the dice and the sum of numbers they showed is _A_. Agrippina didn't see which dice showed what number, she knows only the sum _A_ and the values _d_1,u2009_d_2,u2009...,u2009_d__n_. However, s... | 1,600 | true | false | false | false | false | false | false | false | false | false | 7,699 |
113A | Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with friends, that's why all the language's grammar can be described with the following set of rules: There are three parts of speech... | 1,600 | false | false | true | false | false | false | false | false | false | false | 9,435 |
1779B | MKnez wants to construct an array $$$s_1,s_2, ldots , s_n$$$ satisfying the following conditions: Each element is an integer number different from $$$0$$$; For each pair of adjacent elements their sum is equal to the sum of the whole array. More formally, $$$s_i eq 0$$$ must hold for each $$$1 leq i leq n$$$. Moreov... | 900 | true | false | false | false | false | true | false | false | false | false | 1,601 |
221B | Problem - 221B - 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 | false | false | false | false | 8,953 |
802L | Heidi is terrified by your estimate and she found it unrealistic that her friends would collaborate to drive her into debt. She expects that, actually, each person will just pick a random friend to send Heidi to. (This randomness assumption implies, however, that she can now visit the same friend an arbitrary number of... | 2,400 | true | false | false | true | false | false | false | false | false | false | 6,556 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.