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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1421C | Ringo found a string $$$s$$$ of length $$$n$$$ in his and to append the substring $$$s_2s_3 ldots s_i$$$ ($$$i - 1$$$ characters) reversed to the front of $$$s$$$. The second operation allows him to choose $$$i$$$ ($$$2 le i le n-1$$$) and to append the substring $$$s_i s_{i + 1}ldots s_{n - 1}$$$ ($$$n - i$$$ characte... | 1,400 | false | false | false | false | false | true | false | false | false | false | 3,572 |
838A | You are given an image, that can be represented with a 2-d _n_ by _m_ grid of pixels. Each pixel of the image is either on or off, denoted by the characters "0" or "1", respectively. You would like to compress this image. You want to choose an integer _k_u2009>u20091 and split the image into _k_ by _k_ blocks. If _n_ a... | 1,400 | false | false | false | false | false | false | true | false | false | false | 6,414 |
69A | A guy named Vasya attends the final grade of a high school. One day Vasya decided to watch a match of his favorite hockey team. And, as the boy loves hockey very much, even more than physics, he forgot to do the homework. Specifically, he forgot to complete his physics tasks. Next day the teacher got very angry at Vasy... | 1,000 | true | false | true | false | false | false | false | false | false | false | 9,626 |
1403B | Spring cleanings are probably the most boring parts of our lives, except this year, when Flóra and her mother found a dusty old tree graph under the carpet. This tree has $$$N$$$ nodes (numbered from $$$1$$$ to $$$N$$$), connected by $$$N-1$$$ edges. The edges gathered too much dust, so Flóra's mom decided to clean the... | 2,300 | false | false | false | false | true | false | false | false | false | true | 3,655 |
1748C | The score of an array $$$v_1,v_2,ldots,v_n$$$ is defined as the number of indices $$$i$$$ ($$$1 le i le n$$$) such that $$$v_1+v_2+ldots+v_i = 0$$$. You are given an array $$$a_1,a_2,ldots,a_n$$$ of length $$$n$$$. You can perform the following operation multiple times: select an index $$$i$$$ ($$$1 le i le n$$$) such... | 1,600 | false | true | true | true | true | false | true | false | false | false | 1,795 |
584D | Problem - 584D - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 1,800 | true | false | false | false | false | false | true | false | false | false | 7,507 |
1860F | You are given $$$2n$$$ tuples of values $$$(a, b, c)$$$, where $$$a$$$ and $$$b$$$ are positive integers and $$$c$$$ is a bracket '(' or ')'. Exactly $$$n$$$ tuples have $$$c = $$$'(' and the other $$$n$$$ tuples have $$$c =$$$ ')'. You are asked to choose two positive values $$$x$$$ and $$$y$$$ ($$$x > 0$$$ and $$$y >... | 2,900 | true | false | true | false | true | false | false | false | true | false | 1,120 |
1401A | We have a point $$$A$$$ with coordinate $$$x = n$$$ on $$$OX$$$-axis. We'd like to find an integer point $$$B$$$ (also on $$$OX$$$-axis), such that the absolute difference between the distance from $$$O$$$ to $$$B$$$ and the distance from $$$A$$$ to $$$B$$$ is equal to $$$k$$$. The description of the first test case. ... | 900 | true | false | false | false | false | true | false | false | false | false | 3,665 |
255A | Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was _n_ integers _a_1,u2009_a_2,u2009...,u2009_a__n_. These numbers mean that Greg needs to do exactly _n_ exercises today. Besides, Greg should repeat the _i_-th in order exercise _a__i_ times. Greg now only does three types of ... | 800 | false | false | true | false | false | false | false | false | false | false | 8,814 |
6B | President of Berland has a very vast office-room, where, apart from him, work his subordinates. Each subordinate, as well as President himself, has his own desk of a unique colour. Each desk is rectangular, and its sides are parallel to the office walls. One day President decided to establish an assembly, of which all ... | 1,100 | false | false | true | false | false | false | false | false | false | false | 9,964 |
1117F | You are given a string of length $$$n$$$. Each character is one of the first $$$p$$$ lowercase Latin letters. You are also given a matrix $$$A$$$ with binary values of size $$$p imes p$$$. This matrix is symmetric ($$$A_{ij} = A_{ji}$$$). $$$A_{ij} = 1$$$ means that the string can have the $$$i$$$-th and $$$j$$$-th le... | 2,500 | false | false | false | true | false | false | false | false | false | false | 5,104 |
1175E | You are given $$$n$$$ intervals in form $$$[l; r]$$$ on a number line. You are also given $$$m$$$ queries in form $$$[x; y]$$$. What is the minimal number of intervals you have to take so that every point (not necessarily integer) from $$$x$$$ to $$$y$$$ is covered by at least one of them? If you can't choose intervals... | 2,200 | false | true | true | true | true | false | false | false | false | false | 4,841 |
1832C | For an array of integers $$$[a_1, a_2, dots, a_n]$$$, let's call the value $$$a_1-a_2+a_2-a_3+cdots+a_{n-1}-a_n$$$ the contrast of the array. Note that the contrast of an array of size $$$1$$$ is equal to $$$0$$$. You are given an array of integers $$$a$$$. Your task is to build an array of $$$b$$$ in such a way that a... | 1,200 | false | true | true | false | false | false | false | false | false | false | 1,296 |
805B | Problem - 805B - 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 | false | false | false | true | false | false | false | false | 6,538 |
1284D | Filled with optimism, Hyunuk will host a conference about how great this new year will be! The conference will have $$$n$$$ lectures. Hyunuk has two candidate venues $$$a$$$ and $$$b$$$. For each of the $$$n$$$ lectures, the speaker specified two time intervals $$$[sa_i, ea_i]$$$ ($$$sa_i le ea_i$$$) and $$$[sb_i, eb_i... | 2,100 | false | false | false | false | true | false | false | true | true | false | 4,271 |
1081H | After learning some fancy algorithms about palindromes, Chouti found palindromes very interesting, so he wants to challenge you with this problem. Chouti has got two strings $$$A$$$ and $$$B$$$. Since he likes . The second line contains a single string $$$B$$$ ($$$1 le B le 2 cdot 10^5$$$). Strings $$$A$$$ and $$$B$$$ ... | 3,500 | false | false | false | false | true | false | false | false | false | false | 5,316 |
1176A | You are given an integer $$$n$$$. You can perform any of the following operations with this number an arbitrary (possibly, zero) number of times: 1. Replace $$$n$$$ with $$$frac{n}{2}$$$ if $$$n$$$ is divisible by $$$2$$$; 2. Replace $$$n$$$ with $$$frac{2n}{3}$$$ if $$$n$$$ is divisible by $$$3$$$; 3. Replace $$$n$$$ ... | 800 | false | true | true | false | false | false | true | false | false | false | 4,838 |
571B | Problem - 571B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 2,000 | false | true | false | true | false | false | false | false | true | false | 7,565 |
886A | Problem - 886A - Codeforces =============== xa0 ") ") — scores of the participants Output Print "YES" (quotes for clarity), if it is possible to build teams with equal score, and "NO" otherwise. You can print each character either upper- or lowercase ("YeS" and "yes" are valid when the answer is "YES"). Ex... | 1,000 | false | false | false | false | false | false | true | false | false | false | 6,208 |
174C | Polycarpus is an amateur programmer. Now he is analyzing a friend's program. He has already found there the function rangeIncrement(l, r), that adds 1 to each element of some array _a_ for all indexes in the segment [_l_,u2009_r_]. In other words, this function does the following: function rangeIncrement(l, r) for ... | 1,800 | false | true | false | false | true | false | false | false | false | false | 9,166 |
1875A | Flowey has planted a bomb in Snowdin! The bomb has a timer that is initially set to $$$b$$$. Every second, the timer will decrease by $$$1$$$. When the timer reaches $$$0$$$, the bomb will explode! To give the residents of Snowdin enough time to evacuate, you will need to delay the bomb from exploding for as long as po... | 900 | false | true | false | false | false | false | true | false | false | false | 1,029 |
1520C | Problem - 1520C - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ... | 1,000 | false | false | false | false | false | true | false | false | false | false | 3,061 |
1185E | After a hard-working week Polycarp prefers to have fun. Polycarp's favorite entertainment is drawing snakes. He takes a rectangular checkered sheet of paper of size $$$n imes m$$$ (where $$$n$$$ is the number of rows, $$$m$$$ is the number of columns) and starts to draw snakes in cells. Polycarp draws snakes with lowe... | 2,000 | false | false | true | false | false | false | true | false | false | false | 4,775 |
1066B | Vova's house is an array consisting of $$$n$$$ elements (yeah, this is the first problem, I think, where someone lives in the array). There are heaters in some positions of the array. The $$$i$$$-th element of the array is $$$1$$$ if there is a heater in the position $$$i$$$, otherwise the $$$i$$$-th element of the arr... | 1,500 | false | true | false | false | false | false | false | false | false | false | 5,380 |
1503A | A sequence of brackets is called balanced if one can turn it into a valid math expression by adding characters '+' and '1'. For example, sequences '(())()', '()', and '(()(()))' are balanced, while ')(', '(()', and '(()))(' are not. You are given a binary string $$$s$$$ of length $$$n$$$. Construct two balanced bracket... | 1,600 | false | true | false | false | false | true | false | false | false | false | 3,160 |
1658E | Marin feels exhausted after a long day of cosplay, so Gojou invites her to play a game! Marin and Gojou take turns to place one of their tokens on an $$$n imes n$$$ grid with Marin starting first. There are some restrictions and allowances on where to place tokens: Apart from the first move, the token placed by a pla... | 2,500 | true | false | true | true | true | false | false | false | true | false | 2,334 |
2028B | Alice mixed up the words transmutation and permutation! She has an array $$$a$$$ specified via three integers $$$n$$$, $$$b$$$, $$$c$$$: the array $$$a$$$ has length $$$n$$$ and is given via $$$a_i = bcdot (i - 1) + c$$$ for $$$1le ile n$$$. For example, if $$$n=3$$$, $$$b=2$$$, and $$$c=1$$$, then $$$a=[2 cdot 0 + 1, ... | 1,400 | true | false | true | false | false | false | false | true | false | false | 102 |
32B | Problem - 32B - 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... | 800 | false | false | true | false | false | false | false | false | false | false | 9,837 |
1583C | The problem statement looms below, filling you with determination. Consider a grid in which some cells are empty and some cells are filled. Call a cell in this grid exitable if, starting at that cell, you can exit the grid by moving up and left through only empty cells. This includes the cell itself, so all filled in c... | 1,700 | false | false | false | true | true | false | false | false | false | false | 2,715 |
148B | The princess is going to escape the dragon's cave, and she needs to plan it carefully. The princess runs at _v__p_ miles per hour, and the dragon flies at _v__d_ miles per hour. The dragon will discover the escape after _t_ hours and will chase the princess immediately. Looks like there's no chance to success, but the ... | 1,500 | true | false | true | false | false | false | false | false | false | false | 9,285 |
1234E | Let's define $$$p_i(n)$$$ as the following permutation: $$$[i, 1, 2, dots, i - 1, i + 1, dots, n]$$$. This means that the $$$i$$$-th permutation is almost identity (i.e. which maps every element to itself) permutation but the element $$$i$$$ is on the first position. Examples: $$$p_1(4) = [1, 2, 3, 4]$$$; $$$p_2(4) =... | 2,000 | true | false | false | false | false | false | false | false | false | false | 4,520 |
922A | Problem - 922A - 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 | 6,029 |
1760F | There are $$$n$$$ quests. If you complete the $$$i$$$-th quest, you will gain $$$a_i$$$ coins. You can only complete at most one quest per day. However, once you complete a quest, you cannot do the same quest again for $$$k$$$ days. (For example, if $$$k=2$$$ and you do quest $$$1$$$ on day $$$1$$$, then you cannot do ... | 1,500 | false | true | false | false | false | false | false | true | true | false | 1,750 |
764A | Problem - 764A - 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 | true | false | true | false | false | false | true | false | false | false | 6,732 |
741D | Problem - 741D - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 2,900 | false | false | false | false | true | false | false | false | false | false | 6,833 |
1175B | You are given a function $$$f$$$ written in some basic language. The function accepts an integer value, which is immediately written into some variable $$$x$$$. $$$x$$$ is an integer variable and can be assigned values from $$$0$$$ to $$$2^{32}-1$$$. The function contains three types of commands: for $$$n$$$ — for loo... | 1,600 | false | false | true | false | true | false | false | false | false | false | 4,844 |
1843A | Sasha found an array $$$a$$$ consisting of $$$n$$$ integers and asked you to paint elements. You have to paint each element of the array. You can use as many colors as you want, but each element should be painted into exactly one color, and for each color, there should be at least one element of that color. The cost of... | 800 | false | true | false | false | false | false | false | false | true | false | 1,230 |
1646F | There are $$$n$$$ players, numbered from $$$1$$$ to $$$n$$$ sitting around a round table. The $$$(i+1)$$$-th player sits to the right of the $$$i$$$-th player for $$$1 le i < n$$$, and the $$$1$$$-st player sits to the right of the $$$n$$$-th player. There are $$$n^2$$$ cards, each of which has an integer between $$$1$... | 2,900 | false | true | true | false | false | true | false | false | false | false | 2,390 |
1463A | You are playing a new computer game in which you have to fight monsters. In a dungeon you are trying to clear, you met three monsters; the first of them has $$$a$$$ health points, the second has $$$b$$$ health points, and the third has $$$c$$$. To kill the monsters, you can use a cannon that, when fired, deals $$$1$$$ ... | 1,100 | true | false | false | false | false | false | false | true | false | false | 3,373 |
442B | Andrey needs one more problem to conduct a programming contest. He has _n_ friends who are always willing to help. He can ask some of them to come up with a contest problem. Andrey knows one value for each of his fiends — the probability that this friend will come up with a problem if Andrey asks him. Help Andrey choos... | 1,800 | true | true | false | false | false | false | false | false | false | false | 8,069 |
509D | Vasya had two arrays consisting of non-negative integers: _a_ of size _n_ and _b_ of size _m_. Vasya chose a positive integer _k_ and created an _n_u2009×u2009_m_ matrix _v_ using the following formula: Vasya wrote down matrix _v_ on a piece of paper and put it in the table. A year later Vasya was cleaning his table wh... | 2,200 | true | false | false | false | false | true | false | false | false | false | 7,803 |
1474B | Positive integer $$$x$$$ is called divisor of positive integer $$$y$$$, if $$$y$$$ is divisible by $$$x$$$ without remainder. For example, $$$1$$$ is a divisor of $$$7$$$ and $$$3$$$ is not divisor of $$$8$$$. We gave you an integer $$$d$$$ and asked you to find the smallest positive integer $$$a$$$, such that $$$a$$$... | 1,000 | true | true | false | false | false | true | false | true | false | false | 3,309 |
1163B2 | This problem is same as the previous one, but has larger constraints. Shiro's just moved to the new house. She wants to invite all friends of her to the house so they can play monopoly. However, her house is too small, so she can only invite one friend at a time. For each of the $$$n$$$ days since the day Shiro moved t... | 1,600 | false | false | true | false | true | false | false | false | false | false | 4,902 |
955D | Jenya has recently acquired quite a useful tool — _k_-scissors for cutting strings. They are generally used for cutting out two non-intersecting substrings of length _k_ from an arbitrary string _s_ (its length should be at least 2·_k_ in order to perform this operation) and concatenating them afterwards (preserving th... | 2,600 | false | false | false | false | false | false | true | false | false | false | 5,897 |
1687B | As for the technology in the outside world, it is really too advanced for Gensokyo to even look up to. —Yasaka Kanako, Symposium of Post-mysticism This is an interactive problem. Under the direct supervision of Kanako and the Moriya Shrine, the railway system of Gensokyo is finally finished. GSKR (Gensokyo Railways) co... | 1,700 | false | true | false | false | false | true | false | false | true | true | 2,156 |
56A | Problem - 56A - 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,000 | false | false | true | false | false | false | false | false | false | false | 9,695 |
41E | Problem - 41E - 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 | true | false | false | false | true | 9,780 |
1998A | I couldn't think of a good title for this problem, so I decided to learn from LeetCode. — Sun Tzu, The Art of War You are given three integers $$$x_c$$$, $$$y_c$$$, and $$$k$$$ ($$$-100 leq x_c, y_c leq 100$$$, $$$1 leq k leq 1000$$$). You need to find $$$k$$$ distinct points ($$$x_1, y_1$$$), ($$$x_2, y_2$$$), $$$ldot... | 800 | true | false | true | false | false | true | false | false | false | false | 277 |
1267J | BerPhone X is almost ready for release with $$$n$$$ applications being preinstalled on the phone. A category of an application characterizes a genre or a theme of this application (like "game", "business", or "education"). The categories are given as integers between $$$1$$$ and $$$n$$$, inclusive; the $$$i$$$-th appli... | 1,800 | true | true | true | false | false | false | false | false | false | false | 4,354 |
922F | Problem - 922F - 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,400 | false | true | false | true | false | true | false | false | false | false | 6,024 |
652D | Problem - 652D - Codeforces =============== xa0 ]( "Announcement") — the number of segments on a line. Each of the next _n_ lines contains two integers _l__i_ and _r__i_ (u2009-u2009109u2009≤u2009_l__i_u2009<u2009_r__i_u2009≤u2009109) — the coordinates of the left and the right ends of the _i_-th segment. ... | 1,800 | false | false | false | false | true | false | false | false | true | false | 7,207 |
237C | Problem - 237C - 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 | false | false | false | false | false | false | true | false | false | 8,887 |
229A | You are given a table consisting of _n_ rows and _m_ columns. Each cell of the table contains a number, 0 or 1. In one move we can choose some row of the table and cyclically shift its values either one cell to the left, or one cell to the right. To cyclically shift a table row one cell to the right means to move the v... | 1,500 | false | false | false | false | false | false | true | false | false | false | 8,923 |
1731A | Joey is low on money. His friend Chandler wants to lend Joey some money, but can't give him directly, as Joey is too proud of himself to accept it. So, in order to trick him, Chandler asks Joey to play a game. In this game, Chandler gives Joey an array $$$a_1, a_2, dots, a_n$$$ ($$$n geq 2$$$) of positive integers ($$$... | 800 | true | true | false | false | false | false | false | false | false | false | 1,905 |
1117E | This is an interactive problem. Remember to flush your output while communicating with the testing program. You may use fflush(stdout) in C++, system.out.flush() in Java, stdout.flush() in Python or flush(output) in Pascal to flush the output. If you use some other programming language, consult its documentation. You m... | 2,200 | true | false | false | false | false | true | false | false | false | false | 5,105 |
1619C | Tanya is learning how to add numbers, but so far she is not doing it correctly. She is adding two numbers $$$a$$$ and $$$b$$$ using the following algorithm: 1. If one of the numbers is shorter than the other, Tanya adds leading zeros so that the numbers are the same length. 2. The numbers are processed from right to le... | 1,200 | false | false | true | false | false | false | false | false | false | false | 2,533 |
630M | Vasya started working in a machine vision company of IT City. Vasya's team creates software and hardware for identification of people by their face. One of the project's know-how is a camera rotating around its optical axis on shooting. People see an eye-catching gadget — a rotating camera — come up to it to see it bet... | 1,800 | true | false | false | false | false | false | false | false | false | false | 7,292 |
868C | Snark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quarter-finals. They have a bank of _n_ problems, and they want to select any non-empty subset of it as a problemset. _k_ experienced teams are participating in the contest. Some of these teams already know some of the probl... | 1,500 | false | false | false | true | false | true | true | false | false | false | 6,271 |
1702F | Multisetxa0—is a set of numbers in which there can be equal elements, and the order of the numbers does not matter. Two multisets are equal when each value occurs the same number of times. For example, the multisets $$${2,2,4}$$$ and $$${2,4,2}$$$ are equal, but the multisets $$${1,2,2}$$$ and $$${1,1,2}$$$xa0— are not... | 1,700 | true | true | false | false | true | true | false | false | false | false | 2,065 |
1499A | You have a board represented as a grid with $$$2 imes n$$$ cells. The first $$$k_1$$$ cells on the first row and first $$$k_2$$$ cells on the second row are colored in white. All other cells are colored in black. You have $$$w$$$ white dominoes ($$$2 imes 1$$$ tiles, both cells are colored in white) and $$$b$$$ black... | 800 | true | false | false | false | false | true | false | false | false | false | 3,175 |
84C | Perhaps many have heard that the World Biathlon Championship has finished. Although our hero Valera was not present at this spectacular event himself and only watched it on TV, it excited him so much that he decided to enroll in a biathlon section. Of course, biathlon as any sport, proved very difficult in practice. It... | 1,700 | false | false | true | false | false | false | false | true | false | false | 9,547 |
1722F | An L-shape is a figure on gridded paper that looks like the first four pictures below. An L-shape contains exactly three shaded cells (denoted by *), which can be rotated in any way. You are given a rectangular grid. Determine if it contains L-shapes only, where L-shapes can't touch an edge or corner. More formally: E... | 1,700 | false | false | true | false | false | false | false | false | false | false | 1,948 |
1741B | A sequence of $$$n$$$ numbers is called permutation if it contains all numbers from $$$1$$$ to $$$n$$$ exactly once. For example, the sequences $$$[3, 1, 4, 2]$$$, [$$$1$$$] and $$$[2,1]$$$ are permutations, but $$$[1,2,1]$$$, $$$[0,1]$$$ and $$$[1,3,4]$$$ are not. For a given number $$$n$$$ you need to make a permutat... | 800 | true | false | false | false | false | true | false | false | false | false | 1,837 |
1512G | Problem - 1512G - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ... | 1,700 | true | false | false | true | false | false | true | false | false | false | 3,103 |
177C1 | To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Smart Beaver wants to invite only those of his friends who are connected by friends... | 1,500 | false | false | false | false | false | false | false | false | false | true | 9,150 |
1698C | You are given an array $$$a$$$ of length $$$n$$$. The array is called 3SUM-closed if for all distinct indices $$$i$$$, $$$j$$$, $$$k$$$, the sum $$$a_i + a_j + a_k$$$ is an element of the array. More formally, $$$a$$$ is 3SUM-closed if for all integers $$$1 leq i < j < k leq n$$$, there exists some integer $$$1 leq l l... | 1,300 | false | false | false | false | true | false | true | false | false | false | 2,092 |
677B | Vanya smashes potato in a vertical food processor. At each moment of time the height of the potato in the processor doesn't exceed _h_ and the processor smashes _k_ centimeters of potato each second. If there are less than _k_ centimeters remaining, than during this second processor smashes all the remaining potato. Va... | 1,400 | true | false | true | false | false | false | false | false | false | false | 7,120 |
525A | After a hard day Vitaly got very hungry and he wants to eat his favorite potato pie. But it's not that simple. Vitaly is in the first room of the house with _n_ room located in a line and numbered starting from one from left to right. You can go from the first room to the second room, from the second room to the third ... | 1,100 | false | true | false | false | false | false | false | false | false | false | 7,736 |
1534F1 | This is the easy version of the problem. The difference between the versions is the constraints on $$$a_i$$$. You can make hacks only if all versions of the problem are solved. Little Dormi has recently received a puzzle from his friend and needs your help to solve it. The puzzle consists of an upright board with $$$n$... | 2,500 | false | true | false | false | false | false | false | false | false | true | 2,978 |
1928E | You are given two integers $$$x$$$ and $$$y$$$. A sequence $$$a$$$ of length $$$n$$$ is called modular if $$$a_1=x$$$, and for all $$$1 < i le n$$$ the value of $$$a_{i}$$$ is either $$$a_{i-1} + y$$$ or $$$a_{i-1} bmod y$$$. Here $$$x bmod y$$$ denotes the remainder from dividing $$$x$$$ by $$$y$$$. Determine if there... | 2,300 | true | true | false | true | false | true | true | false | false | true | 719 |
1598D | Monocarp is the coach of the Berland State University programming teams. He decided to compose a problemset for a training session for his teams. Monocarp has $$$n$$$ problems that none of his students have seen yet. The $$$i$$$-th problem has a topic $$$a_i$$$ (an integer from $$$1$$$ to $$$n$$$) and a difficulty $$$b... | 1,700 | true | false | true | false | true | false | false | false | false | false | 2,668 |
1214A | Andrew was very excited to participate in Olympiad of Metropolises. Days flew by quickly, and Andrew is already at the airport, ready to go home. He has $$$n$$$ rubles left, and would like to exchange them to euro and dollar bills. Andrew can mix dollar bills and euro bills in whatever way he wants. The price of one do... | 1,400 | true | false | false | false | false | false | true | false | false | false | 4,611 |
59A | Problem - 59A - 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... | 800 | false | false | true | false | false | false | false | false | false | false | 9,680 |
743E | Vladik was bored on his way home and decided to play the following game. He took _n_ cards and put them in a row in front of himself. Every card has a positive integer number not exceeding 8 written on it. He decided to find the longest subsequence of cards which satisfies the following conditions: the number of occur... | 2,200 | false | false | false | true | false | false | true | true | false | false | 6,825 |
1706E | You are given a connected undirected graph with $$$n$$$ vertices and $$$m$$$ edges. Vertices of the graph are numbered by integers from $$$1$$$ to $$$n$$$ and edges of the graph are numbered by integers from $$$1$$$ to $$$m$$$. Your task is to answer $$$q$$$ queries, each consisting of two integers $$$l$$$ and $$$r$$$.... | 2,300 | false | true | false | false | true | false | false | true | false | false | 2,035 |
518F | On a certain meeting of a ruling party "A" minister Pavel suggested to improve the sewer system and to create a new pipe in the city. The city is an _n_u2009×u2009_m_ rectangular squared field. Each square of the field is either empty (then the pipe can go in it), or occupied (the pipe cannot go in such square). Empty ... | 2,300 | false | false | true | true | false | false | true | true | false | false | 7,763 |
2007A | Dora has a set $$$s$$$ containing integers. In the beginning, she will put all integers in $$$xa0— the number of test cases. The description of the test cases follows. The only line of each test case contains two integers $$$l$$$ and $$$r$$$ ($$$1 leq l leq r leq 1000$$$)xa0— the range of integers in the initial set. N... | 800 | true | true | false | false | false | false | false | false | false | false | 211 |
330B | A country has _n_ cities. Initially, there is no road in the country. One day, the king decides to construct some roads connecting pairs of cities. Roads can be traversed either way. He wants those roads to be constructed in such a way that it is possible to go from each city to any other city by traversing at most two... | 1,300 | false | false | false | false | false | true | false | false | false | true | 8,523 |
1510B | You are standing in front of the room with great treasures. The only thing stopping you is the door with a push-button combination lock. This lock has $$$d$$$ buttons with digits from $$$0$$$ to $$$d - 1$$$. Whenever you press a button, it stays pushed down. You can not pop back up just one button, but there is a "RESE... | 2,600 | false | false | false | false | false | false | false | false | false | true | 3,126 |
266D | BerDonalds, a well-known fast food restaurant, is going to open a cafe in Bertown. The important thing is to choose the new restaurant's location so that it would be easy to get there. The Bertown road system is represented by _n_ junctions, connected by _m_ bidirectional roads. For each road we know its length. We als... | 2,400 | true | false | false | false | false | false | false | false | false | true | 8,768 |
1628A | Mihai has just learned about the . Append the MEX of the first $$$k$$$ numbers of the array $$$a$$$ to the end of array $$$b$$$ and erase them from the array $$$a$$$, shifting the positions of the remaining numbers in $$$a$$$. But, since Mihai loves big arrays as much as the MEX concept, he wants the new array $$$b$$$... | 1,400 | true | true | true | false | false | true | false | true | false | false | 2,475 |
1196C | $$$n$$$ robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerous! Fortunately, even though your robots have escaped, you still have some control over them. First of all, you know the ... | 1,500 | false | false | true | false | false | false | false | false | false | false | 4,720 |
1227D2 | This is the harder version of the problem. In this version, $$$1 le n, m le 2cdot10^5$$$. You can hack this problem if you locked it. But you can hack the previous problem only if you locked both problems. You are given a sequence of integers $$$a=[a_1,a_2,dots,a_n]$$$ of length $$$n$$$. Its subsequence is obtained by ... | 1,800 | false | true | false | false | true | false | false | false | false | false | 4,540 |
2006B | Given a rooted tree with the root at vertex $$$1$$$. For any vertex $$$i$$$ ($$$1 < i leq n$$$) in the tree, there is an edge connecting vertices $$$i$$$ and $$$p_i$$$ ($$$1 leq p_i < i$$$), with a weight equal to $$$t_i$$$. Iris does not know the values of $$$t_i$$$, but she knows that $$$displaystylesum_{i=2}^n t_i =... | 1,800 | true | false | false | false | true | false | true | false | false | false | 216 |
1388D | Captain Fint is involved in another treasure hunt, but have found only one strange problem. The problem may be connected to the treasure's location or may not. That's why captain Flint decided to leave the solving the problem to his crew and offered an absurdly high reward: one day off. The problem itself sounds like t... | 2,000 | false | true | true | false | true | false | false | false | false | true | 3,730 |
1076G | Consider a following game between two players: There is an array $$$b_1$$$, $$$b_2$$$, ..., $$$b_k$$$, consisting of positive integers. Initially a chip is placed into the first cell of the array, and $$$b_1$$$ is decreased by $$$1$$$. Players move in turns. Each turn the current player has to do the following: if the ... | 3,000 | false | false | false | false | true | false | false | false | false | false | 5,338 |
922E | Apart from plush toys, Imp is a huge fan of little yellow birds! To summon birds, Imp needs strong magic. There are _n_ trees in a row on an alley in a park, there is a nest on each of the trees. In the _i_-th nest there are _c__i_ birds; to summon one bird from this nest Imp needs to stay under this tree and it costs ... | 2,200 | false | false | false | true | false | false | false | false | false | false | 6,025 |
859D | The annual college sports-ball tournament is approaching, which for trademark reasons we'll refer to as Third Month Insanity. There are a total of 2_N_ teams participating in the tournament, numbered from 1 to 2_N_. The tournament lasts _N_ rounds, with each round eliminating half the teams. The first round consists of... | 2,100 | false | false | false | true | false | false | false | false | false | false | 6,305 |
1746A | You have an array $$$a$$$ of size $$$n$$$ consisting only of zeroes and ones and an integer $$$k$$$. In one operation you can do one of the following: Select $$$2$$$ consecutive elements of $$$a$$$ and replace them with their minimum (that is, let $$$a := [a_{1}, a_{2}, ldots, a_{i-1}, min(a_{i}, a_{i+1}), a_{i+2}, ld... | 800 | false | true | false | false | false | true | false | false | false | false | 1,810 |
1017B | Rudolf is on his way to the castle. Before getting into the castle, the security staff asked him a question: Given two binary numbers $$$a$$$ and $$$b$$$ of length $$$n$$$. How many different ways of swapping two digits in $$$a$$$ (only in $$$a$$$, not $$$b$$$) so that bitwise OR of these two numbers will be changed? I... | 1,200 | true | false | true | false | false | false | false | false | false | false | 5,604 |
999F | There are $$$n$$$ players sitting at the card table. Each player has a favorite number. The favorite number of the $$$j$$$-th player is $$$f_j$$$. There are $$$k cdot n$$$ cards on the table. Each card contains a single integer: the $$$i$$$-th card contains number $$$c_i$$$. Also, you are given a sequence $$$h_1, h_2, ... | 2,000 | false | false | false | true | false | false | false | false | false | false | 5,706 |
681B | Kolya is developing an economy simulator game. His most favourite part of the development process is in-game testing. Once he was entertained by the testing so much, that he found out his game-coin score become equal to 0. Kolya remembers that at the beginning of the game his game-coin score was equal to _n_ and that h... | 1,300 | false | false | false | false | false | false | true | false | false | false | 7,102 |
32C | Problem - 32C - 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,700 | true | false | false | false | false | false | false | false | false | false | 9,836 |
847A | Doubly linked list is one of the fundamental data structures. A doubly linked list is a sequence of elements, each containing information about the previous and the next elements of the list. In this problem all lists have linear structure. I.e. each element except the first has exactly one previous element, each eleme... | 1,500 | false | false | true | false | false | false | false | false | false | false | 6,371 |
226C | Problem - 226C - 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,400 | true | false | true | false | true | false | false | false | false | false | 8,933 |
1898D | Kirill has two integer arrays $$$a_1,a_2,ldots,a_n$$$ and $$$b_1,b_2,ldots,b_n$$$ of length $$$n$$$. He defines the absolute beauty of the array $$$b$$$ as $$$$$$sum_{i=1}^{n} a_i - b_i.$$$$$$ Here, $$$x$$$ denotes the absolute value of $$$x$$$. Kirill can perform the following operation at most once: select two indic... | 1,900 | true | true | false | false | false | false | false | false | false | false | 925 |
1117D | Reziba has many magic gems. Each magic gem can be split into $$$M$$$ normal gems. The amount of space each magic (and normal) gem takes is $$$1$$$ unit. A normal gem cannot be split. Reziba wants to choose a set of magic gems and split some of them, so the total space occupied by the resulting set of gems is $$$N$$$ un... | 2,100 | true | false | false | true | false | false | false | false | false | false | 5,106 |
1921G | Once the mischievous and wayward shooter named Shel found himself on a rectangular field of size $$$n imes m$$$, divided into unit squares. Each cell either contains a target or not. Shel only had a lucky shotgun with him, with which he can shoot in one of the four directions: right-down, left-down, left-up, or right-... | 2,200 | false | false | true | true | true | false | true | false | false | false | 759 |
1352E | Pay attention to the non-standard memory limit in this problem. In order to cut off efficient solutions from inefficient ones in this problem, the time limit is rather strict. Prefer to use compiled statically typed languages (e.g. C++). If you use Python, then submit solutions on PyPy. Try to write an efficient soluti... | 1,500 | false | false | true | false | false | false | true | false | false | false | 3,948 |
1762D | Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Codeforces Round 838 (Div. 2) 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... | 2,100 | false | false | false | false | false | true | false | false | false | false | 1,737 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.