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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
755A | Problem - 755A - Codeforces =============== xa0 xa0— number from the PolandBall's hypothesis. Output Output such _m_ that _n_·_m_u2009+u20091 is not a prime number. Your answer will be considered correct if you output any suitable _m_ such that 1u2009≤u2009_m_u2009≤u2009103. It is guaranteed the the answe... | 800 | true | false | false | false | false | false | true | false | false | true | 6,777 |
1139D | Vivek initially has an empty array $$$a$$$ and some integer constant $$$m$$$. He performs the following algorithm: 1. Select a random integer $$$x$$$ uniformly in range from $$$1$$$ to $$$m$$$ and append it to the end of $$$a$$$. 2. Compute the greatest common divisor of integers in $$$a$$$. 3. In case it equals to $$$... | 2,300 | true | false | false | true | false | false | false | false | false | false | 5,031 |
1703G | There are $$$n$$$ chests. The $$$i$$$-th chest contains $$$a_i$$$ coins. You need to open all $$$n$$$ chests in order from chest $$$1$$$ to chest $$$n$$$. There are two types of keys you can use to open a chest: a good key, which costs $$$k$$$ coins to use; a bad key, which does not cost any coins, but will halve all... | 1,600 | true | true | false | true | false | false | true | false | false | false | 2,056 |
1276A | You are given a non-empty string $$$s=s_1s_2dots s_n$$$, which consists only of lowercase Latin letters. Polycarp does not like a string if it contains at least one string "one" or at least one string "two" (or both at the same time) as a substring. In other words, Polycarp does not like the string $$$s$$$ if there is ... | 1,400 | false | true | false | true | false | false | false | false | false | false | 4,315 |
1985H1 | Easy and hard versions are actually different problems, so read statements of both problems completely and carefully. The only difference between the two versions is the operation. Alex has a grid with $$$n$$$ rows and $$$m$$$ columns consisting of '.' and '#' characters. A set of '#' cells forms a connected component ... | 1,700 | false | false | true | false | true | false | true | false | false | true | 367 |
1778C | You have a string $$$a$$$ and a string $$$b$$$. Both of the strings have length $$$n$$$. There are at most $$$10$$$ different characters in the string $$$a$$$. You also have a set $$$Q$$$. Initially, the set $$$Q$$$ is empty. You can apply the following operation on the string $$$a$$$ any number of times: Choose an in... | 1,600 | false | false | false | false | false | false | true | false | false | false | 1,606 |
1195E | Seryozha conducts a course dedicated to building a map of heights of Stepanovo recreation center. He laid a rectangle grid of size $$$n imes m$$$ cells on a map (rows of grid are numbered from $$$1$$$ to $$$n$$$ from north to south, and columns are numbered from $$$1$$$ to $$$m$$$ from west to east). After that he mea... | 2,100 | false | false | false | false | true | false | false | false | false | false | 4,724 |
914F | Given a string _s_, process _q_ queries, each having one of the following forms: 1u2009_i_u2009_c_ — Change the _i_-th character in the string to _c_. 2u2009_l_u2009_r_u2009_y_ — Consider the substring of _s_ starting at position _l_ and ending at position _r_. Output the number of times _y_ occurs as a substring in ... | 3,000 | false | false | false | false | true | false | true | false | false | false | 6,078 |
535E | Tavas is a cheerleader in the new sports competition named "Pashmaks". This competition consists of two part: swimming and then running. People will immediately start running _R_ meters after they finished swimming exactly _S_ meters. A winner is a such person that nobody else finishes running before him/her (there may... | 2,600 | true | false | false | false | false | false | false | false | false | false | 7,691 |
1921D | Petya has an array $$$a_i$$$ of $$$n$$$ integers. His brother Vasya became envious and decided to make his own array of $$$n$$$ integers. To do this, he found $$$m$$$ integers $$$b_i$$$ ($$$mge n$$$), and now he wants to choose some $$$n$$$ integers of them and arrange them in a certain order to obtain an array $$$c_i$... | 1,100 | false | true | false | false | true | false | false | false | true | false | 762 |
311B | Zxr960115 is owner of a large farm. He feeds _m_ cute cats and employs _p_ feeders. There's a straight road across the farm and _n_ hills along the road, numbered from 1 to _n_ from left to right. The distance between hill _i_ and (_i_u2009-u20091) is _d__i_ meters. The feeders live in hill 1. One day, the cats went ou... | 2,400 | false | false | false | true | true | false | false | false | false | false | 8,601 |
1560B | Some number of people (this number is even) have stood in a circle. The people stand in the circle evenly. They are numbered clockwise starting from a person with the number $$$1$$$. Each person is looking through the circle's center at the opposite person. A sample of a circle of $$$6$$$ persons. The orange arrows in... | 800 | true | false | false | false | false | false | false | false | false | false | 2,829 |
1948C | There is a grid, consisting of $$$2$$$ rows and $$$n$$$ columns. The rows are numbered from $$$1$$$ to $$$2$$$ from top to bottom. The columns are numbered from $$$1$$$ to $$$n$$$ from left to right. Each cell of the grid contains an arrow pointing either to the left or to the right. No arrow points outside the grid. T... | 1,300 | false | false | false | true | false | true | true | false | false | true | 597 |
1630A | You are given a set of $$$n$$$ ($$$n$$$ is always a power of $$$2$$$) elements containing all integers $$$0, 1, 2, ldots, n-1$$$ exactly once. Find $$$frac{n}{2}$$$ pairs of elements such that: Each element in the set is in exactly one pair. The sum over all pairs of the — the number of test cases. Description of the... | 1,500 | false | false | false | false | false | true | false | false | false | false | 2,466 |
1253B | The Central Company has an office with a sophisticated security system. There are $$$10^6$$$ employees, numbered from $$$1$$$ to $$$10^6$$$. The security system logs entrances and departures. The entrance of the $$$i$$$-th employee is denoted by the integer $$$i$$$, while the departure of the $$$i$$$-th employee is den... | 1,400 | false | true | true | false | false | false | false | false | false | false | 4,421 |
19A | Everyone knows that 2010 FIFA World Cup is being held in South Africa now. By the decision of BFA (Berland's Football Association) next World Cup will be held in Berland. BFA took the decision to change some World Cup regulations: the final tournament features _n_ teams (_n_ is always even) the first _n_u2009/u20092 ... | 1,400 | false | false | true | false | false | false | false | false | false | false | 9,900 |
1394C | Boboniu defines BN-string as a string $$$s$$$ of characters 'B' and 'N'. You can perform the following operations on the BN-string $$$s$$$: Remove a character of $$$s$$$. Remove a substring "BN" or "NB" of $$$s$$$. Add a character 'B' or 'N' to the end of $$$s$$$. Add a string "BN" or "NB" to the end of $$$s$$$. No... | 2,600 | false | false | false | false | false | false | false | true | false | false | 3,699 |
736E | Ostap is preparing to play chess again and this time he is about to prepare. Thus, he was closely monitoring one recent chess tournament. There were _m_ players participating and each pair of players played exactly one game. The victory gives 2 points, drawxa0— 1 points, losexa0— 0 points. Ostap is lazy, so he never tr... | 2,900 | true | true | false | false | false | true | false | false | false | false | 6,846 |
1550D | Let's call an integer array $$$a_1, a_2, dots, a_n$$$ good if $$$a_i eq i$$$ for each $$$i$$$. Let $$$F(a)$$$ be the number of pairs $$$(i, j)$$$ ($$$1 le i < j le n$$$) such that $$$a_i + a_j = i + j$$$. Let's say that an array $$$a_1, a_2, dots, a_n$$$ is excellent if: $$$a$$$ is good; $$$l le a_i le r$$$ for each... | 2,300 | true | false | true | false | false | true | false | true | true | false | 2,895 |
1860D | You are given a binary string $$$s$$$ (a binary string is a string consisting of characters 0 and/or 1). Let's call a binary string balanced if the number of subsequences 01 (the number of indices $$$i$$$ and $$$j$$$ such that $$$1 le i < j le n$$$, $$$s_i=0$$$ and $$$s_j=1$$$) equals to the number of subsequences 10 (... | 2,200 | false | false | false | true | false | false | false | false | false | false | 1,122 |
1353A | You are given two integers $$$n$$$ and $$$m$$$. You have to construct the array $$$a$$$ of length $$$n$$$ consisting of non-negative integers (i.e. integers greater than or equal to zero) such that the sum of elements of this array is exactly $$$m$$$ and the value $$$sumlimits_{i=1}^{n-1} a_i - a_{i+1}$$$ is the maximu... | 800 | true | true | false | false | false | true | false | false | false | false | 3,945 |
1976D | A regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters '1' and '+' between the original characters of the sequence. For example: bracket sequences "()()" and "(())" are regular (the resulting expressions are: "(1)+(1)" and "((1+1)+1)"); br... | 2,000 | false | false | true | false | true | false | false | true | false | false | 430 |
1091F | Bob is a duck. He wants to get to Alice's nest, so that those two can duck! Duck is the ultimate animal! (Image courtesy of See Bang) The journey can be represented as a straight line, consisting of $$$n$$$ segments. Bob is located to the left of the first segment, while Alice's nest is on the right of the last segmen... | 2,600 | false | true | false | false | false | true | false | false | false | false | 5,254 |
149C | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers). The key in football is to divide into teams fairly before the g... | 1,500 | true | true | false | false | false | false | false | false | true | false | 9,279 |
1383A | Note that the only difference between String Transformation 1 and String Transformation 2 is in the move Koa does. In this version the letter $$$y$$$ Koa selects must be strictly greater alphabetically than $$$x$$$ (read statement for better understanding). You can make hacks in these problems independently. Koa the Ko... | 1,700 | false | true | false | false | false | false | false | false | true | true | 3,756 |
1397A | You are given $$$n$$$ strings $$$s_1, s_2, ldots, s_n$$$ consisting of lowercase Latin letters. In one operation you can remove a character from a string $$$s_i$$$ and insert it to an arbitrary position in a string $$$s_j$$$ ($$$j$$$ may be equal to $$$i$$$). You may perform this operation any number of times. Is it po... | 800 | false | true | false | false | false | false | false | false | false | false | 3,688 |
351E | Problem - 351E - 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,200 | false | true | false | false | false | false | false | false | false | false | 8,426 |
1787C | RSJ has a sequence $$$a$$$ of $$$n$$$ integers $$$a_1,a_2, ldots, a_n$$$ and an integer $$$s$$$. For each of $$$a_2,a_3, ldots, a_{n-1}$$$, he chose a pair of non-negative integers $$$x_i$$$ and $$$y_i$$$ such that $$$x_i+y_i=a_i$$$ and $$$(x_i-s) cdot (y_i-s) geq 0$$$. Now he is interested in the value $$$$$$F = a_1 c... | 1,600 | true | true | false | true | false | false | false | false | false | false | 1,561 |
261D | Problem - 261D - 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,600 | false | false | false | true | false | false | false | false | false | false | 8,787 |
1468D | Consider a long corridor which can be divided into $$$n$$$ square cells of size $$$1 imes 1$$$. These cells are numbered from $$$1$$$ to $$$n$$$ from left to right. There are two people in this corridor, a hooligan and a security guard. Initially, the hooligan is in the $$$a$$$-th cell, the guard is in the $$$b$$$-th ... | 1,700 | false | false | false | false | false | false | false | true | true | false | 3,349 |
358C | Dima has a birthday soon! It's a big day! Saryozha's present to Dima is that Seryozha won't be in the room and won't disturb Dima and Inna as they celebrate the birthday. Inna's present to Dima is a stack, a queue and a deck. Inna wants her present to show Dima how great a programmer he is. For that, she is going to gi... | 2,000 | false | true | true | false | false | true | false | false | false | false | 8,402 |
1641B | Output For each test case print answer in the following format. If you cannot turn the array into a concatenation of tandem repeats, print a single integer $$$-1$$$. Otherwise print the number of operations $$$q$$$ ($$$0 le q le 2 cdot n^2$$$) that you want to do. Then print the descriptions of operations. In each of t... | 2,000 | false | false | true | false | false | true | false | false | true | false | 2,408 |
1769C1 | Statement is not available on English language В этой версии задачи $$$n le 50$$$ и $$$a_i le 100$$$. Вика за время работы в компании VK уже сделала $$$n$$$ коммитов в системе контроля версий. $$$i$$$-й коммит был сделан в $$$a_i$$$-й день работы Вики в компании. В некоторые дни Вика могла сделать несколько коммитов, а... | 1,200 | false | true | false | true | false | false | true | false | false | false | 1,682 |
1795G | You are given a simple undirected graph, consisting of $$$n$$$ vertices and $$$m$$$ edges. The vertices are numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th vertex has a value $$$a_i$$$ written on it. You will be removing vertices from that graph. You are allowed to remove vertex $$$i$$$ only if its degree is equal to ... | 2,700 | false | false | false | false | false | false | false | false | false | true | 1,503 |
754A | One spring day on his way to university Lesha found an array _A_. Lesha likes to split arrays into several parts. This time Lesha decided to split the array _A_ into several, possibly one, new arrays so that the sum of elements in each of the new arrays is not zero. One more condition is that if we place the new arrays... | 1,200 | false | true | true | false | false | true | false | false | false | false | 6,782 |
1523A | William really likes the cellular automaton called "Game of Life" so he decided to make his own version. For simplicity, William decided to define his cellular automaton on an array containing $$$n$$$ cells, with each cell either being alive or dead. Evolution of the array in William's cellular automaton occurs iterati... | 800 | false | false | true | false | false | false | false | false | false | false | 3,050 |
1742G | You are given an array $$$a$$$ consisting of $$$n$$$ nonnegative integers. Let's define the prefix OR array $$$b$$$ as the array $$$b_i = a_1~mathsf{OR}~a_2~mathsf{OR}~dots~mathsf{OR}~a_i$$$, where $$$mathsf{OR}$$$ represents the — the number of test cases. The description of test cases follows. The first line of each ... | 1,500 | true | true | false | false | false | false | true | false | true | false | 1,825 |
899B | Everybody in Russia uses Gregorian calendar. In this calendar there are 31 days in January, 28 or 29 days in February (depending on whether the year is leap or not), 31 days in March, 30 days in April, 31 days in May, 30 in June, 31 in July, 31 in August, 30 in September, 31 in October, 30 in November, 31 in December. ... | 1,200 | false | false | true | false | false | false | false | false | false | false | 6,151 |
1006D | You are given two strings $$$a$$$ and $$$b$$$ consisting of lowercase English letters, both of length $$$n$$$. The characters of both strings have indices from $$$1$$$ to $$$n$$$, inclusive. You are allowed to do the following changes: Choose any index $$$i$$$ ($$$1 le i le n$$$) and swap characters $$$a_i$$$ and $$$b... | 1,700 | false | false | true | false | false | false | false | false | false | false | 5,652 |
1779A | Thalia is a Legendary Grandmaster in chess. She has $$$n$$$ trophies in a line numbered from $$$1$$$ to $$$n$$$ (from left to right) and a lamp standing next to each of them (the lamps are numbered as the trophies). A lamp can be directed either to the left or to the right, and it illuminates all trophies in that direc... | 800 | false | true | false | false | false | true | false | false | false | false | 1,602 |
1209A | You are given a sequence of integers $$$a_1, a_2, dots, a_n$$$. You need to paint elements in colors, so that: If we consider any color, all elements of this color must be divisible by the minimal element of this color. The number of used colors must be minimized. For example, it's fine to paint elements $$$[40, 10, ... | 800 | true | true | true | false | false | false | false | false | false | false | 4,646 |
195C | Vasya is developing his own programming language VPL (Vasya Programming Language). Right now he is busy making the system of exceptions. He thinks that the system of exceptions must function like that. The exceptions are processed by try-catch-blocks. There are two operators that work with the blocks: 1. The try operat... | 1,800 | false | false | true | false | false | false | false | false | false | false | 9,061 |
1810C | You have an integer array $$$a$$$ of length $$$n$$$. There are two kinds of operations you can make. Remove an integer from $$$a$$$. This operation costs $$$c$$$. Insert an arbitrary positive integer $$$x$$$ to any position of $$$a$$$ (to the front, to the back, or between any two consecutive elements). This operatio... | 1,300 | false | true | false | false | false | false | true | false | true | false | 1,411 |
1900C | Keksic keeps getting left on seen by Anji. Through a mutual friend, he's figured out that Anji really likes binary trees and decided to solve her problem in order to get her attention. Anji has given Keksic a binary tree with $$$n$$$ vertices. Vertex $$$1$$$ is the root and does not have a parent. All other vertices ha... | 1,300 | false | false | false | true | false | false | false | false | false | false | 913 |
1844B | You are given a positive integer $$$n$$$. In this problem, the $$$operatorname{MEX}$$$ of a collection of integers $$$c_1,c_2,dots,c_k$$$ is defined as the smallest positive integer $$$x$$$ which does not occur in the collection $$$c$$$. The primality of an array $$$a_1,dots,a_n$$$ is defined as the number of pairs $$$... | 1,000 | true | false | false | false | false | true | false | false | false | false | 1,222 |
166B | You've got another geometrical task. You are given two non-degenerate polygons _A_ and _B_ as vertex coordinates. Polygon _A_ is strictly convex. Polygon _B_ is an arbitrary polygon without any self-intersections and self-touches. The vertices of both polygons are given in the clockwise order. For each polygon no three... | 2,100 | false | false | false | false | false | false | false | false | true | false | 9,199 |
242B | Problem - 242B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 1,100 | false | false | true | false | false | false | false | false | true | false | 8,867 |
1970B1 | The only difference between this and the hard version is that all $$$a_{i}$$$ are even. After some recent attacks on Hogwarts Castle by the Death Eaters, the Order of the Phoenix has decided to station $$$n$$$ members in Hogsmead Village. The houses will be situated on a picturesque $$$n imes n$$$ square field. Each wi... | 1,900 | false | false | false | false | false | true | false | false | false | false | 483 |
1270F | Problem - 1270F - Codeforces =============== xa0 characters from the beginning and several (possibly, zero or all) characters from the end. Input The first line contains the string $$$s$$$ ($$$1 leq sle 200,000$$$) consisting only of zeros and ones. Output Output a single numberxa0— the number of awes... | 2,600 | true | false | false | false | false | false | false | false | false | false | 4,339 |
757G | Whoa! You did a great job helping Team Rocket who managed to capture all the Pokemons sent by Bash. Meowth, part of Team Rocket, having already mastered the human language, now wants to become a master in programming as well. He agrees to free the Pokemons if Bash can answer his questions. Initially, Meowth gives Bash ... | 3,400 | false | false | false | false | true | false | false | false | false | true | 6,758 |
1407A | Alexandra has an even-length array $$$a$$$, consisting of $$$0$$$s and $$$1$$$s. The elements of the array are enumerated from $$$1$$$ to $$$n$$$. She wants to remove at most $$$frac{n}{2}$$$ elements (where $$$n$$$ — length of array) in the way that alternating sum of the array will be equal $$$0$$$ (i.e. $$$a_1 - a_2... | 1,100 | true | false | false | false | false | true | false | false | false | false | 3,641 |
112A | Problem - 112A - 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 | 9,437 |
613B | Lesha plays the recently published new version of the legendary game hacknet. In this version character skill mechanism was introduced. Now, each player character has exactly _n_ skills. Each skill is represented by a non-negative integer _a__i_xa0— the current skill level. All skills have the same maximum level _A_. A... | 1,900 | false | true | false | true | false | false | true | true | true | false | 7,386 |
1370F2 | # The Hidden Pair (Hard Version) Input file: standard input Output file: standard output Time limit: 2 seconds Memory limit: 256 megabytes Note that the only difference between the easy and hard version is the constraint on the number of queries. You can make hacks only if all versions of the problem are solved. Th... | 2,700 | false | false | false | false | false | false | false | true | false | true | 3,815 |
1261F | You are given two sets of integers: $$$A$$$ and $$$B$$$. You need to output the sum of elements in the set $$$C = {x x = a oplus b, a in A, b in B}$$$ modulo $$$998244353$$$, where $$$oplus$$$ denotes the . The $$$i$$$-th of the next $$$n_A$$$ lines contains two integers $$$l_i$$$ and $$$r_i$$$ ($$$1 le l_i le r_i le ... | 3,100 | true | false | false | false | false | false | false | false | false | false | 4,388 |
1982C | On another boring day, Egor got bored and decided to do something. But since he has no friends, he came up with a game to play. Egor has a deck of $$$n$$$ cards, the $$$i$$$-th card from the top has a number $$$a_i$$$ written on it. Egor wants to play a certain number of rounds until the cards run out. In each round, h... | 1,200 | false | true | false | true | true | false | false | true | false | false | 394 |
627C | Johnny drives a truck and must deliver a package from his hometown to the district center. His hometown is located at point 0 on a number line, and the district center is located at the point _d_. Johnny's truck has a gas tank that holds exactly _n_ liters, and his tank is initially full. As he drives, the truck consum... | 2,200 | false | true | false | false | true | false | false | false | false | false | 7,319 |
1808C | In this problem, unlike problem A, you need to look for unluckiest number, not the luckiest one. Note that the constraints of this problem differ from such in problem A. Olympus City recently launched the production of personal starships. Now everyone on Mars can buy one and fly to other planets inexpensively. Each sta... | 1,900 | false | true | true | true | false | false | true | false | false | false | 1,425 |
1830E | On a permutation $$$p$$$ of length $$$n$$$, we define a bully swap as follows: Let $$$i$$$ be the index of the largest element $$$p_i$$$ such that $$$p_i eq i$$$. Let $$$j$$$ be the index of the smallest element $$$p_j$$$ such that $$$i < j$$$. Swap $$$p_i$$$ and $$$p_j$$$. We define $$$f(p)$$$ as the number of bul... | 3,500 | true | false | false | false | true | false | false | false | false | false | 1,302 |
1581A | CQXYM is counting permutations length of $$$2n$$$. A permutation is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation, but $$$[1,2,2]$$$ is not a permutation ($$$2$$$ appears twice in the array) and $$$[1,3,4]$$$ is also not a pe... | 800 | true | false | false | false | false | false | false | false | false | false | 2,727 |
1477C | Nezzar loves the game osu!. osu! is played on beatmaps, which can be seen as an array consisting of distinct points on a plane. A beatmap is called nice if for any three consecutive points $$$A,B,C$$$ listed in order, the angle between these three points, centered at $$$B$$$, is strictly less than $$$90$$$ degrees. Po... | 2,200 | true | true | false | false | false | true | false | false | true | false | 3,288 |
1806C | For some positive integer $$$m$$$, YunQian considers an array $$$q$$$ of $$$2m$$$ (possibly negative) integers good, if and only if for every possible subsequence of $$$q$$$ that has length $$$m$$$, the product of the $$$m$$$ elements in the subsequence is equal to the sum of the $$$m$$$ elements that are not in the su... | 1,600 | true | false | false | false | false | true | true | false | false | false | 1,440 |
494D | Ali is Hamed's little brother and tomorrow is his birthday. Hamed wants his brother to earn his gift so he gave him a hard programming problem and told him if he can successfully solve it, he'll get him a brand new laptop. Ali is not yet a very talented programmer like Hamed and although he usually doesn't cheat but th... | 2,700 | false | false | false | true | true | false | false | false | false | false | 7,855 |
1729D | A group of $$$n$$$ friends decide to go to a restaurant. Each of the friends plans to order meals for $$$x_i$$$ burles and has a total of $$$y_i$$$ burles ($$$1 le i le n$$$). The friends decide to split their visit to the restaurant into several days. Each day, some group of at least two friends goes to the restaurant... | 1,200 | false | true | false | false | false | false | false | false | true | false | 1,915 |
1335A | There are two sisters Alice and Betty. You have $$$n$$$ candies. You want to distribute these $$$n$$$ candies between two sisters in such a way that: Alice will get $$$a$$$ ($$$a > 0$$$) candies; Betty will get $$$b$$$ ($$$b > 0$$$) candies; each sister will get some integer number of candies; Alice will get a grea... | 800 | true | false | false | false | false | false | false | false | false | false | 4,030 |
1270D | This problem is interactive. We have hidden an array $$$a$$$ of $$$n$$$ pairwise different numbers (this means that no two numbers are equal). You can get some information about this array using a new device you just ordered on Amazon. This device can answer queries of the following form: in response to the positions o... | 1,900 | true | false | false | false | false | true | false | false | true | false | 4,341 |
1056G | Having problems with tram routes in the morning, Arkady decided to return home by metro. Fortunately for Arkady, there is only one metro line in the city. Unfortunately for Arkady, the line is circular. It means that the stations are enumerated from $$$1$$$ to $$$n$$$ and there is a tunnel between any pair of consecuti... | 2,900 | false | false | false | false | true | false | true | false | false | true | 5,426 |
1714B | Polycarp was presented with some sequence of integers $$$a$$$ of length $$$n$$$ ($$$1 le a_i le n$$$). A sequence can make Polycarp happy only if it consists of different numbers (i.e. distinct numbers). In order to make his sequence like this, Polycarp is going to make some (possibly zero) number of moves. In one move... | 800 | false | true | true | false | true | false | false | false | false | false | 1,999 |
954I | Problem - 954I - 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,200 | true | false | false | false | false | false | false | false | false | false | 5,901 |
402C | Let's call an undirected graph of _n_ vertices _p_-interesting, if the following conditions fulfill: the graph contains exactly 2_n_u2009+u2009_p_ edges; the graph doesn't contain self-loops and multiple edges; for any integer _k_ (1u2009≤u2009_k_u2009≤u2009_n_), any subgraph consisting of _k_ vertices contains at m... | 1,500 | false | false | false | false | false | true | true | false | false | true | 8,215 |
808G | Berland has a long and glorious history. To increase awareness about it among younger citizens, King of Berland decided to compose an anthem. Though there are lots and lots of victories in history of Berland, there is the one that stand out the most. King wants to mention it in the anthem as many times as possible. He ... | 2,300 | false | false | false | true | false | false | false | false | false | false | 6,529 |
73F | Vasya plays the Plane of Tanks. The tanks in this game keep trying to finish each other off. But your "Pedalny" is not like that... He just needs to drive in a straight line from point _A_ to point B on the plane. Unfortunately, on the same plane are _n_ enemy tanks. We shall regard all the tanks as points. At the init... | 2,900 | false | false | false | false | false | false | true | false | false | false | 9,597 |
471C | Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev decided to build a house of cards. For that they've already found a hefty deck of _n_ playing cards. Let's describe the house they want to make: 1. The house consists of some non-zero number of floors. 2. Each floor... | 1,700 | true | true | false | false | false | false | true | true | false | false | 7,950 |
559A | Problem - 559A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 1,600 | true | false | false | false | false | false | true | false | false | false | 7,598 |
1837D | A regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters "1" and "+" between the original characters of the sequence. For example: the bracket sequences "()()" and "(())" are regular (the resulting expressions are: "(1)+(1)" and "((1+1)+1)");... | 1,400 | false | true | false | false | false | true | false | false | false | false | 1,267 |
1468E | Monocarp wants to draw four line segments on a sheet of paper. He wants the $$$i$$$-th segment to have its length equal to $$$a_i$$$ ($$$1 le i le 4$$$). These segments can intersect with each other, and each segment should be either horizontal or vertical. Monocarp wants to draw the segments in such a way that they en... | 800 | false | true | false | false | false | false | false | false | false | false | 3,348 |
1887D | Let's call an array $$$b_1, b_2, ldots, b_m$$$ ($$$m ge 2$$$) good if it can be split into two parts such that all elements in the left part are strictly smaller than all elements in the right part. In other words, there must exist an index $$$1 le i < m$$$ such that every element from $$$b_1, ldots, b_i$$$ is strictly... | 2,700 | true | false | false | false | true | false | false | true | false | false | 969 |
274D | Lenny had an _n_u2009×u2009_m_ matrix of positive integers. He loved the matrix so much, because each row of the matrix was sorted in non-decreasing order. For the same reason he calls such matrices of integers lovely. One day when Lenny was at school his little brother was playing with Lenny's matrix in his room. He e... | 2,200 | false | true | false | false | false | false | false | false | true | true | 8,736 |
1209G2 | This is a harder version of the problem. In this version $$$q le 200,000$$$. A sequence of integers is called nice if its elements are arranged in blocks like in $$$[3, 3, 3, 4, 1, 1]$$$. Formally, if two elements are equal, everything in between must also be equal. Let's define difficulty of a sequence as a minimum po... | 3,200 | false | false | false | false | true | false | false | false | false | false | 4,638 |
1393A | One evening Rainbow Dash and Fluttershy have come up with a game. Since the ponies are friends, they have decided not to compete in the game but to pursue a common goal. The game starts on a square flat grid, which initially has the outline borders built up. Rainbow Dash and Fluttershy have flat square blocks with size... | 800 | true | true | false | false | false | false | false | false | false | false | 3,707 |
11C | You are given a 0-1 rectangular matrix. What is the number of squares in it? A square is a solid square frame (border) with linewidth equal to 1. A square should be at least 2u2009×u20092. We are only interested in two types of squares: 1. squares with each side parallel to a side of the matrix; 2. squares with each si... | 2,200 | false | false | true | false | false | false | false | false | false | false | 9,938 |
21A | Jabber ID on the national Berland service «Babber» has a form <username>@<hostname>[/resource], where <username> — is a sequence of Latin letters (lowercase or uppercase), digits or underscores characters «_», the length of <username> is between 1 and 16, inclusive. <hostname> — is a sequence of word separated by per... | 1,900 | false | false | true | false | false | false | false | false | false | false | 9,892 |
248D | For he knew every Who down in Whoville beneath, Was busy now, hanging a mistletoe wreath. "And they're hanging their stockings!" he snarled with a sneer, "Tomorrow is Christmas! It's practically here!" Dr. Suess, How The Grinch Stole Christmas Christmas celebrations are coming to Whoville. Cindy Lou Who and her parents... | 2,300 | false | true | true | false | false | false | false | true | false | false | 8,840 |
1562D2 | This is the hard version of the problem. The difference between the versions is that the hard version does require you to output the numbers of the rods to be removed. You can make hacks only if all versions of the problem are solved. Stitch likes experimenting with different machines with his friend Sparky. Today they... | 2,200 | true | false | false | false | true | false | false | false | false | false | 2,816 |
246A | Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of _n_ integers _a_1,u2009_a_2,u2009...,u2009_a__n_ in the non-decreasing order. The pseudocode of the program, written by Valera, is give... | 900 | false | true | false | false | false | true | false | false | true | false | 8,848 |
711B | ZS the Coder and Chris the Baboon arrived at the entrance of Udayland. There is a _n_u2009×u2009_n_ magic grid on the entrance which is filled with integers. Chris noticed that exactly one of the cells in the grid is empty, and to enter Udayland, they need to fill a positive integer into the empty cell. Chris tried fil... | 1,400 | false | false | true | false | false | true | false | false | false | false | 6,975 |
1120D | You are given a rooted tree with $$$n$$$ vertices, the root of the tree is the vertex $$$1$$$. Each vertex has some non-negative price. A leaf of the tree is a non-root vertex that has degree $$$1$$$. Arkady and Vasily play a strange game on the tree. The game consists of three stages. On the first stage Arkady buys so... | 2,500 | false | true | false | true | false | false | false | false | false | true | 5,083 |
1863B | You are given a permutation$$$^{dagger}$$$ $$$p_1, p_2, ldots, p_n$$$ of integers $$$1$$$ to $$$n$$$. You can change the current permutation by applying the following operation several (possibly, zero) times: choose some $$$x$$$ ($$$2 le x le n$$$); create a new permutation by: first, writing down all elements of $$... | 1,100 | true | true | false | false | false | false | false | false | true | false | 1,105 |
1387C | The Committee for Research on Binary Viruses discovered a method of replication for a large family of viruses whose genetic codes are sequences of zeros and ones. Each virus originates from a single gene; for simplicity genes are denoted by integers from $$$0$$$ to $$$G - 1$$$. At each moment in time a virus is a seque... | 2,900 | false | false | false | true | false | false | false | false | false | false | 3,734 |
779B | Polycarp is crazy about round numbers. He especially likes the numbers divisible by 10_k_. In the given number of _n_ Polycarp wants to remove the least number of digits to get a number that is divisible by 10_k_. For example, if _k_u2009=u20093, in the number 30020 it is enough to delete a single digit (2). In this ca... | 1,100 | false | true | false | false | false | false | true | false | false | false | 6,650 |
1000E | Your friend is developing a computer game. He has already decided how the game world should look like — it should consist of $$$n$$$ locations connected by $$$m$$$ two-way passages. The passages are designed in such a way that it should be possible to get from any location to any other location. Of course, some passage... | 2,100 | false | false | false | false | false | false | false | false | false | true | 5,701 |
166C | A median in an array with the length of _n_ is an element which occupies position number after we sort the elements in the non-decreasing order (the array elements are numbered starting with 1). A median of an array (2,u20096,u20091,u20092,u20093) is the number 2, and a median of array (0,u200996,u200917,u200923) — the... | 1,500 | true | true | false | false | false | false | false | false | true | false | 9,198 |
1738D | Given a permutation $$$a_1, a_2, dots, a_n$$$ of integers from $$$1$$$ to $$$n$$$, and a threshold $$$k$$$ with $$$0 leq k leq n$$$, you compute a sequence $$$b_1, b_2, dots, b_n$$$ as follows. For every $$$1 leq i leq n$$$ in increasing order, let $$$x = a_i$$$. If $$$x leq k$$$, set $$$b_{x}$$$ to the last element $... | 1,900 | false | false | false | false | true | true | false | false | false | true | 1,858 |
1468H | Let's denote the median of a sequence $$$s$$$ with odd length as the value in the middle of $$$s$$$ if we sort $$$s$$$ in non-decreasing order. For example, let $$$s = [1, 2, 5, 7, 2, 3, 12]$$$. After sorting, we get sequence $$$[1, 2, 2, underline{3}, 5, 7, 12]$$$, and the median is equal to $$$3$$$. You have a sequen... | 2,200 | true | true | false | false | false | true | false | false | false | false | 3,345 |
2002D2 | This is the hard version of the problem. In this version, you are given a generic tree and the constraints on $$$n$$$ and $$$q$$$ are higher. You can make hacks only if both versions of the problem are solved. You are given a rooted tree consisting of $$$n$$$ vertices. The vertices are numbered from $$$1$$$ to $$$n$$$,... | 2,300 | false | false | false | false | true | false | false | true | false | true | 245 |
176A | To get money for a new aeonic blaster, ranger Qwerty decided to engage in trade for a while. He wants to buy some number of items (or probably not to buy anything at all) on one of the planets, and then sell the bought items on another planet. Note that this operation is not repeated, that is, the buying and the sellin... | 1,200 | false | true | false | false | false | false | false | false | true | false | 9,159 |
346B | Problem - 346B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 2,000 | false | false | false | true | false | false | false | false | false | false | 8,448 |
1182B | You have a given picture with size $$$w imes h$$$. Determine if the given picture has a single "+" shape or not. A "+" shape is described below: A "+" shape has one center nonempty cell. There should be some (at least one) consecutive non-empty cells in each direction (left, right, up, down) from the center. In othe... | 1,300 | false | false | true | false | false | false | false | false | false | false | 4,807 |
69E | Problem - 69E - 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,800 | false | false | true | false | true | false | false | false | false | false | 9,622 |
425C | Sereja has two sequences _a_1,u2009_a_2,u2009...,u2009_a__n_ and _b_1,u2009_b_2,u2009...,u2009_b__m_, consisting of integers. One day Sereja got bored and he decided two play with them. The rules of the game was very simple. Sereja makes several moves, in one move he can perform one of the following actions: 1. Choose ... | 2,300 | false | false | false | true | true | false | false | false | false | false | 8,136 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.