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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7B | There is little time left before the release of the first national operating system BerlOS. Some of its components are not finished yet — the memory manager is among them. According to the developers' plan, in the first release the memory manager will be very simple and rectilinear. It will support three operations: a... | 1,600 | false | false | true | false | false | false | false | false | false | false | 9,959 |
1977E | Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Codeforces Round 948 (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,600 | false | false | false | false | false | true | false | false | false | true | 423 |
81C | After the educational reform Polycarp studies only two subjects at school, Safety Studies and PE (Physical Education). During the long months of the fourth term, he received _n_ marks in them. When teachers wrote a mark in the journal, they didn't write in what subject the mark was for, they just wrote the mark. Now it... | 1,700 | true | true | false | false | false | false | false | false | true | false | 9,561 |
1399E1 | Easy and hard versions are actually different problems, so we advise you to read both statements carefully. You are given a weighted rooted tree, vertex $$$1$$$ is the root of this tree. A tree is a connected graph without cycles. A rooted tree has a special vertex called the root. A parent of a vertex $$$v$$$ is the l... | 2,000 | false | true | false | false | true | false | false | false | false | false | 3,675 |
766C | Mahmoud wrote a message _s_ of length _n_. He wants to send it as a birthday present to his friend Moaz who likes strings. He wrote it on a magical paper but he was surprised because some characters disappeared while writing the string. That's because this magical paper doesn't allow character number _i_ in the English... | 1,700 | false | true | false | true | false | false | true | false | false | false | 6,721 |
1238A | You are given two integers $$$x$$$ and $$$y$$$ (it is guaranteed that $$$x > y$$$). You may choose any prime integer $$$p$$$ and subtract it any number of times from $$$x$$$. Is it possible to make $$$x$$$ equal to $$$y$$$? Recall that a prime number is a positive integer that has exactly two positive divisors: $$$1$$$... | 900 | true | false | false | false | false | false | false | false | false | false | 4,503 |
1373E | Problem - 1373E - 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 | false | true | false | true | false | true | true | false | false | false | 3,797 |
1438C | Artem is building a new robot. He has a matrix $$$a$$$ consisting of $$$n$$$ rows and $$$m$$$ columns. The cell located on the $$$i$$$-th row from the top and the $$$j$$$-th column from the left has a value $$$a_{i,j}$$$ written in it. If two adjacent cells contain the same value, the robot will break. A matrix is call... | 2,000 | false | false | false | false | false | true | false | false | false | false | 3,476 |
1073G | Let $$$ ext{LCP}(s, t)$$$ be the length of the longest common prefix of strings $$$s$$$ and $$$t$$$. Also let $$$s[x dots y]$$$ be the substring of $$$s$$$ from index $$$x$$$ to index $$$y$$$ (inclusive). For example, if $$$s = $$$ "abcde", then $$$s[1 dots 3] =$$$ "abc", $$$s[2 dots 5] =$$$ "bcde". You are given a str... | 2,600 | false | false | false | false | true | false | false | false | false | false | 5,347 |
1863A | Petya is an administrator of a channel in one of the messengers. A total of $$$n$$$ people are subscribed to his channel, and Petya is not considered a subscriber. Petya has published a new post on the channel. At the moment of the publication, there were $$$a$$$ subscribers online. We assume that every subscriber alwa... | 800 | false | true | true | false | false | false | false | false | false | false | 1,106 |
682B | Someone gave Alyona an array containing _n_ positive integers _a_1,u2009_a_2,u2009...,u2009_a__n_. In one operation, Alyona can choose any element of the array and decrease it, i.e. replace with any positive integer that is smaller than the current one. Alyona can repeat this operation as many times as she wants. In pa... | 1,200 | false | false | false | false | false | false | false | false | true | false | 7,097 |
255D | Problem - 255D - 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 | true | false | false | false | false | true | false | false | 8,811 |
39E | Problem - 39E - 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... | 2,000 | false | false | false | true | false | false | false | false | false | false | 9,796 |
1898C | Elena has a grid formed by $$$n$$$ horizontal lines and $$$m$$$ vertical lines. The horizontal lines are numbered by integers from $$$1$$$ to $$$n$$$ from top to bottom. The vertical lines are numbered by integers from $$$1$$$ to $$$m$$$ from left to right. For each $$$x$$$ and $$$y$$$ ($$$1 leq x leq n$$$, $$$1 leq y ... | 1,700 | false | false | false | false | false | true | false | false | false | false | 926 |
1299A | Anu has created her own function $$$f$$$: $$$f(x, y) = (x y) - y$$$ where $$$$$$ denotes the = (116) - 6 = 15 - 6 = 9$$$. It can be proved that for any nonnegative numbers $$$x$$$ and $$$y$$$ value of $$$f(x, y)$$$ is also nonnegative. She would like to research more about this function and has created multiple proble... | 1,500 | true | true | false | false | false | false | true | false | false | false | 4,201 |
2030G1 | This is the easy version of the problem. In this version, $$$n leq 5000$$$. You can only make hacks if both versions of the problem are solved. Orangutans are powerful beings—so powerful that they only need $$$1$$$ unit of time to destroy every vulnerable planet in the universe! There are $$$n$$$ planets in the univers... | 2,900 | true | true | false | false | false | false | false | false | false | false | 82 |
1648B | You are given an array $$$a$$$ of $$$n$$$ positive integers numbered from $$$1$$$ to $$$n$$$. Let's call an array integral if for any two, not necessarily different, numbers $$$x$$$ and $$$y$$$ from this array, $$$x ge y$$$, the number $$$left lfloor frac{x}{y} ight floor$$$ ($$$x$$$ divided by $$$y$$$ with rounding ... | 1,800 | true | false | false | false | true | true | true | false | false | false | 2,382 |
449C | Problem - 449C - 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,500 | false | false | false | false | false | true | false | false | false | false | 8,042 |
12C | The spring is coming and it means that a lot of fruits appear on the counters. One sunny day little boy Valera decided to go shopping. He made a list of _m_ fruits he wanted to buy. If Valera want to buy more than one fruit of some kind, he includes it into the list several times. When he came to the fruit stall of Ash... | 1,100 | false | true | true | false | false | false | false | false | true | false | 9,933 |
84A | The hero of our story, Valera, and his best friend Arcady are still in school, and therefore they spend all the free time playing turn-based strategy "GAGA: Go And Go Again". The gameplay is as follows. There are two armies on the playing field each of which consists of _n_ men (_n_ is always even). The current player ... | 900 | true | false | false | false | false | false | false | false | false | false | 9,548 |
350C | You've got a robot, its task is destroying bombs on a square plane. Specifically, the square plane contains _n_ bombs, the _i_-th bomb is at point with coordinates (_x__i_,u2009_y__i_). We know that no two bombs are at the same point and that no bomb is at point with coordinates (0,u20090). Initially, the robot is at p... | 1,600 | false | true | true | false | false | false | false | false | true | false | 8,433 |
596C | Wilbur is playing with a set of _n_ points on the coordinate plane. All points have non-negative integer coordinates. Moreover, if some point (_x_, _y_) belongs to the set, then all points (_x_', _y_'), such that 0u2009≤u2009_x_'u2009≤u2009_x_ and 0u2009≤u2009_y_'u2009≤u2009_y_ also belong to this set. Now Wilbur wants... | 1,700 | false | true | false | false | false | false | false | false | true | false | 7,463 |
1909B | You are given an array $$$a_1, a_2, dots, a_n$$$ of distinct positive integers. You have to do the following operation exactly once: choose a positive integer $$$k$$$; for each $$$i$$$ from $$$1$$$ to $$$n$$$, replace $$$a_i$$$ with $$$a_i ext{ mod } k^dagger$$$. Find a value of $$$k$$$ such that $$$1 leq k leq 10^{... | 1,200 | true | false | false | false | false | true | false | false | false | false | 856 |
1637H | You are given a permutation $$$p$$$ of length $$$n$$$. You can choose any subsequence, remove it from the permutation, and insert it at the beginning of the permutation keeping the same order. For every $$$k$$$ from $$$0$$$ to $$$n$$$, find the minimal possible number of inversions in the permutation after you choose a... | 3,500 | true | true | false | false | true | false | false | false | true | false | 2,427 |
1260C | You are a rebel leader and you are planning to start a revolution in your country. But the evil Government found out about your plans and set your punishment in the form of correctional labor. You must paint a fence which consists of $$$10^{100}$$$ planks in two colors in the following way (suppose planks are numbered ... | 1,700 | true | true | false | false | false | false | false | false | false | false | 4,392 |
1305D | This is an interactive problem. After getting AC after 13 Time Limit Exceeded verdicts on a geometry problem, Kuroni went to an Italian restaurant to celebrate this holy achievement. Unfortunately, the excess sauce disoriented him, and he's now lost! The United States of America can be modeled as a tree (why though) wi... | 1,900 | false | false | false | false | false | true | false | false | false | false | 4,161 |
696D | Barney was hanging out with Nora for a while and now he thinks he may have feelings for her. Barney wants to send her a cheesy text message and wants to make her as happy as possible. Initially, happiness level of Nora is 0. Nora loves some pickup lines like "I'm falling for you" and stuff. Totally, she knows _n_ picku... | 2,500 | false | false | false | true | true | false | false | false | false | false | 7,038 |
12D | Problem - 12D - 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... | 2,400 | false | false | false | false | true | false | false | false | true | false | 9,932 |
114A | Problem - 114A - 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 | true | false | false | false | false | false | false | false | false | false | 9,430 |
1365D | Vivek has encountered a problem. He has a maze that can be represented as an $$$n imes m$$$ grid. Each of the grid cells may represent the following: Emptyxa0— '.' Wallxa0— '#' Good person xa0— 'G' Bad personxa0— 'B' The only escape from the maze is at cell $$$(n, m)$$$. A person can move to a cell only if it shar... | 1,700 | false | true | true | false | false | true | false | false | false | true | 3,854 |
294E | The great Shaass is the new king of the Drakht empire. The empire has _n_ cities which are connected by _n_u2009-u20091 bidirectional roads. Each road has an specific length and connects a pair of cities. There's a unique simple path connecting each pair of cities. His majesty the great Shaass has decided to tear down ... | 2,300 | false | false | false | true | false | false | false | false | false | false | 8,652 |
747D | The winter in Berland lasts _n_ days. For each day we know the forecast for the average air temperature that day. Vasya has a new set of winter tires which allows him to drive safely no more than _k_ days at any average air temperature. After _k_ days of using it (regardless of the temperature of these days) the set of... | 1,800 | false | true | false | true | false | false | false | false | true | false | 6,807 |
1975C | Mocha likes arrays, so before her departure, Chamo gave her an array $$$a$$$ consisting of $$$n$$$ positive integers as a gift. Mocha doesn't like arrays containing different numbers, so Mocha decides to use magic to change the array. Mocha can perform the following three-step operation some (possibly, zero) times: 1. ... | 1,200 | false | true | false | false | false | false | true | true | false | false | 440 |
1980C | Sofia had an array of $$$n$$$ integers $$$a_1, a_2, ldots, a_n$$$. One day she got bored with it, so she decided to sequentially apply $$$m$$$ modification operations to it. Each modification operation is described by a pair of numbers $$$langle c_j, d_j angle$$$ and means that the element of the array with index $$$c... | 1,300 | false | true | false | false | false | true | false | false | false | false | 408 |
433E | Tachibana Kanade likes Mapo Tofu very much. One day, the canteen cooked all kinds of tofu to sell, but not all tofu is Mapo Tofu, only those spicy enough can be called Mapo Tofu. Each piece of tofu in the canteen is given a _m_-based number, all numbers are in the range [_l_,u2009_r_] (_l_ and _r_ being _m_-based numbe... | 2,500 | false | false | false | true | false | false | false | false | false | false | 8,105 |
2039E | Problem - 2039E - 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 | true | true | false | false | false | false | false | false | 19 |
432A | Problem - 432A - 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 | true | true | false | false | false | false | false | true | false | 8,114 |
1234D | You are given a string $$$s$$$ consisting of lowercase Latin letters and $$$q$$$ queries for this string. Recall that the substring $$$s[l; r]$$$ of the string $$$s$$$ is the string $$$s_l s_{l + 1} dots s_r$$$. For example, the substrings of "codeforces" are "code", "force", "f", "for", but not "coder" and "top". Ther... | 1,600 | false | false | false | false | true | false | false | false | false | false | 4,521 |
1558E | In a certain video game, the player controls a hero characterized by a single integer value: power. On the current level, the hero got into a system of $$$n$$$ caves numbered from $$$1$$$ to $$$n$$$, and $$$m$$$ tunnels between them. Each tunnel connects two distinct caves. Any two caves are connected with at most one ... | 3,000 | false | true | false | false | false | false | false | true | false | true | 2,838 |
1610G | Right before the UEFA Euro 2020, AmShZ and Safar placed bets on who'd be the champion, AmShZ betting on Italy, and Safar betting on France. Of course, AmShZ won. Hence, Safar gave him a bracket sequence $$$S$$$. Note that a bracket sequence is a string made of '(' and ')' characters. AmShZ can perform the following ope... | 3,300 | false | true | false | false | true | false | false | false | false | false | 2,594 |
518D | Ilya got tired of sports programming, left university and got a job in the subway. He was given the task to determine the escalator load factor. Let's assume that _n_ people stand in the queue for the escalator. At each second one of the two following possibilities takes place: either the first person in the queue ente... | 1,700 | true | false | false | true | false | false | false | false | false | false | 7,765 |
624B | Problem - 624B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 1,100 | false | true | false | false | false | false | false | false | true | false | 7,334 |
1392D | Omkar is playing his favorite pixelated video game, Bed Wars! In Bed Wars, there are $$$n$$$ players arranged in a circle, so that for all $$$j$$$ such that $$$2 leq j leq n$$$, player $$$j - 1$$$ is to the left of the player $$$j$$$, and player $$$j$$$ is to the right of player $$$j - 1$$$. Additionally, player $$$n$$... | 1,700 | false | true | false | true | false | false | false | false | false | false | 3,713 |
799G | Arkady reached the _n_-th level in Township game, so Masha decided to bake a pie for him! Of course, the pie has a shape of convex _n_-gon, i.e. a polygon with _n_ vertices. Arkady decided to cut the pie in two equal in area parts by cutting it by a straight line, so that he can eat one of them and give the other to Ma... | 3,500 | false | false | false | false | true | false | false | true | false | false | 6,570 |
1788D | We play a game with $$$n$$$ dots on a number line. The initial coordinate of the $$$i$$$-th dot is $$$x_i$$$. These coordinates are distinct. Every dot starts moving simultaneously with the same constant speed. Each dot moves in the direction of the closest dot (different from itself) until it meets another dot. In the... | 2,000 | true | false | false | false | false | false | true | true | false | false | 1,551 |
105D | The maps in the game are divided into square cells called Geo Panels. Some of these panels are painted. We shall assume that the Geo Panels without color are painted the transparent color. Besides, the map has so-called Geo Symbols. They look like pyramids of different colors (including Geo Symbols of the transparent c... | 2,700 | false | false | true | false | false | false | true | false | false | false | 9,463 |
479C | Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly _n_ exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order. According to the schedule, a stu... | 1,400 | false | true | false | false | false | false | false | false | true | false | 7,914 |
625E | Ostap Bender recently visited frog farm and was inspired to create his own frog game. Number of frogs are places on a cyclic gameboard, divided into _m_ cells. Cells are numbered from 1 to _m_, but the board is cyclic, so cell number 1 goes right after the cell number _m_ in the direction of movement. _i_-th frog durin... | 2,800 | false | true | false | false | true | false | false | false | false | false | 7,329 |
70A | Fangy collects cookies. Once he decided to take a box and put cookies into it in some way. If we take a square _k_u2009×u2009_k_ in size, divided into blocks 1u2009×u20091 in size and paint there the main diagonal together with cells, which lie above it, then the painted area will be equal to the area occupied by one c... | 1,300 | true | false | false | false | false | false | false | false | false | false | 9,621 |
1324C | There is a frog staying to the left of the string $$$s = s_1 s_2 ldots s_n$$$ consisting of $$$n$$$ characters (to be more precise, the frog initially stays at the cell $$$0$$$). Each character of $$$s$$$ is either 'L' or 'R'. It means that if the frog is staying at the $$$i$$$-th cell and the $$$i$$$-th character is '... | 1,100 | false | true | true | false | true | false | false | true | false | false | 4,097 |
147A | Problem - 147A - Codeforces =============== xa0 . A word is defined as a sequence of consecutive Latin letters. Your task is to add spaces to the text by the following rules: if there is no punctuation mark between two words, then they should be separated by exactly one space there should be no spaces befor... | 1,300 | false | false | true | false | false | false | false | false | false | false | 9,288 |
889E | Problem - 889E - 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... | 3,000 | true | false | false | true | false | false | false | true | false | false | 6,189 |
349B | Problem - 349B - 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,700 | false | true | true | true | true | false | false | false | false | false | 8,436 |
852A | John gave Jack a very hard problem. He wrote a very big positive integer _A_0 on a piece of paper. The number is less than 10200000 . In each step, Jack is allowed to put 'u2009+u2009' signs in between some of the digits (maybe none) of the current number and calculate the sum of the expression. He can perform the same... | 2,500 | true | false | true | false | false | false | true | false | false | false | 6,343 |
48G | In a far away galaxy there are _n_ inhabited planets numbered with numbers from 1 to _n_. One day the presidents of all the _n_ planets independently from each other came up with an idea of creating the Galaxy Union. Now they need to share this wonderful idea with their galaxymates, that’s why each president is busy wo... | 2,700 | false | false | false | true | false | false | false | false | false | false | 9,731 |
1119C | Ramesses came to university to algorithms practice, and his professor, who is a fairly known programmer, gave him the following task. You are given two matrices $$$A$$$ and $$$B$$$ of size $$$n imes m$$$, each of which consists of $$$0$$$ and $$$1$$$ only. You can apply the following operation to the matrix $$$A$$$ ar... | 1,500 | true | true | true | false | false | true | false | false | false | false | 5,092 |
342B | Xenia the vigorous detective faced _n_ (_n_u2009≥u20092) foreign spies lined up in a row. We'll consider the spies numbered from 1 to _n_ from left to right. Spy _s_ has an important note. He has to pass the note to spy _f_. Xenia interrogates the spies in several steps. During one step the spy keeping the important no... | 1,500 | false | true | true | false | false | false | true | false | false | false | 8,467 |
839D | Winter is here at the North and the White Walkers are close. John Snow has an army consisting of _n_ soldiers. While the rest of the world is fighting for the Iron Throne, he is going to get ready for the attack of the White Walkers. He has created a method to know how strong his army is. Let the _i_-th soldier’s stren... | 2,200 | true | false | false | true | false | false | false | false | false | false | 6,405 |
1623C | There are $$$n$$$ heaps of stone. The $$$i$$$-th heap has $$$h_i$$$ stones. You want to change the number of stones in the heap by performing the following process once: You go through the heaps from the $$$3$$$-rd heap to the $$$n$$$-th heap, in this order. Let $$$i$$$ be the number of the current heap. You can cho... | 1,600 | false | true | false | false | false | false | false | true | false | false | 2,503 |
802G | Problem - 802G - 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 | 6,561 |
1103B | This is an interactive problem. Vasya and Petya are going to play the following game: Petya has some positive integer number $$$a$$$. After that Vasya should guess this number using the following questions. He can say a pair of non-negative integer numbers $$$(x, y)$$$. Petya will answer him: "x", if $$$(x bmod a) geq... | 2,000 | false | false | false | false | false | true | false | true | false | false | 5,186 |
1611A | Polycarp has an integer $$$n$$$ that doesn't contain the digit 0. He can do the following operation with his number several (possibly zero) times: Reverse the prefix of length $$$l$$$ (in other words, $$$l$$$ leftmost digits) of $$$n$$$. So, the leftmost digit is swapped with the $$$l$$$-th digit from the left, the se... | 800 | true | false | false | false | false | true | false | false | false | false | 2,591 |
623A | One day student Vasya was sitting on a lecture and mentioned a string _s_1_s_2... _s__n_, consisting of letters "a", "b" and "c" that was written on his desk. As the lecture was boring, Vasya decided to complete the picture by composing a graph _G_ with the following properties: _G_ has exactly _n_ vertices, numbered ... | 1,800 | false | false | false | false | false | true | false | false | false | true | 7,340 |
1153B | Luckily, Serval got onto the right bus, and he came to the kindergarten on time. After coming to kindergarten, he found the toy bricks very funny. He has a special interest to create difficult problems for others to solve. This time, with many $$$1 imes 1 imes 1$$$ toy bricks, he builds up a 3-dimensional object. We ... | 1,200 | false | true | false | false | false | true | false | false | false | false | 4,948 |
337C | Manao is taking part in a quiz. The quiz consists of _n_ consecutive questions. A correct answer gives one point to the player. The game also has a counter of consecutive correct answers. When the player answers a question correctly, the number on this counter increases by 1. If the player answers a question incorrectl... | 1,600 | true | true | false | false | false | false | false | true | false | false | 8,485 |
1970A3 | Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Helvetic Coding Contest 2024 online mirror (teams allowed, unrated) 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 o... | 2,400 | false | false | false | false | false | true | false | false | false | false | 484 |
2014E | In the humble act of meeting, joy doth unfold like a flower in bloom. Absence makes the heart grow fonder. Marian sold her last ware at the Market at the same time Robin finished training at the Major Oak. They couldn't wait to meet, so they both start without delay. The travel network is represented as $$$n$$$ vertice... | 1,800 | false | false | false | false | false | false | false | false | false | true | 167 |
161A | The Two-dimensional kingdom is going through hard times... This morning the Three-Dimensional kingdom declared war on the Two-dimensional one. This (possibly armed) conflict will determine the ultimate owner of the straight line. The Two-dimensional kingdom has a regular army of _n_ people. Each soldier registered hims... | 1,300 | false | true | false | false | false | false | true | true | false | false | 9,230 |
118B | Problem - 118B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 1,000 | false | false | true | false | false | true | false | false | false | false | 9,415 |
540D | Problem - 540D - 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,900 | false | false | false | true | false | false | false | false | false | false | 7,677 |
44I | Little Masha loves arranging her toys into piles on the floor. And she also hates it when somebody touches her toys. One day Masha arranged all her _n_ toys into several piles and then her elder brother Sasha came and gathered all the piles into one. Having seen it, Masha got very upset and started crying. Sasha still ... | 2,300 | false | false | false | false | false | false | true | false | false | false | 9,761 |
2001A | You are given a cyclic array $$$a_1, a_2, ldots, a_n$$$. You can perform the following operation on $$$a$$$ at most $$$n - 1$$$ times: Let $$$m$$$ be the current size of $$$a$$$, you can choose any two adjacent elements where the previous one is no greater than the latter one (In particular, $$$a_m$$$ and $$$a_1$$$ ar... | 800 | false | true | true | false | false | false | false | false | false | false | 255 |
1694A | Define the score of some binary string $$$T$$$ as the absolute difference between the number of zeroes and ones in it. (for example, $$$T=$$$ 010001 contains $$$4$$$ zeroes and $$$2$$$ ones, so the score of $$$T$$$ is $$$4-2 = 2$$$). Define the creepiness of some binary string $$$S$$$ as the maximum score among all of ... | 800 | false | true | true | false | false | false | false | false | false | false | 2,116 |
727E | Several years ago Tolya had _n_ computer games and at some point of time he decided to burn them to CD. After that he wrote down the names of the games one after another in a circle on the CD in clockwise order. The names were distinct, the length of each name was equal to _k_. The names didn't overlap. Thus, there is ... | 2,300 | false | false | false | false | true | false | false | false | false | false | 6,896 |
1477F | Nezzar buys his favorite snackxa0— $$$n$$$ chocolate bars with lengths $$$l_1,l_2,ldots,l_n$$$. However, chocolate bars might be too long to store them properly! In order to solve this problem, Nezzar designs an interesting process to divide them into small pieces. Firstly, Nezzar puts all his chocolate bars into a bla... | 3,500 | true | false | false | false | false | false | false | false | false | false | 3,285 |
762A | Problem - 762A - Codeforces =============== xa0 ]( "Announcement") . Output If _n_ has less than _k_ divisors, output -1. Otherwise, output the _k_-th smallest divisor of _n_. Examples Input 4 2 Output 2 Input 5 3 Output -1 Input 12 5 Output 6 Note In the first example, number 4 has three divisors: 1... | 1,400 | true | false | false | false | false | false | false | false | false | false | 6,743 |
1887B | Berland is a country with ancient history, where roads were built and destroyed for centuries. It is known that there always were $$$n$$$ cities in Berland. You also have records of $$$t$$$ key moments in the history of the country, numbered from $$$1$$$ to $$$t$$$. Each record contains a list of bidirectional roads be... | 1,900 | false | false | false | false | false | false | false | true | false | true | 971 |
920E | You are given an undirected graph consisting of _n_ vertices and edges. Instead of giving you the edges that exist in the graph, we give you _m_ unordered pairs (_x_,u2009_y_) such that there is no edge between _x_ and _y_, and if some pair of vertices is not listed in the input, then there is an edge between these ver... | 2,100 | false | false | false | false | true | false | false | false | false | true | 6,046 |
371E | Berland is going through tough times — the dirt price has dropped and that is a blow to the country's economy. Everybody knows that Berland is the top world dirt exporter! The President of Berland was forced to leave only _k_ of the currently existing _n_ subway stations. The subway stations are located on a straight l... | 2,000 | true | true | false | false | false | false | false | false | false | false | 8,344 |
327E | Iahub wants to meet his girlfriend Iahubina. They both live in _Ox_ axis (the horizontal axis). Iahub lives at point 0 and Iahubina at point _d_. Iahub has _n_ positive integers _a_1, _a_2, ..., _a__n_. The sum of those numbers is _d_. Suppose _p_1, _p_2, ..., _p__n_ is a permutation of {1,u20092,u2009...,u2009_n_}. Th... | 2,300 | false | false | false | true | false | true | false | false | false | false | 8,532 |
1096D | Vasya is preparing a contest, and now he has written a statement for an easy problem. The statement is a string of length $$$n$$$ consisting of lowercase Latin latters. Vasya thinks that the statement can be considered hard if it contains a subsequence hard; otherwise the statement is easy. For example, hard, hzazrzd, ... | 1,800 | false | false | false | true | false | false | false | false | false | false | 5,228 |
1634F | One of my most productive days was throwing away 1,000 lines of code. — Ken Thompson Fibonacci addition is an operation on an array $$$X$$$ of integers, parametrized by indices $$$l$$$ and $$$r$$$. Fibonacci addition increases $$$X_l$$$ by $$$F_1$$$, increases $$$X_{l + 1}$$$ by $$$F_2$$$, and so on up to $$$X_r$$$ whi... | 2,700 | true | false | true | false | true | false | true | false | false | false | 2,441 |
686B | Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places. The robber girl was angry at first, but then she decided to arrange the animals herself. She r... | 1,100 | false | false | true | false | false | true | false | false | true | false | 7,077 |
1178E | Alice bought a Congo Prime Video subscription and was watching a documentary on the archaeological findings from Factor's Island on Loch Katrine in Scotland. The archaeologists found a book whose age and origin are unknown. Perhaps Alice can make some sense of it? The book contains a single string of characters "a", "b... | 1,900 | false | true | false | false | false | true | true | false | false | false | 4,826 |
988B | You are given $$$n$$$ strings. Each string consists of lowercase English letters. Rearrange (reorder) the given strings in such a way that for every string, all strings that are placed before it are its substrings. String $$$a$$$ is a substring of string $$$b$$$ if it is possible to choose several consecutive letters i... | 1,100 | false | false | false | false | false | false | false | false | true | false | 5,762 |
1151B | Student Dima from Kremland has a matrix $$$a$$$ of size $$$n imes m$$$ filled with non-negative integers. He wants to select exactly one integer from each row of the matrix so that the bitwise exclusive OR of the selected integers is strictly greater than zero. Help him! Formally, he wants to choose an integers sequen... | 1,600 | false | false | false | true | false | true | true | false | false | false | 4,961 |
1348C | Phoenix has a string $$$s$$$ consisting of lowercase Latin letters. He wants to distribute all the letters of his string into $$$k$$$ non-empty strings $$$a_1, a_2, dots, a_k$$$ such that every letter of $$$s$$$ goes to exactly one of the strings $$$a_i$$$. The strings $$$a_i$$$ do not need to be substrings of $$$s$$$.... | 1,600 | false | true | false | false | false | true | false | false | true | false | 3,968 |
212D | Vasya the carpenter has an estate that is separated from the wood by a fence. The fence consists of _n_ planks put in a line. The fence is not closed in a circle. The planks are numbered from left to right from 1 to _n_, the _i_-th plank is of height _a__i_. All planks have the same width, the lower edge of each plank ... | 2,500 | false | false | false | false | true | false | false | true | false | false | 8,990 |
774K | Problem - 774K - Codeforces =============== xa0 . → Problem tags *special problem implementation strings *1600 No tag edit access → Contest materials — the number of letters in the word written by Stepan. The second line contains the string _s_ which has length that equals to _n_ and contains only l... | 1,600 | false | false | true | false | false | false | false | false | false | false | 6,671 |
1737B | Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Dytechlab Cup 2022 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 see... | 1,300 | true | false | true | false | false | false | false | true | false | false | 1,867 |
1773L | Lisa loves playing with the sequences of integers. When she gets a new integer sequence $$$a_i$$$ of length $$$n$$$, she starts looking for all monotone subsequences. A monotone subsequence $$$[l, r]$$$ is defined by two indices $$$l$$$ and $$$r$$$ ($$$1 le l < r le n$$$) such that $$$forall i = l, l+1, ldots, r-1: a_i... | 3,500 | false | false | false | true | false | false | false | false | false | false | 1,645 |
1490A | Polycarp calls an array dense if the greater of any two adjacent elements is not more than twice bigger than the smaller. More formally, for any $$$i$$$ ($$$1 le i le n-1$$$), this condition must be satisfied: $$$$$$frac{max(a[i], a[i+1])}{min(a[i], a[i+1])} le 2$$$$$$ For example, the arrays $$$[1, 2, 3, 4, 3]$$$, $$$... | 800 | true | true | false | false | false | false | false | false | false | false | 3,229 |
405D | Little Chris is very keen on his toy blocks. His teacher, however, wants Chris to solve more problems, so he decided to play a trick on Chris. There are exactly _s_ blocks in Chris's set, each block has a unique number from 1 to _s_. Chris's teacher picks a subset of blocks _X_ and keeps it to himself. He will give the... | 1,700 | true | true | true | false | false | false | false | false | false | false | 8,202 |
741A | As you have noticed, there are lovely girls in Arpa’s land. People in Arpa's land are numbered from 1 to _n_. Everyone has exactly one crush, _i_-th person's crush is person with the number _crush__i_. Someday Arpa shouted Owf loudly from the top of the palace and a funny game started in Arpa's land. The rules are as f... | 1,600 | true | false | false | false | false | false | false | false | false | false | 6,836 |
1688A | Even if it's a really easy question, she won't be able to answer it — Perfect Memento in Strict Sense Cirno's perfect bitmasks classroom has just started! Cirno gave her students a positive integer $$$x$$$. As an assignment, her students need to find the minimum positive integer $$$y$$$, which satisfies the following t... | 800 | false | false | false | false | false | false | true | false | false | false | 2,151 |
1912F | The city of F. can be represented as a tree. A famous fugitive is hiding in it, and today a faithful police officer decided to catch him at all costs. The police officer is stronger than the fugitive, but the fugitive is much faster than the former. That is why the pursuit proceeds as follows. At the moment $$$t = 0$$$... | 3,100 | true | false | false | false | false | false | false | false | false | false | 832 |
887C | During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2. It's too hard to learn to solve Rubik's cube instantly, so she learns to understand if it's possible to solve the cube in some state using 90-degrees rotation ... | 1,500 | false | false | true | false | false | false | true | false | false | false | 6,200 |
1778F | You are given a rooted tree consisting of $$$n$$$ vertices numbered from $$$1$$$ to $$$n$$$. Vertex $$$1$$$ is the root of the tree. Each vertex has an integer value. The value of $$$i$$$-th vertex is $$$a_i$$$. You can do the following operation at most $$$k$$$ times. Choose a vertex $$$v$$$ that has not been chosen ... | 2,600 | true | false | false | true | false | false | false | false | false | true | 1,603 |
1430F | Recently you've discovered a new shooter. They say it has realistic game mechanics. Your character has a gun with magazine size equal to $$$k$$$ and should exterminate $$$n$$$ waves of monsters. The $$$i$$$-th wave consists of $$$a_i$$$ monsters and happens from the $$$l_i$$$-th moment of time up to the $$$r_i$$$-th mo... | 2,600 | false | true | false | true | false | false | false | false | false | false | 3,511 |
1169A | The circle line of the Roflanpolis subway has $$$n$$$ stations. There are two parallel routes in the subway. The first one visits stations in order $$$1 o 2 o ldots o n o 1 o 2 o ldots$$$ (so the next stop after station $$$x$$$ is equal to $$$(x+1)$$$ if $$$x < n$$$ and $$$1$$$ otherwise). The second route visits... | 900 | true | false | true | false | false | false | false | false | false | false | 4,871 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.