task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Title: Business trip
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
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 open... | 4,300 |
Title: Delete Them
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarp is a beginner programmer. He is studying how to use a command line.
Polycarp faced the following problem. There are *n* files in a directory and he needs to delete some of them. Polycarp wants to run a single dele... | 4,301 |
Title: Maximum Element
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One day Petya was solving a very interesting problem. But although he used many optimization techniques, his solution still got Time limit exceeded verdict. Petya conducted a thorough analysis of his program and found o... | 4,302 |
Title: Group of Students
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
At the beginning of the school year Berland State University starts two city school programming groups, for beginners and for intermediate coders. The children were tested in order to sort them into groups. According ... | 4,303 |
Title: Matrix Walk
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There is a matrix *A* of size *x*<=Γ<=*y* filled with integers. For every , *A**i*,<=*j*<==<=*y*(*i*<=-<=1)<=+<=*j*. Obviously, every integer from [1..*xy*] occurs exactly once in this matrix.
You have traversed some pat... | 4,304 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You can't possibly imagine how cold our friends are this winter in Nvodsk! Two of them play the following game to warm up: initially a piece of paper has an integer *q*. During a move a player should write any integer number that ... | 4,305 |
Title: Network Mask
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The problem uses a simplified TCP/IP address model, please make sure you've read the statement attentively.
Polycarpus has found a job, he is a system administrator. One day he came across *n* IP addresses. Each IP addres... | 4,306 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Fox Ciel is playing a game. In this game there is an infinite long tape with cells indexed by integers (positive, negative and zero). At the beginning she is standing at the cell 0.
There are also *n* cards, each card has 2 attri... | 4,307 |
Title: Flow Optimality
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There is a computer network consisting of *n* nodes numbered 1 through *n*. There are links in the network that connect pairs of nodes. A pair of nodes may have multiple links between them, but no node has a link to its... | 4,308 |
Title: Chris and Magic Square
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
ZS the Coder and Chris the Baboon arrived at the entrance of Udayland. There is a *n*<=Γ<=*n* magic grid on the entrance which is filled with integers. Chris noticed that exactly one of the cells in the grid is e... | 4,309 |
Title: Non-Secret Cypher
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Berland starts to seize the initiative on the war with Flatland. To drive the enemy from their native land, the berlanders need to know exactly how many more flatland soldiers are left in the enemy's reserve. Fortunat... | 4,310 |
Title: Colorful Field
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Fox Ciel saw a large field while she was on a bus. The field was a *n*<=Γ<=*m* rectangle divided into 1<=Γ<=1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
... | 4,311 |
Title: Tourist's Notes
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A tourist hiked along the mountain range. The hike lasted for *n* days, during each day the tourist noted height above the sea level. On the *i*-th day height was equal to some integer *h**i*. The tourist pick smooth en... | 4,312 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are an assistant director in a new musical play. The play consists of *n* musical parts, each part must be performed by exactly one actor. After the casting the director chose *m* actors who can take part in the play. Your tas... | 4,313 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let's define a forest as a non-directed acyclic graph (also without loops and parallel edges). One day Misha played with the forest consisting of *n* vertices. For each vertex *v* from 0 to *n*<=-<=1 he wrote down two integers, *d... | 4,314 |
Title: Too Easy Problems
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are preparing for an exam on scheduling theory. The exam will last for exactly *T* milliseconds and will consist of *n* problems. You can either solve problem *i* in exactly *t**i* milliseconds or ignore it and sp... | 4,315 |
Title: Sereja and Sets
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Sereja has *m* non-empty sets of integers *A*1,<=*A*2,<=...,<=*A**m*. What a lucky coincidence! The given sets are a partition of the set of all integers from 1 to *n*. In other words, for any integer *v* (1<=β€<=*v*<=β€<... | 4,316 |
Title: Optimal Sum
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
And here goes another problem on arrays. You are given positive integer *len* and array *a* which consists of *n* integers *a*1, *a*2, ..., *a**n*. Let's introduce two characteristics for the given array.
- Let's consider... | 4,317 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
We'll call an array of *n* non-negative integers *a*[1],<=*a*[2],<=...,<=*a*[*n*] interesting, if it meets *m* constraints. The *i*-th of the *m* constraints consists of three integers *l**i*, *r**i*, *q**i* (1<=β€<=*l**i*<=β€<=*r**... | 4,318 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A permutation *p* of size *n* is the sequence *p*1,<=*p*2,<=...,<=*p**n*, consisting of *n* distinct integers, each of them is from 1 to *n* (1<=β€<=*p**i*<=β€<=*n*).
A lucky permutation is such permutation *p*, that any integer *i... | 4,319 |
Title: Tanya is 5!
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Tanya is now five so all her friends gathered together to celebrate her birthday. There are *n* children on the celebration, including Tanya.
The celebration is close to its end, and the last planned attraction is gaming m... | 4,320 |
Title: Present from Lena
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya's birthday is approaching and Lena decided to sew a patterned handkerchief to him as a present. Lena chose digits from 0 to *n* as the pattern. The digits will form a rhombus. The largest digit *n* should be loc... | 4,321 |
Title: Fire
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarp is in really serious trouble β his house is on fire! It's time to save the most valuable items. Polycarp estimated that it would take *t**i* seconds to save *i*-th item. In addition, for each item, he estimated the value ... | 4,322 |
Title: Significant Cups
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Stepan is a very experienced olympiad participant. He has *n* cups for Physics olympiads and *m* cups for Informatics olympiads. Each cup is characterized by two parameters β its significance *c**i* and width *w**i*.
... | 4,323 |
Title: Little Elephant and Retro Strings
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Little Elephant has found a ragged old black-and-white string *s* on the attic.
The characters of string *s* are numbered from the left to the right from 1 to |*s*|, where |*s*| is the length of t... | 4,324 |
Title: Amity Assessment
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Bessie the cow and her best friend Elsie each received a sliding puzzle on Pi Day. Their puzzles consist of a 2<=Γ<=2 grid and three tiles labeled 'A', 'B', and 'C'. The three tiles sit on top of the grid, leaving one ... | 4,325 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Shuseki Islands are an archipelago of 30001 small islands in the Yutampo Sea. The islands are evenly spaced along a line, numbered from 0 to 30000 from the west to the east. These islands are known to contain many treasures. T... | 4,326 |
Title: Future Failure
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Alice and Bob are playing a game with a string of characters, with Alice going first. The string consists *n* characters, each of which is one of the first *k* letters of the alphabet. On a playerβs turn, they can either... | 4,327 |
Title: Ordering Pizza
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
It's another Start[c]up finals, and that means there is pizza to order for the onsite contestants. There are only 2 types of pizza (obviously not, but let's just pretend for the sake of the problem), and all pizzas conta... | 4,328 |
Title: Maze 2D
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The last product of the R2 company in the 2D games' field is a new revolutionary algorithm of searching for the shortest path in a 2<=Γ<=*n* maze.
Imagine a maze that looks like a 2<=Γ<=*n* rectangle, divided into unit squares... | 4,329 |
Title: Cycling City
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are organizing a cycling race on the streets of the city. The city contains *n* junctions, some pairs of them are connected by roads; on each road you can move in any direction. No two roads connect the same pair of in... | 4,330 |
Title: Blog Post Rating
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
It's well-known that blog posts are an important part of Codeforces platform. Every blog post has a global characteristic changing over timeΒ β its community rating. A newly created blog post's community rating is 0. Co... | 4,331 |
Title: Wizards and Huge Prize
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One must train much to do well on wizardry contests. So, there are numerous wizardry schools and magic fees.
One of such magic schools consists of *n* tours. A winner of each tour gets a huge prize. The school i... | 4,332 |
Title: Colorado Potato Beetle
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Old MacDonald has a farm and a large potato field, (1010<=+<=1)<=Γ<=(1010<=+<=1) square meters in size. The field is divided into square garden beds, each bed takes up one square meter.
Old McDonald knows that t... | 4,333 |
Title: AlgoRace
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
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... | 4,334 |
Title: Let's Go Rolling!
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
On a number axis directed from the left rightwards, *n* marbles with coordinates *x*1,<=*x*2,<=...,<=*x**n* are situated. Let's assume that the sizes of the marbles are infinitely small, that is in this task each of them ... | 4,335 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any positive decimal fraction. First he got disappointed, as he expected a way more pleasant result. Then, he developed a... | 4,336 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let's call an undirected graph of *n* vertices *p*-interesting, if the following conditions fulfill:
- the graph contains exactly 2*n*<=+<=*p* edges; - the graph doesn't contain self-loops and multiple edges; - for any intege... | 4,337 |
Title: Square and Rectangles
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given *n* rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the *Ox* and *Oy* axes. The rectangles may touch each other, but they do not overlap (that is, there... | 4,338 |
Title: Rumor
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vova promised himself that he would never play computer games... But recently Firestorm β a well-known game developing company β published their newest game, World of Farcraft, and it became really popular. Of course, Vova starte... | 4,339 |
Title: Jeopardy!
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
'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 fin... | 4,340 |
Title: Cubes
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let's imagine that you're playing the following simple computer game. The screen displays *n* lined-up cubes. Each cube is painted one of *m* colors. You are allowed to delete not more than *k* cubes (that do not necessarily go o... | 4,341 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *N* cities in Bob's country connected by roads. Some pairs of cities are connected by public transport. There are two competing transport companiesΒ β Boblines operating buses and Bobrail running trains. When traveling fr... | 4,342 |
Title: Flowers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
We saw the little game Marmot made for Mole's lunch. Now it's Marmot's dinner time and, as we all know, Marmot eats flowers. At every dinner he eats some red and white flowers. Therefore a dinner can be represented as a sequenc... | 4,343 |
Title: Secret
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Greatest Secret Ever consists of *n* words, indexed by positive integers from 1 to *n*. The secret needs dividing between *k* Keepers (let's index them by positive integers from 1 to *k*), the *i*-th Keeper gets a non-empty ... | 4,344 |
Title: Messenger
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Each employee of the "Blake Techologies" company uses a special messaging app "Blake Messenger". All the stuff likes this app and uses it constantly. However, some important futures are missing. For example, many users want t... | 4,345 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Piglet has got a birthday today. His friend Winnie the Pooh wants to make the best present for him β a honey pot. Of course Winnie realizes that he won't manage to get the full pot to Piglet. In fact, he is likely to eat all the h... | 4,346 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vlad likes to eat in cafes very much. During his life, he has visited cafes *n* times. Unfortunately, Vlad started to feel that his last visits are not any different from each other. To fix that Vlad had a small research.
First o... | 4,347 |
Title: Jamie and Tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
To your surprise, Jamie is the final boss! Ehehehe.
Jamie has given you a tree with *n* vertices, numbered from 1 to *n*. Initially, the root of the tree is the vertex with number 1. Also, each vertex has a value on it.... | 4,348 |
Title: Plant
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Dwarfs have planted a very interesting plant, which is a triangle directed "upwards". This plant has an amusing feature. After one year a triangle plant directed "upwards" divides into four triangle plants: three of them will poi... | 4,349 |
Title: Find The Bone
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Zane the wizard is going to perform a magic show shuffling the cups.
There are *n* cups, numbered from 1 to *n*, placed along the *x*-axis on a table that has *m* holes on it. More precisely, cup *i* is on the table at t... | 4,350 |
Title: Face Detection
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The developers of Looksery have to write an efficient algorithm that detects faces on a picture. Unfortunately, they are currently busy preparing a contest for you, so you will have to do it for them.
In this problem a... | 4,351 |
Title: Malek Dance Club
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
As a tradition, every year before IOI all the members of Natalia Fan Club are invited to Malek Dance Club to have a fun night together. Malek Dance Club has 2*n* members and coincidentally Natalia Fan Club also has 2*n... | 4,352 |
Title: Underfail
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You have recently fallen through a hole and, after several hours of unconsciousness, have realized you are in an underground city. On one of your regular, daily walks through the unknown, you have encountered two unusually lo... | 4,353 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a positive integer *n*. Let's build a graph on vertices 1,<=2,<=...,<=*n* in such a way that there is an edge between vertices *u* and *v* if and only if . Let *d*(*u*,<=*v*) be the shortest distance between *u* and ... | 4,354 |
Title: Land Lot
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Vasya has a beautiful garden where wonderful fruit trees grow and yield fantastic harvest every year. But lately thieves started to sneak into the garden at nights and steal the fruit too often. Vasya canβt spend the nights in the... | 4,355 |
Title: Family Photos
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Alice and Bonnie are sisters, but they don't like each other very much. So when some old family photos were found in the attic, they started to argue about who should receive which photos. In the end, they decided that th... | 4,356 |
Title: Looking for Order
Time Limit: 4 seconds
Memory Limit: 512 megabytes
Problem Description:
Girl Lena likes it when everything is in order, and looks for order everywhere. Once she was getting ready for the University and noticed that the room was in a mess β all the objects from her handbag were thrown about th... | 4,357 |
Title: Nanami's Digital Board
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Nanami is an expert at playing games. This day, Nanami's good friend Hajime invited her to watch a game of baseball. Unwilling as she was, she followed him to the stadium. But Nanami had no interest in the game, ... | 4,358 |
Title: Lucky Pair
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Pe... | 4,359 |
Title: Bertown Subway
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The construction of subway in Bertown is almost finished! The President of Berland will visit this city soon to look at the new subway himself.
There are *n* stations in the subway. It was built according to the Bertown... | 4,360 |
Title: Alternative Thinking
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Kevin has just recevied his disappointing results on the USA Identification of Cows Olympiad (USAICO) in the form of a binary string of length *n*. Each character of Kevin's string represents Kevin's score on one o... | 4,361 |
Title: Scrambled
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Btoh yuo adn yuor roomatme lhoate wianshg disehs, btu stlil sdmoeboy msut peorrfm tihs cohre dialy. Oen dya yuo decdie to idourtcne smoe syestm. Yuor rmmotaoe sstgegus teh fooniwllg dael. Yuo argee on tow arayrs of ientgres M... | 4,362 |
Title: Vasya the Hipster
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One day Vasya the Hipster decided to count how many socks he had. It turned out that he had *a* red socks and *b* blue socks.
According to the latest fashion, hipsters should wear the socks of different colors: a red... | 4,363 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vladimir wants to modernize partitions in his office. To make the office more comfortable he decided to remove a partition and plant several bamboos in a row. He thinks it would be nice if there are *n* bamboos in a row, and the *... | 4,364 |
Title: Clever Fat Rat
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Fat Rat and his friend Π‘erealguy have had a bet whether at least a few oats are going to descend to them by some clever construction. The figure below shows the clever construction.
A more formal description of the ... | 4,365 |
Title: File List
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Eudokimus, a system administrator is in trouble again. As a result of an error in some script, a list of names of very important files has been damaged. Since they were files in the BerFS file system, it is known that each fi... | 4,366 |
Title: Boys and Girls
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* boys and *m* girls studying in the class. They should stand in a line so that boys and girls alternated there as much as possible. Let's assume that positions in the line are indexed from left to right by n... | 4,367 |
Title: Road Repairs
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A country named Berland has *n* cities. They are numbered with integers from 1 to *n*. City with index 1 is the capital of the country. Some pairs of cities have monodirectional roads built between them. However, not all o... | 4,368 |
Title: Weather Tomorrow
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya came up with his own weather forecasting method. He knows the information about the average air temperature for each of the last *n* days. Assume that the average air temperature for each day is integral.
Vasya ... | 4,369 |
Title: Trails and Glades
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya went for a walk in the park. The park has *n* glades, numbered from 1 to *n*. There are *m* trails between the glades. The trails are numbered from 1 to *m*, where the *i*-th trail connects glades *x**i* and *y*... | 4,370 |
Title: Energy exchange
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
It is well known that the planet suffers from the energy crisis. Little Petya doesn't like that and wants to save the world. For this purpose he needs every accumulator to contain the same amount of energy. Initially every ... | 4,371 |
Title: Oh Sweet Beaverette
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
β Oh my sweet Beaverette, would you fancy a walk along a wonderful woodland belt with me?
β Of course, my Smart Beaver! Let us enjoy the splendid view together. How about Friday night?
At this point the Smart ... | 4,372 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Ilya is sitting in a waiting area of Metropolis airport and is bored of looking at time table that shows again and again that his plane is delayed. So he took out a sheet of paper and decided to solve some problems.
First Ilya ha... | 4,373 |
Title: Rooks and Rectangles
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarpus has a chessboard of size *n*<=Γ<=*m*, where *k* rooks are placed. Polycarpus hasn't yet invented the rules of the game he will play. However, he has already allocated *q* rectangular areas of special str... | 4,374 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Sasha has an array of integers *a*1,<=*a*2,<=...,<=*a**n*. You have to perform *m* queries. There might be queries of two types:
1. 1 l r xΒ β increase all integers on the segment from *l* to *r* by values *x*; 1. 2 l rΒ β find ,... | 4,375 |
Title: Optimal Point on a Line
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given *n* points on a line with their coordinates *x**i*. Find the point *x* so the sum of distances to the given points is minimal.
Input Specification:
The first line contains integer *n* (1<=β€<=*n*<=... | 4,376 |
Title: Fire Again
Time Limit: 2 seconds
Memory Limit: 64 megabytes
Problem Description:
After a terrifying forest fire in Berland a forest rebirth program was carried out. Due to it *N* rows with *M* trees each were planted and the rows were so neat that one could map it on a system of coordinates so that the *j*-th... | 4,377 |
Title: Lakes in Berland
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The map of Berland is a rectangle of the size *n*<=Γ<=*m*, which consists of cells of size 1<=Γ<=1. Each cell is either land or water. The map is surrounded by the ocean.
Lakes are the maximal regions of water cells,... | 4,378 |
Title: Lift and Throw
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
You are given a straight half-line divided into segments of unit length, which we will call positions. The positions are numbered by positive integers that start with 1 from the end of half-line, i. e. 1, 2, 3 and so on. The... | 4,379 |
Title: Scaygerboss
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Cthulhu decided to catch Scaygerboss. Scaygerboss found it out and is trying to hide in a pack of his scaygers. Each scayger except Scaygerboss is either a male or a female. Scaygerboss's gender is "other".
Scaygers are sc... | 4,380 |
Title: Fibonacci-ish II
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Yash is finally tired of computing the length of the longest Fibonacci-ish sequence. He now plays around with more complex things such as Fibonacci-ish potentials.
Fibonacci-ish potential of an array *a**i* is comput... | 4,381 |
Title: Second Order Statistics
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Once Bob needed to find the second order statistics of a sequence of integer numbers. Lets choose each number from the sequence exactly once and sort them. The value on the second position is the second order statis... | 4,382 |
Title: Alex and Complicated Task
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
After you have read all the problems, probably, you think Alex is genius person. That's true! One day he came up with the following task.
Given a sequence of integer numbers *a*1,<=*a*2,<=...,<=*a**n*. You ar... | 4,383 |
Title: Mahmoud and Ehab and the binary string
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Mahmoud and Ehab are in the fourth stage now.
Dr. Evil has a hidden binary string of length *n*. He guarantees that there is at least one '0' symbol and at least one '1' symbol in it. Now he want... | 4,384 |
Title: Encryption (easy)
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Rebel spy Heidi has just obtained the plans for the Death Star from the Empire and, now on her way to safety, she is trying to break the encryption of the plans (of course they are encrypted β the Empire may be evil, ... | 4,385 |
Title: Vile Grasshoppers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The weather is fine today and hence it's high time to climb the nearby pine and enjoy the landscape.
The pine's trunk includes several branches, located one above another and numbered from 2 to *y*. Some of them (mor... | 4,386 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
After years of hard work scientists invented an absolutely new e-reader display. The new display has a larger resolution, consumes less energy and its production is cheaper. And besides, one can bend it. The only inconvenience is ... | 4,387 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Eighth-grader Vova is on duty today in the class. After classes, he went into the office to wash the board, and found on it the number *n*. He asked what is this number and the teacher of mathematics Inna Petrovna answered Vova th... | 4,388 |
Title: Cookie Clicker
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Kostya is playing the computer game Cookie Clicker. The goal of this game is to gather cookies. You can get cookies using different buildings: you can just click a special field on the screen and get the cookies for the ... | 4,389 |
Title: Message
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Dr. Moriarty is about to send a message to Sherlock Holmes. He has a string *s*.
String *p* is called a substring of string *s* if you can read it starting from some position in the string *s*. For example, string "aba" has s... | 4,390 |
Title: New Year and Old Property
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The year 2015 is almost over.
Limak is a little polar bear. He has recently learnt about the binary system. He noticed that the passing year has exactly one zero in its representation in the binary systemΒ β 2... | 4,391 |
Title: Ternary Logic
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little Petya very much likes computers. Recently he has received a new "Ternatron IV" as a gift from his mother. Unlike other modern computers, "Ternatron IV" operates with ternary and not binary logic. Petya immediately ... | 4,392 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Fat Rat and his friend Π‘erealguy have had a bet whether at least a few oats are going to descend to them by some clever construction. The figure below shows the clever construction.
A more formal description of the clever con... | 4,393 |
Title: Divisor Tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A divisor tree is a rooted tree that meets the following conditions:
- Each vertex of the tree contains a positive integer number. - The numbers written in the leaves of the tree are prime numbers. - For any inner ver... | 4,394 |
Title: The Sum of the k-th Powers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are well-known formulas: , , . Also mathematicians found similar formulas for higher degrees.
Find the value of the sum modulo 109<=+<=7 (so you should find the remainder after dividing the answer by ... | 4,395 |
Title: Garland
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Once little Vasya read an article in a magazine on how to make beautiful handmade garland from colored paper. Vasya immediately went to the store and bought *n* colored sheets of paper, the area of each sheet is 1 square meter.... | 4,396 |
Title: Disposition
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Vasya bought the collected works of a well-known Berland poet Petya in *n* volumes. The volumes are numbered from 1 to *n*. He thinks that it does not do to arrange the book simply according to their order. Vasya wants to minim... | 4,397 |
Title: Suffix Structures
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Bizon the Champion isn't just a bison. He also is a favorite of the "Bizons" team.
At a competition the "Bizons" got the following problem: "You are given two distinct words (strings of English letters), *s* and *t*.... | 4,398 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
This is an interactive problem.
Jury has hidden a permutation *p* of integers from 0 to *n*<=-<=1. You know only the length *n*. Remind that in permutation all integers are distinct.
Let *b* be the inverse permutation for *p*, i... | 4,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.