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
1931C
Problem - 1931C - Codeforces =============== xa0 ]( --- Finished β†’ Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
1,000
true
true
false
false
false
false
true
false
false
false
699
1346H
Alice and Bob are playing a game (yet again). They have two sequences of segments of the coordinate axis: a sequence of $$$n$$$ initial segments: $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$, and a sequence of $$$m$$$ terminal segments: $$$[L_1, R_1]$$$, $$$[L_2, R_2]$$$, ..., $$$[L_m, R_m]$$$. At the begi...
2,700
false
false
false
false
true
false
false
false
false
false
3,972
964B
There are _n_ incoming messages for Vasya. The _i_-th message is going to be received after _t__i_ minutes. Each message has a cost, which equals to _A_ initially. After being received, the cost of a message decreases by _B_ each minute (it can become negative). Vasya can read any message after receiving it at any mome...
1,300
true
false
false
false
false
false
false
false
false
false
5,843
1539D
Lena is the most economical girl in Moscow. So, when her dad asks her to buy some food for a trip to the country, she goes to the best store xa0β€” "PriceFixed". Here are some rules of that store: The store has an infinite number of items of every product. All products have the same price: $$$2$$$ rubles per item. For...
1,600
false
true
true
false
false
false
false
true
true
false
2,945
1957B
Given integers $$$n$$$ and $$$k$$$, construct a sequence of $$$n$$$ non-negative (i.e. $$$geq 0$$$) integers $$$a_1, a_2, ldots, a_n$$$ such that 1. $$$sumlimits_{i = 1}^n a_i = k$$$ 2. The number of $$$1$$$s in the binary representation of $$$a_1 a_2 ldots a_n$$$ is maximized, where $$$$$$ denotes the xa0β€” the numb...
1,100
false
true
true
false
false
true
false
false
false
false
532
773F
Problem - 773F - Codeforces =============== xa0 ") xa0β€” the size of the set. The second line contains _n_ distinct integers _a_1,u2009_a_2,u2009...,u2009_a__n_ (1u2009≀u2009_a__i_u2009≀u2009_max__a_)xa0β€” the elements of the set in increasing order. If you don't pay attention to the problem solution, it loo...
3,400
true
false
false
true
false
false
false
false
false
false
6,682
1702A
At the store, the salespeople want to make all prices round. In this problem, a number that is a power of $$$10$$$ is called a round number. For example, the numbers $$$10^0 = 1$$$, $$$10^1 = 10$$$, $$$10^2 = 100$$$ are round numbers, but $$$20$$$, $$$110$$$ and $$$256$$$ are not round numbers. So, if an item is worth ...
800
false
false
false
false
false
true
false
false
false
false
2,070
660E
Problem - 660E - Codeforces =============== xa0 ]( "Educational Codeforces Round 11") as the number of distinct subsequences of _a_ (including the empty subsequence). You are given two positive integers _n_ and _m_. Let _S_ be the set of all sequences of length _n_ consisting of numbers from 1 to _m_. Comp...
2,300
true
false
false
false
false
false
false
false
false
false
7,178
1775E
Petya and his friend, the robot Petya++, went to BFDMONCON, where the costume contest is taking place today. While walking through the festival, they came across a scientific stand named after Professor Oak and Golfball, where they were asked to solve an interesting problem. Given a sequence of numbers $$$a_1, a_2, dot...
2,100
false
true
true
false
false
false
false
false
false
false
1,630
1989B
You are given two strings $$$a$$$ and $$$b$$$, both consisting of lowercase Latin letters. A subsequence of a string is a string which can be obtained by removing several (possibly zero) characters from the original string. A substring of a string is a contiguous subsequence of that string. For example, consider the st...
1,200
false
true
false
false
false
false
true
false
false
false
340
714A
Problem - 714A - 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
true
false
true
false
false
false
false
false
false
false
6,961
1626B
You are given a decimal representation of an integer $$$x$$$ without leading zeros. You have to perform the following reduction on it exactly once: take two neighboring digits in $$$x$$$ and replace them with their sum without leading zeros (if the sum is $$$0$$$, it's represented as a single $$$0$$$). For example, if ...
1,100
false
true
false
false
false
false
false
false
false
false
2,486
168A
Some country is populated by wizards. They want to organize a demonstration. There are _n_ people living in the city, _x_ of them are the wizards who will surely go to the demonstration. Other city people (_n_u2009-u2009_x_ people) do not support the wizards and aren't going to go to the demonstration. We know that the...
900
true
false
true
false
false
false
false
false
false
false
9,190
906B
Students went into a class to write a test and sat in some way. The teacher thought: "Probably they sat in this order to copy works of each other. I need to rearrange them in such a way that students that were neighbors are not neighbors in a new seating." The class can be represented as a matrix with _n_ rows and _m_ ...
2,200
true
false
false
false
false
true
true
false
false
false
6,126
1367F2
# Flying Sort (Hard Version) Input file: standard input Output file: standard output Time limit: 2 seconds Memory limit: 256 megabytes This is a hard version of the problem. In this version, the given array can contain equal elements and the constraints on n are greater than in the easy version of the problem. You...
2,400
false
true
false
true
true
false
false
true
true
false
3,837
1650D
Petya got an array $$$a$$$ of numbers from $$$1$$$ to $$$n$$$, where $$$a[i]=i$$$. He performed $$$n$$$ operations sequentially. In the end, he received a new state of the $$$a$$$ array. At the $$$i$$$-th operation, Petya chose the first $$$i$$$ elements of the array and cyclically shifted them to the right an arbitrar...
1,300
true
false
true
false
false
true
true
false
false
false
2,372
663A
Problem - 663A - 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
true
false
false
false
true
false
false
false
false
7,163
451B
Being a programmer, you like arrays a lot. For your birthday, your friends have given you an array _a_ consisting of _n_ distinct integers. Unfortunately, the size of _a_ is too small. You want a bigger array! Your friends agree to give you a bigger array, but only if you are able to answer the following question corre...
1,300
false
false
true
false
false
false
false
false
true
false
8,036
476C
Problem - 476C - 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
false
false
false
false
7,926
65B
The History of Magic is perhaps the most boring subject in the Hogwarts school of Witchcraft and Wizardry. Harry Potter is usually asleep during history lessons, and his magical quill writes the lectures for him. Professor Binns, the history of magic teacher, lectures in such a boring and monotonous voice, that he has ...
1,700
false
true
true
false
false
false
true
false
false
false
9,645
10A
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes _P_1 watt per minute. _T_1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to _P_2 watt per minute. Finally, after _T...
900
false
false
true
false
false
false
false
false
false
false
9,945
998B
There are a lot of things which could be cutxa0β€” trees, paper, "the rope". In this problem you are going to cut a sequence of integers. There is a sequence of integers, which contains the equal number of even and odd numbers. Given a limited budget, you need to make maximum possible number of cuts such that each result...
1,200
false
true
false
true
false
false
false
false
true
false
5,712
1896C
You are given two arrays $$$a$$$ and $$$b$$$ of size $$$n$$$. The beauty of the arrays $$$a$$$ and $$$b$$$ is the number of indices $$$i$$$ such that $$$a_i > b_i$$$. You are also given an integer $$$x$$$. Determine whether it is possible to rearrange the elements of $$$b$$$ such that the beauty of the arrays becomes $...
1,400
false
true
false
false
false
true
false
true
true
false
935
1105B
Given a string $$$s$$$ of length $$$n$$$ and integer $$$k$$$ ($$$1 le k le n$$$). The string $$$s$$$ has a level $$$x$$$, if $$$x$$$ is largest non-negative integer, such that it's possible to find in $$$s$$$: $$$x$$$ non-intersecting (non-overlapping) substrings of length $$$k$$$, all characters of these $$$x$$$ sub...
1,100
false
false
true
false
false
false
true
false
false
false
5,179
187B
PMP is getting a warrior. He is practicing a lot, but the results are not acceptable yet. This time instead of programming contests, he decided to compete in a car racing to increase the spirit of victory. He decides to choose a competition that also exhibits algorithmic features. AlgoRace is a special league of car ra...
1,800
false
false
false
true
false
false
false
false
false
false
9,096
1070K
Polycarp took $$$n$$$ videos, the duration of the $$$i$$$-th video is $$$a_i$$$ seconds. The videos are listed in the chronological order, i.e. the $$$1$$$-st video is the earliest, the $$$2$$$-nd video is the next, ..., the $$$n$$$-th video is the last. Now Polycarp wants to publish exactly $$$k$$$ ($$$1 le k le n$$$)...
1,100
false
false
true
false
false
false
false
false
false
false
5,357
1098B
Problem - 1098B - 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,100
true
true
false
false
false
true
true
false
false
false
5,215
1534B
Little Dormi received a histogram with $$$n$$$ bars of height $$$a_1, a_2, ldots, a_n$$$ for Christmas. However, the more he played with his new histogram, the more he realized its imperfections, so today he wanted to modify it to his liking. To modify the histogram, Little Dormi is able to perform the following operat...
1,100
true
true
true
false
false
false
false
false
false
false
2,982
679B
Limak is a little polar bear. He plays by building towers from blocks. Every block is a cube with positive integer length of side. Limak has infinitely many blocks of each side length. A block with side _a_ has volume _a_3. A tower consisting of blocks with sides _a_1,u2009_a_2,u2009...,u2009_a__k_ has the total volume...
2,200
false
true
false
true
false
false
false
true
false
false
7,109
1216B
Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed $$$n$$$ cans in a row on a table. Cans are numbered from left to right from $$$1$$$ to $$$n$$$. Vasya has to knock down each can exactly once to finish the exercise. He is allowed to choose the or...
900
false
true
true
false
false
false
false
false
true
false
4,596
1983D
Given two arrays of distinct positive integers $$$a$$$ and $$$b$$$ of length $$$n$$$, we would like to make both the arrays the same. Two arrays $$$x$$$ and $$$y$$$ of length $$$k$$$ are said to be the same when for all $$$1 le i le k$$$, $$$x_i = y_i$$$. Now in one move, you can choose some index $$$l$$$ and $$$r$$$ i...
1,700
true
true
false
false
true
true
false
false
true
false
387
886C
A very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, his exploration is just walking through the catacombs. Catacombs consist of several rooms and bidirectional passages between some pairs of them. Some passages can connect a room to itself and since the passages a...
1,300
false
true
true
false
false
false
false
false
false
false
6,206
148D
The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains to watch fairies dancing in the moonlight, while the princess thinks they should just go to bed early. They are desperate to come to an amicable agreement, so they decide to leave this up to chanc...
1,800
true
false
false
true
false
false
false
false
false
false
9,283
1093A
Mishka got a six-faced dice. It has integer numbers from $$$2$$$ to $$$7$$$ written on its faces (all numbers on faces are different, so this is an almost usual dice). Mishka wants to get exactly $$$x$$$ points by rolling his dice. The number of points is just a sum of numbers written at the topmost face of the dice fo...
800
true
false
false
false
false
false
false
false
false
false
5,244
1585D
Petya has an array of integers $$$a_1, a_2, ldots, a_n$$$. He only likes sorted arrays. Unfortunately, the given array could be arbitrary, so Petya wants to sort it. Petya likes to challenge himself, so he wants to sort array using only $$$3$$$-cycles. More formally, in one operation he can pick $$$3$$$ pairwise distin...
1,900
true
false
false
false
true
false
false
false
false
false
2,699
306D
Problem - 306D - Codeforces =============== xa0 β€” the number of the polygon vertexes. Output Print _n_ lines, containing the coordinates of the vertexes of the _n_-gon "_x__i_ _y__i_" in the counter clockwise order. The coordinates of the vertexes shouldn't exceed 106 in their absolute value. The side lengths...
2,300
false
false
false
false
false
true
false
false
false
false
8,608
1100B
Arkady coordinates rounds on some not really famous competitive programming platform. Each round features $$$n$$$ problems of distinct difficulty, the difficulties are numbered from $$$1$$$ to $$$n$$$. To hold a round Arkady needs $$$n$$$ new (not used previously) problems, one for each difficulty. As for now, Arkady c...
1,300
false
false
true
false
true
false
false
false
false
false
5,205
542D
It's tough to be a superhero. And it's twice as tough to resist the supervillain who is cool at math. Suppose that you're an ordinary Batman in an ordinary city of Gotham. Your enemy Joker mined the building of the city administration and you only have several minutes to neutralize the charge. To do that you should ent...
2,600
true
false
false
true
false
false
false
false
false
false
7,672
631C
Each month Blake gets the report containing main economic indicators of the company "Blake Technologies". There are _n_ commodities produced by the company. For each of them there is exactly one integer in the final report, that denotes corresponding revenue. Before the report gets to Blake, it passes through the hands...
1,700
false
false
false
false
true
false
false
false
true
false
7,284
44B
Problem - 44B - 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,500
false
false
true
false
false
false
false
false
false
false
9,768
1621I
Consider an array of integers $$$C = [c_1, c_2, ldots, c_n]$$$ of length $$$n$$$. Let's build the sequence of arrays $$$D_0, D_1, D_2, ldots, D_{n}$$$ of length $$$n+1$$$ in the following way: The first element of this sequence will be equals $$$C$$$: $$$D_0 = C$$$. For each $$$1 leq i leq n$$$ array $$$D_i$$$ will b...
3,500
false
false
false
false
true
false
false
false
false
false
2,512
901C
You are given an undirected graph with _n_ vertices. There are no edge-simple cycles with the even length in it. In other words, there are no cycles of even length that pass each edge at most once. Let's enumerate vertices from 1 to _n_. You have to answer _q_ queries. Each query is described by a segment of vertices [...
2,300
false
false
false
false
true
false
false
true
false
true
6,139
1804H
Lara has a safe that is locked with a circle-shaped code lock that consists of a rotating arrow, a static circumference around the arrow, an input screen, and an input button. The circumference of the lock is split into $$$k$$$ equal sections numbered from $$$1$$$ to $$$k$$$ in clockwise order. Arrow always points to o...
3,300
false
false
false
true
false
false
false
false
false
false
1,450
1884A
A positive integer is called $$$k$$$-beautiful, if the digit sum of the decimal representation of this number is divisible by $$$k^{dagger}$$$. For example, $$$9272$$$ is $$$5$$$-beautiful, since the digit sum of $$$9272$$$ is $$$9 + 2 + 7 + 2 = 20$$$. You are given two integers $$$x$$$ and $$$k$$$. Please find the sma...
800
true
true
false
false
false
false
true
false
false
false
983
217E
Professor Bajtocy is conducting experiments on alien DNA. He has discovered that it is subject to repetitive mutations β€” each mutation happens in the same way: some continuous subsequence of the alien DNA becomes active, copies itself, the copy gets mangled and inserts itself right after the original subsequence. The m...
2,800
false
false
false
false
true
false
false
false
false
false
8,967
982C
Problem - 982C - Codeforces =============== xa0 ]( --- Finished β†’ Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
1,500
false
true
false
true
false
false
false
false
false
true
5,790
981G
In the School of Magic in Dirtpolis a lot of interesting objects are studied on Computer Science lessons. Consider, for example, the magic multiset. If you try to add an integer to it that is already presented in the multiset, each element in the multiset duplicates. For example, if you try to add the integer $$$2$$$ t...
2,500
false
false
false
false
true
false
false
false
false
false
5,794
1362B
Among Johnny's numerous hobbies, there are two seemingly harmless ones: applying bitwise operations and sneaking into his dad's office. As it is usually the case with small children, Johnny is unaware that combining these two activities can get him in a lot of trouble. There is a set $$$S$$$ containing very important n...
1,200
false
false
false
false
false
false
true
false
false
false
3,870
58C
On Bertown's main street _n_ trees are growing, the tree number _i_ has the height of _a__i_ meters (1u2009≀u2009_i_u2009≀u2009_n_). By the arrival of the President of Berland these trees were decided to be changed so that their heights formed a beautiful sequence. This means that the heights of trees on ends (the 1st ...
1,800
false
false
false
false
false
false
true
false
false
false
9,683
818C
Yet another round on DecoForces is coming! Grandpa Maks wanted to participate in it but someone has stolen his precious sofa! And how can one perform well with such a major loss? Fortunately, the thief had left a note for Grandpa Maks. This note got Maks to the sofa storehouse. Still he had no idea which sofa belongs t...
2,000
false
false
true
false
false
false
true
false
false
false
6,485
1873G
You are given a string $$$s$$$ made up of characters $$$ exttt{A}$$$ and $$$ exttt{B}$$$. Initially you have no coins. You can perform two types of operations: Pick a substring$$$^dagger$$$ $$$ exttt{AB}$$$, change it to $$$ exttt{BC}$$$, and get a coin. Pick a substring$$$^dagger$$$ $$$ exttt{BA}$$$, change it to $$...
1,500
false
true
false
false
false
true
false
false
false
false
1,038
69B
In Chelyabinsk lives a much respected businessman Nikita with a strange nickname "Boss". Once Nikita decided to go with his friend Alex to the Summer Biathlon World Cup. Nikita, as a very important person, received a token which allows to place bets on each section no more than on one competitor. To begin with friends ...
1,200
false
true
true
false
false
false
false
false
false
false
9,625
1793F
Kostya and Zhenya β€” the creators of the band "Paper" β€” after the release of the legendary album decided to create a new band "Day movers", for this they need to find two new people. They invited $$$n$$$ people to the casting. The casting will last $$$q$$$ days. On the $$$i$$$th of the days, Kostya and Zhenya want to fi...
2,600
false
false
true
false
true
false
true
false
false
false
1,515
2023F
In a desert city with a hilly landscape, the city hall decided to level the road surface by purchasing a dump truck. The road is divided into $$$n$$$ sections, numbered from $$$1$$$ to $$$n$$$ from left to right. The height of the surface in the $$$i$$$-th section is equal to $$$a_i$$$. If the height of the $$$i$$$-th ...
3,500
true
true
false
false
true
false
false
false
false
false
126
1968B
You are given two binary strings $$$a$$$ and $$$b$$$. A binary string is a string consisting of the characters '0' and '1'. Your task is to determine the maximum possible number $$$k$$$ such that a prefix of string $$$a$$$ of length $$$k$$$ is a subsequence of string $$$b$$$. A sequence $$$a$$$ is a subsequence of a se...
800
false
true
false
false
false
false
false
false
false
false
499
1928B
Vasya has two hobbiesxa0β€” adding permutations$$$^{dagger}$$$ to arrays and finding the most frequently occurring element. Recently, he found an array $$$a$$$ and decided to find out the maximum number of elements equal to the same number in the array $$$a$$$ that he can obtain after adding some permutation to the array...
1,200
false
true
false
false
false
false
false
true
true
false
722
1349F1
Note that the only differences between easy and hard versions are the constraints on $$$n$$$ and the time limit. You can make hacks only if all versions are solved. Slime is interested in sequences. He defined good positive integer sequences $$$p$$$ of length $$$n$$$ as follows: For each $$$k>1$$$ that presents in $$$...
3,100
true
false
false
true
false
false
false
false
false
false
3,959
13C
Problem - 13C - Codeforces =============== xa0 β€” the length of the initial sequence. The following _N_ lines contain one integer each β€” elements of the sequence. These numbers do not exceed 109 by absolute value. Output Output one integer β€” minimum number of steps required to achieve the goal. Examples In...
2,200
false
false
false
true
false
false
false
false
true
false
9,928
1424M
While exploring the old caves, researchers found a book, or more precisely, a stash of mixed pages from a book. Luckily, all of the original pages are present and each page contains its number. Therefore, the researchers can reconstruct the book. After taking a deeper look into the contents of these pages, linguists th...
2,200
false
false
false
false
false
false
false
false
true
true
3,548
698A
Vasya has _n_ days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this _n_ days: whether that gym opened and whether a contest was carried out in the Internet on that day. For the _i_-th day there are four options: 1. on this day the gym is closed ...
1,400
false
false
false
true
false
false
false
false
false
false
7,033
1497B
You are given an array $$$a_1, a_2, ldots, a_n$$$ consisting of $$$n$$$ positive integers and a positive integer $$$m$$$. You should divide elements of this array into some arrays. You can order the elements in the new arrays as you want. Let's call an array $$$m$$$-divisible if for each two adjacent numbers in the arr...
1,200
true
true
false
false
false
true
false
false
false
false
3,187
1106F
Lunar New Year is approaching, and Bob received a gift from his friend recently β€” a recursive sequence! He loves this sequence very much and wants to play with it. Let $$$f_1, f_2, ldots, f_i, ldots$$$ be an infinite sequence of positive integers. Bob knows that for $$$i > k$$$, $$$f_i$$$ can be obtained by the followi...
2,400
true
false
false
false
false
false
false
false
false
false
5,170
1539F
Vasya has an array of $$$n$$$ integers $$$a_1, a_2, ldots, a_n$$$. Vasya thinks that all numbers in his array are strange for some reason. To calculate how strange the $$$i$$$-th number is, Vasya created the following algorithm. He chooses a subsegment $$$a_l, a_{l+1}, ldots, a_r$$$, such that $$$1 le l le i le r le n$...
2,600
false
true
false
false
true
false
false
false
true
false
2,943
1973A
Three friends gathered to play a few games of chess together. In every game, two of them play against each other. The winner gets $$$2$$$ points while the loser gets $$$0$$$, and in case of a draw, both players get $$$1$$$ point each. Note that the same pair of players could have played any non-negative number of times...
900
true
false
true
true
false
false
true
false
false
false
455
1800E1
This is an easy version of the problem. In this version, $$$k$$$ is always $$$3$$$. The chief wizard of the Wizengamot once caught the evil wizard Drahyrt, but the evil wizard has returned and wants revenge on the chief wizard. So he stole spell $$$s$$$ from his student Harry. The spellxa0β€” is a $$$n$$$-length string o...
1,400
false
true
false
false
false
true
true
false
false
true
1,470
505E
Mr. Kitayuta's garden is planted with _n_ bamboos. (Bamboos are tall, fast-growing tropical plants with hollow stems.) At the moment, the height of the _i_-th bamboo is _h__i_ meters, and it grows _a__i_ meters at the end of each day. Actually, Mr. Kitayuta hates these bamboos. He once attempted to cut them down, but f...
2,900
false
true
false
false
false
false
false
true
false
false
7,819
1119D
Miyako came to the flea kingdom with a ukulele. She became good friends with local flea residents and played beautiful music for them every day. In return, the fleas made a bigger ukulele for her: it has $$$n$$$ strings, and each string has $$$(10^{18} + 1)$$$ frets numerated from $$$0$$$ to $$$10^{18}$$$. The fleas us...
1,800
false
false
false
false
false
false
false
true
true
false
5,091
1174C
Problem - 1174C - 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,300
false
false
false
false
false
true
false
false
false
false
4,849
496B
Problem - 496B - Codeforces =============== xa0 ]( --- Finished β†’ Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - s...
1,500
false
false
true
false
false
true
true
false
false
false
7,850
1791A
Problem - 1791A - Codeforces =============== xa0 ]( --- Finished β†’ Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
800
false
false
true
false
false
false
false
false
false
false
1,535
952G
In this problem you will write a simple code generator for a 2D programming language derived from , and each 'X' character is converted a Brainfuck instruction to be executed. The instruction is defined by the left, top and right neighbors of the 'X' character using the following conversion table: You are given a strin...
2,200
false
false
false
false
false
true
false
false
false
false
5,910
601B
A function is called Lipschitz continuous if there is a real constant _K_ such that the inequality _f_(_x_)u2009-u2009_f_(_y_)u2009≀u2009_K_Β·_x_u2009-u2009_y_ holds for all . We'll deal with a more... discrete version of this term. For an array , we define it's Lipschitz constant as follows: In other words, is the smal...
2,100
true
false
false
false
true
false
false
false
false
false
7,439
1784C
This is the hard version of the problem. In this version, you need to find the answer for every prefix of the monster array. In a computer game, you are fighting against $$$n$$$ monsters. Monster number $$$i$$$ has $$$a_i$$$ health points, all $$$a_i$$$ are integers. A monster is alive while it has at least $$$1$$$ hea...
2,200
false
true
false
false
true
false
false
false
false
false
1,570
1689C
Byteland is a beautiful land known because of its beautiful trees. Misha has found a binary tree with $$$n$$$ vertices, numbered from $$$1$$$ to $$$n$$$. A binary tree is an acyclic connected bidirectional graph containing $$$n$$$ vertices and $$$n - 1$$$ edges. Each vertex has a degree at most $$$3$$$, whereas the roo...
1,600
false
false
false
true
false
false
false
false
false
false
2,146
1840D
In a small town, there is a workshop specializing in woodwork. Since the town is small, only three carvers work there. Soon, a wooden toy festival is planned in the town. The workshop employees want to prepare for it. They know that $$$n$$$ people will come to the workshop with a request to make a wooden toy. People ar...
1,400
false
true
false
false
false
false
false
true
true
false
1,250
907A
A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car and she likes it. Moreover, son bear can climb into the smallest car and he likes it. It's known that the largest car is strictly larg...
1,300
false
false
true
false
false
false
true
false
false
false
6,122
797D
Let _T_ be arbitrary binary tree β€” tree, every vertex of which has no more than two children. Given tree is rooted, so there exists only one vertex which doesn't have a parent β€” it's the root of a tree. Every vertex has an integer number written on it. Following algorithm is run on every value from the tree _T_: 1. Set...
2,100
false
false
false
false
true
false
false
false
false
false
6,584
628E
A tourist wants to visit country Zeydabad for Zbazi (a local game in Zeydabad). The country Zeydabad is a rectangular table consisting of _n_ rows and _m_ columns. Each cell on the country is either 'z' or '.'. The tourist knows this country is named Zeydabad because there are lots of ''Z-pattern"s in the country. A ''...
2,300
false
false
true
false
true
false
false
false
false
false
7,311
1346G
You have two IP cameras of the same model. Each camera can take photos starting from some moment of time with a fixed period. You can freely choose the starting moment but you can choose the period only as one of $$$k$$$ values $$$p_1, p_2, dots, p_k$$$ which are chosen by the camera's manufacturer. You have $$$n$$$ mo...
2,300
true
false
false
false
false
false
false
false
false
false
3,973
993D
You need to execute several tasks, each associated with number of processors it needs, and the compute power it will consume. You have sufficient number of analog computers, each with enough processors for any task. Each computer can execute up to one task at a time, and no more than two tasks total. The first task can...
2,500
false
true
false
true
false
false
false
true
false
false
5,731
460E
Roland loves growing flowers. He has recently grown a beautiful rose at point (0,u20090) of the Cartesian coordinate system. The rose is so beautiful that Roland is afraid that the evil forces can try and steal it. To protect the rose, Roland wants to build _n_ watch towers. Let's assume that a tower is a point on the ...
2,700
true
false
false
false
false
false
true
false
true
false
7,997
1515G
In Fire City, there are $$$n$$$ intersections and $$$m$$$ one-way roads. The $$$i$$$-th road goes from intersection $$$a_i$$$ to $$$b_i$$$ and has length $$$l_i$$$ miles. There are $$$q$$$ cars that may only drive along those roads. The $$$i$$$-th car starts at intersection $$$v_i$$$ and has an odometer that begins at ...
2,700
true
false
false
false
false
false
false
false
false
true
3,085
1559B
As their story unravels, a timeless tale is told once again... Shirahime, a friend of Mocha's, is keen on playing the music game Arcaea and sharing Mocha interesting puzzles to solve. This day, Shirahime comes up with a new simple puzzle and wants Mocha to solve them. However, these puzzles are too easy for Mocha to so...
900
false
true
false
true
false
false
false
false
false
false
2,835
1211H
There are $$$n$$$ cities and $$$n-1$$$ two-way roads in Treeland. Each road connects a pair of different cities. From any city you can drive to any other, moving only along the roads. Cities are numbered from $$$1$$$ to $$$n$$$. Yes, of course, you recognized an undirected tree in this description. The government plans...
3,100
false
false
false
true
false
false
false
true
false
false
4,621
1995C
ikrpprpp found an array $$$a$$$ consisting of integers. He likes justice, so he wants to make $$$a$$$ fairxa0β€” that is, make it non-decreasing. To do that, he can perform an act of justice on an index $$$1 le i le n$$$ of the array, which will replace $$$a_i$$$ with $$$a_i ^ 2$$$ (the element at position $$$i$$$ with i...
1,800
true
true
true
false
false
true
true
false
false
false
294
413C
Jeopardy!' is an intellectual game where players answer questions and earn points. Company Q conducts a simplified 'Jeopardy!' tournament among the best IT companies. By a lucky coincidence, the old rivals made it to the finals: company R1 and company R2. The finals will have _n_ questions, _m_ of them are auction ques...
1,400
true
true
false
false
false
false
false
false
false
false
8,172
919D
You are given a graph with $$$n$$$ nodes and $$$m$$$ directed edges. One lowercase letter is assigned to each node. We define a path's value as the number of the most frequently occurring letter. For example, if letters on a path are "abaca", then the value of that path is $$$3$$$. Your task is find a path whose value ...
1,700
false
false
false
true
false
false
false
false
false
true
6,053
1062C
JATC loves Banh-mi (a Vietnamese food). His affection for Banh-mi is so much that he always has it for breakfast. This morning, as usual, he buys a Banh-mi and decides to enjoy it in a special way. First, he splits the Banh-mi into $$$n$$$ parts, places them on a row and numbers them from $$$1$$$ through $$$n$$$. For e...
1,600
true
true
true
false
false
false
false
false
false
false
5,400
1580E
Because the railway system in Gensokyo is often congested, as an enthusiastic engineer, Kawasiro Nitori plans to construct more railway to ease the congestion. There are $$$n$$$ stations numbered from $$$1$$$ to $$$n$$$ and $$$m$$$ two-way railways in Gensokyo. Every two-way railway connects two different stations and ...
3,400
false
false
false
false
true
true
true
false
false
true
2,729
875A
Problem - 875A - 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
true
false
false
false
6,248
1850F
Mihai and Slavic were looking at a group of $$$n$$$ frogs, numbered from $$$1$$$ to $$$n$$$, all initially located at point $$$0$$$. Frog $$$i$$$ has a hop length of $$$a_i$$$. Each second, frog $$$i$$$ hops $$$a_i$$$ units forward. Before any frogs start hopping, Slavic and Mihai can place exactly one trap in a coordi...
1,300
true
false
true
false
false
false
true
false
false
false
1,177
1946B
You have an array $$$a$$$ of $$$n$$$ integers. You perform exactly $$$k$$$ operations on it. In one operation, you select any contiguous subarray of the array $$$a$$$ (possibly empty) and insert the sum of this subarray anywhere in the array. Your task is to find the maximum possible sum of the array after $$$k$$$ such...
1,100
true
true
false
true
false
false
false
false
false
false
604
1748B
A non-empty digit string is diverse if the number of occurrences of each character in it doesn't exceed the number of distinct characters in it. For example: string "7" is diverse because 7 appears in it $$$1$$$ time and the number of distinct characters in it is $$$1$$$; string "77" is not diverse because 7 appears ...
1,400
false
false
true
false
false
false
true
false
false
false
1,796
712B
Memory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string _s_ with his directions for motion: An 'L' indicates he should move one unit left. An 'R' indicates he should move one unit right. A 'U' indicates he should move one unit up. A 'D' indicates he should move one uni...
1,100
false
false
true
false
false
false
false
false
false
false
6,970
662C
Problem - 662C - Codeforces =============== xa0 ]( "The Final Round of CROC 2016 and Codeforces Round #347") xa0β€” the number of rows and the number of columns, respectively. Then _n_ lines follows with the descriptions of the rows. Each line has length _m_ and contains only digits '0' and '1'. Output Outpu...
2,600
true
false
false
true
false
false
true
false
false
false
7,166
898C
Vasya has several phone books, in which he recorded the telephone numbers of his friends. Each of his friends can have one or several phone numbers. Vasya decided to organize information about the phone numbers of friends. You will be given _n_ strings β€” all entries from Vasya's phone books. Each entry starts with a fr...
1,400
false
false
true
false
false
false
false
false
false
false
6,156
319C
Kalila and Dimna are two jackals living in a huge jungle. One day they decided to join a logging factory in order to make money. The manager of logging factory wants them to go to the jungle and cut _n_ trees with heights _a_1,u2009_a_2,u2009...,u2009_a__n_. They bought a chain saw from a shop. Each time they use the c...
2,100
false
false
false
true
false
false
false
false
false
false
8,556
1034B
Problem - 1034B - 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
false
false
false
false
true
true
false
false
false
5,527
1945A
The organizing committee plans to take the participants of the Olympiad on a hike after the tour. Currently, the number of tents needed to be taken is being calculated. It is known that each tent can accommodate up to $$$3$$$ people. Among the participants, there are $$$a$$$ introverts, $$$b$$$ extroverts, and $$$c$$$ ...
800
true
true
false
false
false
false
false
false
false
false
613
2033F
Problem - 2033F - 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,800
true
false
false
false
false
false
true
false
false
false
63