task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Title: Is This a Zebra?
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A camera you have accidentally left in a desert has taken an interesting photo. The photo has a resolution of *n* pixels width, and each column of this photo is all white or all black. Thus, we can represent the photo ... | 2,000 |
Title: Bark to Unlock
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
As technologies develop, manufacturers are making the process of unlocking a phone as user-friendly as possible. To unlock its new phone, Arkady's pet dog Mu-mu has to bark the password once. The phone represents a passw... | 2,001 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Currently Tiny is learning Computational Geometry. When trying to solve a problem called "The Closest Pair Of Points In The Plane", he found that a code which gave a wrong time complexity got Accepted instead of Time Limit Exceede... | 2,002 |
Title: Matching Names
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Teachers of one programming summer school decided to make a surprise for the students by giving them names in the style of the "Hobbit" movie. Each student must get a pseudonym maximally similar to his own name. The pseu... | 2,003 |
Title: Dirty plates
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
After one of celebrations there is a stack of dirty plates in Nikita's kitchen. Nikita has to wash them and put into a dryer. In dryer, the plates should be also placed in a stack also, and the plates sizes should increase... | 2,004 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Arkady decided to buy roses for his girlfriend.
A flower shop has white, orange and red roses, and the total amount of them is *n*. Arkady thinks that red roses are not good together with white roses, so he won't buy a bouquet co... | 2,005 |
Title: Sereja and Algorithm
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Sereja loves all sorts of algorithms. He has recently come up with a new algorithm, which receives a string as an input. Let's represent the input string of the algorithm as *q*<==<=*q*1*q*2... *q**k*. The algorit... | 2,006 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Programmer Sasha is a student at MIPT (Moscow Institute of Physics and Technology) and he needs to make a laboratory work to pass his finals.
A laboratory unit is a plane with standard coordinate axes marked on it. Physicists fro... | 2,007 |
Title: Test
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Sometimes it is hard to prepare tests for programming problems. Now Bob is preparing tests to new problem about strings — input data to his problem is one string. Bob has 3 wrong solutions to this problem. The first gives the wrong an... | 2,008 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One day Polycarpus got hold of two non-empty strings *s* and *t*, consisting of lowercase Latin letters. Polycarpus is quite good with strings, so he immediately wondered, how many different pairs of "*x* *y*" are there, such that... | 2,009 |
Title: Ciel and Flowers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Fox Ciel has some flowers: *r* red flowers, *g* green flowers and *b* blue flowers. She wants to use these flowers to make several bouquets. There are 4 types of bouquets:
- To make a "red bouquet", it needs 3 red fl... | 2,010 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Yaroslav has an array, consisting of (2·*n*<=-<=1) integers. In a single operation Yaroslav can change the sign of exactly *n* elements in the array. In other words, in one operation Yaroslav can select exactly *n* array elements,... | 2,011 |
Title: Team Rocket Rises Again
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
It's the turn of the year, so Bash wants to send presents to his friends. There are *n* cities in the Himalayan region and they are connected by *m* bidirectional roads. Bash is living in city *s*. Bash has exac... | 2,012 |
Title: Modified GCD
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Well, here is another math class task. In mathematics, GCD is the greatest common divisor, and it's an easy task to calculate the GCD between two positive integers.
A common divisor for two positive numbers is a number which ... | 2,013 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Little Elephant has got a problem — somebody has been touching his sorted by non-decreasing array *a* of length *n* and possibly swapped some elements of the array.
The Little Elephant doesn't want to call the police until he... | 2,014 |
Title: Captains Mode
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Kostya is a progamer specializing in the discipline of Dota 2. Valve Corporation, the developer of this game, has recently released a new patch which turned the balance of the game upside down. Kostya, as the captain of t... | 2,015 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
ZS the Coder has a large tree. It can be represented as an undirected connected graph of *n* vertices numbered from 0 to *n*<=-<=1 and *n*<=-<=1 edges between them. There is a single nonzero digit written on each edge.
One day, Z... | 2,016 |
Title: Phone Numbers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Winters are just damn freezing cold in Nvodsk! That's why a group of *n* friends prefers to take a taxi, order a pizza and call girls. The phone numbers in the city consist of three pairs of digits (for example, 12-34-56)... | 2,017 |
Title: Petya and Coloring
Time Limit: 5 seconds
Memory Limit: 256 megabytes
Problem Description:
Little Petya loves counting. He wants to count the number of ways to paint a rectangular checkered board of size *n*<=×<=*m* (*n* rows, *m* columns) in *k* colors. Besides, the coloring should have the following property... | 2,018 |
Title: DZY Loves Sequences
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
DZY has a sequence *a*, consisting of *n* integers.
We'll call a sequence *a**i*,<=*a**i*<=+<=1,<=...,<=*a**j* (1<=≤<=*i*<=≤<=*j*<=≤<=*n*) a subsegment of the sequence *a*. The value (*j*<=-<=*i*<=+<=1) denotes the... | 2,019 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Limak is a smart brown bear who loves chemistry, reactions and transforming elements.
In Bearland (Limak's home) there are *n* elements, numbered 1 through *n*. There are also special machines, that can transform elements. Each m... | 2,020 |
Title: Four Segments
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given an array of *n* integer numbers. Let *sum*(*l*,<=*r*) be the sum of all numbers on positions from *l* to *r* non-inclusive (*l*-th element is counted, *r*-th element is not counted). For indices *l* and *r* ... | 2,021 |
Title: Close Vertices
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You've got a weighted tree, consisting of *n* vertices. Each edge has a non-negative weight. The length of the path between any two vertices of the tree is the number of edges in the path. The weight of the path is the t... | 2,022 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In the spirit of the holidays, Saitama has given Genos two grid paths of length *n* (a weird gift even by Saitama's standards). A grid path is an ordered sequence of neighbouring squares in an infinite grid. Two squares are neighb... | 2,023 |
Title: Hamiltonian Spanning Tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A group of *n* cities is connected by a network of roads. There is an undirected road between every pair of cities, so there are roads in total. It takes exactly *y* seconds to traverse any single road.
A sp... | 2,024 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You have number *a*, whose decimal representation quite luckily contains digits 1, 6, 8, 9. Rearrange the digits in its decimal representation so that the resulting number will be divisible by 7.
Number *a* doesn't contain any le... | 2,025 |
Title: Painting Square
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasily the bear has got a large square white table of *n* rows and *n* columns. The table has got a black border around this table.
Vasily the bear wants to paint his square table in exactly *k* moves. Each move is seq... | 2,026 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya and Petya are playing a simple game. Vasya thought of number *x* between 1 and *n*, and Petya tries to guess the number.
Petya can ask questions like: "Is the unknown number divisible by number *y*?".
The game is played by... | 2,027 |
Title: Table
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Simon has a rectangular table consisting of *n* rows and *m* columns. Simon numbered the rows of the table from top to bottom starting from one and the columns — from left to right starting from one. We'll represent the cell on t... | 2,028 |
Title: Really Big Numbers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Ivan likes to learn different things about numbers, but he is especially interested in really big numbers. Ivan thinks that a positive integer number *x* is really big if the difference between *x* and the sum of its... | 2,029 |
Title: Little Artem and Graph
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little Artem is given a graph, constructed as follows: start with some *k*-clique, then add new vertices one by one, connecting them to *k* already existing vertices that form a *k*-clique.
Artem wants to count ... | 2,030 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given an infinite periodic array *a*0,<=*a*1,<=...,<=*a**n*<=-<=1,<=... with the period of length *n*. Formally, . A periodic subarray (*l*,<=*s*) (0<=≤<=*l*<=<<=*n*, 1<=≤<=*s*<=<<=*n*) of array *a* is an infinite pe... | 2,031 |
Title: Zero-One
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little Petya very much likes playing with little Masha. Recently he has received a game called "Zero-One" as a gift from his mother. Petya immediately offered Masha to play the game with him.
Before the very beginning of the ... | 2,032 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Duff is one if the heads of Mafia in her country, Andarz Gu. Andarz Gu has *n* cities (numbered from 1 to *n*) connected by *m* bidirectional roads (numbered by 1 to *m*).
Each road has a destructing time, and a color. *i*-th roa... | 2,033 |
Title: Pilgrims
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A long time ago there was a land called Dudeland. Dudeland consisted of *n* towns connected with *n*<=-<=1 bidirectonal roads. The towns are indexed from 1 to *n* and one can reach any city from any other city if he moves alon... | 2,034 |
Title: Quasi Binary
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A number is called quasibinary if its decimal representation contains only digits 0 or 1. For example, numbers 0, 1, 101, 110011 — are quasibinary and numbers 2, 12, 900 are not.
You are given a positive integer *n*. Repr... | 2,035 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A new bus route is opened in the city . The route is a closed polygon line in the place, with all segments parallel to one of the axes. *m* buses will operate on the route. All buses move in a loop along the route in the same dire... | 2,036 |
Title: Two Heaps
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Valera has 2·*n* cubes, each cube contains an integer from 10 to 99. He arbitrarily chooses *n* cubes and puts them in the first heap. The remaining cubes form the second heap.
Valera decided to play with cubes. During the ... | 2,037 |
Title: Maxim and Array
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Recently Maxim has found an array of *n* integers, needed by no one. He immediately come up with idea of changing it: he invented positive integer *x* and decided to add or subtract it from arbitrary array elements. For... | 2,038 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given several queries. In the *i*-th query you are given a single positive integer *n**i*. You are to represent *n**i* as a sum of maximum possible number of composite summands and print this maximum number, or print -1, i... | 2,039 |
Title: Anfisa the Monkey
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Anfisa the monkey learns to type. She is yet unfamiliar with the "space" key and can only type in lower-case Latin letters. Having typed for a fairly long line, Anfisa understood that it would be great to divide what she ... | 2,040 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Sereja has two sequences *a*1,<=*a*2,<=...,<=*a**n* and *b*1,<=*b*2,<=...,<=*b**m*, consisting of integers. One day Sereja got bored and he decided two play with them. The rules of the game was very simple. Sereja makes several mo... | 2,041 |
Title: Short Program
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Petya learned a new programming language CALPAS. A program in this language always takes one non-negative integer and returns one non-negative integer as well.
In the language, there are only three commands: apply a bitw... | 2,042 |
Title: Far Relative’s Problem
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has *n* friends and each of them can come to the party in a specific range of days of the year from *a**i* to *b**i*. Of course, F... | 2,043 |
Title: Bandit Blues
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Japate, while traveling through the forest of Mala, saw *N* bags of gold lying in a row. Each bag has some distinct weight of gold between 1 to *N*. Japate can carry only one bag of gold with him, so he uses the following ... | 2,044 |
Title: Iahub and Xors
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Iahub does not like background stories, so he'll tell you exactly what this problem asks you for.
You are given a matrix *a* with *n* rows and *n* columns. Initially, all values of the matrix are zeros. Both rows and co... | 2,045 |
Title: none
Time Limit: None seconds
Memory Limit: None 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.
Petya wond... | 2,046 |
Title: Appleman and Easy Task
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Toastman came up with a very easy task. He gives it to Appleman, but Appleman doesn't know how to solve it. Can you help him?
Given a *n*<=×<=*n* checkerboard. Each cell of the board has either character 'x', or... | 2,047 |
Title: The Eternal Immortality
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Even if the world is full of counterfeits, I still regard it as wonderful.
Pile up herbs and incense, and arise again from the flames and ashes of its predecessor — as is known to many, the phoenix does it like... | 2,048 |
Title: Before an Exam
Time Limit: 0 seconds
Memory Limit: 64 megabytes
Problem Description:
Tomorrow Peter has a Biology exam. He does not like this subject much, but *d* days ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately, for this purpose he has... | 2,049 |
Title: Addition on Segments
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Grisha come to a contest and faced the following problem.
You are given an array of size $n$, initially consisting of zeros. The elements of the array are enumerated from $1$ to $n$. You perform $q$ operations on ... | 2,050 |
Title: Print Check
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Kris works in a large company "Blake Technologies". As a best engineer of the company he was assigned a task to develop a printer that will be able to print horizontal and vertical strips. First prototype is already built a... | 2,051 |
Title: The Race
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Every year a race takes place on the motorway between cities A and B. This year Vanya decided to take part in the race and drive his own car that has been around and bears its own noble name — The Huff-puffer.
So, Vasya leaves ci... | 2,052 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car and she likes it. Moreover, son bear can cli... | 2,053 |
Title: Tetragon
Time Limit: 3 seconds
Memory Limit: 256 megabytes
Problem Description:
You're given the centers of three equal sides of a strictly convex tetragon. Your task is to restore the initial tetragon.
Input Specification:
The first input line contains one number *T* — amount of tests (1<=≤<=*T*<=≤<=5·104).... | 2,054 |
Title: Hongcow Draws a Circle
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Hongcow really likes the color red. Hongcow doesn't like the color blue.
Hongcow is standing in an infinite field where there are *n* red points and *m* blue points.
Hongcow wants to draw a circle in the field ... | 2,055 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
В Берляндском государственном университете локальная сеть между серверами не всегда работает без ошибок. При передаче двух одинаковых сообщений подряд возможна ошибка, в результате которой эти два сообщения сливаются в одно. При т... | 2,056 |
Title: On Sum of Number of Inversions in Permutations
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a permutation *p*. Calculate the total number of inversions in all permutations that lexicographically do not exceed the given one.
As this number can be very large, print i... | 2,057 |
Title: Pouring Rain
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A lot of people in Berland hates rain, but you do not. Rain pacifies, puts your thoughts in order. By these years you have developed a good tradition — when it rains, you go on the street and stay silent for a moment, cont... | 2,058 |
Title: Little Pony and Elements of Harmony
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Elements of Harmony are six supernatural artifacts representing subjective aspects of harmony. They are arguably the most powerful force in Equestria. The inside of Elements of Harmony can be see... | 2,059 |
Title: Robbery
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
It is nighttime and Joe the Elusive got into the country's main bank's safe. The safe has *n* cells positioned in a row, each of them contains some amount of diamonds. Let's make the problem more comfortable to work with and mark t... | 2,060 |
Title: Lucky Year
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Apart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lucky if it has no more than 1 non-zero digit in its number. So years 100, 40000, 5 are lucky and 1... | 2,061 |
Title: The Next Good String
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In problems on strings one often has to find a string with some particular properties. The problem authors were reluctant to waste time on thinking of a name for some string so they called it good. A string is good... | 2,062 |
Title: Boredom
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... | 2,063 |
Title: Bear and Prime Numbers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Recently, the bear started studying data structures and faced the following problem.
You are given a sequence of integers *x*1,<=*x*2,<=...,<=*x**n* of length *n* and *m* queries, each of them is characterized b... | 2,064 |
Title: Grocer's Problem
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Yesterday was a fair in a supermarket's grocery section. There were *n* jars with spices on the fair. Before the event the jars were numbered from 1 to *n* from the left to the right. After the event the jars were moved an... | 2,065 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
It's Piegirl's birthday soon, and Pieguy has decided to buy her a bouquet of flowers and a basket of chocolates.
The flower shop has *F* different types of flowers available. The *i*-th type of flower always has exactly *p**i* pe... | 2,066 |
Title: Cow Tennis Tournament
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Farmer John is hosting a tennis tournament with his *n* cows. Each cow has a skill level *s**i*, and no two cows having the same skill level. Every cow plays every other cow exactly once in the tournament, and eac... | 2,067 |
Title: Good Substrings
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Smart Beaver recently got interested in a new word game. The point is as follows: count the number of distinct good substrings of some string *s*. To determine if a string is good or not the game uses rules. Overall the... | 2,068 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given an integer *m* as a product of integers *a*1,<=*a*2,<=... *a**n* . Your task is to find the number of distinct decompositions of number *m* into the product of *n* ordered positive integers.
Decomposition into *n* p... | 2,069 |
Title: Anya and Smartphone
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Anya has bought a new smartphone that uses Berdroid operating system. The smartphone menu has exactly *n* applications, each application has its own icon. The icons are located on different screens, one screen conta... | 2,070 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Stepan likes to repeat vowel letters when he writes words. For example, instead of the word "pobeda" he can write "pobeeeedaaaaa".
Sergey does not like such behavior, so he wants to write a program to format the words written by ... | 2,071 |
Title: Bits
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let's denote as the number of bits set ('1' bits) in the binary representation of the non-negative integer *x*.
You are given multiple queries consisting of pairs of integers *l* and *r*. For each query, find the *x*, such that ... | 2,072 |
Title: Preparing for the Contest
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Soon there will be held the world's largest programming contest, but the testing system still has *m* bugs. The contest organizer, a well-known university, has no choice but to attract university students to f... | 2,073 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Iahub and Iahubina went to a picnic in a forest full of trees. Less than 5 minutes passed before Iahub remembered of trees from programming. Moreover, he invented a new problem and Iahubina has to solve it, otherwise Iahub won't g... | 2,074 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Living in Byteland was good enough to begin with, but the good king decided to please his subjects and to introduce a national language. He gathered the best of wise men, and sent an expedition to faraway countries, so that they w... | 2,075 |
Title: Karen and Coffee
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
To stay woke and attentive during classes, Karen needs some coffee!
Karen, a coffee aficionado, wants to know the optimal temperature for brewing the perfect cup of coffee. Indeed, she has spent some time reading seve... | 2,076 |
Title: Pasha Maximizes
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Pasha has a positive integer *a* without leading zeroes. Today he decided that the number is too small and he should make it larger. Unfortunately, the only operation Pasha can do is to swap two adjacent decimal digits ... | 2,077 |
Title: Star
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Input Specification:
The input contains a single integer *a* (1<=≤<=*a*<=≤<=18257).
Output Specification:
Print a single integer *output* (1<=≤<=*output*<=≤<=2·109).
Demo Input:
['2\n']
Demo Output:
['13']
Note:
none | 2,078 |
Title: Xor-Paths
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There is a rectangular grid of size $n \times m$. Each cell has a number written on it; the number on the cell ($i, j$) is $a_{i, j}$. Your task is to calculate the number of paths from the upper-left cell ($1, 1$) to the bot... | 2,079 |
Title: Sereja and Array
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Sereja has got an array, consisting of *n* integers, *a*1,<=*a*2,<=...,<=*a**n*. Sereja is an active boy, so he is now going to complete *m* operations. Each operation will have one of the three forms:
1. Make *v**i*... | 2,080 |
Title: Cinema Cashier
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
All cinema halls in Berland are rectangles with *K* rows of *K* seats each, and *K* is an odd number. Rows and seats are numbered from 1 to *K*. For safety reasons people, who come to the box office to buy tickets, are not a... | 2,081 |
Title: Add Points
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* points on a straight line, and the *i*-th point among them is located at *x**i*. All these coordinates are distinct.
Determine the number *m* — the smallest number of points you should add on the line to make ... | 2,082 |
Title: Peter and Snow Blower
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Peter got a new snow blower as a New Year present. Of course, Peter decided to try it immediately. After reading the instructions he realized that it does not work like regular snow blowing machines. In order to m... | 2,083 |
Title: George and Job
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The new ITone 6 has been released recently and George got really keen to buy it. Unfortunately, he didn't have enough money, so George was going to work as a programmer. Now he faced the following problem at the work.
G... | 2,084 |
Title: Obsessive String
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Hamed has recently found a string *t* and suddenly became quite fond of it. He spent several days trying to find all occurrences of *t* in other strings he had. Finally he became tired and started thinking about the fo... | 2,085 |
Title: Magic Squares
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this challenge to the ABBYY Cup ... | 2,086 |
Title: Chips
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
There are *n* walruses sitting in a circle. All of them are numbered in the clockwise order: the walrus number 2 sits to the left of the walrus number 1, the walrus number 3 sits to the left of the walrus number 2, ..., the walrus nu... | 2,087 |
Title: Sonya and Robots
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Since Sonya is interested in robotics too, she decided to construct robots that will read and recognize numbers.
Sonya has drawn $n$ numbers in a row, $a_i$ is located in the $i$-th position. She also has put a robot ... | 2,088 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Pupils decided to go to amusement park. Some of them were with parents. In total, *n* people came to the park and they all want to get to the most extreme attraction and roll on it exactly once.
Tickets for group of *x* people ar... | 2,089 |
Title: Holiday Of Equality
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In Berland it is the holiday of equality. In honor of the holiday the king decided to equalize the welfare of all citizens in Berland by the expense of the state treasury.
Totally in Berland there are *n* citizens... | 2,090 |
Title: Pangram
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstrate fonts in printing or test the output devices.
... | 2,091 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* kangaroos with pockets. Each kangaroo has a size (integer number). A kangaroo can go into another kangaroo's pocket if and only if the size of kangaroo who hold the kangaroo is at least twice as large as the size of ... | 2,092 |
Title: Ping-Pong (Easy Version)
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In this problem at each moment you have a set of intervals. You can move from interval (*a*,<=*b*) from our set to interval (*c*,<=*d*) from our set if and only if *c*<=<<=*a*<=<<=*d* or *c*<=<<=*b*<=&... | 2,093 |
Title: Open Communication
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Two participants are each given a pair of distinct numbers from 1 to 9 such that there's exactly one number that is present in both pairs. They want to figure out the number that matches by using a communication chan... | 2,094 |
Title: Kefa and Watch
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
One day Kefa the parrot was walking down the street as he was on the way home from the restaurant when he saw something glittering by the road. As he came nearer he understood that it was a watch. He decided to take it t... | 2,095 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Карта звёздного неба представляет собой прямоугольное поле, состоящее из *n* строк по *m* символов в каждой строке. Каждый символ — это либо «.» (означает пустой участок неба), либо «*» (означает то, что в этом месте на небе есть ... | 2,096 |
Title: Queue
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* schoolchildren, boys and girls, lined up in the school canteen in front of the bun stall. The buns aren't ready yet and the line is undergoing some changes.
Each second all boys that stand right in front of girls, ... | 2,097 |
Title: Three Horses
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are three horses living in a horse land: one gray, one white and one gray-and-white. The horses are really amusing animals, which is why they adore special cards. Each of those cards must contain two integers, the fi... | 2,098 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* psychos standing in a line. Each psycho is assigned a unique integer from 1 to *n*. At each step every psycho who has an id greater than the psycho to his right (if exists) kills his right neighbor in the line. Note ... | 2,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.