task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Title: Paint it really, really dark gray
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
I see a pink boar and I want it painted black. Black boars look much more awesome and mighty than the pink ones. Since Jaggy became the ruler of the forest, he has been trying his best to improve the d... | 1,600 |
Title: Weird journey
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little boy Igor wants to become a traveller. At first, he decided to visit all the cities of his motherlandΒ β Uzhlyandia.
It is widely known that Uzhlyandia has *n* cities connected with *m* bidirectional roads. Also, th... | 1,601 |
Title: Yet Another Number Sequence
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Everyone knows what the Fibonacci sequence is. This sequence can be defined by the recurrence relation:
We'll define a new number sequence *A**i*(*k*) by the formula:
In this problem, your task is to cal... | 1,602 |
Title: Lucky Sum
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.
Let *... | 1,603 |
Title: Industrial Nim
Time Limit: 2 seconds
Memory Limit: 64 megabytes
Problem Description:
There are *n* stone quarries in Petrograd.
Each quarry owns *m**i* dumpers (1<=β€<=*i*<=β€<=*n*). It is known that the first dumper of the *i*-th quarry has *x**i* stones in it, the second dumper has *x**i*<=+<=1 stones in it,... | 1,604 |
Title: Relay Race
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Furik and Rubik take part in a relay race. The race will be set up on a large square with the side of *n* meters. The given square is split into *n*<=Γ<=*n* cells (represented as unit squares), each cell has some number.
At... | 1,605 |
Title: Make a Square
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a positive integer $n$, written without leading zeroes (for example, the number 04 is incorrect).
In one operation you can delete any digit of the given integer so that the result remains a positive intege... | 1,606 |
Title: Brand New Easy Problem
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A widely known among some people Belarusian sport programmer Lesha decided to make some money to buy a one square meter larger flat. To do this, he wants to make and carry out a Super Rated Match (SRM) on the sit... | 1,607 |
Title: Labyrinth-10
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
See the problem statement here: [http://codeforces.com/contest/921/problem/01](//codeforces.com/contest/921/problem/01).
Input Specification:
none
Output Specification:
none
Note:
none | 1,608 |
Title: Lucky Tickets
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
In Walrusland public transport tickets are characterized by two integers: by the number of the series and by the number of the ticket in the series. Let the series number be represented by *a* and the ticket number β by *b*, ... | 1,609 |
Title: New Year Transportation
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
New Year is coming in Line World! In this world, there are *n* cells numbered by integers from 1 to *n*, as a 1<=Γ<=*n* board. People live in cells. However, it was hard to move between distinct cells, because o... | 1,610 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Santa Claus likes palindromes very much. There was his birthday recently. *k* of his friends came to him to congratulate him, and each of them presented to him a string *s**i* having the same length *n*. We denote the beauty of th... | 1,611 |
Title: DZY Loves Strings
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
DZY loves collecting special strings which only contain lowercase letters. For each lowercase letter *c* DZY knows its value *w**c*. For each special string *s*<==<=*s*1*s*2... *s*|*s*| (|*s*| is the length of the str... | 1,612 |
Title: Restore Graph
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Valera had an undirected connected graph without self-loops and multiple edges consisting of *n* vertices. The graph had an interesting property: there were at most *k* edges adjacent to each of its vertices. For convenie... | 1,613 |
Title: Opening Portals
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Pavel plays a famous computer game. A player is responsible for a whole country and he can travel there freely, complete quests and earn experience.
This country has *n* cities connected by *m* bidirectional roads of d... | 1,614 |
Title: Colorful Stones
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are two sequences of colorful stones. The color of each stone is one of red, green, or blue. You are given two strings *s* and *t*. The *i*-th (1-based) character of *s* represents the color of the *i*-th stone of... | 1,615 |
Title: Vladik and Courtesy
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
At regular competition Vladik and Valera won *a* and *b* candies respectively. Vladik offered 1 his candy to Valera. After that Valera gave Vladik 2 his candies, so that no one thought that he was less generous. Vla... | 1,616 |
Title: Jzzhu and Cities
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Jzzhu is the president of country A. There are *n* cities numbered from 1 to *n* in his country. City 1 is the capital of A. Also there are *m* roads connecting the cities. One can go from city *u**i* to *v**i* (and vi... | 1,617 |
Title: Greed
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Jafar has *n* cans of cola. Each can is described by two integers: remaining volume of cola *a**i* and can's capacity *b**i* (*a**i* <=β€<= *b**i*).
Jafar has decided to pour all remaining cola into just 2 cans, determine if he c... | 1,618 |
Title: Karen and Game
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
On the way to school, Karen became fixated on the puzzle game on her phone!
The game is played as follows. In each level, you have a grid with *n* rows and *m* columns. Each cell originally contains the number 0.
One m... | 1,619 |
Title: Substring
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a graph with $n$ nodes and $m$ directed edges. One lowercase letter is assigned to each node. We define a path's value as the number of the most frequently occurring letter. For example, if letters on a path are... | 1,620 |
Title: Transferring Pyramid
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya and Petya are using an interesting data storing structure: a pyramid.
The pyramid consists of *n* rows, the *i*-th row contains *i* cells. Each row is shifted half a cell to the left relative to the previous... | 1,621 |
Title: Mother of Dragons
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* castles in the Lannister's Kingdom and some walls connect two castles, no two castles are connected by more than one wall, no wall connects a castle to itself.
Sir Jaime Lannister has discovered that D... | 1,622 |
Title: Cola
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
To celebrate the opening of the Winter Computer School the organizers decided to buy in *n* liters of cola. However, an unexpected difficulty occurred in the shop: it turned out that cola is sold in bottles 0.5, 1 and 2 liters in volu... | 1,623 |
Title: Roland and Rose
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Roland loves growing flowers. He has recently grown a beautiful rose at point (0,<=0) of the Cartesian coordinate system. The rose is so beautiful that Roland is afraid that the evil forces can try and steal it.
To pr... | 1,624 |
Title: Fox And Two Dots
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size *n*<=Γ<=*m* cells, like this:
Each cell contains a dot that has some color. We will use different uppercase La... | 1,625 |
Title: Byteland coins
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* types of coins in Byteland. Conveniently, the denomination of the coin type *k* divides the denomination of the coin type *k*<=+<=1, the denomination of the coin type 1 equals 1 tugrick. The ratio of the de... | 1,626 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Emuskald is a well-known illusionist. One of his trademark tricks involves a set of magical boxes. The essence of the trick is in packing the boxes inside other boxes.
From the top view each magical box looks like a square with s... | 1,627 |
Title: Sereja and Squares
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Sereja painted *n* points on the plane, point number *i* (1<=β€<=*i*<=β€<=*n*) has coordinates (*i*,<=0). Then Sereja marked each point with a small or large English letter. Sereja don't like letter "x", so he didn't u... | 1,628 |
Title: My pretty girl Noora
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In Pavlopolis University where Noora studies it was decided to hold beauty contest "Miss Pavlopolis University". Let's describe the process of choosing the most beautiful girl in the university in more detail.
The... | 1,629 |
Title: Quasi-palindrome
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let quasi-palindromic number be such number that adding some leading zeros (possible none) to it produces a palindromic string.
String *t* is called a palindrome, if it reads the same from left to right and from righ... | 1,630 |
Title: none
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 "1" and "+" b... | 1,631 |
Title: Vacuum Π‘leaner
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
One winter evening the Hedgehog was relaxing at home in his cozy armchair and clicking through the TV channels. Stumbled on an issue of Β«TopShopΒ», the Hedgehog was about to change the channel when all of a sudden he was stop... | 1,632 |
Title: Funky Numbers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
As you very well know, this year's funkiest numbers are so called triangular numbers (that is, integers that are representable as , where *k* is some positive integer), and the coolest numbers are those that are represent... | 1,633 |
Title: Mister B and Flight to the Moon
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In order to fly to the Moon Mister B just needs to solve the following problem.
There is a complete indirected graph with *n* vertices. You need to cover it with several simple cycles of length 3 and 4 ... | 1,634 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Allen dreams of one day owning a enormous fleet of electric cars, the car of the future! He knows that this will give him a big status boost. As Allen is planning out all of the different types of cars he will own and how he will ... | 1,635 |
Title: Leha and another game about graph
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 integ... | 1,636 |
Title: Array
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Chris the Rabbit has been interested in arrays ever since he was a child. At the moment he is researching arrays with the length of *n*, containing only integers from 1 to *n*. He is not good at math, that's why some simple things dr... | 1,637 |
Title: Moon Craters
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
There are lots of theories concerning the origin of moon craters. Most scientists stick to the meteorite theory, which says that the craters were formed as a result of celestial bodies colliding with the Moon. The other versio... | 1,638 |
Title: Infinity Gauntlet
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You took a peek on Thanos wearing Infinity Gauntlet. In the Gauntlet there is a place for six Infinity Gems:
- the Power Gem of purple color, - the Time Gem of green color, - the Space Gem of blue color, - the So... | 1,639 |
Title: Cows and Primitive Roots
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The cows have just learned what a primitive root is! Given a prime *p*, a primitive root is an integer *x* (1<=β€<=*x*<=<<=*p*) such that none of integers *x*<=-<=1,<=*x*2<=-<=1,<=...,<=*x**p*<=-<=2<=-<=1 ar... | 1,640 |
Title: Polycarp's phone book
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* phone numbers in Polycarp's contacts on his phone. Each number is a 9-digit integer, starting with a digit different from 0. All the numbers are distinct.
There is the latest version of Berdroid OS ... | 1,641 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to upper flo... | 1,642 |
Title: Random Task
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer *n*, that among numbers *n*<=+<=1, *n*<=+<=2, ..., 2Β·*n* there are ex... | 1,643 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.
There are *n* citizens in Kekoland, each person has *c**i* coins. Each day, ... | 1,644 |
Title: Alyona and a tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Alyona has a tree with *n* vertices. The root of the tree is the vertex 1. In each vertex Alyona wrote an positive integer, in the vertex *i* she wrote *a**i*. Moreover, the girl wrote a positive integer to every edge... | 1,645 |
Title: Launch of Collider
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. *n* particles will be launched inside it. All of them are located in a straight line and there can not be... | 1,646 |
Title: Valera and X
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Valera is a little boy. Yesterday he got a huge Math hometask at school, so Valera didn't have enough time to properly learn the English alphabet for his English lesson. Unfortunately, the English teacher decided to have a... | 1,647 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Instructors of Some Informatics School make students go to bed.
The house contains *n* rooms, in each room exactly *b* students were supposed to sleep. However, at the time of curfew it happened that many students are not located... | 1,648 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Felix the Robot is preparing for a probability theory exam. Unfortunately, during the semester, he took a course of the belles-lettres instead of studying the subject, so now he does not know the answer to any of the upcoming exam... | 1,649 |
Title: Grasshopper And the String
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far en... | 1,650 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Alyona has a tree with *n* vertices. The root of the tree is the vertex 1. In each vertex Alyona wrote an positive integer, in the vertex *i* she wrote *a**i*. Moreover, the girl wrote a positive integer to every edge of the tree ... | 1,651 |
Title: Hyperdrive
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
In a far away galaxy there are *n* inhabited planets, numbered with numbers from 1 to *n*. They are located at large distances from each other, that's why the communication between them was very difficult until on the planet num... | 1,652 |
Title: Tanya and Postcard
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little Tanya decided to present her dad a postcard on his Birthday. She has already created a message β string *s* of length *n*, consisting of uppercase and lowercase English letters. Tanya can't write yet, so she f... | 1,653 |
Title: Lucky Interval
Time Limit: 4 seconds
Memory Limit: 512 megabytes
Problem Description:
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
One ... | 1,654 |
Title: Log Stream Analysis
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You've got a list of program warning logs. Each record of a log stream is a string in this format:
String "MESSAGE" consists of spaces, uppercase and lowercase English letters and characters "!", ".", ",", "?". St... | 1,655 |
Title: Cut 'em all!
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You're given a tree with $n$ vertices.
Your task is to determine the maximum possible number of edges that can be removed in such a way that all the remaining connected components will have even size.
Input Specification... | 1,656 |
Title: MUH and Sticks
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Two polar bears Menshykov and Uslada from the St.Petersburg zoo and elephant Horace from the Kiev zoo got six sticks to play with and assess the animals' creativity. Menshykov, Uslada and Horace decided to make either an... | 1,657 |
Title: National Property
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You all know that the Library of Bookland is the largest library in the world. There are dozens of thousands of books in the library.
Some long and uninteresting story was removed...
The alphabet of Bookland is so l... | 1,658 |
Title: Graphic Settings
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Recently Ivan bought a new computer. Excited, he unpacked it and installed his favourite game. With his old computer Ivan had to choose the worst possible graphic settings (because otherwise the framerate would be real... | 1,659 |
Title: Petya and Pipes
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A little boy Petya dreams of growing up and becoming the Head Berland Plumber. He is thinking of the problems he will have to solve in the future. Unfortunately, Petya is too inexperienced, so you are about to solve one... | 1,660 |
Title: Beautiful Set
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
We'll call a set of positive integers *a* beautiful if the following condition fulfills: for any prime *p*, if , then . In other words, if one number from the set is divisible by prime *p*, then at least half of numbers f... | 1,661 |
Title: Sum of Digits
Time Limit: 2 seconds
Memory Limit: 265 megabytes
Problem Description:
Having watched the last Harry Potter film, little Gerald also decided to practice magic. He found in his father's magical book a spell that turns any number in the sum of its digits. At the moment Gerald learned that, he came... | 1,662 |
Title: Work Group
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One Big Software Company has *n* employees numbered from 1 to *n*. The director is assigned number 1. Every employee of the company except the director has exactly one immediate superior. The director, of course, doesn't hav... | 1,663 |
Title: Time to Raid Cowavans
Time Limit: 4 seconds
Memory Limit: 70 megabytes
Problem Description:
As you know, the most intelligent beings on the Earth are, of course, cows. This conclusion was reached long ago by the Martian aliens, as well as a number of other intelligent civilizations from outer space.
Sometim... | 1,664 |
Title: Set Theory
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Masha and Grisha like studying sets of positive integers.
One day Grisha has written a set *A* containing *n* different integers *a**i* on a blackboard. Now he asks Masha to create a set *B* containing *n* different integer... | 1,665 |
Title: Hostname Aliases
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are some websites that are accessible through several different addresses. For example, for a long time Codeforces was accessible with two hostnames codeforces.com and codeforces.ru.
You are given a list of page... | 1,666 |
Title: Weird Chess
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Igor has been into chess for a long time and now he is sick of the game by the ordinary rules. He is going to think of new rules of the game and become world famous.
Igor's chessboard is a square of size *n*<=Γ<=*n* cells.... | 1,667 |
Title: Reposts
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One day Polycarp published a funny picture in a social network making a poll about the color of his handle. Many of his friends started reposting Polycarp's joke to their news feed. Some of them reposted the reposts and so on.
... | 1,668 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given an array of positive integers *a*1,<=*a*2,<=...,<=*a**n*<=Γ<=*T* of length *n*<=Γ<=*T*. We know that for any *i*<=><=*n* it is true that *a**i*<==<=*a**i*<=-<=*n*. Find the length of the longest non-decreasing seq... | 1,669 |
Title: Mice and Holes
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One day Masha came home and noticed *n* mice in the corridor of her flat. Of course, she shouted loudly, so scared mice started to run to the holes in the corridor.
The corridor can be represeted as a numeric axis with ... | 1,670 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Sasha and Kolya decided to get drunk with Coke, again. This time they have *k* types of Coke. *i*-th type is characterised by its carbon dioxide concentration . Today, on the party in honour of Sergiy of Vancouver they decided to ... | 1,671 |
Title: Lightsabers (medium)
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There is unrest in the Galactic Senate. Several thousand solar systems have declared their intentions to leave the Republic. Master Heidi needs to select the Jedi Knights who will go on peacekeeping missions throug... | 1,672 |
Title: Pairs
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
There are *n* students in Polycarp's class (including himself). A few days ago all students wrote an essay "My best friend". Each student's essay was dedicated to one of the students of class, to his/her best friend. Note that studen... | 1,673 |
Title: Escaping on Beaveractor
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Don't put up with what you're sick of! The Smart Beaver decided to escape from the campus of Beaver Science Academy (BSA). BSA is a *b*<=Γ<=*b* square on a plane. Each point *x*,<=*y* (0<=β€<=*x*,<=*y*<=β€<=*b*) b... | 1,674 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value.
However, all Mike has is lots of identical resistors with unit resistance *R*0<==<=1. Eleme... | 1,675 |
Title: Chemistry Experiment
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One day two students, Grisha and Diana, found themselves in the university chemistry lab. In the lab the students found *n* test tubes with mercury numbered from 1 to *n* and decided to conduct an experiment.
The ... | 1,676 |
Title: Power Defence
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya plays the Power Defence.
He must pass the last level of the game. In order to do this he must kill the Main Villain, who moves in a straight line at speed 1 meter per second from the point (<=-<=β,<=0) to the poin... | 1,677 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You have been offered a job in a company developing a large social network. Your first task is connected with searching profiles that most probably belong to the same user.
The social network contains *n* registered profiles, num... | 1,678 |
Title: Pasha and Phone
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Pasha has recently bought a new phone jPager and started adding his friends' phone numbers there. Each phone number consists of exactly *n* digits.
Also Pasha has a number *k* and two sequences of length *n*<=/<=*k* (*... | 1,679 |
Title: Longest Regular Bracket Sequence
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
This is yet another problem dealing with regular bracket sequences.
We should remind you that a bracket sequence is called regular, if by inserting Β«+Β» and Β«1Β» into it we can get a correct mathematical exp... | 1,680 |
Title: A Simple Task
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Given a simple graph, output the number of simple cycles in it. A simple cycle is a cycle with no repeated vertices or edges.
Input Specification:
The first line of input contains two integers *n* and *m* (1<=β€<=*n*<=β€<=19, ... | 1,681 |
Title: Opponents
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Arya has *n* opponents in the school. Each day he will fight with all opponents who are present this day. His opponents have some fighting plan that guarantees they will win, but implementing this plan requires presence of th... | 1,682 |
Title: Bus
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A bus moves along the coordinate line *Ox* from the point *x*<==<=0 to the point *x*<==<=*a*. After starting from the point *x*<==<=0, it reaches the point *x*<==<=*a*, immediately turns back and then moves to the point *x*<==<=0. ... | 1,683 |
Title: Reversing Encryption
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A string $s$ of length $n$ can be encrypted by the following algorithm:
- iterate over all divisors of $n$ in decreasing order (i.e. from $n$ to $1$), - for each divisor $d$, reverse the substring $s[1 \dots d]$... | 1,684 |
Title: Police Recruits
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The police department of your city has just started its journey. Initially, they donβt have any manpower. So, they started hiring new recruits in groups.
Meanwhile, crimes keeps occurring within the city. One member of... | 1,685 |
Title: Eugeny and Play List
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Eugeny loves listening to music. He has *n* songs in his play list. We know that song number *i* has the duration of *t**i* minutes. Eugeny listens to each song, perhaps more than once. He listens to song number *i... | 1,686 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The employees of the F company have lots of ways to entertain themselves. Today they invited a famous magician who shows a trick with plastic cups and a marble.
The point is to trick the spectator's attention. Initially, the spec... | 1,687 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Tavas is a strange creature. Usually "zzz" comes out of people's mouth while sleeping, but string *s* of length *n* comes out from Tavas' mouth instead.
Today Tavas fell asleep in Malekas' place. While he was sleeping, Malekas di... | 1,688 |
Title: Cards
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Catherine has a deck of *n* cards, each of which is either red, green, or blue. As long as there are at least two cards left, she can do one of two actions:
- take any two (not necessarily adjacent) cards with different colors... | 1,689 |
Title: International Olympiad
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
International Abbreviation Olympiad takes place annually starting from 1989. Each year the competition receives an abbreviation of form IAO'y, where *y* stands for some number of consequent last digits of the cur... | 1,690 |
Title: Sheep
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Information technologies are developing and are increasingly penetrating into all spheres of human activity. Incredible as it is, the most modern technology are used in farming!
A large farm has a meadow with grazing sheep. Over... | 1,691 |
Title: Valued Keys
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You found a mysterious function *f*. The function takes two strings *s*1 and *s*2. These strings must consist only of lowercase English letters, and must be the same length.
The output of the function *f* is another string... | 1,692 |
Title: War of the Corporations
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce competition. Crucial moment is just around the corner: Gogol is ready to release it's new tablet Last... | 1,693 |
Title: Approximating a Constant Range
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
When Xellos was doing a practice course in university, he once had to measure the intensity of an effect that slowly approached equilibrium. A good way to determine the equilibrium intensity would be choo... | 1,694 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In the year 2500 the annual graduation ceremony in the German University in Cairo (GUC) has run smoothly for almost 500 years so far.
The most important part of the ceremony is related to the arrangement of the professors in the ... | 1,695 |
Title: Olympiad in Programming and Sports
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* students at Berland State University. Every student has two skills, each measured as a number: *a**i* β the programming skill and *b**i* β the sports skill.
It is announced that an Olym... | 1,696 |
Title: If at first you don't succeed...
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Each student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from the same group w... | 1,697 |
Title: Green and Black Tea
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Innokentiy likes tea very much and today he wants to drink exactly *n* cups of tea. He would be happy to drink more but he had exactly *n* tea bags, *a* of them are green and *b* are black.
Innokentiy doesn't like ... | 1,698 |
Title: Lada Malina
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
After long-term research and lots of experiments leading Megapolian automobile manufacturer Β«AutoVozΒ» released a brand new car model named Β«Lada MalinaΒ». One of the most impressive features of Β«Lada MalinaΒ» is its highly ef... | 1,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.