task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polar bears like unique arrays β that is, arrays without repeated elements.
You have got a unique array *s* with length *n* containing non-negative integers. Since you are good friends with Alice and Bob, you decide to split the... | 4,600 |
Title: Interactive LowerBound
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
This is an interactive problem.
You are given a sorted in increasing order singly linked list. You should find the minimum integer in the list which is greater than or equal to *x*.
More formally, there is a si... | 4,601 |
Title: Greedy Elevator
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The *m*-floor (*m*<=><=1) office of international corporation CodeForces has the advanced elevator control system established. It works as follows.
All office floors are sequentially numbered with integers from 1 to... | 4,602 |
Title: Picking Strings
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
Not... | 4,603 |
Title: Sereja and Contests
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Sereja is a coder and he likes to take part in Codesorfes rounds. However, Uzhland doesn't have good internet connection, so Sereja sometimes skips rounds.
Codesorfes has rounds of two types: *Div*1 (for advanced c... | 4,604 |
Title: Hard Work
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
After the contest in comparing numbers, Shapur's teacher found out that he is a real genius and that no one could possibly do the calculations faster than him even using a super computer!
Some days before the contest, the teache... | 4,605 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You can perfectly predict the price of a certain stock for the next *N* days. You would like to profit on this knowledge, but only want to transact one share of stock per day. That is, each day you will either buy one share, sell ... | 4,606 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Throughout Igor K.'s life he has had many situations worthy of attention. We remember the story with the virus, the story of his mathematical career and of course, his famous programming achievements. However, one does not always ... | 4,607 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
On a plane are *n* points (*x**i*, *y**i*) with integer coordinates between 0 and 106. The distance between the two points with numbers *a* and *b* is said to be the following value: (the distance calculated by such formula is ca... | 4,608 |
Title: Table
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
John Doe has an *n*<=Γ<=*m* table. John Doe can paint points in some table cells, not more than one point in one table cell. John Doe wants to use such operations to make each square subtable of size *n*<=Γ<=*n* have exactly *k* ... | 4,609 |
Title: Antipalindrome
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A string is a palindrome if it reads the same from the left to the right and from the right to the left. For example, the strings "kek", "abacaba", "r" and "papicipap" are palindromes, while the strings "abb" and "iq" ar... | 4,610 |
Title: President's Office
Time Limit: 2 seconds
Memory Limit: 64 megabytes
Problem Description:
President of Berland has a very vast office-room, where, apart from him, work his subordinates. Each subordinate, as well as President himself, has his own desk of a unique colour. Each desk is rectangular, and its sides ... | 4,611 |
Title: Luxurious Houses
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The capital of Berland has *n* multifloor buildings. The architect who built up the capital was very creative, so all the houses were built in one row.
Let's enumerate all the houses from left to right, starting with ... | 4,612 |
Title: Hopscotch
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
So nearly half of the winter is over and Maria is dreaming about summer. She's fed up with skates and sleds, she was dreaming about Hopscotch all night long. It's a very popular children's game. The game field, the court, loo... | 4,613 |
Title: Easter Eggs
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
The Easter Rabbit laid *n* eggs in a circle and is about to paint them.
Each egg should be painted one color out of 7: red, orange, yellow, green, blue, indigo or violet. Also, the following conditions should be satisfied:
-... | 4,614 |
Title: Bus
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There is a bus stop near the university. The lessons are over, and *n* students come to the stop. The *i*-th student will appear at the bus stop at time *t**i* (all *t**i*'s are distinct).
We shall assume that the stop is located ... | 4,615 |
Title: SMSC
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Some large corporation where Polycarpus works has its own short message service center (SMSC). The center's task is to send all sorts of crucial information. Polycarpus decided to check the efficiency of the SMSC.
For that, he a... | 4,616 |
Title: Summer Reading
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
At school Vasya got an impressive list of summer reading books. Unlike other modern schoolchildren, Vasya loves reading, so he read some book each day of the summer.
As Vasya was reading books, he was making notes in th... | 4,617 |
Title: 24 Game
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of *n* integers: 1,<=2,<=...,<=*n*. In a single step, you can pick two of them... | 4,618 |
Title: Unordered Subsequence
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. Y... | 4,619 |
Title: The Chocolate Spree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Alice and Bob have a tree (undirected acyclic connected graph). There are *a**i* chocolates waiting to be picked up in the *i*-th vertex of the tree. First, they choose two different vertices as their starting posit... | 4,620 |
Title: Little Artem and Presents
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little Artem got *n* stones on his birthday and now wants to give some of them to Masha. He knows that Masha cares more about the fact of receiving the present, rather than the value of that present, so he wan... | 4,621 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* walruses standing in a queue in an airport. They are numbered starting from the queue's tail: the 1-st walrus stands at the end of the queue and the *n*-th walrus stands at the beginning of the queue. The *i*-th walr... | 4,622 |
Title: Progress Bar
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
A progress bar is an element of graphical interface that displays the progress of a process for this very moment before it is completed. Let's take a look at the following form of such a bar.
A bar is represented as *n* squar... | 4,623 |
Title: Zbazi in Zeydabad
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A tourist wants to visit country Zeydabad for Zbazi (a local game in Zeydabad).
The country Zeydabad is a rectangular table consisting of *n* rows and *m* columns. Each cell on the country is either 'z' or '.'.
The ... | 4,624 |
Title: Ostap and Tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Ostap already settled down in Rio de Janiero suburb and started to grow a tree in his garden. Recall that a tree is a connected undirected acyclic graph.
Ostap's tree now has *n* vertices. He wants to paint some vertic... | 4,625 |
Title: Lucky Division
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
... | 4,626 |
Title: String Task
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Petya started to attend programming lessons. On the first lesson his task was to write a simple program. The program was supposed to do the following: in the given string, consisting if uppercase and lowercase Latin letters... | 4,627 |
Title: Zoo
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Zoo in the Grid Kingdom is represented by an infinite grid. The Zoo has *n* observation binoculars located at the *OX* axis. For each *i* between 1 and *n*, inclusive, there exists a single binocular located at the point with c... | 4,628 |
Title: Currency System in Geraldion
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several values. But the problem is, the system is not perfect and sometimes it happens that Geraldionians cann... | 4,629 |
Title: Laurenty and Shop
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A little boy Laurenty has been playing his favourite game Nota for quite a while and is now very hungry. The boy wants to make sausage and cheese sandwiches, but first, he needs to buy a sausage and some cheese.
The ... | 4,630 |
Title: Toy Sum
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little Chris is very keen on his toy blocks. His teacher, however, wants Chris to solve more problems, so he decided to play a trick on Chris.
There are exactly *s* blocks in Chris's set, each block has a unique number from 1 ... | 4,631 |
Title: Decoding
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the... | 4,632 |
Title: Joysticks
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Friends are going to play console. They have two joysticks and only one charger for them. Initially first joystick is charged at *a*1 percent and second one is charged at *a*2 percent. You can connect charger to a joystick on... | 4,633 |
Title: Rotatable Number
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Bike is a smart boy who loves math very much. He invented a number called "Rotatable Number" inspired by 142857.
As you can see, 142857 is a magic number because any of its rotatings can be got by multiplying that nu... | 4,634 |
Title: Oppa Funcan Style Remastered
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Surely you have seen insane videos by South Korean rapper PSY, such as "Gangnam Style", "Gentleman" and "Daddy". You might also hear that PSY has been recording video "Oppa Funcan Style" two years ago (unfo... | 4,635 |
Title: Progress Monitoring
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Programming teacher Dmitry Olegovich is going to propose the following task for one of his tests for students:
You are given a tree *T* with *n* vertices, specified by its adjacency matrix *a*[1... *n*,<=1... *n*].... | 4,636 |
Title: Zip-line
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya has decided to build a zip-line on trees of a nearby forest. He wants the line to be as long as possible but he doesn't remember exactly the heights of all trees in the forest. He is sure that he remembers correct height... | 4,637 |
Title: Zigzag
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The court wizard Zigzag wants to become a famous mathematician. For that, he needs his own theorem, like the Cauchy theorem, or his sum, like the Minkowski sum. But most of all he wants to have his sequence, like the Fibonacci s... | 4,638 |
Title: Mod Mod Mod
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a sequence of integers *a*1,<=*a*2,<=...,<=*a**n*. Let , and for 1<=β€<=*i*<=<<=*n*. Here, denotes the modulus operation. Find the maximum value of *f*(*x*,<=1) over all nonnegative integers *x*.
Input Sp... | 4,639 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Iahub is so happy about inventing bubble sort graphs that he's staying all day long at the office and writing permutations. Iahubina is angry that she is no more important for Iahub. When Iahub goes away, Iahubina comes to his off... | 4,640 |
Title: Logging
Time Limit: 1 seconds
Memory Limit: 64 megabytes
Problem Description:
The main server of Gomble company received a log of one top-secret process, the name of which can't be revealed. The log was written in the following format: Β«[date:time]: messageΒ», where for each Β«[date:time]Β» value existed not mor... | 4,641 |
Title: Lecture Sleep
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Your friend Mishka and you attend a calculus lecture. Lecture lasts *n* minutes. Lecturer tells *a**i* theorems during the *i*-th minute.
Mishka is really interested in calculus, though it is so hard to stay awake for al... | 4,642 |
Title: Login Verification
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
When registering in a social network, users are allowed to create their own convenient login to make it easier to share contacts, print it on business cards, etc.
Login is an arbitrary sequence of lower and uppercas... | 4,643 |
Title: Random Function and Tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You have a rooted tree consisting of *n* vertices. Let's number them with integers from 1 to *n* inclusive. The root of the tree is the vertex 1. For each *i*<=><=1 direct parent of the vertex *i* is *p**i*.... | 4,644 |
Title: Vasya and Types
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Programmer Vasya is studying a new programming language &K*. The &K* language resembles the languages of the C family in its syntax. However, it is more powerful, which is why the rules of the actual C-like language... | 4,645 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
This time our child has a simple polygon. He has to find the number of ways to split the polygon into non-degenerate triangles, each way must satisfy the following requirements:
- each vertex of each triangle is one of the polyg... | 4,646 |
Title: The Road to Berland is Paved With Good Intentions
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Berland has *n* cities, some of them are connected by bidirectional roads. For each road we know whether it is asphalted or not.
The King of Berland Valera II wants to asphalt all road... | 4,647 |
Title: Welcome home, Chtholly
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
β I... I survived.
β Welcome home, Chtholly.
β I kept my promise...
β I made it... I really made it!
After several days of fighting, Chtholly Nota Seniorious miraculously returned from the fierce battle.
As ... | 4,648 |
Title: Doctor
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
There are *n* animals in the queue to Dr. Dolittle. When an animal comes into the office, the doctor examines him, gives prescriptions, appoints tests and may appoint extra examination. Doc knows all the forest animals perfectly wel... | 4,649 |
Title: Liars and Serge
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* people, sitting in a line at the table. For each person we know that he always tells either the truth or lies.
Little Serge asked them: how many of you always tell the truth? Each of the people at the tab... | 4,650 |
Title: Numbers
Time Limit: 1 seconds
Memory Limit: 64 megabytes
Problem Description:
Little Petya likes numbers a lot. He found that number 123 in base 16 consists of two digits: the first is 7 and the second is 11. So the sum of digits of 123 in base 16 is equal to 18.
Now he wonders what is an average value of su... | 4,651 |
Title: Swaps in Permutation
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a permutation of the numbers 1,<=2,<=...,<=*n* and *m* pairs of positions (*a**j*,<=*b**j*).
At each step you can choose a pair from the given positions and swap the numbers in that positions. What i... | 4,652 |
Title: Cowboys
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A very tense moment: *n* cowboys stand in a circle and each one points his colt at a neighbor. Each cowboy can point the colt to the person who follows or precedes him in clockwise direction. Human life is worthless, just like ... | 4,653 |
Title: Birthday
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Today is birthday of a Little DashaΒ β she is now 8 years old! On this occasion, each of her *n* friends and relatives gave her a ribbon with a greeting written on it, and, as it turned out, all the greetings are different. Das... | 4,654 |
Title: Tea Queue
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Recently *n* students from city S moved to city P to attend a programming camp.
They moved there by train. In the evening, all students in the train decided that they want to drink some tea. Of course, no two people can use ... | 4,655 |
Title: Valid Sets
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
As you know, an undirected connected graph with *n* nodes and *n*<=-<=1 edges is called a tree. You are given an integer *d* and a tree consisting of *n* nodes. Each node *i* has a value *a**i* associated with it.
We call a... | 4,656 |
Title: Watering System
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
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 fi... | 4,657 |
Title: Booking System
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Innovation technologies are on a victorious march around the planet. They integrate into all spheres of human activity!
A restaurant called "Dijkstra's Place" has started thinking about optimizing the booking system.
... | 4,658 |
Title: And Yet Another Bracket Sequence
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarpus has a finite sequence of opening and closing brackets. In order not to fall asleep in a lecture, Polycarpus is having fun with his sequence. He is able to perform two operations:
- adding a... | 4,659 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Bearland has *n* cities, numbered 1 through *n*. Cities are connected via bidirectional roads. Each road connects two distinct cities. No two roads connect the same pair of cities.
Bear Limak was once in a city *a* and he wanted ... | 4,660 |
Title: Red-Green Towers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *r* red and *g* green blocks for construction of the red-green tower. Red-green tower can be built following next rules:
- Red-green tower is consisting of some number of levels; - Let the red-green tower ... | 4,661 |
Title: Andryusha and Socks
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Andryusha is an orderly boy and likes to keep things in their place.
Today he faced a problem to put his socks in the wardrobe. He has *n* distinct pairs of socks which are initially in a bag. The pairs are numbere... | 4,662 |
Title: Bipartite Segments
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given an undirected graph with *n* vertices. There are no edge-simple cycles with the even length in it. In other words, there are no cycles of even length that pass each edge at most once. Let's enumerate ve... | 4,663 |
Title: Property
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Bill is a famous mathematician in BubbleLand. Thanks to his revolutionary math discoveries he was able to make enough money to build a beautiful house. Unfortunately, for not paying property tax on time, court decided to punis... | 4,664 |
Title: Football
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A... | 4,665 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Petya and Vasya arranged a game. The game runs by the following rules. Players have a directed graph consisting of *n* vertices and *m* edges. One of the vertices contains a chip. Initially the chip is located at vertex *s*. Playe... | 4,666 |
Title: Help Greg the Dwarf
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
A very unusual citizen lives in a far away kingdom β Dwarf Gracula. However, his unusual name is not the weirdest thing (besides, everyone long ago got used to calling him simply Dwarf Greg). What is special about Dwarf... | 4,667 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
We call a positive integer *x* a *k*-beautiful integer if and only if it is possible to split the multiset of its digits in the decimal representation into two subsets such that the difference between the sum of digits in one subs... | 4,668 |
Title: Chessboard Billiard
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Let's imagine: there is a chess piece billiard ball. Its movements resemble the ones of a bishop chess piece. The only difference is that when a billiard ball hits the board's border, it can reflect from it and continue... | 4,669 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Santa Claus has *n* tangerines, and the *i*-th of them consists of exactly *a**i* slices. Santa Claus came to a school which has *k* pupils. Santa decided to treat them with tangerines.
However, there can be too few tangerines to... | 4,670 |
Title: Save the City!
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
In the town of Aalam-Aara (meaning the Light of the Earth), previously there was no crime, no criminals but as the time progressed, sins started creeping into the hearts of once righteous people. Seeking solution to the prob... | 4,671 |
Title: Upgrading Tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a tree with *n* vertices and you are allowed to perform no more than 2*n* transformations on it. Transformation is defined by three vertices *x*,<=*y*,<=*y*' and consists of deleting edge (*x*,<=*y*) and ad... | 4,672 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Something happened in Uzhlyandia again... There are riots on the streets... Famous Uzhlyandian superheroes Shean the Sheep and Stas the Giraffe were called in order to save the situation. Upon the arriving, they found that citizen... | 4,673 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In the country of Never, there are *n* cities and a well-developed road system. There is exactly one bidirectional road between every pair of cities, thus, there are as many as roads! No two roads intersect, and no road passes th... | 4,674 |
Title: The same permutation
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Seyyed and MoJaK are friends of Sajjad. Sajjad likes a permutation. Seyyed wants to change the permutation in a way that Sajjad won't like it. Seyyed thinks more swaps yield more probability to do that, so he make... | 4,675 |
Title: Little Girl and Maximum XOR
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A little girl loves problems on bitwise operations very much. Here's one of them.
You are given two integers *l* and *r*. Let's consider the values of for all pairs of integers *a* and *b* (*l*<=β€<=*a*<=β€<... | 4,676 |
Title: Shake It!
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A never-ending, fast-changing and dream-like world unfolds, as the secret door opens.
A world is an unordered graph *G*, in whose vertex set *V*(*G*) there are two special vertices *s*(*G*) and *t*(*G*). An initial world has... | 4,677 |
Title: Polycarpus' Dice
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarp has *n* dice *d*1,<=*d*2,<=...,<=*d**n*. The *i*-th dice shows numbers from 1 to *d**i*. Polycarp rolled all the dice and the sum of numbers they showed is *A*. Agrippina didn't see which dice showed what numb... | 4,678 |
Title: Permutation
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
"Hey, it's homework time" β thought Polycarpus and of course he started with his favourite subject, IT. Polycarpus managed to solve all tasks but for the last one in 20 minutes. However, as he failed to solve the last task ... | 4,679 |
Title: Hockey
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Petya loves hockey very much. One day, as he was watching a hockey match, he fell asleep. Petya dreamt of being appointed to change a hockey team's name. Thus, Petya was given the original team name *w* and the collection of forbidd... | 4,680 |
Title: Three matrices
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Chubby Yang is studying linear equations right now. He came up with a nice problem. In the problem you are given an *n*<=Γ<=*n* matrix *W*, consisting of integers, and you should find two *n*<=Γ<=*n* matrices *A* and *B*... | 4,681 |
Title: Happy Line
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Do you like summer? Residents of Berland do. They especially love eating ice cream in the hot summer. So this summer day a large queue of *n* Berland residents lined up in front of the ice cream stall. We know that each of t... | 4,682 |
Title: Antimatter
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Iahub accidentally discovered a secret lab. He found there *n* devices ordered in a line, numbered from 1 to *n* from left to right. Each device *i* (1<=β€<=*i*<=β€<=*n*) can create either *a**i* units of matter or *a**i* unit... | 4,683 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a convex polygon *P* with *n* distinct vertices *p*1,<=*p*2,<=...,<=*p**n*. Vertex *p**i* has coordinates (*x**i*,<=*y**i*) in the 2D plane. These vertices are listed in clockwise order.
You can choose a real number... | 4,684 |
Title: Arrow
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Petya has recently started working as a programmer in the IT city company that develops computer games.
Besides game mechanics implementation to create a game it is necessary to create tool programs that can be used by game desi... | 4,685 |
Title: Lawnmower
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You have a garden consisting entirely of grass and weeds. Your garden is described by an *n*<=Γ<=*m* grid, with rows numbered 1 to *n* from top to bottom, and columns 1 to *m* from left to right. Each cell is identified by a ... | 4,686 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
An expedition group flew from planet ACM-1 to Earth in order to study the bipedal species (its representatives don't even have antennas on their heads!).
The flying saucer, on which the brave pioneers set off, consists of three s... | 4,687 |
Title: On Iteration of One Well-Known Function
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Of course, many of you can calculate Ο(*n*) β the number of positive integers that are less than or equal to *n*, that are coprime with *n*. But what if we need to calculate Ο(Ο(...Ο(*n*))), wher... | 4,688 |
Title: Short Code
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Arkady's code contains $n$ variables. Each variable has a unique name consisting of lowercase English letters only. One day Arkady decided to shorten his code.
He wants to replace each variable name with its non-empty prefi... | 4,689 |
Title: Points, Lines and Ready-made Titles
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given *n* distinct points on a plane with integral coordinates. For each point you can either draw a vertical line through it, draw a horizontal line through it, or do nothing.
You consider ... | 4,690 |
Title: Domino
Time Limit: 0 seconds
Memory Limit: 256 megabytes
Problem Description:
Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2<=Γ<=1. Both halves of each domino contain one digit from 0 to 6.
The figure that consists of 28 dominoes is ca... | 4,691 |
Title: Roman Digits
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let's introduce a number system which is based on a roman digits. There are digits I, V, X, L which correspond to the numbers $1$, $5$, $10$ and $50$ respectively. The use of other roman digits is not allowed.
Numbers in ... | 4,692 |
Title: Spreadsheet
Time Limit: 10 seconds
Memory Limit: 64 megabytes
Problem Description:
In the popular spreadsheets systems (for example, in Excel) the following numeration of columns is used. The first column has number A, the second β number B, etc. till column 26 that is marked by Z. Then there are two-letter n... | 4,693 |
Title: Simplified Nonogram
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In this task you have to write a program dealing with nonograms on fields no larger than 5<=Γ<=20.
Simplified nonogram is a task where you have to build such field (each cell is either white or black) that satisfie... | 4,694 |
Title: Mike and distribution
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Mike has always been thinking about the harshness of social inequality. He's so obsessed with it that sometimes it even affects him while solving problems. At the moment, Mike has two sequences of positive integer... | 4,695 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Sereja adores trees. Today he came up with a revolutionary new type of binary root trees.
His new tree consists of *n* levels, each vertex is indexed by two integers: the number of the level and the number of the vertex on the cu... | 4,696 |
Title: A Student's Dream
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Statistics claims that students sleep no more than three hours a day. But even in the world of their dreams, while they are snoring peacefully, the sense of impending doom is still upon them.
A poor student is dreaming t... | 4,697 |
Title: 123-sequence
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
There is a given sequence of integers *a*1,<=*a*2,<=...,<=*a**n*, where every number is from 1 to 3 inclusively. You have to replace the minimum number of numbers in it so that all the numbers in the sequence are equal to each... | 4,698 |
Title: Cookies
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Olga came to visit the twins Anna and Maria and saw that they have many cookies. The cookies are distributed into bags. As there are many cookies, Olga decided that it's no big deal if she steals a bag. However, she doesn't wan... | 4,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.