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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1230A | Problem - 1230A - 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 | true | false | false | false | 4,529 |
1452A | There is an infinite 2-dimensional grid. The robot stands in cell $$$(0, 0)$$$ and wants to reach cell $$$(x, y)$$$. Here is a list of possible commands the robot can execute: move north from cell $$$(i, j)$$$ to $$$(i, j + 1)$$$; move east from cell $$$(i, j)$$$ to $$$(i + 1, j)$$$; move south from cell $$$(i, j)$$... | 800 | true | false | false | false | false | false | false | false | false | false | 3,421 |
1799C | You are given a string $$$s$$$. You can reorder the characters to form a string $$$t$$$. Define $$$t_{mathrm{max}}$$$ to be the lexicographical maximum of $$$t$$$ and $$$t$$$ in reverse order. Given $$$s$$$ determine the lexicographically minimum value of $$$t_{mathrm{max}}$$$ over all reorderings $$$t$$$ of $$$s$$$. A... | 1,700 | false | true | false | false | false | false | false | false | false | false | 1,482 |
1286C1 | This problem is different with hard version only by constraints on total answers length It is an interactive problem Venya joined a tour to the madhouse, in which orderlies play with patients the following game. Orderlies pick a string $$$s$$$ of length $$$n$$$, consisting only of lowercase English letters. The player ... | 2,400 | true | false | false | false | false | true | true | false | false | false | 4,259 |
1209B | It is a holiday season, and Koala is decorating his house with cool lights! He owns $$$n$$$ lights, all of which flash periodically. After taking a quick glance at them, Koala realizes that each of his lights can be described with two parameters $$$a_i$$$ and $$$b_i$$$. Light with parameters $$$a_i$$$ and $$$b_i$$$ wil... | 1,300 | true | false | true | false | false | false | false | false | false | false | 4,645 |
291C | The problem uses a simplified TCP/IP address model, please make sure you've read the statement attentively. Polycarpus has found a job, he is a system administrator. One day he came across _n_ IP addresses. Each IP address is a 32 bit number, represented as a group of four 8-bit numbers (without leading zeroes), separa... | 1,600 | false | false | true | false | false | false | true | false | false | false | 8,669 |
811E | In his spare time Vladik estimates beauty of the flags. Every flag could be represented as the matrix _n_u2009×u2009_m_ which consists of positive integers. Let's define the beauty of the flag as number of components in its matrix. We call component a set of cells with same numbers and between any pair of cells from th... | 2,600 | false | false | false | false | true | false | false | false | false | true | 6,517 |
794D | Oleg the bank client lives in Bankopolia. There are _n_ cities in Bankopolia and some pair of cities are connected directly by bi-directional roads. The cities are numbered from 1 to _n_. There are a total of _m_ roads in Bankopolia, the _i_-th road connects cities _u__i_ and _v__i_. It is guaranteed that from each cit... | 2,400 | false | false | false | false | false | false | false | false | false | true | 6,597 |
2030B | For an arbitrary binary string $$$t$$$$$$^{ ext{∗}}$$$, let $$$f(t)$$$ be the number of non-empty subsequences$$$^{ ext{†}}$$$ of $$$t$$$ that contain only $$$mathtt{0}$$$, and let $$$g(t)$$$ be the number of non-empty subsequences of $$$t$$$ that contain at least one $$$mathtt{1}$$$. Note that for $$$f(t)$$$ and for $... | 800 | true | false | false | false | false | true | false | false | false | false | 87 |
1895A | Monocarp has found a treasure map. The map represents the treasure location as an OX axis. Monocarp is at $$$0$$$, the treasure chest is at $$$x$$$, the key to the chest is at $$$y$$$. Obviously, Monocarp wants to open the chest. He can perform the following actions: go $$$1$$$ to the left or $$$1$$$ to the right (spe... | 800 | true | false | false | false | false | false | false | false | false | false | 944 |
76E | Problem - 76E - Codeforces =============== xa0 ") — the number of points. Each of the following _N_ lines contain two integer numbers _X_ and _Y_ (u2009-u200910u2009000u2009≤u2009_X_,u2009_Y_u2009≤u200910u2009000) — the coordinates of points. Two or more points may coincide. Output The only line of output... | 1,700 | true | false | true | false | false | false | false | false | false | false | 9,582 |
756B | A new innovative ticketing systems for public transport is introduced in Bytesburg. Now there is a single travel card for all transport. To make a trip a passenger scan his card and then he is charged according to the fare. The fare is constructed in the following manner. There are three types of tickets: 1. a ticket f... | 1,600 | false | false | false | true | false | false | false | true | false | false | 6,769 |
1158D | Vasya has $$$n$$$ different points $$$A_1, A_2, ldots A_n$$$ on the plane. No three of them lie on the same line He wants to place them in some order $$$A_{p_1}, A_{p_2}, ldots, A_{p_n}$$$, where $$$p_1, p_2, ldots, p_n$$$xa0— some permutation of integers from $$$1$$$ to $$$n$$$. After doing so, he will draw oriented p... | 2,600 | true | true | false | false | false | true | false | false | false | false | 4,912 |
1175A | Problem - 1175A - 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 - ... | 900 | true | false | true | false | false | false | false | false | false | false | 4,845 |
1141F2 | This problem is given in two editions, which differ exclusively in the constraints on the number $$$n$$$. You are given an array of integers $$$a[1], a[2], dots, a[n].$$$ A block is a sequence of contiguous (consecutive) elements $$$a[l], a[l+1], dots, a[r]$$$ ($$$1 le l le r le n$$$). Thus, a block is defined by a pai... | 1,900 | false | true | false | false | true | false | false | false | false | false | 5,015 |
1689D | Lena is a beautiful girl who likes logical puzzles. As a gift for her birthday, Lena got a matrix puzzle! The matrix consists of $$$n$$$ rows and $$$m$$$ columns, and each cell is either black or white. The coordinates $$$(i,j)$$$ denote the cell which belongs to the $$$i$$$-th row and $$$j$$$-th column for every $$$1l... | 1,900 | false | false | false | true | true | false | false | false | false | false | 2,145 |
60A | Problem - 60A - Codeforces =============== xa0 , "Hidden to the right of the _i_-th box" ("To the right of _i_"). Such hints mean that there are no flakes in the _i_-th box as well. The Cereal Guy wants to know the minimal number of boxes he necessarily needs to check to find the flakes considering all th... | 1,300 | false | false | true | false | false | false | false | false | false | false | 9,675 |
123E | A maze is represented by a tree (an undirected graph, where exactly one way exists between each pair of vertices). In the maze the entrance vertex and the exit vertex are chosen with some probability. The exit from the maze is sought by Deep First Search. If there are several possible ways to move, the move is chosen e... | 2,500 | false | false | false | true | false | false | false | false | false | false | 9,385 |
1610A | You are playing a game on a $$$n imes m$$$ grid, in which the computer has selected some cell $$$(x, y)$$$ of the grid, and you have to determine which one. To do so, you will choose some $$$k$$$ and some $$$k$$$ cells $$$(x_1, y_1),, (x_2, y_2), ldots, (x_k, y_k)$$$, and give them to the computer. In response, you wi... | 900 | true | false | false | false | false | false | false | false | false | false | 2,600 |
1291F | This is the easy version of the problem. You can find the hard version in the Div. 1 contest. Both versions only differ in the number of times you can ask your friend to taste coffee. This is an interactive problem. You're considering moving to another city, where one of your friends already lives. There are $$$n$$$ ca... | 2,800 | false | false | false | false | false | false | false | false | false | true | 4,238 |
1627E | Major Ram is being chased by his arch enemy Raghav. Ram must reach the top of the building to escape via helicopter. The building, however, is on fire. Ram must choose the optimal path to reach the top of the building to lose the minimum amount of health. The building consists of $$$n$$$ floors, each with $$$m$$$ rooms... | 2,200 | false | false | true | true | true | false | false | false | false | false | 2,477 |
196A | Problem - 196A - 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 | 9,058 |
148C | «Next please», — the princess called and cast an estimating glance at the next groom. The princess intends to choose the most worthy groom, this is, the richest one. Whenever she sees a groom who is more rich than each of the previous ones, she says a measured «Oh...». Whenever the groom is richer than all previous one... | 1,700 | false | true | false | false | false | true | false | false | false | false | 9,284 |
134C | There are _n_ players sitting at a round table. All of them have _s_ cards of _n_ colors in total. Besides, initially the first person had cards of only the first color, the second one had cards of only the second color and so on. They can swap the cards by the following rules: as the players swap, a player can give a... | 2,200 | false | true | false | false | false | true | false | false | false | true | 9,338 |
1114A | For simplicity, we'll assume that there are only three types of grapes: green grapes, purple grapes and black grapes. Andrew, Dmitry and Michal are all grapes' lovers, however their preferences of grapes are different. To make all of them happy, the following should happen: Andrew, Dmitry and Michal should eat at leas... | 800 | false | true | true | false | false | false | true | false | false | false | 5,134 |
133B | Unary is a minimalistic Brainfuck dialect in which programs are written using only one token. Brainfuck programs use 8 commands: "+", "-", "[", "]", "<", ">", "." and "," (their meaning is not important for the purposes of this problem). Unary programs are created from Brainfuck programs using the following algorithm. ... | 1,200 | false | false | true | false | false | false | false | false | false | false | 9,341 |
988D | There are $$$n$$$ distinct points on a coordinate line, the coordinate of $$$i$$$-th point equals to $$$x_i$$$. Choose a subset of the given set of points such that the distance between each pair of points in a subset is an integral power of two. It is necessary to consider each pair of points, not only adjacent. Note ... | 1,800 | true | false | false | false | false | false | true | false | false | false | 5,760 |
955B | Problem - 955B - 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 | true | false | false | false | false | false | false | false | 5,899 |
1011A | Natasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lowercase Latin letter. This way, the rocket can be described by the stringxa0— concatenation of letters, which correspond to the stages. There are $$$n$$$ stages available. T... | 900 | false | true | true | false | false | false | false | false | true | false | 5,629 |
44H | Alas, finding one's true love is not easy. Masha has been unsuccessful in that yet. Her friend Dasha told Masha about a way to determine the phone number of one's Prince Charming through arithmancy. The phone number is divined like that. First one needs to write down one's own phone numbers. For example, let's suppose ... | 1,700 | false | false | false | true | false | false | false | false | false | false | 9,762 |
1832D2 | The only difference between easy and hard versions is the maximum values of $$$n$$$ and $$$q$$$. You are given an array, consisting of $$$n$$$ integers. Initially, all elements are red. You can apply the following operation to the array multiple times. During the $$$i$$$-th operation, you select an element of the array... | 2,400 | true | true | true | false | false | true | false | true | false | false | 1,294 |
374D | Dima's spent much time thinking what present to give to Inna and gave her an empty sequence _w_. Now they want to fill sequence _w_ with numbers zero and one. For that, they decided to play an amusing game. Before the game begins, Dima chooses _m_ integers _a_1,u2009_a_2,u2009...,u2009_a__m_ (1u2009≤u2009_a_1u2009<u200... | 2,000 | false | false | false | true | true | false | false | true | false | false | 8,333 |
879A | Problem - 879A - 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... | 900 | false | false | true | false | false | false | false | false | false | false | 6,229 |
1857F | You have an array $$$a$$$ of length $$$n$$$. Your task is to answer $$$q$$$ queries: given $$$x,y$$$, find the number of pairs $$$i$$$ and $$$j$$$ ($$$1 le i < j le n$$$) that both $$$a_i + a_j = x$$$ and $$$a_i cdot a_j = y$$$. That is, for the array $$$[1,3,2]$$$ and asking for $$$x=3,y=2$$$ the answer is $$$1$$$: $... | 1,600 | true | false | false | false | true | false | false | true | false | false | 1,139 |
1333E | Egor wants to achieve a rating of 1600 points on the well-known chess portal ChessForces and he needs your help! Before you start solving the problem, Egor wants to remind you how the chess pieces move. Chess rook moves along straight lines up and down, left and right, as many squares as it wants. And when it wants, it... | 2,400 | false | false | false | false | false | true | true | false | false | false | 4,039 |
1190C | Duel!" Betting on the lovely princess Claris, the duel between Tokitsukaze and Quailty has started. There are $$$n$$$ cards in a row. Each card has two sides, one of which has color. At first, some of these cards are with color sides facing up and others are with color sides facing down. Then they take turns flipping c... | 2,300 | false | true | false | false | false | false | true | false | false | false | 4,748 |
925A | In the year of $$$30XX$$$ participants of some world programming championship live in a single large hotel. The hotel has $$$n$$$ floors. Each floor has $$$m$$$ sections with a single corridor connecting all of them. The sections are enumerated from $$$1$$$ to $$$m$$$ along the corridor, and all sections with equal num... | 1,600 | false | false | false | false | false | false | false | true | false | false | 6,011 |
316A2 | Special Agent Smart Beaver works in a secret research department of ABBYY. He's been working there for a long time and is satisfied with his job, as it allows him to eat out in the best restaurants and order the most expensive and exotic wood types there. The content special agent has got an important task: to get the ... | 1,400 | true | false | false | false | false | false | false | false | false | false | 8,582 |
253D | Vasya has recently started to learn English. Now he needs to remember how to write English letters. He isn't sure about some of them, so he decided to train a little. He found a sheet of squared paper and began writing arbitrary English letters there. In the end Vasya wrote _n_ lines containing _m_ characters each. Thu... | 2,000 | false | false | false | false | false | false | true | false | false | false | 8,821 |
1493A | Problem - 1493A - 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 | true | false | false | false | true | false | false | false | false | 3,208 |
1850B | In the game show "Ten Words of Wisdom", there are $$$n$$$ participants numbered from $$$1$$$ to $$$n$$$, each of whom submits one response. The $$$i$$$-th response is $$$a_i$$$ words long and has quality $$$b_i$$$. No two responses have the same quality, and at least one response has length at most $$$10$$$. The winner... | 800 | false | false | true | false | false | false | false | false | true | false | 1,181 |
950B | Hacker Zhorik wants to decipher two secret messages he intercepted yesterday. Yeah message is a sequence of encrypted blocks, each of them consists of several bytes of information. Zhorik knows that each of the messages is an archive containing one or more files. Zhorik knows how each of these archives was transferred ... | 1,100 | false | true | true | false | false | false | false | false | false | false | 5,917 |
460B | Problem - 460B - 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 | true | false | true | false | false | false | true | false | false | false | 8,000 |
778A | Little Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns out to be pretty hard for her, because she is too young. Therefore, her brother Sergey always helps her. Sergey gives Nastya the word _t_ and wants to get the word _p_ out of it. Nastya removes letters in a certa... | 1,700 | false | true | false | false | false | false | false | true | false | false | 6,656 |
1070E | Polycarp has a lot of work to do. Recently he has learned a new time management rule: "if a task takes five minutes or less, do it immediately". Polycarp likes the new rule, however he is not sure that five minutes is the optimal value. He supposes that this value $$$d$$$ should be chosen based on existing task list. P... | 2,100 | false | false | false | false | true | false | false | true | false | false | 5,363 |
961F | You are given a string _s_ consisting of _n_ lowercase Latin letters. Let's denote _k_-substring of _s_ as a string _subs__k_u2009=u2009_s__k__s__k_u2009+u20091.._s__n_u2009+u20091u2009-u2009_k_. Obviously, _subs_1u2009=u2009_s_, and there are exactly such substrings. Let's call some string _t_ an odd proper suprefix o... | 2,700 | false | false | false | false | false | false | false | true | false | false | 5,858 |
498B | It turns out that you are a great fan of rock band AC/PE. Peter learned that and started the following game: he plays the first song of the list of _n_ songs of the group, and you have to find out the name of the song. After you tell the song name, Peter immediately plays the following song in order, and so on. The _i_... | 2,400 | false | false | false | true | false | false | false | false | false | false | 7,843 |
1200B | Gildong is playing a video game called Block Adventure. In Block Adventure, there are $$$n$$$ columns of blocks in a row, and the columns are numbered from $$$1$$$ to $$$n$$$. All blocks have equal heights. The height of the $$$i$$$-th column is represented as $$$h_i$$$, which is the number of blocks stacked in the $$$... | 1,200 | false | true | false | true | false | false | false | false | false | false | 4,700 |
1542C | Let $$$f(i)$$$ denote the minimum positive integer $$$x$$$ such that $$$x$$$ is not a divisor of $$$i$$$. Compute $$$sum_{i=1}^n f(i)$$$ modulo $$$10^9+7$$$. In other words, compute $$$f(1)+f(2)+dots+f(n)$$$ modulo $$$10^9+7$$$. Input The first line contains a single integer $$$t$$$ ($$$1leq tleq 10^4$$$), the number o... | 1,600 | true | false | false | false | false | false | false | false | false | false | 2,932 |
1296E1 | This is an easy version of the problem. The actual problems are different, but the easy version is almost a subtask of the hard version. Note that the constraints and the output format are different. You are given a string $$$s$$$ consisting of $$$n$$$ lowercase Latin letters. You have to color all its characters one o... | 1,800 | false | true | false | true | false | true | false | false | true | true | 4,213 |
850F | You have a bag of balls of _n_ different colors. You have _a__i_ balls of the _i_-th color. While there are at least two different colored balls in the bag, perform the following steps: Take out two random balls without replacement one by one. These balls might be the same color. Color the second ball to the color of... | 2,800 | true | false | false | false | false | false | false | false | false | false | 6,346 |
356E | Xenia the coder went to The Olympiad of Informatics and got a string problem. Unfortunately, Xenia isn't fabulous in string algorithms. Help her solve the problem. String _s_ is a sequence of characters _s_1_s_2... _s__s_, where record _s_ shows the length of the string. Substring _s_[_i_... _j_] of string _s_ is strin... | 3,000 | false | false | true | true | false | false | false | false | false | false | 8,407 |
689A | While swimming at the beach, Mike has accidentally dropped his cellphone into the water. There was no worry as he bought a cheap replacement phone with an old-fashioned keyboard. The keyboard has only ten digital equal-sized keys, located in the following way: Together with his old phone, he lost all his contacts and n... | 1,400 | false | false | true | false | false | true | true | false | false | false | 7,069 |
1005B | You are given two strings $$$s$$$ and $$$t$$$. In a single move, you can choose any of two strings and delete the first (that is, the leftmost) character. After a move, the length of the string decreases by $$$1$$$. You can't choose a string if it is empty. For example: by applying a move to the string "where", the re... | 900 | false | false | true | false | false | false | true | false | false | false | 5,661 |
334A | Problem - 334A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 1,000 | false | false | true | false | false | false | false | false | false | false | 8,500 |
1609G | William has two arrays of numbers $$$a_1, a_2, dots, a_n$$$ and $$$b_1, b_2, dots, b_m$$$. The arrays satisfy the conditions of being convex. Formally an array $$$c$$$ of length $$$k$$$ is considered convex if $$$c_i - c_{i - 1} < c_{i + 1} - c_i$$$ for all $$$i$$$ from $$$2$$$ to $$$k - 1$$$ and $$$c_1 < c_2$$$. Throu... | 3,000 | true | true | false | false | true | false | false | false | false | false | 2,602 |
1036G | You are given an acyclic directed graph, consisting of $$$n$$$ vertices and $$$m$$$ edges. The graph contains no multiple edges and no self-loops. The vertex is called a source if it has no incoming edges. The vertex is called a sink if it has no outgoing edges. These definitions imply that some vertices can be both so... | 2,700 | false | false | false | false | false | false | true | false | false | false | 5,517 |
965B | Arkady is playing Battleship. The rules of this game aren't really important. There is a field of $$$n imes n$$$ cells. There should be exactly one $$$k$$$-decker on the field, i.xa0e. a ship that is $$$k$$$ cells long oriented either horizontally or vertically. However, Arkady doesn't know where it is located. For ea... | 1,300 | false | false | true | false | false | false | false | false | false | false | 5,841 |
1326B | Alicia has an array, $$$a_1, a_2, ldots, a_n$$$, of non-negative integers. For each $$$1 leq i leq n$$$, she has found a non-negative integer $$$x_i = max(0, a_1, ldots, a_{i-1})$$$. Note that for $$$i=1$$$, $$$x_i = 0$$$. For example, if Alicia had the array $$$a = {0, 1, 2, 0, 3}$$$, then $$$x = {0, 0, 1, 2, 2}$$$. T... | 900 | true | false | true | false | false | false | false | false | false | false | 4,086 |
245D | Recently Polycarpus has learned the "bitwise AND" operation (which is also called "AND") of non-negative integers. Now he wants to demonstrate the school IT teacher his superb manipulation with the learned operation. For that Polycarpus came to school a little earlier and wrote on the board a sequence of non-negative i... | 1,500 | false | true | false | false | false | true | false | false | false | false | 8,853 |
1562C | Frodo was caught by Saruman. He tore a pouch from Frodo's neck, shook out its contentsxa0—there was a pile of different rings: gold and silver..."How am I to tell which is the One?!" the mage howled. "Throw them one by one into the Cracks of Doom and watch when Mordor falls!" Somewhere in a parallel Middle-earth, when ... | 1,500 | true | false | false | false | false | true | false | false | false | false | 2,818 |
200E | While most students still sit their exams, the tractor college has completed the summer exam session. In fact, students study only one subject at this college — the Art of Operating a Tractor. Therefore, at the end of a term a student gets only one mark, a three (satisfactory), a four (good) or a five (excellent). Thos... | 2,400 | true | false | true | false | false | false | false | false | false | false | 9,040 |
1342D | So you decided to hold a contest on Codeforces. You prepared the problems: statements, solutions, checkers, validators, tests... Suddenly, your coordinator asks you to change all your tests to multiple testcases in the easiest problem! Initially, each test in that problem is just an array. The maximum size of an array ... | 1,900 | false | true | false | false | true | true | false | true | true | false | 3,996 |
1665D | This is an interactive problem. There is a positive integer $$$1 le x le 10^9$$$ that you have to guess. In one query you can choose two positive integers $$$a eq b$$$. As an answer to this query you will get $$$gcd(x + a, x + b)$$$, where $$$gcd(n, m)$$$ is the denoting the number of test cases. The integer $$$x$$$ t... | 2,000 | true | false | false | false | false | true | false | false | false | false | 2,287 |
160D | You are given a connected weighted undirected graph without any loops and multiple edges. Let us remind you that a graph's spanning tree is defined as an acyclic connected subgraph of the given graph that includes all of the graph's vertexes. The weight of a tree is defined as the sum of weights of the edges that the g... | 2,300 | false | false | false | false | false | false | false | false | true | true | 9,232 |
1427G | You have to paint with shades of grey the tiles of an $$$n imes n$$$ wall. The wall has $$$n$$$ rows of tiles, each with $$$n$$$ tiles. The tiles on the boundary of the wall (i.e., on the first row, last row, first column and last column) are already painted and you shall not change their color. All the other tiles are... | 3,300 | false | false | false | false | false | false | false | false | false | true | 3,527 |
1015A | You are given a set of $$$n$$$ segments on the axis $$$Ox$$$, each segment has integer endpoints between $$$1$$$ and $$$m$$$ inclusive. Segments may intersect, overlap or even coincide with each other. Each segment is characterized by two integers $$$l_i$$$ and $$$r_i$$$ ($$$1 le l_i le r_i le m$$$) — coordinates of th... | 800 | false | false | true | false | false | false | false | false | false | false | 5,619 |
1538B | Polycarp has $$$n$$$ friends, the $$$i$$$-th of his friends has $$$a_i$$$ candies. Polycarp's friends do not like when they have different numbers of candies. In other words they want all $$$a_i$$$ to be the same. To solve this, Polycarp performs the following set of actions exactly once: Polycarp chooses $$$k$$$ ($$$... | 800 | true | true | false | false | false | false | false | false | false | false | 2,954 |
1256F | You are given two strings $$$s$$$ and $$$t$$$ both of length $$$n$$$ and both consisting of lowercase Latin letters. In one move, you can choose any length $$$len$$$ from $$$1$$$ to $$$n$$$ and perform the following operation: Choose any contiguous substring of the string $$$s$$$ of length $$$len$$$ and reverse it; a... | 2,000 | false | false | false | false | false | true | false | false | true | false | 4,402 |
1010F | The Main Martian Tree grows on Mars. It is a binary tree (a rooted tree, with no more than two sons at each vertex) with $$$n$$$ vertices, where the root vertex has the number $$$1$$$. Its fruits are the Main Martian Fruits. It's summer now, so this tree does not have any fruit yet. Autumn is coming soon, and leaves an... | 3,400 | false | false | false | false | false | false | false | false | false | true | 5,630 |
1750H | You are given a binary string $$$s$$$ of length $$$n$$$. We define a maximal substring as a substring that cannot be extended while keeping all elements equal. For example, in the string $$$11000111$$$ there are three maximal substrings: $$$11$$$, $$$000$$$ and $$$111$$$. In one operation, you can select two maximal ad... | 3,500 | false | false | false | true | true | true | false | false | false | false | 1,778 |
1293A | A.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them. It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal. ConneR's office is at floor $$$s... | 1,100 | false | false | true | false | false | false | true | true | false | false | 4,231 |
57E | Brian the Rabbit adores chess. Not long ago he argued with Stewie the Rabbit that a knight is better than a king. To prove his point he tries to show that the knight is very fast but Stewie doesn't accept statements without evidence. He constructed an infinite chessboard for Brian, where he deleted several squares to a... | 3,000 | true | false | false | false | false | false | false | false | false | false | 9,686 |
475D | Problem - 475D - Codeforces =============== xa0 ]( "Bayan Contest Warm Up round + 50 tshirts!") such that 1u2009≤u2009_l_u2009≤u2009_r_u2009≤u2009_n_ and _gcd_(_a__l_,u2009_a__l_u2009+u20091,u2009...,u2009_a__r_)u2009=u2009_x__i_. is a greatest common divisor of _v_1,u2009_v_2,u2009...,u2009_v__n_, tha... | 2,000 | true | false | false | false | true | false | true | false | false | false | 7,931 |
592B | Ari the monster always wakes up very early with the first ray of the sun and the first thing she does is feeding her squirrel. Ari draws a regular convex polygon on the floor and numbers it's vertices 1,u20092,u2009...,u2009_n_ in clockwise order. Then starting from the vertex 1 she draws a ray in the direction of each... | 1,100 | true | false | false | false | false | false | false | false | false | false | 7,481 |
730I | There are _n_ students at Berland State University. Every student has two skills, each measured as a number: _a__i_ — the programming skill and _b__i_ — the sports skill. It is announced that an Olympiad in programming and sports will be held soon. That's why Berland State University should choose two teams: one to tak... | 2,000 | false | true | false | true | false | false | false | false | false | true | 6,880 |
796B | Zane the wizard is going to perform a magic show shuffling the cups. There are _n_ cups, numbered from 1 to _n_, placed along the _x_-axis on a table that has _m_ holes on it. More precisely, cup _i_ is on the table at the position _x_u2009=u2009_i_. The problematic bone is initially at the position _x_u2009=u20091. Za... | 1,300 | false | false | true | false | false | false | false | false | false | false | 6,592 |
1599H | This is an interactive problem! As part of your contribution in the Great Bubble War, you have been tasked with finding the newly built enemy fortress. The world you live in is a giant $$$10^9 imes 10^9$$$ grid, with squares having both coordinates between $$$1$$$ and $$$10^9$$$. You know that the enemy base has the s... | 2,100 | true | false | false | false | false | false | false | false | false | false | 2,657 |
496E | You are an assistant director in a new musical play. The play consists of _n_ musical parts, each part must be performed by exactly one actor. After the casting the director chose _m_ actors who can take part in the play. Your task is to assign the parts to actors. However, there are several limitations. First, each ac... | 2,100 | false | true | false | false | false | false | false | false | true | false | 7,847 |
1621D | Circular land is an $$$2n imes 2n$$$ grid. Rows of this grid are numbered by integers from $$$1$$$ to $$$2n$$$ from top to bottom and columns of this grid are numbered by integers from $$$1$$$ to $$$2n$$$ from left to right. The cell $$$(x, y)$$$ is the cell on the intersection of row $$$x$$$ and column $$$y$$$ for $$... | 2,100 | true | true | false | false | false | true | false | false | false | false | 2,517 |
1067B | Someone give a strange birthday present to Ivan. It is hedgehogxa0— connected undirected graph in which one vertex has degree at least $$$3$$$ (we will call it center) and all other vertices has degree 1. Ivan thought that hedgehog is too boring and decided to make himself $$$k$$$-multihedgehog. Let us define $$$k$$$-m... | 1,800 | false | false | false | false | false | false | false | false | false | true | 5,374 |
1656D | We say that a positive integer $$$n$$$ is $$$k$$$-good for some positive integer $$$k$$$ if $$$n$$$ can be expressed as a sum of $$$k$$$ positive integers which give $$$k$$$ distinct remainders when divided by $$$k$$$. Given a positive integer $$$n$$$, find some $$$k geq 2$$$ so that $$$n$$$ is $$$k$$$-good or tell tha... | 1,900 | true | false | false | false | false | true | false | false | false | false | 2,351 |
1656C | You are given an array of $$$n$$$ non-negative integers $$$a_1, a_2, ldots, a_n$$$. You can make the following operation: choose an integer $$$x geq 2$$$ and replace each number of the array by the remainder when dividing that number by $$$x$$$, that is, for all $$$1 leq i leq n$$$ set $$$a_i$$$ to $$$a_i bmod x$$$. De... | 1,200 | true | false | false | false | false | true | false | false | true | false | 2,352 |
1426E | Alice and Bob have decided to play the game "Rock, Paper, Scissors". The game consists of several rounds, each round is independent of each other. In each round, both players show one of the following things at the same time: rock, paper or scissors. If both players showed the same things then the round outcome is a dr... | 1,800 | true | true | false | false | false | true | true | false | false | false | 3,535 |
931A | Two friends are on the coordinate axis _Ox_ in points with integer coordinates. One of them is in the point _x_1u2009=u2009_a_, another one is in the point _x_2u2009=u2009_b_. Each of the friends can move by one along the line in any direction unlimited number of times. When a friend moves, the tiredness of a friend ch... | 800 | true | true | true | false | false | false | true | false | false | false | 5,981 |
1372C | # Omkar and Baseball Input file: standard input Output file: standard output Time limit: 2 seconds Memory limit: 256 megabytes Patrick likes to play baseball, but sometimes he will spend so many hours hitting home runs that his mind starts to get foggy! Patrick is sure that his scores across n sessions follow the id... | 1,500 | true | false | false | false | false | true | false | false | false | false | 3,805 |
321B | Fox Ciel is playing a card game with her friend Jiro. Jiro has _n_ cards, each one has two attributes: _position_ (Attack or Defense) and _strength_. Fox Ciel has _m_ cards, each one has these two attributes too. It's known that position of all Ciel's cards is Attack. Now is Ciel's battle phase, Ciel can do the followi... | 1,900 | false | true | false | true | false | false | false | false | false | false | 8,550 |
631D | Each employee of the "Blake Techologies" company uses a special messaging app "Blake Messenger". All the stuff likes this app and uses it constantly. However, some important futures are missing. For example, many users want to be able to search through the message history. It was already announced that the new feature ... | 2,100 | false | false | true | false | true | false | false | false | false | false | 7,283 |
71D | Vasya has a pack of 54 cards (52 standard cards and 2 distinct jokers). That is all he has at the moment. Not to die from boredom, Vasya plays Solitaire with them. Vasya lays out _nm_ cards as a rectangle _n_u2009×u2009_m_. If there are jokers among them, then Vasya should change them with some of the rest of 54u2009-u... | 2,200 | false | false | true | false | false | false | true | false | false | false | 9,613 |
195E | An oriented weighted forest is an acyclic weighted digraph in which from each vertex at most one edge goes. The root of vertex _v_ of an oriented weighted forest is a vertex from which no edge goes and which can be reached from vertex _v_ moving along the edges of the weighted oriented forest. We denote the root of ver... | 2,000 | false | false | false | false | true | false | false | false | false | true | 9,059 |
321C | Now Fox Ciel becomes a commander of Tree Land. Tree Land, like its name said, has _n_ cities connected by _n_u2009-u20091 undirected roads, and for any two cities there always exists a path between them. Fox Ciel needs to assign an officer to each city. Each officer has a rank — a letter from 'A' to 'Z'. So there will ... | 2,100 | false | true | false | false | false | true | false | false | false | false | 8,549 |
2029I | Kevin has recently learned the definition of variance. For an array $$$a$$$ of length $$$n$$$, the variance of $$$a$$$ is defined as follows: Let $$$x=dfrac{1}{n}displaystylesum_{i=1}^n a_i$$$, i.e., $$$x$$$ is the mean of the array $$$a$$$; Then, the variance of $$$a$$$ is $$$$$$ V(a)=frac{1}{n}sum_{i=1}^n(a_i-x)^2.... | 3,400 | false | true | false | false | false | false | false | false | false | true | 89 |
1536A | Omkar has received a message from Anton saying "Your story for problem A is confusing. Just make a formal statement." Because of this, Omkar gives you an array $$$a = [a_1, a_2, ldots, a_n]$$$ of $$$n$$$ distinct integers. An array $$$b = [b_1, b_2, ldots, b_k]$$$ is called nice if for any two distinct elements $$$b_i,... | 800 | false | false | false | false | false | true | true | false | false | false | 2,968 |
1358C | During the quarantine, Sicromoft has more free time to create the new functions in "Celex-2021". The developers made a new function GAZ-GIZ, which infinitely fills an infinite table to the right and down from the upper left corner as follows: The cell with coordinates $$$(x, y)$$$ is at the intersection of $$$x$$$-th r... | 1,600 | true | false | false | false | false | false | false | false | false | false | 3,895 |
1359A | The game of Berland poker is played with a deck of $$$n$$$ cards, $$$m$$$ of which are jokers. $$$k$$$ players play this game ($$$n$$$ is divisible by $$$k$$$). At the beginning of the game, each player takes $$$frac{n}{k}$$$ cards from the deck (so each card is taken by exactly one player). The player who has the maxi... | 1,000 | true | true | false | false | false | false | true | false | false | false | 3,891 |
42B | Once Volodya was at the museum and saw a regular chessboard as a museum piece. And there were only four chess pieces on it: two white rooks, a white king and a black king. "Aha, blacks certainly didn't win!", — Volodya said and was right for sure. And your task is to say whether whites had won or not. Pieces on the che... | 1,700 | false | false | true | false | false | false | false | false | false | false | 9,778 |
1153D | Now Serval is a junior high school student in Japari Middle School, and he is still thrilled on math as before. As a talented boy in mathematics, he likes to play with numbers. This time, he wants to play with numbers on a rooted tree. A tree is a connected graph without cycles. A rooted tree has a special vertex calle... | 1,900 | false | true | false | true | false | false | false | true | false | false | 4,946 |
1692E | Slavic has an array of length $$$n$$$ consisting only of zeroes and ones. In one operation, he removes either the first or the last element of the array. What is the minimum number of operations Slavic has to perform such that the total sum of the array is equal to $$$s$$$ after performing all the operations? In case t... | 1,200 | false | false | true | false | false | false | false | true | false | false | 2,126 |
662A | As you know, the game of "Nim" is played with _n_ piles of stones, where the _i_-th pile initially contains _a__i_ stones. Two players alternate the turns. During a turn a player picks any non-empty pile and removes any positive number of stones from it. The one who is not able to make a move loses the game. Petya and ... | 2,400 | true | false | false | false | false | false | false | false | false | false | 7,168 |
1593D2 | This problem is a complicated version of D1, but it has significant differences, so read the whole statement. Polycarp has an array of $$$n$$$ ($$$n$$$ is even) integers $$$a_1, a_2, dots, a_n$$$. Polycarp conceived of a positive integer $$$k$$$. After that, Polycarp began performing the following operations on the arr... | 1,900 | true | false | false | false | false | false | true | false | false | false | 2,682 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.