task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little penguin Polo adores strings. But most of all he adores strings of length *n*.
One day he wanted to find a string that meets the following conditions:
1. The string consists of *n* lowercase English letters (that is, the ... | 4,100 |
Title: PolandBall and Hypothesis
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
PolandBall is a young, clever Ball. He is interested in prime numbers. He has stated a following hypothesis: "There exists such a positive integer *n* that for each positive integer *m* number *n*·*m*<=+<=1 is... | 4,101 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Edo has got a collection of *n* refrigerator magnets!
He decided to buy a refrigerator and hang the magnets on the door. The shop can make the refrigerator with any size of the door that meets the following restrictions: the refr... | 4,102 |
Title: Restaurant Tables
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In a small restaurant there are *a* tables for one person and *b* tables for two persons.
It it known that *n* groups of people come today, each consisting of one or two people.
If a group consist of one person, i... | 4,103 |
Title: Testing
Time Limit: 2 seconds
Memory Limit: 64 megabytes
Problem Description:
You take part in the testing of new weapon. For the testing a polygon was created. The polygon is a rectangular field *n*<=×<=*m* in size, divided into unit squares 1<=×<=1 in size. The polygon contains *k* objects, each of which is... | 4,104 |
Title: Substrings Sort
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given $n$ strings. Each string consists of lowercase English letters. Rearrange (reorder) the given strings in such a way that for every string, all strings that are placed before it are its substrings.
String ... | 4,105 |
Title: In a Trap
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Lech got into a tree consisting of *n* vertices with a root in vertex number 1. At each vertex *i* written integer *a**i*. He will not get out until he answers *q* queries of the form *u* *v*. Answer for the query is maximal ... | 4,106 |
Title: Conveyor
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Anton came to a chocolate factory. There he found a working conveyor and decided to run on it from the beginning to the end.
The conveyor is a looped belt with a total length of 2*l* meters, of which *l* meters are located on... | 4,107 |
Title: Flea travel
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
A flea is sitting at one of the *n* hassocks, arranged in a circle, at the moment. After minute number *k* the flea jumps through *k*<=-<=1 hassoсks (clockwise). For example, after the first minute the flea jumps to the neighbo... | 4,108 |
Title: Vitaly and Strings
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vitaly is a diligent student who never missed a lesson in his five years of studying in the university. He always does his homework on time and passes his exams in time.
During the last lesson the teacher has provi... | 4,109 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a rebus of form ? + ? - ? + ? = n, consisting of only question marks, separated by arithmetic operation '+' and '-', equality and positive integer *n*. The goal is to replace each question mark with some positive int... | 4,110 |
Title: A Piece of Cake
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
How to make a cake you'll never eat.
Ingredients.
- 2 carrots - 0 calories - 100 g chocolate spread - 1 pack of flour - 1 egg
Method.
1. Put calories into the mixing bowl. 1. Take carrots from refrigerator.... | 4,111 |
Title: Walking!
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There is a sand trail in front of Alice's home.
In daytime, people walk over it and leave a footprint on the trail for their every single step. Alice cannot distinguish the order of the footprints, but she can tell whether ea... | 4,112 |
Title: Propagating tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Iahub likes trees very much. Recently he discovered an interesting tree named propagating tree. The tree consists of *n* nodes numbered from 1 to *n*, each node *i* having an initial value *a**i*. The root of the tree ... | 4,113 |
Title: Stranger Trees
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Will shares a psychic connection with the Upside Down Monster, so everything the monster knows, Will knows. Suddenly, he started drawing, page after page, non-stop. Joyce, his mom, and Chief Hopper put the drawings toget... | 4,114 |
Title: Bitonix' Patrol
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Byteland is trying to send a space mission onto the Bit-X planet. Their task is complicated by the fact that the orbit of the planet is regularly patrolled by Captain Bitonix, the leader of the space forces of Bit-X.
T... | 4,115 |
Title: Soft Drinking
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
This winter is so cold in Nvodsk! A group of *n* friends decided to buy *k* bottles of a soft drink called "Take-It-Light" to warm up a bit. Each bottle has *l* milliliters of the drink. Also they bought *c* limes and cut... | 4,116 |
Title: Coach
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A programming coach has *n* students to teach. We know that *n* is divisible by 3. Let's assume that all students are numbered from 1 to *n*, inclusive.
Before the university programming championship the coach wants to split all... | 4,117 |
Title: Slightly Decreasing Permutations
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Permutation *p* is an ordered set of integers *p*1,<=<=*p*2,<=<=...,<=<=*p**n*, consisting of *n* distinct positive integers, each of them doesn't exceed *n*. We'll denote the *i*-th element of permutat... | 4,118 |
Title: Internet Address
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format:
where:
- <protocol>... | 4,119 |
Title: Logo Turtle
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A lot of people associate Logo programming language with turtle graphics. In this case the turtle moves along the straight line and accepts commands "T" ("turn around") and "F" ("move 1 unit forward").
You are given a list... | 4,120 |
Title: Mahmoud and Ehab and the xor
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Mahmoud and Ehab are on the third stage of their adventures now. As you know, Dr. Evil likes sets. This time he won't show them any set from his large collection, but will ask them to create a new set to re... | 4,121 |
Title: Holes
Time Limit: 1 seconds
Memory Limit: 64 megabytes
Problem Description:
Little Petya likes to play a lot. Most of all he likes to play a game «Holes». This is a game for one person with following rules:
There are *N* holes located in a single row and numbered from left to right with numbers from 1 to *N*... | 4,122 |
Title: Numbers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You have a sequence of *n* distinct integers *a*1,<=*a*2,<=...,<=*a**n* (1<=≤<=*a**i*<=≤<=*n*). You want to remove some integers in such a way that the resulting sequence of integers satisfies the following three conditions:
1... | 4,123 |
Title: Xor-tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Iahub is very proud of his recent discovery, propagating trees. Right now, he invented a new tree, called xor-tree. After this new revolutionary discovery, he invented a game for kids which uses xor-trees.
The game is played ... | 4,124 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Alice has a string consisting of characters 'A', 'B' and 'C'. Bob can use the following transitions on any substring of our string in any order any number of times:
- A BC - B AC - C AB - AAA empty string
Note that a su... | 4,125 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
At a geometry lesson Gerald was given a task: to get vector *B* out of vector *A*. Besides, the teacher permitted him to perform the following operations with vector *А*:
- Turn the vector by 90 degrees clockwise.- Add to the ve... | 4,126 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Petya likes horse racing very much. Horses numbered from *l* to *r* take part in the races. Petya wants to evaluate the probability of victory; for some reason, to do that he needs to know the amount of nearly lucky horses' number... | 4,127 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Andrew and Eugene are playing a game. Initially, Andrew has string *s*, consisting of digits. Eugene sends Andrew multiple queries of type "*d**i*<=→<=*t**i*", that means "replace all digits *d**i* in string *s* with substrings eq... | 4,128 |
Title: Geometrical problem
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
Polycarp loves geometric progressions — he collects them. However, as such progressions occur very rarely, he also loves the sequences of numbers where it is enough to delete a single element to get a geometric progress... | 4,129 |
Title: Ants on a Circle
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
*n* ants are on a circle of length *m*. An ant travels one unit of distance per one unit of time. Initially, the ant number *i* is located at the position *s**i* and is facing in the direction *d**i* (which is either L... | 4,130 |
Title: Maximum Increase
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given array consisting of *n* integers. Your task is to find the maximum length of an increasing subarray of the given array.
A subarray is the sequence of consecutive elements of the array. Subarray is called... | 4,131 |
Title: Valuable Resources
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Many computer strategy games require building cities, recruiting army, conquering tribes, collecting resources. Sometimes it leads to interesting problems.
Let's suppose that your task is to build a square city. Th... | 4,132 |
Title: Color the Fence
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya's house. Igor thinks that the larger the number is, the more chance to win Tanya's heart he has. ... | 4,133 |
Title: Reachability from the Capital
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are $n$ cities and $m$ roads in Berland. Each road connects a pair of cities. The roads in Berland are one-way.
What is the minimum number of new roads that need to be built to make all the cities r... | 4,134 |
Title: Nikita and game
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
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... | 4,135 |
Title: DZY Loves Modification
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
As we know, DZY loves playing games. One day DZY decided to play with a *n*<=×<=*m* matrix. To be more precise, he decided to modify the matrix with exactly *k* operations.
Each modification is one of the follow... | 4,136 |
Title: Two Segments
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Nick has some permutation consisting of *p* integers from 1 to *n*. A segment [*l*,<=*r*] (*l*<=≤<=*r*) is a set of elements *p**i* satisfying *l*<=≤<=*i*<=≤<=*r*.
Nick calls a pair of segments [*a*0,<=*a*1] and [*b*0,<=*... | 4,137 |
Title: Journey
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
Stewie the Rabbit explores a new parallel universe. This two dimensional universe has the shape of a rectangular grid, containing *n* lines and *m* columns. The universe is very small: one cell of the grid can only contain one part... | 4,138 |
Title: The Values You Can Make
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Pari wants to buy an expensive chocolate from Arya. She has *n* coins, the value of the *i*-th coin is *c**i*. The price of the chocolate is *k*, so Pari will take a subset of her coins with sum equal to *k* and... | 4,139 |
Title: Choosing Capital for Treeland
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The country Treeland consists of *n* cities, some pairs of them are connected with unidirectional roads. Overall there are *n*<=-<=1 roads in the country. We know that if we don't take the direction of the... | 4,140 |
Title: Ohana Cleans Up
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Ohana Matsumae is trying to clean a room, which is divided up into an *n* by *n* grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very str... | 4,141 |
Title: Bit++
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The classic programming language of Bitland is Bit++. This language is so peculiar and complicated.
The language is that peculiar as it has exactly one variable, called *x*. Also, there are two operations:
- Operation ++ incre... | 4,142 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Santa Claus is the first who came to the Christmas Olympiad, and he is going to be the first to take his place at a desk! In the classroom there are *n* lanes of *m* desks each, and there are two working places at each of the desk... | 4,143 |
Title: Combination Lock
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Scrooge McDuck keeps his most treasured savings in a home safe with a combination lock. Each time he wants to put there the treasures that he's earned fair and square, he has to open the lock.
The combination lock is ... | 4,144 |
Title: BRT Contract
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In the last war of PMP, he defeated all his opponents and advanced to the final round. But after the end of semi-final round evil attacked him from behind and killed him! God bless him.
Before his death, PMP signed a co... | 4,145 |
Title: GCD Table
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The GCD table *G* of size *n*<=×<=*n* for an array of positive integers *a* of length *n* is defined by formula
Let us remind you that the greatest common divisor (GCD) of two positive integers *x* and *y* is the greatest i... | 4,146 |
Title: Yura and Developers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Yura has a team of *k* developers and a list of *n* tasks numbered from 1 to *n*. Yura is going to choose some tasks to be done this week. Due to strange Looksery habits the numbers of chosen tasks should be a segme... | 4,147 |
Title: Chess For Three
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Alex, Bob and Carl will soon participate in a team chess tournament. Since they are all in the same team, they have decided to practise really hard before the tournament. But it's a bit difficult for them because chess ... | 4,148 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Fox Ciel wants to write a task for a programming contest. The task is: "You are given a simple undirected graph with *n* vertexes. Each its edge has unit length. You should calculate the number of shortest paths between vertex 1 a... | 4,149 |
Title: Jury Marks
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarp watched TV-show where *k* jury members one by one rated a participant by adding him a certain number of points (may be negative, i. e. points were subtracted). Initially the participant had some score, and each the ... | 4,150 |
Title: Messages on a Tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Alice and Bob are well-known for sending messages to each other. This time you have a rooted tree with Bob standing in the root node and copies of Alice standing in each of the other vertices. The root node has numbe... | 4,151 |
Title: Multithreading
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions" list. He likes to read thread conversations where each thread consists of multiple messages.
Recent ... | 4,152 |
Title: World of Darkraft - 2
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Roma found a new character in the game "World of Darkraft - 2". In this game the character fights monsters, finds the more and more advanced stuff that lets him fight stronger monsters.
The character can equip hi... | 4,153 |
Title: The Brand New Function
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarpus has a sequence, consisting of *n* non-negative integers: *a*1,<=*a*2,<=...,<=*a**n*.
Let's define function *f*(*l*,<=*r*) (*l*,<=*r* are integer, 1<=≤<=*l*<=≤<=*r*<=≤<=*n*) for sequence *a* as an oper... | 4,154 |
Title: Delivery Club
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Petya and Vasya got employed as couriers. During the working day they are to deliver packages to *n* different points on the line. According to the company's internal rules, the delivery of packages must be carried out st... | 4,155 |
Title: Destiny
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Once, Leha found in the left pocket an array consisting of *n* integers, and in the right pocket *q* queries of the form *l* *r* *k*. If there are queries, then they must be answered. Answer for the query is minimal *x* such th... | 4,156 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Leha plays a computer game, where is on each level is given a connected graph with *n* vertices and *m* edges. Graph can contain multiple edges, but can not contain self loops. Each vertex has an integer *d**i*, which can be equal... | 4,157 |
Title: Polycarp and Letters
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string *s* consisting only of lowercase and uppercase Latin letters.
Let *A* be a set of positions in the string. Let's call it pretty if... | 4,158 |
Title: Pretty Song
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
When Sasha was studying in the seventh grade, he started listening to music a lot. In order to evaluate which songs he likes more, he introduced the notion of the song's prettiness. The title of the song is a word consistin... | 4,159 |
Title: Красивая команда
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Завтра у хоккейной команды, которой руководит Евгений, важный матч. Евгению нужно выбрать шесть игроков, которые выйдут на лед в стартовом составе: один вратарь, два защитника и три нападающих.
Так как это стартовый с... | 4,160 |
Title: Azembler
Time Limit: 5 seconds
Memory Limit: 256 megabytes
Problem Description:
After the Search Ultimate program that searched for strings in a text failed, Igor K. got to think: "Why on Earth does my program work so slowly?" As he double-checked his code, he said: "My code contains no errors, yet I know how... | 4,161 |
Title: Nephren Runs a Cinema
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Lakhesh loves to make movies, so Nephren helps her run a cinema. We may call it No. 68 Cinema.
However, one day, the No. 68 Cinema runs out of changes (they don't have 50-yuan notes currently), but Nephren stil... | 4,162 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let's define the sum of two permutations *p* and *q* of numbers 0,<=1,<=...,<=(*n*<=-<=1) as permutation , where *Perm*(*x*) is the *x*-th lexicographically permutation of numbers 0,<=1,<=...,<=(*n*<=-<=1) (counting from zero), an... | 4,163 |
Title: Design Tutorial: Inverse the Problem
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There is an easy way to obtain a new task from an old one called "Inverse the problem": we give an output of the original task, and ask to generate an input, such that solution to the original probl... | 4,164 |
Title: Divide by three, multiply by two
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarp likes to play with numbers. He takes some integer number $x$, writes it down on the board, and then performs with it $n - 1$ operations of the two kinds:
- divide the number $x$ by $3$ ($x$ ... | 4,165 |
Title: Digit Tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
ZS the Coder has a large tree. It can be represented as an undirected connected graph of *n* vertices numbered from 0 to *n*<=-<=1 and *n*<=-<=1 edges between them. There is a single nonzero digit written on each edge.
One ... | 4,166 |
Title: Sorting by Subsequences
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a sequence *a*1,<=*a*2,<=...,<=*a**n* consisting of different integers. It is required to split this sequence into the maximum number of subsequences such that after sorting integers in each of the... | 4,167 |
Title: Forecast
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Department of economic development of IT City created a model of city development till year 2100.
To prepare report about growth perspectives it is required to get growth estimates from the model.
To get the growth estim... | 4,168 |
Title: Fair
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Some company is going to hold a fair in Byteland. There are $n$ towns in Byteland and $m$ two-way roads between towns. Of course, you can reach any town from any other town using roads.
There are $k$ types of goods produced in By... | 4,169 |
Title: Divisibility
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
IT City company developing computer games invented a new way to reward its employees. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each transaction. ... | 4,170 |
Title: Bender Problem
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Robot Bender decided to make Fray a birthday present. He drove *n* nails and numbered them from 1 to *n* in some order. Bender decided to make a picture using metal rods. The picture is a closed polyline, which vertices shou... | 4,171 |
Title: Periodical Numbers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A non-empty string *s* is called binary, if it consists only of characters "0" and "1". Let's number the characters of binary string *s* from 1 to the string's length and let's denote the *i*-th character in string *... | 4,172 |
Title: Help Victoria the Wise
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
Vasilisa the Wise from a far away kingdom got a present from her friend Helga the Wise from a farther away kingdom. The present is a surprise box, yet Vasilisa the Wise doesn't know yet what the surprise actually is ... | 4,173 |
Title: Arthur and Table
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Arthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new table is unstable.
In total the table Arthur bought has *n* legs, the length of the *i*-th leg is *l**i*.
Arth... | 4,174 |
Title: Doe Graphs
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
John Doe decided that some mathematical object must be named after him. So he invented the Doe graphs. The Doe graphs are a family of undirected graphs, each of them is characterized by a single non-negative number — its ord... | 4,175 |
Title: Chess Tourney
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Berland annual chess tournament is coming!
Organizers have gathered 2·*n* chess players who should be divided into two teams with *n* people each. The first team is sponsored by BerOil and the second team is sponsored by... | 4,176 |
Title: Zero Tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A tree is a graph with *n* vertices and exactly *n*<=-<=1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.
A subtree of a tr... | 4,177 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
An infinitely long railway has a train consisting of *n* cars, numbered from 1 to *n* (the numbers of all the cars are distinct) and positioned in arbitrary order. David Blaine wants to sort the railway cars in the order of increa... | 4,178 |
Title: Beautiful Pairs of Numbers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The sequence of integer pairs (*a*1,<=*b*1),<=(*a*2,<=*b*2),<=...,<=(*a**k*,<=*b**k*) is beautiful, if the following statements are fulfilled:
- 1<=≤<=*a*1<=≤<=*b*1<=<<=*a*2<=≤<=*b*2<=<<=...<=<<=*... | 4,179 |
Title: Literature Lesson
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vera adores poems. All the poems Vera knows are divided into quatrains (groups of four lines) and in each quatrain some lines contain rhymes.
Let's consider that all lines in the poems consist of lowercase Latin lett... | 4,180 |
Title: On Corruption and Numbers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Alexey, a merry Berland entrant, got sick of the gray reality and he zealously wants to go to university. There are a lot of universities nowadays, so Alexey is getting lost in the diversity — he has not yet d... | 4,181 |
Title: Little Elephant and Strings
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Little Elephant loves strings very much.
He has an array *a* from *n* strings, consisting of lowercase English letters. Let's number the elements of the array from 1 to *n*, then let's denote the eleme... | 4,182 |
Title: Ray Tracing
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *k* sensors located in the rectangular room of size *n*<=×<=*m* meters. The *i*-th sensor is located at point (*x**i*,<=*y**i*). All sensors are located at distinct points strictly inside the rectangle.
Opposite... | 4,183 |
Title: Game with Strings
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You play the game with your friend. The description of this game is listed below.
Your friend creates *n* distinct strings of the same length *m* and tells you all the strings. Then he randomly chooses one of them. ... | 4,184 |
Title: Noble Knight's Path
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In Berland each feudal owns exactly one castle and each castle belongs to exactly one feudal.
Each feudal, except one (the King) is subordinate to another feudal. A feudal can have any number of vassals (subordinat... | 4,185 |
Title: Petya and Spiders
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Little Petya loves training spiders. Petya has a board *n*<=×<=*m* in size. Each cell of the board initially has a spider sitting on it. After one second Petya chooses a certain action for each spider, and all of them hum... | 4,186 |
Title: Common Divisors
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya has recently learned at school what a number's divisor is and decided to determine a string's divisor. Here is what he came up with.
String *a* is the divisor of string *b* if and only if there exists a positive ... | 4,187 |
Title: Border
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Astronaut Natasha arrived on Mars. She knows that the Martians are very poor aliens. To ensure a better life for the Mars citizens, their emperor decided to take tax from every tourist who visited the planet. Natasha is the inha... | 4,188 |
Title: Puzzles
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The end of the school year is near and Ms. Manana, the teacher, will soon have to say goodbye to a yet another class. She decided to prepare a goodbye present for her *n* students and give each of them a jigsaw puzzle (which, a... | 4,189 |
Title: Set of Points
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Convexity of a set of points on the plane is the size of the largest subset of points that form a convex polygon. Your task is to build a set of *n* points with the convexity of exactly *m*. Your set of points should not ... | 4,190 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Jzzhu has picked *n* apples from his big apple tree. All the apples are numbered from 1 to *n*. Now he wants to sell them to an apple store.
Jzzhu will pack his apples into groups and then sell them. Each group must contain two ... | 4,191 |
Title: Bracket Sequence
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A bracket sequence is a string, containing only characters "(", ")", "[" and "]".
A correct bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters "... | 4,192 |
Title: Yash And Trees
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Yash loves playing with trees and gets especially excited when they have something to do with prime numbers. On his 20th birthday he was granted with a rooted tree of *n* nodes to answer queries on. Hearing of prime numb... | 4,193 |
Title: Max and Bike
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
For months Maxim has been coming to work on his favorite bicycle. And quite recently he decided that he is ready to take part in a cyclists' competitions.
He knows that this year *n* competitions will take place. During t... | 4,194 |
Title: PFAST Inc.
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
When little Petya grew up and entered the university, he started to take part in АСМ contests. Later he realized that he doesn't like how the АСМ contests are organised: the team could only have three members (and he couldn'... | 4,195 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A tree is a graph with *n* vertices and exactly *n*<=-<=1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.
A subtree of a tree *T... | 4,196 |
Title: Magic Odd Square
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Find an *n*<=×<=*n* matrix with different numbers from 1 to *n*2, so the sum in each row, column and both main diagonals are odd.
Input Specification:
The only line contains odd integer *n* (1<=≤<=*n*<=≤<=49).
Output... | 4,197 |
Title: Lucky Arrays
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little Maxim loves interesting problems. He decided to share one such problem with you.
Initially there is an array *a*, consisting of *n* zeroes. The elements of the array are indexed, starting from 1. Then follow queri... | 4,198 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Emuskald considers himself a master of flow algorithms. Now he has completed his most ingenious program yet — it calculates the maximum flow in an undirected graph. The graph consists of *n* vertices and *m* edges. Vertices are nu... | 4,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.