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
690F2
Heidi got tired of deciphering the prophecy hidden in the Tree of Life and decided to go back to her headquarters, rest a little and try there. Of course, she cannot uproot the Tree and take it with her, so she made a drawing of the Tree on a piece of paper. On second thought, she made more identical drawings so as to ...
2,700
false
false
false
false
false
true
false
false
false
false
7,049
1671F
Problem - 1671F - 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,700
true
false
false
true
false
false
true
false
false
false
2,246
1446E
A patient has been infected with an unknown disease. His body can be seen as an infinite grid of triangular cells which looks as follows: Two cells are neighboring if they share a side. Therefore, each cell ($$$x$$$, $$$y$$$) has exactly three neighbors: ($$$x+1$$$, $$$y$$$) ($$$x-1$$$, $$$y$$$) ($$$x+1$$$, $$$y-1$$...
3,500
false
false
false
false
false
true
false
false
false
false
3,442
1619E
Dmitry has an array of $$$n$$$ non-negative integers $$$a_1, a_2, dots, a_n$$$. In one operation, Dmitry can choose any index $$$j$$$ ($$$1 le j le n$$$) and increase the value of the element $$$a_j$$$ by $$$1$$$. He can choose the same index $$$j$$$ multiple times. For each $$$i$$$ from $$$0$$$ to $$$n$$$, determine w...
1,700
true
true
true
true
true
true
false
false
true
false
2,531
465B
Over time, Alexey's mail box got littered with too many letters. Some of them are read, while others are unread. Alexey's mail program can either show a list of all letters or show the content of a single letter. As soon as the program shows the content of an unread letter, it becomes read letter (if the program shows ...
1,000
false
false
true
false
false
false
false
false
false
false
7,978
1209F
Koala Land consists of $$$m$$$ bidirectional roads connecting $$$n$$$ cities. The roads are numbered from $$$1$$$ to $$$m$$$ by order in input. It is guaranteed, that one can reach any city from every other city. Koala starts traveling from city $$$1$$$. Whenever he travels on a road, he writes its number down in his n...
2,600
false
false
false
false
true
false
false
false
false
true
4,640
1819B
Anton plays his favorite game "Defense of The Ancients 2" for his favorite heroxa0β€” The Butcher. Now he wants to make his own dinner. To do this he will take a rectangle of height $$$h$$$ and width $$$w$$$, then make a vertical or horizontal cut so that both resulting parts have integer sides. After that, he will put o...
1,900
false
true
true
false
false
false
false
false
true
false
1,364
1811D
The girl Umka loves to travel and participate in math olympiads. One day she was flying by plane to the next olympiad and out of boredom explored a huge checkered sheet of paper. Denote the $$$n$$$-th Fibonacci number as $$$F_n = begin{cases} 1, & n = 0; 1, & n = 1; F_{n-2} + F_{n-1}, & n ge 2. end{cases}$$$ A checke...
1,600
true
false
true
false
false
true
false
false
false
false
1,402
296A
Problem - 296A - 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
true
false
false
false
false
false
false
false
false
8,646
1696G
Suppose you are given a 1-indexed sequence $$$a$$$ of non-negative integers, whose length is $$$n$$$, and two integers $$$x$$$, $$$y$$$. In consecutive $$$t$$$ seconds ($$$t$$$ can be any positive real number), you can do one of the following operations: Select $$$1le i<n$$$, decrease $$$a_i$$$ by $$$xcdot t$$$, and d...
3,300
true
false
false
false
true
false
true
false
false
false
2,102
1296D
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp. You and your opponent are fighting these monsters. Firstly, you and your oppo...
1,500
false
true
false
false
false
false
false
false
true
false
4,214
767A
According to an old legeng, a long time ago Ankh-Morpork residents did something wrong to miss Fortune, and she cursed them. She said that at some time _n_ snacks of distinct sizes will fall on the city, and the residents should build a Snacktower of them by placing snacks one on another. Of course, big snacks should b...
1,100
false
false
true
false
true
false
false
false
false
false
6,718
813E
As you might remember from our previous rounds, Vova really likes computer games. Now he is playing a strategy game known as Rage of Empires. In the game Vova can hire _n_ different warriors; _i_th warrior has the type _a__i_. Vova wants to create a balanced army hiring some subset of warriors. An army is called balanc...
2,200
false
false
false
false
true
false
false
true
false
false
6,507
400D
Dima took up the biology of bacteria, as a result of his experiments, he invented _k_ types of bacteria. Overall, there are _n_ bacteria at his laboratory right now, and the number of bacteria of type _i_ equals _c__i_. For convenience, we will assume that all the bacteria are numbered from 1 to _n_. The bacteria of ty...
2,000
false
false
false
false
false
false
false
false
false
true
8,224
1768B
You are given a permutation$$$^dagger$$$ $$$p$$$ of length $$$n$$$ and a positive integer $$$k le n$$$. In one operation, you: Choose $$$k$$$ distinct elements $$$p_{i_1}, p_{i_2}, ldots, p_{i_k}$$$. Remove them and then add them sorted in increasing order to the end of the permutation. For example, if $$$p = [2,5,1,...
900
true
true
false
false
false
false
false
false
false
false
1,690
63B
In a strategic computer game "Settlers II" one has to build defense structures to expand and protect the territory. Let's take one of these buildings. At the moment the defense structure accommodates exactly _n_ soldiers. Within this task we can assume that the number of soldiers in the defense structure won't either i...
1,200
false
false
true
false
false
false
false
false
false
false
9,659
128C
In this task Anna and Maria play the following game. Initially they have a checkered piece of paper with a painted _n_u2009Γ—u2009_m_ rectangle (only the border, no filling). Anna and Maria move in turns and Anna starts. During each move one should paint inside the last-painted rectangle a new lesser rectangle (along th...
2,000
false
false
false
true
false
false
false
false
false
false
9,368
1667E
Consider every tree (connected undirected acyclic graph) with $$$n$$$ vertices ($$$n$$$ is odd, vertices numbered from $$$1$$$ to $$$n$$$), and for each $$$2 le i le n$$$ the $$$i$$$-th vertex is adjacent to exactly one vertex with a smaller index. For each $$$i$$$ ($$$1 le i le n$$$) calculate the number of trees for ...
3,000
true
false
false
true
false
false
false
false
false
false
2,269
1617D2
This is an interactive problem. The only difference between the easy and hard version is the limit on number of questions. There are $$$n$$$ players labelled from $$$1$$$ to $$$n$$$. It is guaranteed that $$$n$$$ is a multiple of $$$3$$$. Among them, there are $$$k$$$ impostors and $$$n-k$$$ crewmates. The number of im...
2,400
true
false
true
false
false
true
false
false
false
false
2,544
1990D
You are given an array $$$a$$$ of size $$$n$$$. There is an $$$n imes n$$$ grid. In the $$$i$$$-th row, the first $$$a_i$$$ cells are black and the other cells are white. In other words, note $$$(i,j)$$$ as the cell in the $$$i$$$-th row and $$$j$$$-th column, cells $$$(i,1), (i,2), ldots, (i,a_i)$$$ are black, and ce...
1,800
false
true
true
true
false
false
true
false
false
false
332
724G
You are given an undirected graph, constisting of _n_ vertices and _m_ edges. Each edge of the graph has some non-negative integer written on it. Let's call a triple (_u_,u2009_v_,u2009_s_) interesting, if 1u2009≀u2009_u_u2009<u2009_v_u2009≀u2009_n_ and there is a path (possibly non-simple, i.e. it can visit the same v...
2,600
true
false
false
false
false
false
false
false
false
true
6,908
115D
Let's define an unambiguous arithmetic expression (UAE) as follows. All non-negative integers are UAE's. Integers may have leading zeroes (for example, 0000 and 0010 are considered valid integers). If _X_ and _Y_ are two UAE's, then "(_X_)u2009+u2009(_Y_)", "(_X_)u2009-u2009(_Y_)", "(_X_)u2009*u2009(_Y_)", and "(_X_)...
2,600
false
false
false
true
false
false
false
false
false
false
9,425
1473F
Problem - 1473F - 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,700
true
false
false
false
false
false
false
false
false
false
3,312
1004C
Since Sonya is interested in robotics too, she decided to construct robots that will read and recognize numbers. Sonya has drawn $$$n$$$ numbers in a row, $$$a_i$$$ is located in the $$$i$$$-th position. She also has put a robot at each end of the row (to the left of the first number and to the right of the last number...
1,400
false
false
true
false
false
true
false
false
false
false
5,666
281B
Problem - 281B - 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
false
true
false
false
false
true
false
false
false
8,709
1042C
Problem - 1042C - Codeforces =============== xa0 ]( --- Finished β†’ Virtual participation Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests. If you've seen these problems, a virtual contest is not for you - ...
1,700
true
true
false
false
false
true
false
false
false
false
5,487
1272A
Three friends are going to meet each other. Initially, the first friend stays at the position $$$x = a$$$, the second friend stays at the position $$$x = b$$$ and the third friend stays at the position $$$x = c$$$ on the coordinate axis $$$Ox$$$. In one minute each friend independently from other friends can change the...
900
true
true
false
false
false
false
true
false
true
false
4,329
1907B
Polycarp has a problem β€” his laptop keyboard is broken. Now, when he presses the 'b' key, it acts like an unusual backspace: it deletes the last (rightmost) lowercase letter in the typed string. If there are no lowercase letters in the typed string, then the press is completely ignored. Similarly, when he presses the '...
1,000
false
false
true
false
true
false
false
false
false
false
863
1491C
There is a trampoline park with $$$n$$$ trampolines in a line. The $$$i$$$-th of which has strength $$$S_i$$$. Pekora can jump on trampolines in multiple passes. She starts the pass by jumping on any trampoline of her choice. If at the moment Pekora jumps on trampoline $$$i$$$, the trampoline will launch her to positio...
1,700
false
true
true
true
true
false
true
false
false
false
3,220
1744D
You are given an array of positive integers $$$a_1, a_2, ldots, a_n$$$. Make the product of all the numbers in the array (that is, $$$a_1 cdot a_2 cdot ldots cdot a_n$$$) divisible by $$$2^n$$$. You can perform the following operation as many times as you like: select an arbitrary index $$$i$$$ ($$$1 leq i leq n$$$) a...
1,200
true
true
false
false
false
false
false
false
true
false
1,814
1415D
Arkady owns a non-decreasing array $$$a_1, a_2, ldots, a_n$$$. You are jealous of its beauty and want to destroy this property. You have a so-called XOR-gun that you can use one or more times. In one step you can select two consecutive elements of the array, let's say $$$x$$$ and $$$y$$$, remove them from the array and...
2,000
false
false
false
false
false
true
true
false
false
false
3,605
2037F
You have obtained the new limited event character Xilonen. You decide to use her in combat. There are $$$n$$$ enemies in a line. The $$$i$$$'th enemy from the left has health $$$h_i$$$ and is currently at position $$$x_i$$$. Xilonen has an attack damage of $$$m$$$, and you are ready to defeat the enemies with her. Xilo...
2,100
true
false
false
false
true
false
false
true
true
false
40
1163B1
This problem is same as the next one, but has smaller constraints. Shiro's just moved to the new house. She wants to invite all friends of her to the house so they can play monopoly. However, her house is too small, so she can only invite one friend at a time. For each of the $$$n$$$ days since the day Shiro moved to t...
1,500
false
false
true
false
true
false
false
false
false
false
4,903
1883G1
This is the easy version of the problem. The only difference is that in this version $$$m = 1$$$. You are given two arrays of integers $$$a_1, a_2, ldots, a_n$$$ and $$$b_1, b_2, ldots, b_n$$$. Before applying any operations, you can reorder the elements of each array as you wish. Then, in one operation, you will perfo...
1,400
false
true
false
false
false
false
false
true
false
false
985
878C
Recently a tournament in _k_ kinds of sports has begun in Berland. Vasya wants to make money on the bets. The scheme of the tournament is very mysterious and not fully disclosed. Competitions are held back to back, each of them involves two sportsmen who have not left the tournament yet. Each match can be held in any o...
2,700
false
false
false
false
true
false
false
false
false
true
6,232
989C
As the boat drifts down the river, a wood full of blossoms shows up on the riverfront."I've been here once," Mino exclaims with delight, "it's breathtakingly amazing." "What is it like?" "Look, Kanno, you've got your paintbrush, and I've got my words. Have a try, shall we?" There are four kinds of flowers in the wood, ...
1,800
false
false
false
false
false
true
false
false
false
true
5,755
1286E
Note For convenience, we will call "suspicious" those subsegments for which the corresponding lines are prefixes of $$$S$$$, that is, those whose suspiciousness may not be zero. As a result of decryption in the first example, after all requests, the string $$$S$$$ is equal to "abacaba", and all $$$w_i = 1$$$, that is, ...
3,200
false
false
false
false
true
false
false
false
false
false
4,256
967B
Arkady wants to water his only flower. Unfortunately, he has a very poor watering system that was designed for $$$n$$$ flowers and so it looks like a pipe with $$$n$$$ holes. Arkady can only use the water that flows from the first hole. Arkady can block some of the holes, and then pour $$$A$$$ liters of water into the ...
1,000
true
false
false
false
false
false
false
false
true
false
5,836
701B
Vasya has the square chessboard of size _n_u2009Γ—u2009_n_ and _m_ rooks. Initially the chessboard is empty. Vasya will consequently put the rooks on the board one after another. The cell of the field is under rook's attack, if there is at least one rook located in the same row or in the same column with this cell. If t...
1,200
true
false
false
false
true
false
false
false
false
false
7,019
1251D
You are the head of a large enterprise. $$$n$$$ people work at you, and $$$n$$$ is odd (i.u2009e. $$$n$$$ is not divisible by $$$2$$$). You have to distribute salaries to your employees. Initially, you have $$$s$$$ dollars for it, and the $$$i$$$-th employee should get a salary from $$$l_i$$$ to $$$r_i$$$ dollars. You ...
1,900
false
true
false
false
false
false
false
true
true
false
4,438
1872D
You are given $$$3$$$ integersxa0β€” $$$n$$$, $$$x$$$, $$$y$$$. Let's call the score of a permutation$$$^dagger$$$ $$$p_1, ldots, p_n$$$ the following value: $$$$$$(p_{1 cdot x} + p_{2 cdot x} + ldots + p_{lfloor frac{n}{x} floor cdot x}) - (p_{1 cdot y} + p_{2 cdot y} + ldots + p_{lfloor frac{n}{y} floor cdot y})$$$$$...
1,200
true
false
false
false
false
false
false
false
false
false
1,048
472C
A way to make a new task is to make it nondeterministic or probabilistic. For example, the hard task of Topcoder SRM 595, Constellation, is the probabilistic version of a convex hull. Let's try to make a new task. Firstly we will use the following task. There are _n_ people, sort them by their name. It is just an ordin...
1,400
false
true
false
false
false
false
false
false
false
false
7,945
1870C
Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!) 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 ...
1,300
true
false
true
true
true
false
false
true
false
false
1,057
279B
Problem - 279B - 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
false
true
false
false
false
true
true
false
false
8,719
236A
Problem - 236A - 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
true
false
false
false
8,891
1795A
There are two towers consisting of blocks of two colors: red and blue. Both towers are represented by strings of characters B and/or R denoting the order of blocks in them from the bottom to the top, where B corresponds to a blue block, and R corresponds to a red block. These two towers are represented by strings BRBB...
800
false
false
true
false
false
false
true
false
false
false
1,509
435D
You are given an _n_u2009Γ—u2009_m_ grid, some of its nodes are black, the others are white. Moreover, it's not an ordinary grid β€” each unit square of the grid has painted diagonals. The figure below is an example of such grid of size 3u2009Γ—u20095. Four nodes of this grid are black, the other 11 nodes are white. Your t...
2,000
false
true
false
true
false
false
true
false
false
false
8,099
1772G
Monocarp is playing chess on one popular website. He has $$$n$$$ opponents he can play with. The $$$i$$$-th opponent has rating equal to $$$a_i$$$. Monocarp's initial rating is $$$x$$$. Monocarp wants to raise his rating to the value $$$y$$$ ($$$y > x$$$). When Monocarp is playing against one of the opponents, he will ...
2,200
true
true
true
false
false
false
false
true
true
false
1,657
1250N
Polycarpus has a complex electronic device. The core of this device is a circuit board. The board has $$$10^9$$$ contact points which are numbered from $$$1$$$ to $$$10^9$$$. Also there are $$$n$$$ wires numbered from $$$1$$$ to $$$n$$$, each connecting two distinct contact points on the board. An electric signal can p...
2,000
false
true
false
false
false
false
false
false
false
true
4,442
913F
There is a chess tournament in All-Right-City. _n_ players were invited to take part in the competition. The tournament is held by the following rules: 1. Initially, each player plays one game with every other player. There are no ties; 2. After that, the organizers build a complete directed graph with players as verti...
2,800
true
false
false
true
false
false
false
false
false
true
6,086
285A
Problem - 285A - 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
true
false
false
false
false
false
false
false
8,696
1216E2
The only difference between the easy and the hard versions is the maximum value of $$$k$$$. You are given an infinite sequence of form "112123123412345$$$dots$$$" which consist of blocks of all consecutive positive integers written one after another. The first block consists of all numbers from $$$1$$$ to $$$1$$$, the ...
2,200
true
false
false
false
false
false
false
true
false
false
4,592
1805E
You are given a tree (a connected graph without cycles). Each vertex of the tree contains an integer. Let's define the $$$mathrm{MAD}$$$ (maximum double) parameter of the tree as the maximum integer that occurs in the vertices of the tree at least $$$2$$$ times. If no number occurs in the tree more than once, then we a...
2,300
false
false
false
true
true
false
true
false
false
false
1,445
149A
What joy! Petya's parents went on a business trip for the whole year and the playful kid is left all by himself. Petya got absolutely happy. He jumped on the bed and threw pillows all day long, until... Today Petya opened the cupboard and found a scary note there. His parents had left him with duties: he should water t...
900
false
true
true
false
false
false
false
false
true
false
9,281
1056E
One of Arkady's friends works at a huge radio telescope. A few decades ago the telescope has sent a signal $$$s$$$ towards a faraway galaxy. Recently they've received a response $$$t$$$ which they believe to be a response from aliens! The scientists now want to check if the signal $$$t$$$ is similar to $$$s$$$. The ori...
2,100
false
false
false
false
true
false
true
false
false
false
5,428
52C
You are given circular array _a_0,u2009_a_1,u2009...,u2009_a__n_u2009-u20091. There are two types of operations with it: _inc_(_lf_,u2009_rg_,u2009_v_) β€” this operation increases each element on the segment [_lf_,u2009_rg_] (inclusively) by _v_; _rmq_(_lf_,u2009_rg_) β€” this operation returns minimal value on the segm...
2,200
false
false
false
false
true
false
false
false
false
false
9,711
1869A
Enter Register HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN Codeforces Round 896 (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...
900
false
false
false
false
false
true
false
false
false
false
1,061
1556H
William really likes puzzle kits. For one of his birthdays, his friends gifted him a complete undirected edge-weighted graph consisting of $$$n$$$ vertices. He wants to build a spanning tree of this graph, such that for the first $$$k$$$ vertices the following condition is satisfied: the degree of a vertex with index $...
3,300
true
true
false
false
false
false
false
false
false
true
2,848
415A
Mashmokh works in a factory. At the end of each day he must turn off all of the lights. The lights on the factory are indexed from 1 to _n_. There are _n_ buttons in Mashmokh's room indexed from 1 to _n_ as well. If Mashmokh pushes button with index _i_, then each light with index not less than _i_ that is still turned...
900
false
false
true
false
false
false
false
false
false
false
8,164
1045G
In the last mission, MDCS has successfully shipped $$$N$$$ AI robots to Mars. Before they start exploring, system initialization is required so they are arranged in a line. Every robot can be described with three numbers: position ($$$x_i$$$), radius of sight ($$$r_i$$$) and IQ ($$$q_i$$$). Since they are intelligent r...
2,200
false
false
false
false
true
false
false
false
false
false
5,464
1761F2
This is the hard version of the problem. The only difference between the two versions is the constraint on $$$n$$$. You can make hacks only if all versions of the problem are solved. Let's call an array $$$a$$$ of odd length $$$2m+1$$$ (with $$$m ge 1$$$) bad, if element $$$a_{m+1}$$$ is equal to the median of this arr...
3,500
true
false
false
true
false
false
false
false
false
false
1,742
1817D
There is a toy machine with toys arranged in two rows of $$$n$$$ cells each ($$$n$$$ is odd). Initial state for $$$n=9$$$. Initially, $$$n-2$$$ toys are placed in the non-corner cells of the top row. The bottom row is initially empty, and its leftmost, rightmost, and central cells are blocked. There are $$$4$$$ button...
2,700
false
false
true
false
false
true
false
false
false
false
1,370
1354F
Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other. Polycarp can summon $$$n$$$ different minions. The initial power level of the $$$i$$$-th minion is $$$a_i$$$, and when it is summoned, all previously summoned minions' power levels are increased by $...
2,500
false
true
false
true
false
true
false
false
true
false
3,933
1800D
Dmitry has a string $$$s$$$, consisting of lowercase Latin letters. Dmitry decided to remove two consecutive characters from the string $$$s$$$ and you are wondering how many different strings can be obtained after such an operation. For example, Dmitry has a string "aaabcc". You can get the following different strings...
1,200
false
true
false
false
true
false
false
false
false
false
1,471
1706C
Qpwoeirut has taken up architecture and ambitiously decided to remodel his city. Qpwoeirut's city can be described as a row of $$$n$$$ buildings, the $$$i$$$-th ($$$1 le i le n$$$) of which is $$$h_i$$$ floors high. You can assume that the height of every floor in this problem is equal. Therefore, building $$$i$$$ is t...
1,400
false
true
true
true
false
false
false
false
false
false
2,038
1136E
In this task, Nastya asked us to write a formal statement. An array $$$a$$$ of length $$$n$$$ and an array $$$k$$$ of length $$$n-1$$$ are given. Two types of queries should be processed: increase $$$a_i$$$ by $$$x$$$. Then if $$$a_{i+1} < a_i + k_i$$$, $$$a_{i+1}$$$ becomes exactly $$$a_i + k_i$$$; again, if $$$a_{i+...
2,200
false
false
false
false
true
false
false
true
false
false
5,043
1620D
One day, early in the morning, you decided to buy yourself a bag of chips in the nearby store. The store has chips of $$$n$$$ different flavors. A bag of the $$$i$$$-th flavor costs $$$a_i$$$ burles. The store may run out of some flavors, so you'll decide which one to buy after arriving there. But there are two major f...
2,000
false
true
false
false
false
true
true
false
false
false
2,524
1466D
You've probably heard about the twelve labors of Heracles, but do you have any idea about the thirteenth? It is commonly assumed it took him a dozen years to complete the twelve feats, so on average, a year to accomplish every one of them. As time flows faster these days, you have minutes rather than months to solve th...
1,500
false
true
false
false
true
false
false
false
true
false
3,363
1690G
There are $$$n$$$ of independent carriages on the rails. The carriages are numbered from left to right from $$$1$$$ to $$$n$$$. The carriages are not connected to each other. The carriages move to the left, so that the carriage with number $$$1$$$ moves ahead of all of them. The $$$i$$$-th carriage has its own engine, ...
2,000
false
true
false
false
true
false
false
true
true
false
2,137
1889C2
The only differences between the two versions of this problem are the constraint on $$$k$$$, the time limit and the memory limit. You can make hacks only if all versions of the problem are solved. Doremy lives in a rainy country consisting of $$$n$$$ cities numbered from $$$1$$$ to $$$n$$$. The weather broadcast predic...
2,600
false
false
false
true
true
false
false
false
false
false
963
474A
Problem - 474A - 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...
900
false
false
true
false
false
false
false
false
false
false
7,940
1089K
King Kog got annoyed of the usual laxity of his knightsxa0β€” they can break into his hall without prior notice! Thus, the King decided to build a reception with a queue where each knight chooses in advance the time when he will come and how long the visit will take. The knights are served in the order of the recorded ti...
2,400
false
false
false
false
true
false
false
false
false
false
5,275
1266H
There is a directed graph on $$$n$$$ vertices numbered $$$1$$$ through $$$n$$$ where each vertex (except $$$n$$$) has two outgoing arcs, red and blue. At any point in time, exactly one of the arcs is active for each vertex. Initially, all blue arcs are active and there is a token located at vertex $$$1$$$. In one secon...
3,400
true
false
false
true
false
false
false
false
false
true
4,364
1218C
You, the mighty Blackout, are standing in the upper-left $$$(0,0)$$$ corner of $$$N$$$x$$$M$$$ matrix. You must move either right or down each second. There are $$$K$$$ transformers jumping around the matrix in the following way. Each transformer starts jumping from position $$$(x,y)$$$, at time $$$t$$$, and jumps to t...
2,600
false
false
false
true
false
false
false
false
false
false
4,582
2041J
Image generated by ChatGPT 4o. Mayaw works in a renowned Epah (aboriginal Taiwanese millet wine; Epah is the Pangcah term for aboriginal Taiwanese millet wine, named in the language of the Pangcah people, the largest Indigenous group in Taiwan) bar in the Fata'an Village. To showcase the depth of its collections, the b...
2,700
false
true
false
true
true
false
false
false
false
false
4
213E
Rubik is very keen on number permutations. A permutation _a_ with length _n_ is a sequence, consisting of _n_ different numbers from 1 to _n_. Element number _i_ (1u2009≀u2009_i_u2009≀u2009_n_) of this permutation will be denoted as _a__i_. Furik decided to make a present to Rubik and came up with a new problem on perm...
2,700
false
false
false
false
true
false
false
false
false
false
8,984
131A
Problem - 131A - 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
false
false
false
false
false
9,353
1675G
Nastya baked $$$m$$$ pancakes and spread them on $$$n$$$ dishes. The dishes are in a row and numbered from left to right. She put $$$a_i$$$ pancakes on the dish with the index $$$i$$$. Seeing the dishes, Vlad decided to bring order to the stacks and move some pancakes. In one move, he can shift one pancake from any dis...
2,300
false
false
false
true
false
false
false
false
false
false
2,216
1899C
A subarray is a continuous part of array. Yarik recently found an array $$$a$$$ of $$$n$$$ elements and became very interested in finding the maximum sum of a non empty subarray. However, Yarik doesn't like consecutive integers with the same parity, so the subarray he chooses must have alternating parities for adjacent...
1,100
false
true
false
true
false
false
false
false
false
false
920
1548C
Three little pigs from all over the world are meeting for a convention! Every minute, a triple of 3 new pigs arrives on the convention floor. After the $$$n$$$-th minute, the convention ends. The big bad wolf has learned about this convention, and he has an attack plan. At some minute in the convention, he will arrive ...
2,500
true
false
false
true
false
false
false
false
false
false
2,904
1607G
A known chef has prepared $$$n$$$ dishes: the $$$i$$$-th dish consists of $$$a_i$$$ grams of fish and $$$b_i$$$ grams of meat. The banquet organizers estimate the balance of $$$n$$$ dishes as follows. The balance is equal to the absolute value of the difference between the total mass of fish and the total mass of meat....
2,200
false
true
false
false
false
false
false
false
false
false
2,617
1710B
You are the owner of a harvesting field which can be modeled as an infinite line, whose positions are identified by integers. It will rain for the next $$$n$$$ days. On the $$$i$$$-th day, the rain will be centered at position $$$x_i$$$ and it will have intensity $$$p_i$$$. Due to these rains, some rainfall will accumu...
2,100
true
true
true
false
true
false
true
true
false
false
2,019
1767C
You are given an integer $$$n$$$. You have to calculate the number of binary (consisting of characters 0 and/or 1) strings $$$s$$$ meeting the following constraints. For every pair of integers $$$(i, j)$$$ such that $$$1 le i le j le n$$$, an integer $$$a_{i,j}$$$ is given. It imposes the following constraint on the st...
2,100
false
false
false
true
true
false
false
false
false
false
1,695
843D
You are given a weighted directed graph, consisting of _n_ vertices and _m_ edges. You should answer _q_ queries of two types: 1 vxa0β€” find the length of shortest path from vertex 1 to vertex _v_. 2 c _l_1 _l_2 ... _l__c_xa0β€” add 1 to weights of edges with indices _l_1,u2009_l_2,u2009...,u2009_l__c_. Input The first ...
3,400
false
false
false
false
false
false
false
false
false
true
6,388
1710C
You are given a positive integer $$$n$$$. Since $$$n$$$ may be very large, you are given its binary representation. You should compute the number of triples $$$(a,b,c)$$$ with $$$0 leq a,b,c leq n$$$ such that $$$a oplus b$$$, $$$b oplus c$$$, and $$$a oplus c$$$ are the sides of a non-degenerate triangle. Here, $$$opl...
2,500
true
true
false
true
false
true
true
false
false
false
2,018
1028A
Problem - 1028A - 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
5,569
59E
In Ancient Berland there were _n_ cities and _m_ two-way roads of equal length. The cities are numbered with integers from 1 to _n_ inclusively. According to an ancient superstition, if a traveller visits three cities _a__i_, _b__i_, _c__i_ in row, without visiting other cities between them, a great disaster awaits him...
2,000
false
false
false
false
false
false
false
false
false
true
9,676
900B
Problem - 900B - 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
false
false
false
false
6,145
1548D1
This is the easy version of the problem. The only difference from the hard version is that in this version all coordinates are even. There are $$$n$$$ fence-posts at distinct coordinates on a plane. It is guaranteed that no three fence posts lie on the same line. There are an infinite number of cows on the plane, one a...
2,300
true
false
false
false
false
false
false
false
false
false
2,903
1918A
A brick is a strip of size $$$1 imes k$$$, placed horizontally or vertically, where $$$k$$$ can be an arbitrary number that is at least $$$2$$$ ($$$k ge 2$$$). A brick wall of size $$$n imes m$$$ is such a way to place several bricks inside a rectangle $$$n imes m$$$, that all bricks lie either horizontally or verti...
800
true
true
true
false
false
true
false
false
false
false
788
492E
Vanya decided to walk in the field of size _n_u2009Γ—u2009_n_ cells. The field contains _m_ apple trees, the _i_-th apple tree is at the cell with coordinates (_x__i_,u2009_y__i_). Vanya moves towards vector (_dx_,u2009_dy_). That means that if Vanya is now at the cell (_x_,u2009_y_), then in a second he will be at cell...
2,000
true
false
false
false
false
false
false
false
false
false
7,864
2035E
Man, this Genshin boss is so hard. Good thing they have a top-up of $$$6$$$ coins for only $$$ $4.99$$$. I should be careful and spend no more than I need to, lest my mom catches me... You are fighting a monster with $$$z$$$ health using a weapon with $$$d$$$ damage. Initially, $$$d=0$$$. You can perform the following ...
2,300
true
true
true
false
false
true
true
true
false
false
57
1732A
You are given an array $$$a$$$ consisting of $$$n$$$ integers $$$a_1, a_2, ldots, a_n$$$. Friends asked you to make the $$$, where $$$gcd(x, y)$$$ denotes the GCD of integers $$$x$$$ and $$$y$$$. The cost of such an operation is $$$n - i + 1$$$. You need to find the minimum total cost of operations we need to perform s...
1,000
true
false
true
false
false
true
true
false
false
false
1,899
1322A
A bracketed sequence is called correct (regular) if by inserting "+" and "1" you can get a well-formed mathematical expression from it. For example, sequences "(())()", "()" and "(()(()))" are correct, while ")(", "(()" and "(()))(" are not. The teacher gave Dmitry's class a very strange taskxa0β€” she asked every studen...
1,300
false
true
false
false
false
false
false
false
false
false
4,107
808F
Problem - 808F - Codeforces =============== xa0 ]( "52010") . Then _n_ lines follow, each of these lines contains three numbers that represent the corresponding card: _p__i_, _c__i_ and _l__i_ (1u2009≀u2009_p__i_u2009≀u20091000, 1u2009≀u2009_c__i_u2009≀u2009100000, 1u2009≀u2009_l__i_u2009≀u2009_n_). Ou...
2,400
false
false
false
false
false
false
false
true
false
true
6,530
717H
Welcome to the world of Pokermon, yellow little mouse-like creatures, who absolutely love playing poker! Yeah, right… In the ensuing Pokermon League, there are _n_ registered Pokermon trainers, and _t_ existing trainer teams each of which belongs to one of two conferences. Since there is a lot of jealousy between train...
2,400
true
false
false
false
false
false
false
false
false
false
6,945
1583G
El Psy Kongroo. Omkar is watching Steins;Gate. In Steins;Gate, Okabe Rintarou needs to complete $$$n$$$ tasks ($$$1 leq n leq 2 cdot 10^5$$$). Unfortunately, he doesn't know when he needs to complete the tasks. Initially, the time is $$$0$$$. Time travel will now happen according to the following rules: For each $$$k ...
3,000
true
false
false
false
true
false
false
false
false
false
2,711
1536B
I, Fischl, Prinzessin der Verurteilung, descend upon this land by the call of fate an β€” Oh, you are also a traveler from another world? Very well, I grant you permission to travel with me. It is no surprise Fischl speaks with a strange choice of words. However, this time, not even Oz, her raven friend, can interpret he...
1,200
false
false
false
false
false
true
true
false
false
false
2,967
1879B
You are given a board of size $$$n imes n$$$ ($$$n$$$ rows and $$$n$$$ colums) and two arrays of positive integers $$$a$$$ and $$$b$$$ of size $$$n$$$. Your task is to place the chips on this board so that the following condition is satisfied for every cell $$$(i, j)$$$: there exists at least one chip in the same col...
900
false
true
false
false
false
true
false
false
false
false
1,009
1644B
Problem - 1644B - 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
true
true
false
false
false
2,400