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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15B | Petya is the most responsible worker in the Research Institute. So he was asked to make a very important experiment: to melt the chocolate bar with a new laser device. The device consists of a rectangular field of _n_u2009Γu2009_m_ cells and a robotic arm. Each cell of the field is a 1u2009Γu20091 square. The robotic a... | 1,800 | true | false | false | false | false | false | false | false | false | false | 9,919 |
1321A | Polycarp is preparing the first programming contest for robots. There are $$$n$$$ problems in it, and a lot of robots are going to participate in it. Each robot solving the problem $$$i$$$ gets $$$p_i$$$ points, and the score of each robot in the competition is calculated as the sum of $$$p_i$$$ over all problems $$$i$... | 900 | false | true | false | false | false | false | false | false | false | false | 4,109 |
1703F | You are given an array $$$a_1, a_2, dots a_n$$$. Count the number of pairs of indices $$$1 leq i, j leq n$$$ such that $$$a_i < i < a_j < j$$$. Input The first line contains an integer $$$t$$$ ($$$1 leq t leq 1000$$$)xa0β the number of test cases. The first line of each test case contains an integer $$$n$$$ ($$$2 leq n... | 1,300 | false | true | false | true | true | false | false | true | true | false | 2,057 |
1468A | Let's call a sequence $$$b_1, b_2, b_3 dots, b_{k - 1}, b_k$$$ almost increasing if $$$$$$min(b_1, b_2) le min(b_2, b_3) le dots le min(b_{k - 1}, b_k).$$$$$$ In particular, any sequence with no more than two elements is almost increasing. You are given a sequence of integers $$$a_1, a_2, dots, a_n$$$. Calculate the le... | 2,200 | false | true | false | true | true | false | false | false | false | false | 3,352 |
1399B | You have $$$n$$$ gifts and you want to give all of them to children. Of course, you don't want to offend anyone, so all gifts should be equal between each other. The $$$i$$$-th gift consists of $$$a_i$$$ candies and $$$b_i$$$ oranges. During one move, you can choose some gift $$$1 le i le n$$$ and do one of the followi... | 800 | false | true | false | false | false | false | false | false | false | false | 3,678 |
1841F | Monocarp plays a strategic computer game in which he develops a city. The city is inhabited by creatures of four different races β humans, elves, orcs, and dwarves. Each inhabitant of the city has a happiness value, which is an integer. It depends on how many creatures of different races inhabit the city. Specifically,... | 2,700 | false | false | false | false | false | false | false | false | true | false | 1,240 |
616E | Problem - 616E - Codeforces =============== xa0 . The modulo operator _a_ mod _b_ stands for the remainder after dividing _a_ by _b_. For example 10 mod 3 = 1. Input The only line contains two integers _n_,u2009_m_ (1u2009β€u2009_n_,u2009_m_u2009β€u20091013) β the parameters of the sum. Output Print integer... | 2,200 | true | false | true | false | false | false | false | false | false | false | 7,371 |
277D | Many of you must be familiar with the Google Code Jam round rules. Let us remind you of some key moments that are crucial to solving this problem. During the round, the participants are suggested to solve several problems, each divided into two subproblems: an easy one with small limits (Small input), and a hard one wi... | 2,800 | false | false | false | true | false | false | false | false | false | false | 8,724 |
673A | Problem - 673A - Codeforces =============== xa0 ]( --- Finished β Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 800 | false | false | true | false | false | false | false | false | false | false | 7,133 |
1208A | Problem - 1208A - 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 | false | false | false | false | false | false | false | false | 4,654 |
154A | Sergey attends lessons of the _N_-ish language. Each lesson he receives a hometask. This time the task is to translate some sentence to the _N_-ish language. Sentences of the _N_-ish language can be represented as strings consisting of lowercase Latin letters without spaces or punctuation marks. Sergey totally forgot a... | 1,600 | false | true | false | false | false | false | false | false | false | false | 9,259 |
1416F | Another dull quarantine day was going by when BThero decided to start researching matrices of size $$$n imes m$$$. The rows are numerated $$$1$$$ through $$$n$$$ from top to bottom, and the columns are numerated $$$1$$$ through $$$m$$$ from left to right. The cell in the $$$i$$$-th row and $$$j$$$-th column is denoted... | 3,300 | false | true | true | false | false | false | false | false | false | false | 3,597 |
1767A | You are given a non-degenerate triangle (a non-degenerate triangle is a triangle with positive area). The vertices of the triangle have coordinates $$$(x_1, y_1)$$$, $$$(x_2, y_2)$$$ and $$$(x_3, y_3)$$$. You want to draw a straight line to cut the triangle into two non-degenerate triangles. Furthermore, the line you d... | 800 | false | false | true | false | false | false | false | false | false | false | 1,697 |
845C | Problem - 845C - Codeforces =============== xa0 β the number of shows. Each of the next _n_ lines contains two integers _l__i_ and _r__i_ (0u2009β€u2009_l__i_u2009<u2009_r__i_u2009β€u2009109) β starting and ending time of _i_-th show. Output If Polycarp is able to check out all the shows using only two TVs ... | 1,500 | false | true | false | false | true | false | false | false | true | false | 6,382 |
1992E | One of the first programming problems by K1o0n looked like this: "Noobish_Monk has $$$n$$$ $$$(1 le n le 100)$$$ friends. Each of them gave him $$$a$$$ $$$(1 le a le 10000)$$$ apples for his birthday. Delighted with such a gift, Noobish_Monk returned $$$b$$$ $$$(1 le b le min(10000, a cdot n))$$$ apples to his friends.... | 1,700 | true | false | true | false | false | true | true | false | false | false | 315 |
883D | Game field is represented by a line of _n_ square cells. In some cells there are packmen, in some cells there are asterisks and the rest of the cells are empty. Packmen eat asterisks. Before the game starts you can choose a movement direction, left or right, for each packman. Once the game begins all the packmen simult... | 2,500 | true | false | false | true | false | false | false | true | false | false | 6,224 |
1133B | International Women's Day is coming soon! Polycarp is preparing for the holiday. There are $$$n$$$ candy boxes in the shop for sale. The $$$i$$$-th box contains $$$d_i$$$ candies. Polycarp wants to prepare the maximum number of gifts for $$$k$$$ girls. Each gift will consist of exactly two boxes. The girls should be ab... | 1,200 | true | false | false | false | false | false | false | false | false | false | 5,053 |
1156B | You are given a string, consisting of lowercase Latin letters. A pair of neighbouring letters in a string is considered ugly if these letters are also neighbouring in a alphabet. For example, string "abaca" contains ugly pairs at positions $$$(1, 2)$$$ β "ab" and $$$(2, 3)$$$ β "ba". Letters 'a' and 'z' aren't consider... | 1,800 | false | true | true | false | false | false | false | false | true | false | 4,929 |
1411C | You are given a $$$n imes n$$$ chessboard. Rows and columns of the board are numbered from $$$1$$$ to $$$n$$$. Cell $$$(x, y)$$$ lies on the intersection of column number $$$x$$$ and row number $$$y$$$. Rook is a chess piece, that can in one turn move any number of cells vertically or horizontally. There are $$$m$$$ r... | 1,700 | false | false | false | false | false | false | false | false | false | true | 3,619 |
1431F | You want to train a neural network model for your graduation work. There are $$$n$$$ images in the dataset, the $$$i$$$-th image's size is $$$a_i$$$ bytes. You don't have any powerful remote servers to train this model so you have to do it on your local machine. But there is a problem: the total size of the dataset is ... | 2,100 | false | true | false | false | false | false | false | true | false | false | 3,504 |
1805A | There is an array $$$a$$$ consisting of non-negative integers. You can choose an integer $$$x$$$ and denote $$$b_i=a_i oplus x$$$ for all $$$1 le i le n$$$, where $$$oplus$$$ denotes the . Input Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 le t le 1000$$$). The ... | 800 | false | false | false | false | false | false | true | false | false | false | 1,449 |
1545C | Cirno has prepared $$$n$$$ arrays of length $$$n$$$ each. Each array is a permutation of $$$n$$$ integers from $$$1$$$ to $$$n$$$. These arrays are special: for all $$$1 leq i leq n$$$, if we take the $$$i$$$-th element of each array and form another array of length $$$n$$$ with these elements, the resultant array is a... | 2,800 | false | false | false | false | false | true | true | false | false | true | 2,920 |
784D | 1,900 | false | false | true | false | false | false | false | false | false | false | 6,637 | |
848B | Wherever the destination is, whoever we meet, let's render this song together. On a Cartesian coordinate plane lies a rectangular stage of size _w_u2009Γu2009_h_, represented by a rectangle with corners (0,u20090), (_w_,u20090), (_w_,u2009_h_) and (0,u2009_h_). It can be seen that no collisions will happen before one e... | 1,900 | false | false | true | false | true | true | false | false | true | false | 6,357 |
1967B2 | Problem - 1967B2 - Codeforces =============== xa0 ]( --- Finished β Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you -... | 2,200 | true | false | false | false | false | false | true | false | false | false | 506 |
558A | Amr lives in Lala Land. Lala Land is a very beautiful country that is located on a coordinate line. Lala Land is famous with its apple trees growing everywhere. Lala Land has exactly _n_ apple trees. Tree number _i_ is located in a position _x__i_ and has _a__i_ apples growing on it. Amr wants to collect apples from th... | 1,100 | false | false | true | false | false | false | true | false | true | false | 7,603 |
433B | Kuriyama Mirai has killed many monsters and got many (namely _n_) stones. She numbers the stones from 1 to _n_. The cost of the _i_-th stone is _v__i_. Kuriyama Mirai wants to know something about these stones so she will ask you two kinds of questions: 1. She will tell you two numbers, _l_ and _r_xa0(1u2009β€u2009_l_u2... | 1,200 | false | false | true | true | false | false | false | false | true | false | 8,108 |
1843C | Vanya really likes math. One day when he was solving another math problem, he came up with an interesting tree. This tree is built as follows. Initially, the tree has only one vertex with the number $$$1$$$xa0β the root of the tree. Then, Vanya adds two children to it, assigning them consecutive numbersxa0β $$$2$$$ and... | 800 | true | false | false | false | false | false | false | false | false | false | 1,228 |
1195A | Old timers of Summer Informatics School can remember previous camps in which each student was given a drink of his choice on the vechorka (late-evening meal). Or may be the story was more complicated? There are $$$n$$$ students living in a building, and for each of them the favorite drink $$$a_i$$$ is known. So you kno... | 1,000 | true | true | false | false | false | false | false | false | false | false | 4,729 |
718C | Sasha has an array of integers _a_1,u2009_a_2,u2009...,u2009_a__n_. You have to perform _m_ queries. There might be queries of two types: 1. 1 l r xxa0β increase all integers on the segment from _l_ to _r_ by values _x_; 2. 2 l rxa0β find , where _f_(_x_) is the _x_-th Fibonacci number. As this number may be large, you... | 2,300 | true | false | false | false | true | false | false | false | false | false | 6,942 |
713C | Problem - 713C - 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,300 | false | false | false | true | false | false | false | false | true | false | 6,964 |
58B | Problem - 58B - 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,300 | false | true | false | false | false | false | false | false | false | false | 9,684 |
288A | Problem - 288A - 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 | true | false | false | false | false | false | false | false | false | 8,684 |
662B | You are given an undirected graph that consists of _n_ vertices and _m_ edges. Initially, each edge is colored either red or blue. Each turn a player picks a single vertex and switches the color of all edges incident to it. That is, all red edges with an endpoint in this vertex change the color to blue, while all blue ... | 2,200 | false | false | false | false | false | false | false | false | false | true | 7,167 |
1927F | Given an undirected weighted graph with $$$n$$$ vertices and $$$m$$$ edges. There is at most one edge between each pair of vertices in the graph, and the graph does not contain loops (edges from a vertex to itself). The graph is not necessarily connected. A cycle in the graph is called simple if it doesn't pass through... | 1,900 | false | true | true | false | true | false | false | false | true | true | 725 |
1146D | Problem - 1146D - Codeforces =============== xa0 ]( "Forethought Future Cup") $$$ be the number of distinct integers the frog can reach if it never jumps on an integer outside the interval $$$ | 2,100 | true | false | false | false | false | false | false | false | false | false | 4,988 |
76D | Problem - 76D - Codeforces =============== xa0 ") is a binary operation which is equivalent to applying logical exclusive OR to every pair of bits located on the same positions in binary notation of operands. In other words, a binary digit of the result is equal to 1 if and only if bits on the respective ... | 1,700 | true | true | false | true | false | false | false | false | false | false | 9,583 |
1931A | Nikita had a word consisting of exactly $$$3$$$ lowercase Latin letters. The letters in the Latin alphabet are numbered from $$$1$$$ to $$$26$$$, where the letter "a" has the index $$$1$$$, and the letter "z" has the index $$$26$$$. He encoded this word as the sum of the positions of all the characters in the alphabet.... | 800 | false | false | false | false | false | false | true | false | false | false | 701 |
2010B | Problem - 2010B - Codeforces =============== xa0 ]( --- Finished β Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ... | 800 | true | false | true | false | false | false | true | false | false | false | 190 |
20C | Problem - 20C - 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 | false | false | false | false | false | false | false | false | true | 9,893 |
1633C | Monocarp is playing a computer game. In this game, his character fights different monsters. A fight between a character and a monster goes as follows. Suppose the character initially has health $$$h_C$$$ and attack $$$d_C$$$; the monster initially has health $$$h_M$$$ and attack $$$d_M$$$. The fight consists of several... | 1,100 | true | false | false | false | false | false | true | false | false | false | 2,450 |
1909D | There are $$$n$$$ positive integers $$$a_1, a_2, dots, a_n$$$ on a blackboard. You are also given a positive integer $$$k$$$. You can perform the following operation some (possibly $$$0$$$) times: choose a number $$$x$$$ on the blackboard; erase one occurrence of $$$x$$$; write two positive integers $$$y$$$, $$$z$$$... | 1,900 | true | true | false | false | false | false | false | false | false | false | 854 |
1010A | Natasha is going to fly on a rocket to Mars and return to Earth. Also, on the way to Mars, she will land on $$$n - 2$$$ intermediate planets. Formally: we number all the planets from $$$1$$$ to $$$n$$$. $$$1$$$ is Earth, $$$n$$$ is Mars. Natasha will make exactly $$$n$$$ flights: $$$1 o 2 o ldots n o 1$$$. Flight fr... | 1,500 | true | false | false | false | false | false | false | true | false | false | 5,635 |
1187D | You are given an array $$$a_1, a_2, dots, a_n$$$ and an array $$$b_1, b_2, dots, b_n$$$. For one operation you can sort in non-decreasing order any subarray $$$a[l dots r]$$$ of the array $$$a$$$. For example, if $$$a = [4, 2, 2, 1, 3, 1]$$$ and you choose subbarray $$$a[2 dots 5]$$$, then the array turns into $$$[4, 1... | 2,400 | false | false | false | false | true | false | false | false | true | false | 4,763 |
1492C | Your classmate, whom you do not like because he is boring, but whom you respect for his intellect, has two strings: $$$s$$$ of length $$$n$$$ and $$$t$$$ of length $$$m$$$. A sequence $$$p_1, p_2, ldots, p_m$$$, where $$$1 leq p_1 < p_2 < ldots < p_m leq n$$$, is called beautiful, if $$$s_{p_i} = t_i$$$ for all $$$i$$$... | 1,500 | false | true | false | true | true | false | false | true | false | false | 3,211 |
2029C | Hello, Codeforces Forcescode! Kevin used to be a participant of Codeforces. Recently, the KDOI Team has developed a new Online Judge called Forcescode. Kevin has participated in $$$n$$$ contests on Forcescode. In the $$$i$$$-th contest, his performance rating is $$$a_i$$$. Now he has hacked into the backend of Forcesco... | 1,700 | false | true | false | true | true | false | false | true | false | false | 95 |
513B1 | Problem - 513B1 - Codeforces =============== xa0 ]( "16140") as the following sum: Find the lexicographically _m_-th permutation of length _n_ in the set of permutations having the maximum possible value of _f_(_p_). Input The single line of input contains two integers _n_ and _m_ (1u2009β€u2009_m_u2009β€u20... | 1,400 | false | false | false | false | false | false | true | false | false | false | 7,792 |
1133F2 | You are given an undirected unweighted connected graph consisting of $$$n$$$ vertices and $$$m$$$ edges. It is guaranteed that there are no self-loops or multiple edges in the given graph. Your task is to find any spanning tree of this graph such that the degree of the first vertex (vertex with label $$$1$$$ on it) is ... | 1,900 | false | true | false | false | false | true | false | false | false | true | 5,048 |
472A | Problem - 472A - Codeforces =============== xa0 . Output Output two composite integers _x_ and _y_ (1u2009<u2009_x_,u2009_y_u2009<u2009_n_) such that _x_u2009+u2009_y_u2009=u2009_n_. If there are multiple solutions, you can output any of them. Examples Input 12 Output 4 8 Input 15 Output 6 9 Input 23 ... | 800 | true | false | false | false | false | false | false | false | false | false | 7,947 |
1700F | Pupils Alice and Ibragim are best friends. It's Ibragim's birthday soon, so Alice decided to gift him a new puzzle. The puzzle can be represented as a matrix with $$$2$$$ rows and $$$n$$$ columns, every element of which is either $$$0$$$ or $$$1$$$. In one move you can swap two values in neighboring cells. More formall... | 2,600 | false | true | false | true | false | true | false | false | false | false | 2,077 |
1951I | You are given an undirected connected simple graph with $$$n$$$ nodes and $$$m$$$ edges, where edge $$$i$$$ connects node $$$u_i$$$ and $$$v_i$$$, with two positive parameters $$$a_i$$$ and $$$b_i$$$ attached to it. Additionally, you are also given an integer $$$k$$$. A non-negative array $$$x$$$ with size $$$m$$$ is c... | 3,200 | false | true | false | false | false | true | false | true | false | true | 566 |
1867E2 | This is the hard version of the problem. The only difference between the versions is the limit on the number of queries. In this version, you can make no more than 57 queries. You can make hacks only if both versions of the problem are solved. This is an interactive problem! salyg1n has given you a positive integer $$$... | 2,200 | false | false | false | false | false | true | false | false | false | false | 1,070 |
1256A | You have $$$a$$$ coins of value $$$n$$$ and $$$b$$$ coins of value $$$1$$$. You always pay in exact change, so you want to know if there exist such $$$x$$$ and $$$y$$$ that if you take $$$x$$$ ($$$0 le x le a$$$) coins of value $$$n$$$ and $$$y$$$ ($$$0 le y le b$$$) coins of value $$$1$$$, then the total value of take... | 1,000 | true | false | false | false | false | false | false | false | false | false | 4,407 |
1288E | Polycarp is a frequent user of the very popular messenger. He's chatting with his friends all the time. He has $$$n$$$ friends, numbered from $$$1$$$ to $$$n$$$. Recall that a permutation of size $$$n$$$ is an array of size $$$n$$$ such that each integer from $$$1$$$ to $$$n$$$ occurs exactly once in this array. So his... | 2,000 | false | false | false | false | true | false | false | false | false | false | 4,248 |
1374F | You are given an array $$$a$$$ consisting of $$$n$$$ integers. In one move, you can choose some index $$$i$$$ ($$$1 le i le n - 2$$$) and shift the segment $$$[a_i, a_{i + 1}, a_{i + 2}]$$$ cyclically to the right (i.e. replace the segment $$$[a_i, a_{i + 1}, a_{i + 2}]$$$ with $$$[a_{i + 2}, a_i, a_{i + 1}]$$$). Your ... | 2,400 | false | false | true | false | false | true | true | false | true | false | 3,788 |
1793B | For his birthday recently Fedya was given an array $$$a$$$ of $$$n$$$ integers arranged in a circle, For each pair of neighboring numbers ($$$a_1$$$ and $$$a_2$$$, $$$a_2$$$ and $$$a_3$$$, $$$ldots$$$, $$$a_{n - 1}$$$ and $$$a_n$$$, $$$a_n$$$ and $$$a_1$$$) the absolute difference between them is equal to $$$1$$$. Let'... | 1,100 | true | false | false | false | false | true | false | false | false | false | 1,519 |
732F | Berland is a tourist country! At least, it can become suchxa0β the government of Berland is confident about this. There are _n_ cities in Berland, some pairs of which are connected by two-ways roads. Each road connects two different cities. In Berland there are no roads which connect the same pair of cities. It is poss... | 2,300 | false | false | false | false | false | false | false | false | false | true | 6,865 |
891A | Problem - 891A - 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 | true | false | true | false | false | true | false | false | false | 6,188 |
1100D | This is an interactive task. Dasha and NN like playing chess. While playing a match they decided that normal chess isn't interesting enough for them, so they invented a game described below. There are $$$666$$$ black rooks and $$$1$$$ white king on the chess board of size $$$999 imes 999$$$. The white king wins if he ... | 2,500 | false | false | false | false | false | true | false | false | false | false | 5,203 |
1510J | Joseph really likes the culture of Japan. Last year he learned Japanese traditional clothes and visual arts and now he is trying to find out the secret of the Japanese game called Nonogram. In the one-dimensional version of the game, there is a row of $$$n$$$ empty cells, some of which are to be filled with a pen. Ther... | 2,700 | true | false | false | false | false | true | false | false | false | false | 3,118 |
1616B | You have a string $$$s_1 s_2 ldots s_n$$$ and you stand on the left of the string looking right. You want to choose an index $$$k$$$ ($$$1 le k le n$$$) and place a mirror after the $$$k$$$-th letter, so that what you see is $$$s_1 s_2 ldots s_k s_k s_{k - 1} ldots s_1$$$. What is the lexicographically smallest string ... | 1,100 | false | true | false | false | false | false | false | false | false | false | 2,555 |
1534E | This is an interactive problem. Note: the XOR-sum of an array $$$a_1, a_2, ldots, a_n$$$ ($$$1 le a_i le 10^9$$$) is defined as $$$a_1 oplus a_2 oplus ldots oplus a_n$$$, where $$$oplus$$$ denotes the , and allows you to perform the following type of query: by giving the machine $$$k$$$ distinct indices $$$x_1, x_2, ld... | 2,300 | false | true | false | false | false | false | false | false | false | true | 2,979 |
1474D | During cleaning the coast, Alice found $$$n$$$ piles of stones. The $$$i$$$-th pile has $$$a_i$$$ stones. Piles $$$i$$$ and $$$i + 1$$$ are neighbouring for all $$$1 leq i leq n - 1$$$. If pile $$$i$$$ becomes empty, piles $$$i - 1$$$ and $$$i + 1$$$ doesn't become neighbouring. Alice is too lazy to remove these stones... | 2,200 | true | true | false | true | true | false | false | false | false | false | 3,307 |
1354C1 | The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd. You are given a regular polygon with $$$2 cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$... | 1,400 | true | false | false | false | false | false | false | true | false | false | 3,937 |
237B | You've got table _a_, consisting of _n_ rows, numbered from 1 to _n_. The _i_-th line of table _a_ contains _c__i_ cells, at that for all _i_ (1u2009<u2009_i_u2009β€u2009_n_) holds _c__i_u2009β€u2009_c__i_u2009-u20091. Let's denote _s_ as the total number of cells of table _a_, that is, . We know that each cell of the ta... | 1,500 | false | false | true | false | false | false | false | false | true | false | 8,888 |
1504B | There is a binary string $$$a$$$ of length $$$n$$$. In one operation, you can select any prefix of $$$a$$$ with an equal number of $$$0$$$ and $$$1$$$ symbols. Then all symbols in the prefix are inverted: each $$$0$$$ becomes $$$1$$$ and each $$$1$$$ becomes $$$0$$$. For example, suppose $$$a=0111010000$$$. In the fir... | 1,200 | true | true | true | false | false | true | false | false | false | false | 3,153 |
24A | Nowadays the one-way traffic is introduced all over the world in order to improve driving safety and reduce traffic jams. The government of Berland decided to keep up with new trends. Formerly all _n_ cities of Berland were connected by _n_ two-way roads in the ring, i. e. each city was connected directly to exactly tw... | 1,400 | false | false | false | false | false | false | false | false | false | true | 9,878 |
372A | Problem - 372A - Codeforces =============== xa0 ]( --- Finished β Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 1,600 | false | true | false | false | false | false | false | true | true | false | 8,343 |
1527E | You are given an array $$$a$$$ of $$$n$$$ integers. Define the cost of some array $$$t$$$ as follows: $$$$$$cost(t) = sum_{x in set(t) } last(x) - first(x),$$$$$$ where $$$set(t)$$$ is the set of all values in $$$t$$$ without repetitions, $$$first(x)$$$, and $$$last(x)$$$ are the indices of the first and last occurrenc... | 2,500 | false | false | false | true | true | false | false | true | false | false | 3,024 |
1922D | Monocarp is playing a computer game (yet again). Guess what is he doing? That's right, killing monsters. There are $$$n$$$ monsters in a row, numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has two parameters: attack value equal to $$$a_i$$$ and defense value equal to $$$d_i$$$. In order to kill these monsters... | 1,900 | true | false | true | false | true | false | true | false | false | false | 755 |
1017A | John Smith knows that his son, Thomas Smith, is among the best students in his class and even in his school. After the students of the school took the exams in English, German, Math, and History, a table of results was formed. There are $$$n$$$ students, each of them has a unique id (from $$$1$$$ to $$$n$$$). Thomas's ... | 800 | false | false | true | false | false | false | false | false | false | false | 5,605 |
1740G | Pak Chanek has an $$$n imes m$$$ grid of portals. The portal on the $$$i$$$-th row and $$$j$$$-th column is denoted as portal $$$(i,j)$$$. The portals $$$(1,1)$$$ and $$$(n,m)$$$ are on the north-west and south-east corner of the grid respectively. The portal $$$(i,j)$$$ has two settings: Type $$$t_{i,j}$$$, which is... | 3,100 | false | false | false | false | false | true | false | false | true | false | 1,841 |
2014A | There is a little bit of the outlaw in everyone, and a little bit of the hero too. The heroic outlaw Robin Hood is famous for taking from the rich and giving to the poor. Robin encounters $$$n$$$ people starting from the $$$1$$$-st and ending with the $$$n$$$-th. The $$$i$$$-th person has $$$a_i$$$ gold. If $$$a_i ge k... | 800 | false | true | true | false | false | false | false | false | false | false | 171 |
93D | When Igor K. was a freshman, his professor strictly urged him, as well as all other freshmen, to solve programming Olympiads. One day a problem called "Flags" from a website called Timmy's Online Judge caught his attention. In the problem one had to find the number of three-colored flags that would satisfy the conditio... | 2,500 | true | false | false | true | false | false | false | false | false | false | 9,512 |
290E | Problem - 290E - Codeforces =============== xa0 | 2,500 | false | false | false | false | false | true | false | false | false | false | 8,673 |
1211F | Polycarp really likes writing the word "kotlin". He wrote this word several times in a row without spaces. For example, he could write the string like "kotlinkotlinkotlinkotlin". Polycarp sliced (cut) the written string into $$$n$$$ pieces and mixed them. As a result, he has $$$n$$$ strings $$$s_1, s_2, dots, s_n$$$ an... | 2,300 | false | false | true | false | false | false | false | false | false | true | 4,623 |
1055C | Bob and Alice are often participating in various programming competitions. Like many competitive programmers, Alice and Bob have good and bad days. They noticed, that their lucky and unlucky days are repeating with some period. For example, for Alice days $$$[l_a; r_a]$$$ are lucky, then there are some unlucky days: $$... | 1,900 | true | false | false | false | false | false | false | false | false | false | 5,437 |
472E | One way to create task is to learn from game. You should pick a game and focus on part of the mechanic of that game, then it might be a good task. Let's have a try. Puzzle and Dragon was a popular game in Japan, we focus on the puzzle part of that game, it is a tile-matching puzzle. (Picture from Wikipedia page: is an ... | 2,800 | false | false | true | false | false | true | false | false | false | false | 7,943 |
79E | Fox Ciel safely returned to her castle, but there was something wrong with the security system of the castle: sensors attached in the castle were covering her. Ciel is at point (1,u20091) of the castle now, and wants to move to point (_n_,u2009_n_), which is the position of her room. By one step, Ciel can move from poi... | 2,900 | true | false | false | false | false | false | false | false | false | false | 9,566 |
1556B | William has an array of $$$n$$$ integers $$$a_1, a_2, dots, a_n$$$. In one move he can swap two neighboring items. Two items $$$a_i$$$ and $$$a_j$$$ are considered neighboring if the condition $$$i - j = 1$$$ is satisfied. William wants you to calculate the minimal number of swaps he would need to perform to make it so... | 1,300 | false | false | true | false | false | false | false | false | false | false | 2,854 |
1085G | Petya collects beautiful matrix. A matrix of size $$$n imes n$$$ is beautiful if: All elements of the matrix are integers between $$$1$$$ and $$$n$$$; For every row of the matrix, all elements of this row are different; For every pair of vertically adjacent elements, these elements are different. Today Petya bought... | 2,900 | false | false | false | true | true | false | false | false | false | false | 5,293 |
821D | Okabe likes to be able to walk through his city on a path lit by street lamps. That way, he doesn't get beaten up by schoolchildren. Okabe's city is represented by a 2D grid of cells. Rows are numbered from 1 to _n_ from top to bottom, and columns are numbered 1 to _m_ from left to right. Exactly _k_ cells in the city ... | 2,200 | false | false | false | false | false | false | false | false | false | true | 6,470 |
553A | Problem - 553A - 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 | false | true | false | false | false | false | false | false | 7,622 |
1070F | Elections in Berland are coming. There are only two candidates β Alice and Bob. The main Berland TV channel plans to show political debates. There are $$$n$$$ people who want to take part in the debate as a spectator. Each person is described by their influence and political views. There are four kinds of political vie... | 1,500 | false | true | false | false | false | false | false | false | false | false | 5,362 |
807B | Not so long ago the Codecraft-17 contest was held on Codeforces. The top 25 participants, and additionally random 25 participants out of those who got into top 500, will receive a Codeforces T-shirt. Unfortunately, you didn't manage to get into top 25, but you got into top 500, taking place _p_. Now the elimination rou... | 1,300 | false | false | true | false | false | false | true | false | false | false | 6,536 |
1041F | You are given a tube which is reflective inside represented as two non-coinciding, but parallel to $$$Ox$$$ lines. Each line has some special integer pointsxa0β positions of sensors on sides of the tube. You are going to emit a laser ray in the tube. To do so, you have to choose two integer points $$$A$$$ and $$$B$$$ o... | 2,500 | true | false | false | true | true | false | false | false | false | false | 5,490 |
159B | Polycarpus has _n_ markers and _m_ marker caps. Each marker is described by two numbers: _x__i_ is the color and _y__i_ is the diameter. Correspondingly, each cap is described by two numbers: _a__j_ is the color and _b__j_ is the diameter. Cap (_a__j_,u2009_b__j_) can close marker (_x__i_,u2009_y__i_) only if their dia... | 1,100 | false | true | false | false | false | false | false | false | true | false | 9,239 |
1505B | . Output Output the result β an integer number. | 1,600 | false | false | true | false | false | false | false | false | false | false | 3,151 |
2027E2 | This is the hard version of this problem. The only difference is that you need to output the number of choices of games where Bob wins in this version, where the number of stones in each pile are not fixed. You must solve both versions to be able to hack. Alice and Bob are playing a familiar game where they take turns ... | 3,100 | true | false | false | true | false | false | false | false | false | false | 104 |
1654D | Alice's potion making professor gave the following assignment to his students: brew a potion using $$$n$$$ ingredients, such that the proportion of ingredient $$$i$$$ in the final potion is $$$r_i > 0$$$ (and $$$r_1 + r_2 + cdots + r_n = 1$$$). He forgot the recipe, and now all he remembers is a set of $$$n-1$$$ facts ... | 2,100 | true | false | false | false | false | false | false | false | false | false | 2,359 |
1107C | You are playing a new famous fighting game: Kortal Mombat XII. You have to perform a brutality on your opponent's character. You are playing the game on the new generation console so your gamepad have $$$26$$$ buttons. Each button has a single lowercase Latin letter from 'a' to 'z' written on it. All the letters on but... | 1,300 | false | true | false | false | false | false | false | false | true | false | 5,167 |
1360D | Polycarp wants to buy exactly $$$n$$$ shovels. The shop sells packages with shovels. The store has $$$k$$$ types of packages: the package of the $$$i$$$-th type consists of exactly $$$i$$$ shovels ($$$1 le i le k$$$). The store has an infinite number of packages of each type. Polycarp wants to choose one type of packag... | 1,300 | true | false | false | false | false | false | false | false | false | false | 3,882 |
54B | The Hedgehog recently remembered one of his favorite childhood activities, β solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands of tiny pieces of the picture, looking for the required items one by one. Soon the Hedgehog came up with a brilliant idea: inst... | 1,800 | false | false | true | false | false | false | false | false | false | false | 9,704 |
900D | Problem - 900D - 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,143 |
167D | In some country live wizards. They love to build cities and roads. The country used to have _k_ cities, the _j_-th city (1u2009β€u2009_j_u2009β€u2009_k_) was located at a point (_x__j_, _y__j_). It was decided to create another _n_u2009-u2009_k_ cities. And the _i_-th one (_k_u2009<u2009_i_u2009β€u2009_n_) was created at ... | 3,000 | false | true | false | false | true | false | false | false | false | true | 9,192 |
1618F | You are given two positive integers $$$x$$$ and $$$y$$$. You can perform the following operation with $$$x$$$: write it in its binary form without leading zeros, add $$$0$$$ or $$$1$$$ to the right of it, reverse the binary form and turn it into a decimal number which is assigned as the new value of $$$x$$$. For exampl... | 2,000 | true | false | true | false | false | true | false | false | false | false | 2,537 |
1787G | An edge-weighted tree of $$$n$$$ nodes is given with each edge colored in some color. Each node of this tree can be blocked or unblocked, all nodes are unblocked initially. A simple path is a path in a graph that does not have repeating nodes. The length of a path is defined as the sum of weights of all edges on the pa... | 3,000 | false | false | false | false | true | false | true | false | false | false | 1,557 |
204D | The Little Elephant has found a ragged old black-and-white string _s_ on the attic. The characters of string _s_ are numbered from the left to the right from 1 to _s_, where _s_ is the length of the string. Let's denote the _i_-th character of string _s_ as _s__i_. As the string is black-and-white, each character of th... | 2,400 | false | false | false | true | false | false | false | false | false | false | 9,024 |
1740A | Problem - 1740A - 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 | false | false | false | true | false | false | false | false | 1,847 |
203A | A boy Valera registered on site Codeforces as Valera, and wrote his first Codeforces Round #300. He boasted to a friend Arkady about winning as much as _x_ points for his first contest. But Arkady did not believe his friend's words and decided to check whether Valera could have shown such a result. He knows that the co... | 1,200 | false | false | true | false | false | false | true | false | false | false | 9,032 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.