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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1804G | Raj has a single physical network line that connects his office to the Internet. This line bandwidth is $$$b$$$ bytes per millisecond. There are $$$n$$$ users who would like to use this network line to transmit some data. The $$$i$$$-th of them will use the line from millisecond $$$s_i$$$ to millisecond $$$f_i$$$ inclu... | 3,500 | false | false | true | false | true | false | false | false | false | false | 1,451 |
1088D | This is an interactive problem! Ehab plays a game with Laggy. Ehab has 2 hidden integers $$$(a,b)$$$. Laggy can ask a pair of integers $$$(c,d)$$$ and Ehab will reply with: 1 if $$$a oplus c>b oplus d$$$. 0 if $$$a oplus c=b oplus d$$$. -1 if $$$a oplus c<b oplus d$$$. Operation $$$a oplus b$$$ is the $$$ with at mo... | 2,000 | false | false | true | false | false | true | false | false | false | false | 5,288 |
1776G | After the first successful edition, Gabriella has been asked to organize a second wine tasting event. There will be $$$2n - 1$$$ bottles of wine arranged in a row, each of which is either red wine or white wine. This time, Gabriella has already chosen the type and order of all the bottles. The types of the wines are re... | 2,100 | true | false | false | false | false | true | false | false | false | false | 1,622 |
568D | One Khanate had a lot of roads and very little wood. Riding along the roads was inconvenient, because the roads did not have road signs indicating the direction to important cities. The Han decided that it's time to fix the issue, and ordered to put signs on every road. The Minister of Transport has to do that, but he ... | 2,800 | true | false | false | false | false | false | true | false | false | false | 7,575 |
748D | Santa Claus likes palindromes very much. There was his birthday recently. _k_ of his friends came to him to congratulate him, and each of them presented to him a string _s__i_ having the same length _n_. We denote the beauty of the _i_-th string by _a__i_. It can happen that _a__i_ is negativexa0— that means that Santa... | 2,100 | false | true | false | false | true | true | false | false | false | false | 6,801 |
842E | Nikita plays a new computer game. There are _m_ levels in this game. In the beginning of each level a new class appears in the game; this class is a child-class of the class _y__i_ (and _y__i_ is called parent-class for this new class). Thus, the classes form a tree. Initially there is only one class with index 1. Chan... | 2,800 | false | false | false | false | false | false | false | true | false | true | 6,392 |
1773J | You are given an undirected connected graph with $$$n$$$ vertices and $$$m$$$ edges. Each edge has an associated counter, initially equal to $$$0$$$. In one operation, you can choose an arbitrary spanning tree and add any value $$$v$$$ to all edges of this spanning tree. Determine if it's possible to make every counter... | 2,900 | true | false | false | false | false | true | false | false | false | false | 1,647 |
1031D | You are given a matrix of size $$$n imes n$$$ filled with lowercase English letters. You can change no more than $$$k$$$ letters in this matrix. Consider all paths from the upper left corner to the lower right corner that move from a cell to its neighboring cell to the right or down. Each path is associated with the s... | 1,900 | false | true | false | false | false | false | false | false | false | false | 5,545 |
61D | Problem - 61D - 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 | true | false | false | false | false | false | false | false | true | 9,667 |
1808A | Olympus City recently launched the production of personal starships. Now everyone on Mars can buy one and fly to other planets inexpensively. Each starship has a numberxa0—some positive integer $$$x$$$. Let's define the luckiness of a number $$$x$$$ as the difference between the largest and smallest digits of that numb... | 900 | false | false | true | false | false | false | true | false | false | false | 1,427 |
1304F2 | The only difference between easy and hard versions is the constraint on $$$k$$$. Gildong loves observing animals, so he bought two cameras to take videos of wild animals in a forest. The color of one camera is red, and the other one's color is blue. Gildong is going to take videos for $$$n$$$ days, starting from day $$... | 2,400 | false | true | false | true | true | false | false | false | false | false | 4,165 |
1492D | Problem - 1492D - 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,900 | true | true | false | false | false | true | false | false | false | false | 3,210 |
316F1 | Smart Beaver became interested in drawing. He draws suns. However, at some point, Smart Beaver realized that simply drawing suns is boring. So he decided to design a program that will process his drawings. You are given a picture drawn by the beaver. It will have two colors: one for the background and one for the suns ... | 2,200 | false | false | true | false | false | false | false | false | false | false | 8,571 |
1647E | After the most stunning success with the fifth-graders, Madoka has been trusted with teaching the sixth-graders. There's $$$n$$$ single-place desks in her classroom. At the very beginning Madoka decided that the student number $$$b_i$$$ ($$$1 le b_i le n$$$) will sit at the desk number $$$i$$$. Also there's an infinite... | 2,500 | false | true | false | false | true | false | false | false | false | false | 2,385 |
1624G | Recently, Vlad has been carried away by spanning trees, so his friends, without hesitation, gave him a connected weighted undirected graph of $$$n$$$ vertices and $$$m$$$ edges for his birthday. Vlad defined the ority of a spanning tree as the — the number of test cases in the input. An empty line is written in front o... | 1,900 | false | true | false | false | false | false | false | false | false | true | 2,494 |
156D | As Sherlock Holmes was investigating another crime, he found a certain number of clues. Also, he has already found direct links between some of those clues. The direct links between the clues are mutual. That is, the direct link between clues _A_ and _B_ and the direct link between clues _B_ and _A_ is the same thing. ... | 2,500 | false | false | false | false | false | false | false | false | false | true | 9,249 |
1538E | Polycarp came up with a new programming language. There are only two types of statements in it: "x := s": assign the variable named x the value s (where s is a string). For example, the statement var := hello assigns the variable named var the value hello. Note that s is the value of a string, not the name of a variab... | 2,100 | false | false | true | false | true | false | false | false | false | false | 2,951 |
940B | Problem - 940B - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 1,400 | false | true | false | true | false | false | false | false | false | false | 5,937 |
2019A | You are given an array $$$a_1, a_2, ldots, a_n$$$ of positive integers. You can color some elements of the array red, but there cannot be two adjacent red elements (i.e., for $$$1 leq i leq n-1$$$, at least one of $$$a_i$$$ and $$$a_{i+1}$$$ must not be red). Your score is the maximum value of a red element plus the nu... | 800 | false | true | false | true | false | false | true | false | false | false | 154 |
1535D | $$$2^k$$$ teams participate in a playoff tournament. The tournament consists of $$$2^k - 1$$$ games. They are held as follows: first of all, the teams are split into pairs: team $$$1$$$ plays against team $$$2$$$, team $$$3$$$ plays against team $$$4$$$ (exactly in this order), and so on (so, $$$2^{k-1}$$$ games are pl... | 1,800 | false | false | true | true | true | false | false | false | false | false | 2,971 |
107B | As a German University in Cairo (GUC) student and a basketball player, Herr Wafa was delighted once he heard the news. GUC is finally participating in the Annual Basketball Competition (ABC). A team is to be formed of _n_ players, all of which are GUC students. However, the team might have players belonging to differen... | 1,600 | true | false | false | true | false | false | false | false | false | false | 9,455 |
1679E | Today is a holiday in the residence hallxa0— Oleh arrived, in honor of which the girls gave him a string. Oleh liked the gift a lot, so he immediately thought up and offered you, his best friend, the following problem. You are given a string $$$s$$$ of length $$$n$$$, which consists of the first $$$17$$$ lowercase Lati... | 2,400 | false | false | false | true | false | false | false | false | false | false | 2,193 |
1340D | Denis came to Nastya and discovered that she was not happy to see him... There is only one chance that she can become happy. Denis wants to buy all things that Nastya likes so she will certainly agree to talk to him. The map of the city where they live has a lot of squares, some of which are connected by roads. There i... | 2,600 | false | false | false | false | false | true | false | false | false | true | 4,004 |
1646B | $$$ defmyred#1{color{red}{underline{bf{#1}}}} defmyblue#1{color{blue}{overline{bf{#1}}}} $$$ $$$defRED{myred{Red}} defBLUE{myblue{Blue}}$$$ You are given a sequence of $$$n$$$ non-negative integers $$$a_1, a_2, ldots, a_n$$$. Initially, all the elements of the sequence are unpainted. You can paint each number $$$RED$$$... | 800 | false | true | false | false | false | true | true | false | true | false | 2,394 |
1278F | Problem - 1278F - 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,600 | true | false | false | true | false | false | false | false | false | false | 4,301 |
1061A | Problem - 1061A - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ... | 800 | true | true | true | false | false | false | false | false | false | false | 5,408 |
1070L | Berland has $$$n$$$ cities, some of which are connected by roads. Each road is bidirectional, connects two distinct cities and for each two cities there's at most one road connecting them. The president of Berland decided to split country into $$$r$$$ states in such a way that each city will belong to exactly one of th... | 2,600 | false | false | false | false | false | true | false | false | false | false | 5,356 |
232B | John Doe has an _n_u2009×u2009_m_ table. John Doe can paint points in some table cells, not more than one point in one table cell. John Doe wants to use such operations to make each square subtable of size _n_u2009×u2009_n_ have exactly _k_ points. John Doe wondered, how many distinct ways to fill the table with points... | 1,900 | true | false | false | true | false | false | false | false | false | false | 8,910 |
425D | Problem - 425D - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 2,300 | false | false | false | false | true | false | false | true | false | false | 8,135 |
1316D | Nash designed an interesting yet simple board game where a player is simply required to follow instructions written on the cell where the player currently stands. This board game is played on the $$$n imes n$$$ board. Rows and columns of this board are numbered from $$$1$$$ to $$$n$$$. The cell on the intersection of t... | 2,000 | false | false | true | false | false | true | false | false | false | true | 4,118 |
1896H1 | This is the easy version of the problem. The only difference between the two versions is the constraint on $$$k$$$. You can make hacks only if all versions of the problem are solved. In this statement, all strings are $$$0$$$-indexed. For two strings $$$a$$$, $$$b$$$ of the same length $$$p$$$, we define the following ... | 3,400 | true | false | false | true | false | false | true | false | false | false | 930 |
763E | After his birthday party, Timofey went to his favorite tree alley in a park. He wants to feed there his favorite birdsxa0— crows. It's widely known that each tree is occupied by a single crow family. The trees in the alley form a row and are numbered from 1 to _n_. Some families are friends to each other. For some reas... | 2,900 | false | false | false | false | true | false | false | false | false | false | 6,733 |
659B | Very soon Berland will hold a School Team Programming Olympiad. From each of the _m_ Berland regions a team of two people is invited to participate in the olympiad. The qualifying contest to form teams was held and it was attended by _n_ Berland students. There were at least two schoolboys participating from each of th... | 1,300 | false | false | false | false | false | true | false | false | true | false | 7,188 |
799A | In some game by Playrix it takes _t_ minutes for an oven to bake _k_ carrot cakes, all cakes are ready at the same moment _t_ minutes after they started baking. Arkady needs at least _n_ cakes to complete a task, but he currently don't have any. However, he has infinitely many ingredients and one oven. Moreover, Arkady... | 1,100 | false | false | true | false | false | false | true | false | false | false | 6,576 |
456B | Problem - 456B - 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,200 | true | false | false | false | false | false | false | false | false | false | 8,013 |
442C | Problem - 442C - 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 | true | false | false | true | false | false | false | false | false | 8,068 |
1182C | You are given $$$n$$$ words, each of which consists of lowercase alphabet letters. Each word contains at least one vowel. You are going to choose some of the given words and make as many beautiful lyrics as possible. Each lyric consists of two lines. Each line consists of two words separated by whitespace. A lyric is b... | 1,700 | false | true | false | false | true | false | false | false | false | false | 4,806 |
189B | Problem - 189B - 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 | true | false | false | false | false | false | true | false | false | false | 9,083 |
1734E | You are given a prime number $$$n$$$, and an array of $$$n$$$ integers $$$b_1,b_2,ldots, b_n$$$, where $$$0 leq b_i < n$$$ for each $$$1 le i leq n$$$. You have to find a matrix $$$a$$$ of size $$$n imes n$$$ such that all of the following requirements hold: $$$0 le a_{i,j} < n$$$ for all $$$1 le i, j le n$$$. $$$a_... | 2,100 | false | false | false | false | false | true | false | false | false | false | 1,882 |
1105D | Kilani is playing a game with his friends. This game can be represented as a grid of size $$$n imes m$$$, where each cell is either empty or blocked, and every player has one or more castles in some cells (there are no two castles in one cell). The game is played in rounds. In each round players expand turn by turn: f... | 1,900 | false | false | true | false | false | false | false | false | false | true | 5,177 |
547D | Problem - 547D - 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 | false | false | true | false | false | false | true | 7,649 |
1728D | Alice and Bob are playing a game. Initially, they are given a non-empty string $$$s$$$, consisting of lowercase Latin letters. The length of the string is even. Each player also has a string of their own, initially empty. Alice starts, then they alternate moves. In one move, a player takes either the first or the last ... | 1,800 | false | false | false | true | false | true | false | false | false | false | 1,922 |
724D | You are given a string _s_, consisting of lowercase English letters, and the integer _m_. One should choose some symbols from the given string so that any contiguous subsegment of length _m_ has at least one selected symbol. Note that here we choose positions of symbols, not the symbols themselves. Then one uses the ch... | 1,900 | false | true | false | false | true | false | false | false | false | false | 6,911 |
1553E | An identity permutation of length $$$n$$$ is an array $$$[1, 2, 3, dots, n]$$$. We performed the following operations to an identity permutation of length $$$n$$$: firstly, we cyclically shifted it to the right by $$$k$$$ positions, where $$$k$$$ is unknown to you (the only thing you know is that $$$0 le k le n - 1$$$... | 2,100 | true | false | false | false | false | true | true | false | false | true | 2,871 |
2010C1 | This is a simplified version of the problem. It differs from the difficult one only in its constraints. At the Berland State University, the local network between servers does not always operate without errors. When transmitting two identical messages consecutively, an error may occur, resulting in the two messages mer... | 1,400 | false | false | false | false | false | false | true | false | false | false | 189 |
1678A | Tokitsukaze has a sequence $$$a$$$ of length $$$n$$$. For each operation, she selects two numbers $$$a_i$$$ and $$$a_j$$$ ($$$i e j$$$; $$$1 leq i,j leq n$$$). If $$$a_i = a_j$$$, change one of them to $$$0$$$. Otherwise change both of them to $$$min(a_i, a_j)$$$. Tokitsukaze wants to know the minimum number of oper... | 800 | false | false | true | false | false | false | false | false | false | false | 2,200 |
487C | Problem - 487C - Codeforces =============== xa0 ]( --- Finished → Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s... | 2,300 | true | false | false | false | false | true | false | false | false | false | 7,888 |
1392F | Omkar is standing at the foot of Celeste mountain. The summit is $$$n$$$ meters away from him, and he can see all of the mountains up to the summit, so for all $$$1 leq j leq n$$$ he knows that the height of the mountain at the point $$$j$$$ meters away from himself is $$$h_j$$$ meters. It turns out that for all $$$j$$... | 2,400 | true | true | false | false | true | true | false | true | false | false | 3,711 |
273E | Problem - 273E - 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,740 |
2030C | Alice and Bob are playing a game. There is a list of $$$n$$$ booleans, each of which is either true or false, given as a binary string $$$^{ ext{∗}}$$$ of length $$$n$$$ (where $$$ exttt{1}$$$ represents true, and $$$ exttt{0}$$$ represents false). Initially, there are no operators between the booleans. Alice and Bob w... | 1,100 | false | true | false | false | false | false | true | false | false | false | 86 |
1904D1 | This is the easy version of the problem. The only differences between the two versions of this problem are the constraints on $$$n$$$ and the time limit. You can make hacks only if all versions of the problem are solved. You are given two arrays $$$a$$$ and $$$b$$$ of length $$$n$$$. You can perform the following opera... | 1,600 | false | true | false | false | false | true | true | false | false | false | 887 |
810A | Noora is a student of one famous high school. It's her final year in schoolxa0— she is going to study in university next year. However, she has to get an «A» graduation certificate in order to apply to a prestigious one. In school, where Noora is studying, teachers are putting down marks to the online class register, w... | 900 | true | false | true | false | false | false | false | false | false | false | 6,523 |
528E | # Triangles 3000 Input file: standard input Output file: standard output Time limit: 5 seconds Memory limit: 512 megabytes You are given a set L = {l1, l 2, . . . , l n} of n pairwise non-parallel lines on the Euclidean plane. The i-th line is given by an equation in the form of aix + biy = ci. L doesn’t contain thr... | 3,100 | false | false | false | false | false | false | false | false | true | false | 7,718 |
923F | There are _N_ cities in Bob's country connected by roads. Some pairs of cities are connected by public transport. There are two competing transport companiesxa0— Boblines operating buses and Bobrail running trains. When traveling from _A_ to _B_, a passenger always first selects the mode of transport (either bus or tra... | 3,200 | false | false | false | false | false | true | false | false | false | true | 6,018 |
1994H | This is an interactive problem! Timofey is writing a competition called Capture the Flag (or CTF for short). He has one task left, which involves hacking a security system. The entire system is based on polynomial hashes$$$^{ ext{∗}}$$$. Timofey can input a string consisting of lowercase Latin letters into the system, ... | 3,500 | true | true | false | false | false | true | false | false | false | false | 298 |
317C | A system of _n_ vessels with water is given. Several pairs of vessels are connected by tubes with transfusion mechanisms. One may transfer an integer amount of liters of water between two vessels connected by such tube (tube works in both directions). There might be multiple tubes between two vessels. Total number of t... | 2,500 | false | false | false | false | false | true | false | false | false | true | 8,563 |
786B | Rick and his co-workers have made a new radioactive formula and a lot of bad guys are after them. So Rick wants to give his legacy to Morty before bad guys catch them. There are _n_ planets in their universe numbered from 1 to _n_. Rick is in planet number _s_ (the earth) and he doesn't know where Morty is. As we all k... | 2,300 | false | false | false | false | true | false | false | false | false | true | 6,627 |
131D | A subway scheme, classic for all Berland cities is represented by a set of _n_ stations connected by _n_ passages, each of which connects exactly two stations and does not pass through any others. Besides, in the classic scheme one can get from any station to any other one along the passages. The passages can be used t... | 1,600 | false | false | false | false | false | false | false | false | false | true | 9,350 |
1512C | You are given a string $$$s$$$ consisting of the characters '0', '1', and '?'. You need to replace all the characters with '?' in the string $$$s$$$ by '0' or '1' so that the string becomes a palindrome and has exactly $$$a$$$ characters '0' and exactly $$$b$$$ characters '1'. Note that each of the characters '?' is re... | 1,200 | false | false | true | false | false | true | false | false | false | false | 3,107 |
1729B | Polycarp has a string $$$s$$$ consisting of lowercase Latin letters. He encodes it using the following algorithm. He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), the... | 800 | false | true | false | false | false | false | false | false | false | false | 1,917 |
1822B | Karina has an array of $$$n$$$ integers $$$a_1, a_2, a_3, dots, a_n$$$. She loves multiplying numbers, so she decided that the beauty of a pair of numbers is their product. And the beauty of an array is the maximum beauty of a pair of adjacent elements in the array. For example, for $$$n = 4$$$, $$$a=[3, 5, 7, 4]$$$, t... | 800 | true | true | false | false | false | false | false | false | true | false | 1,350 |
1096E | Hasan loves playing games and has recently discovered a game called TopScore. In this soccer-like game there are $$$p$$$ players doing penalty shoot-outs. Winner is the one who scores the most. In case of ties, one of the top-scorers will be declared as the winner randomly with equal probability. They have just finishe... | 2,500 | true | false | false | true | false | false | false | false | false | false | 5,227 |
78D | A breakthrough among computer games, "Civilization XIII", is striking in its scale and elaborate details. Let's take a closer look at one of them. The playing area in the game is split into congruent cells that are regular hexagons. The side of each cell is equal to 1. Each unit occupies exactly one cell of the playing... | 2,300 | true | false | false | false | false | false | false | true | false | false | 9,572 |
439C | Devu being a small kid, likes to play a lot, but he only likes to play with arrays. While playing he came up with an interesting question which he could not solve, can you please solve it for him? Given an array consisting of distinct integers. Is it possible to partition the whole array into _k_ disjoint non-empty par... | 1,700 | false | false | true | false | false | true | true | false | false | false | 8,082 |
809E | Tired of boring dates, Leha and Noora decided to play a game. Leha found a tree with _n_ vertices numbered from 1 to _n_. We remind you that tree is an undirected graph without cycles. Each vertex _v_ of a tree has a number _a__v_ written on it. Quite by accident it turned out that all values written on vertices are di... | 3,100 | true | false | false | false | false | false | false | false | false | false | 6,524 |
1566E | A tree is a connected graph without cycles. A rooted tree has a special vertex called the root. The parent of a vertex $$$v$$$ (different from root) is the previous to $$$v$$$ vertex on the shortest path from the root to the vertex $$$v$$$. Children of the vertex $$$v$$$ are all vertices for which $$$v$$$ is the parent... | 2,000 | false | true | false | true | false | true | false | false | false | false | 2,808 |
426B | Let's assume that we are given a matrix _b_ of size _x_u2009×u2009_y_, let's determine the operation of mirroring matrix _b_. The mirroring of matrix _b_ is a 2_x_u2009×u2009_y_ matrix _c_ which has the following properties: the upper half of matrix _c_ (rows with numbers from 1 to _x_) exactly matches _b_; the lower... | 1,300 | false | false | true | false | false | false | false | false | false | false | 8,132 |
1173A | Nauuo is a girl who loves writing comments. One day, she posted a comment on Codeforces, wondering whether she would get upvotes or downvotes. It's known that there were $$$x$$$ persons who would upvote, $$$y$$$ persons who would downvote, and there were also another $$$z$$$ persons who would vote, but you don't know w... | 800 | false | true | false | false | false | false | false | false | false | false | 4,853 |
1632E2 | This version of the problem differs from the previous one only in the constraint on $$$n$$$. A tree is a connected undirected graph without cycles. A weighted tree has a weight assigned to each edge. The distance between two vertices is the minimum sum of weights on the path connecting them. You are given a weighted tr... | 2,700 | false | false | false | false | false | false | false | true | false | false | 2,453 |
986D | Problem - 986D - 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,100 | true | false | false | false | false | false | false | false | false | false | 5,769 |
1236C | In order to do some research, $$$n^2$$$ labs are built on different heights of a mountain. Let's enumerate them with integers from $$$1$$$ to $$$n^2$$$, such that the lab with the number $$$1$$$ is at the lowest place, the lab with the number $$$2$$$ is at the second-lowest place, $$$ldots$$$, the lab with the number $... | 1,300 | false | true | true | false | false | true | false | false | false | false | 4,516 |
1140F | For a given set of two-dimensional points $$$S$$$, let's denote its extension $$$E(S)$$$ as the result of the following algorithm: Create another set of two-dimensional points $$$R$$$, which is initially equal to $$$S$$$. Then, while there exist four numbers $$$x_1$$$, $$$y_1$$$, $$$x_2$$$ and $$$y_2$$$ such that $$$(x... | 2,600 | false | false | false | false | true | false | false | false | false | false | 5,023 |
645B | It is a balmy spring afternoon, and Farmer John's _n_ cows are ruminating about link-cut cacti in their stalls. The cows, labeled 1 through _n_, are arranged so that the _i_-th cow occupies the _i_-th stall from the left. However, Elsie, after realizing that she will forever live in the shadows beyond Bessie's limeligh... | 1,200 | true | true | false | false | false | false | false | false | false | false | 7,233 |
1242A | Ujan has been lazy lately, but now has decided to bring his yard to good shape. First, he decided to paint the path from his house to the gate. The path consists of $$$n$$$ consecutive tiles, numbered from $$$1$$$ to $$$n$$$. Ujan will paint each tile in some color. He will consider the path aesthetic if for any two di... | 1,500 | true | false | false | false | false | true | false | false | false | false | 4,489 |
1320E | There are $$$n$$$ cities in Treeland connected with $$$n - 1$$$ bidirectional roads in such that a way that any city is reachable from any other; in other words, the graph of cities and roads is a tree. Treeland is preparing for a seasonal virus epidemic, and currently, they are trying to evaluate different infection s... | 3,000 | false | false | false | true | true | false | false | false | false | false | 4,111 |
32D | A star map in Berland is a checked field _n_u2009×u2009_m_ squares. In each square there is or there is not a star. The favourite constellation of all Berland's astronomers is the constellation of the Cross. This constellation can be formed by any 5 stars so, that for some integer _x_ (radius of the constellation) the ... | 1,600 | false | false | true | false | false | false | false | false | false | false | 9,835 |
543B | In some country there are exactly _n_ cities and _m_ bidirectional roads connecting the cities. Cities are numbered with integers from 1 to _n_. If cities _a_ and _b_ are connected by a road, then in an hour you can go along this road either from city _a_ to city _b_, or from city _b_ to city _a_. The road network is s... | 2,100 | false | false | false | false | false | true | false | false | false | true | 7,668 |
710A | Problem - 710A - Codeforces =============== xa0 | 800 | false | false | true | false | false | false | false | false | false | false | 6,982 |
1615C | There are $$$n$$$ candles on a Hanukkah menorah, and some of its candles are initially lit. We can describe which candles are lit with a binary string $$$s$$$, where the $$$i$$$-th candle is lit if and only if $$$s_i=1$$$. Initially, the candle lights are described by a string $$$a$$$. In an operation, you select a can... | 1,600 | true | true | false | false | false | false | true | false | false | true | 2,562 |
1379D | There are many freight trains departing from Kirnes planet every day. One day on that planet consists of $$$h$$$ hours, and each hour consists of $$$m$$$ minutes, where $$$m$$$ is an even number. Currently, there are $$$n$$$ freight trains, and they depart every day at the same time: $$$i$$$-th train departs at $$$h_i$... | 2,300 | false | false | false | false | true | false | true | true | true | false | 3,775 |
1132C | Problem - 1132C - 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 | false | false | false | false | false | false | true | false | false | false | 5,059 |
1175C | At first, there was a legend related to the name of the problem, but now it's just a formal statement. You are given $$$n$$$ points $$$a_1, a_2, dots, a_n$$$ on the $$$OX$$$ axis. Now you are asked to find such an integer point $$$x$$$ on $$$OX$$$ axis that $$$f_k(x)$$$ is minimal possible. The function $$$f_k(x)$$$ ca... | 1,600 | false | true | false | false | false | false | true | true | false | false | 4,843 |
1659D | Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$. Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that ... | 1,900 | true | true | true | false | true | true | false | false | false | false | 2,329 |
1575F | Mr. Chanek opened a letter from his fellow, who is currently studying at Singanesia. Here is what it says. Define an array $$$b$$$ ($$$0 leq b_i < k$$$) with $$$n$$$ integers. While there exists a pair $$$(i, j)$$$ such that $$$b_i e b_j$$$, do the following operation: Randomly pick a number $$$i$$$ satisfying $$$0 l... | 2,900 | true | false | false | false | false | false | false | false | false | false | 2,763 |
290D | Problem - 290D - Codeforces =============== xa0 . Each character will be a letter of English alphabet, lowercase or uppercase. The second line of the input is an integer between 0 and 26, inclusive. Output Output the required string. Examples Input AprilFool 14 Output AprILFooL | 1,400 | false | false | true | false | false | false | false | false | false | false | 8,674 |
1209D | The legendary Farmer John is throwing a huge party, and animals from all over the world are hanging out at his house. His guests are hungry, so he instructs his cow Bessie to bring out the snacks! Moo! There are $$$n$$$ snacks flavors, numbered with integers $$$1, 2, ldots, n$$$. Bessie has $$$n$$$ snacks, one snack of... | 1,700 | false | false | false | false | false | false | false | false | false | true | 4,643 |
1419D1 | This is the easy version of the problem. The difference between the versions is that in the easy version all prices $$$a_i$$$ are different. You can make hacks if and only if you solved both versions of the problem. Today is Sage's birthday, and she will go shopping to buy ice spheres. All $$$n$$$ ice spheres are place... | 1,000 | false | true | false | false | false | true | false | true | true | false | 3,584 |
1070H | Polycarp is working on a new operating system called BerOS. He asks you to help with implementation of a file suggestion feature. There are $$$n$$$ files on hard drive and their names are $$$f_1, f_2, dots, f_n$$$. Any file name contains between $$$1$$$ and $$$8$$$ characters, inclusive. All file names are unique. The ... | 1,500 | false | false | true | false | false | false | true | false | false | false | 5,360 |
964A | Problem - 964A - 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 | false | false | false | false | false | false | false | false | 5,844 |
1567F | Alice has an empty grid with $$$n$$$ rows and $$$m$$$ columns. Some of the cells are marked, and no marked cells are adjacent to the edge of the grid. (Two squares are adjacent if they share a side.) Alice wants to fill each cell with a number such that the following statements are true: every unmarked cell contains e... | 2,700 | false | false | true | false | false | true | false | false | false | true | 2,799 |
633A | Problem - 633A - Codeforces =============== xa0 ]( "Announcement") xa0— the number of units of damage dealt by Ebony gun and Ivory gun, and the total number of damage required to break the shield, respectively. Output Print "Yes" (without quotes) if Dante can deal exactly _c_ damage to the shield and "No" ... | 1,100 | true | false | false | false | false | false | true | false | false | false | 7,275 |
1612A | Let's denote the Manhattan distance between two points $$$p_1$$$ (with coordinates $$$(x_1, y_1)$$$) and $$$p_2$$$ (with coordinates $$$(x_2, y_2)$$$) as $$$d(p_1, p_2) = x_1 - x_2 + y_1 - y_2$$$. For example, the distance between two points with coordinates $$$(1, 3)$$$ and $$$(4, 2)$$$ is $$$1 - 4 + 3 - 2 = 4$$$. You... | 800 | false | false | false | false | false | true | true | false | false | false | 2,583 |
605B | Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graphxa0— something that will definitely never be useful in real life. He asked a girl sitting next to him to lend him some cheat papers for this questions and found there the following def... | 1,700 | false | false | false | false | true | true | false | false | false | true | 7,425 |
925C | Vitya has learned that the answer for The Ultimate Question of Life, the Universe, and Everything is not the integer 54 42, but an increasing integer sequence $$$a_1, ldots, a_n$$$. In order to not reveal the secret earlier than needed, Vitya encrypted the answer and obtained the sequence $$$b_1, ldots, b_n$$$ using th... | 2,200 | true | false | false | false | false | true | false | false | false | false | 6,009 |
960A | A has a string consisting of some number of lowercase English letters 'a'. He gives it to his friend B who appends some number of letters 'b' to the end of this string. Since both A and B like the characters 'a' and 'b', they have made sure that at this point, at least one 'a' and one 'b' exist in the string. B now giv... | 1,200 | false | false | true | false | false | false | false | false | false | false | 5,871 |
1168C | Toad Pimple has an array of integers $$$a_1, a_2, ldots, a_n$$$. We say that $$$y$$$ is reachable from $$$x$$$ if $$$x<y$$$ and there exists an integer array $$$p$$$ such that $$$x = p_1 < p_2 < ldots < p_k=y$$$, and $$$a_{p_i}, &, a_{p_{i+1}} > 0$$$ for all integers $$$i$$$ such that $$$1 leq i < k$$$. Here $$$&$$$ de... | 2,200 | false | false | false | true | false | false | false | false | false | false | 4,874 |
1380F | Let $$$a$$$ and $$$b$$$ be some non-negative integers. Let's define strange addition of $$$a$$$ and $$$b$$$ as following: 1. write down the numbers one under another and align them by their least significant digit; 2. add them up digit by digit and concatenate the respective sums together. Assume that both numbers have... | 2,600 | false | false | false | true | true | false | false | false | false | false | 3,766 |
1090F | , # Problem A. How to Learn You Score Time limit: 1 second Memory limit: 512 megabytes This is an interactive problem. Petya participates in such contest that the participants only learn results of judging their submissions after the end of the contest. There are n problems numbered from 1 to n in the contest. For eac... | 2,600 | false | false | false | false | false | true | false | false | false | false | 5,267 |
325C | Piegirl has found a monster and a book about monsters and pies. When she is reading the book, she found out that there are _n_ types of monsters, each with an ID between 1 and _n_. If you feed a pie to a monster, the monster will split into some number of monsters (possibly zero), and at least one colorful diamond. Mon... | 2,600 | false | false | false | false | false | false | false | false | false | true | 8,539 |
1955G | Not long ago, Egor learned about the Euclidean algorithm for finding the greatest common divisor of two numbers. The greatest common divisor of two numbers $$$a$$$ and $$$b$$$ is the largest number that divides both $$$a$$$ and $$$b$$$ without leaving a remainder. With this knowledge, Egor can solve a problem that he o... | 1,900 | true | false | true | true | false | false | true | false | false | false | 542 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.