task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Title: Sereja and Two Sequences
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. Ser... | 4,700 |
Title: Printer
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let's consider a network printer that functions like that. It starts working at time 0. In each second it can print one page of a text. At some moments of time the printer receives printing tasks. We know that a printer receive... | 4,701 |
Title: Lesson Timetable
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
When Petya has free from computer games time, he attends university classes. Every day the lessons on Petyaβs faculty consist of two double classes. The floor where the lessons take place is a long corridor with *M* classr... | 4,702 |
Title: Top Secret Task
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A top-secret military base under the command of Colonel Zuev is expecting an inspection from the Ministry of Defence. According to the charter, each top-secret military base must include a top-secret troop that should..... | 4,703 |
Title: Vectors
Time Limit: 1 seconds
Memory Limit: 256 megabytes
Problem Description:
At a geometry lesson Gerald was given a task: to get vector *B* out of vector *A*. Besides, the teacher permitted him to perform the following operations with vector *Π*:
- Turn the vector by 90 degrees clockwise.- Add to the vec... | 4,704 |
Title: Fence Divercity
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Long ago, Vasily built a good fence at his country house. Vasily calls a fence good, if it is a series of *n* consecutively fastened vertical boards of centimeter width, the height of each in centimeters is a positive i... | 4,705 |
Title: Subtree Minimum Query
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a rooted tree consisting of *n* vertices. Each vertex has a number written on it; number *a**i* is written on vertex *i*.
Let's denote *d*(*i*,<=*j*) as the distance between vertices *i* and *j* in ... | 4,706 |
Title: Constants in the language of Shakespeare
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Shakespeare is a widely known esoteric programming language in which programs look like plays by Shakespeare, and numbers are given by combinations of ornate epithets. In this problem we will ha... | 4,707 |
Title: Social Network
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarpus got an internship in one well-known social network. His test task is to count the number of unique users who have visited a social network during the day. Polycarpus was provided with information on all user r... | 4,708 |
Title: Young Physicist
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
A guy named Vasya attends the final grade of a high school. One day Vasya decided to watch a match of his favorite hockey team. And, as the boy loves hockey very much, even more than physics, he forgot to do the homework. S... | 4,709 |
Title: The Two Routes
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In Absurdistan, there are *n* towns (numbered 1 through *n*) and *m* bidirectional railways. There is also an absurdly simple road networkΒ β for each pair of different towns *x* and *y*, there is a bidirectional road bet... | 4,710 |
Title: Travel Cards
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In the evening Polycarp decided to analyze his today's travel expenses on public transport.
The bus system in the capital of Berland is arranged in such a way that each bus runs along the route between two stops. Each bus... | 4,711 |
Title: Mike and code of a permutation
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Mike has discovered a new way to encode permutations. If he has a permutation *P*<==<=[*p*1,<=*p*2,<=...,<=*p**n*], he will encode it in the following way:
Denote by *A*<==<=[*a*1,<=*a*2,<=...,<=*a**n*] ... | 4,712 |
Title: Number of Ways
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You've got array *a*[1],<=*a*[2],<=...,<=*a*[*n*], consisting of *n* integers. Count the number of ways to split all the elements of the array into three contiguous parts so that the sum of elements in each part is the s... | 4,713 |
Title: Pseudorandom Sequence Period
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarpus has recently got interested in sequences of pseudorandom numbers. He learned that many programming languages generate such sequences in a similar way: (for *i*<=β₯<=1). Here *a*, *b*, *m* are con... | 4,714 |
Title: Lazy Student
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange algorithm on a graphΒ β something that will definitely never be useful in real life. He asked a girl sittin... | 4,715 |
Title: Cardboard Box
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Everyone who has played Cut the Rope knows full well how the gameplay is organized. All levels in the game are divided into boxes. Initially only one box with some levels is available. Player should complete levels to ear... | 4,716 |
Title: Alternating Sum
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given two integers $a$ and $b$. Moreover, you are given a sequence $s_0, s_1, \dots, s_{n}$. All values in $s$ are integers $1$ or $-1$. It's known that sequence is $k$-periodic and $k$ divides $n+1$. In other w... | 4,717 |
Title: Vanya and Food Processor
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vanya smashes potato in a vertical food processor. At each moment of time the height of the potato in the processor doesn't exceed *h* and the processor smashes *k* centimeters of potato each second. If there a... | 4,718 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are many anime that are about "love triangles": Alice loves Bob, and Charlie loves Bob as well, but Alice hates Charlie. You are thinking about an anime which has *n* characters. The characters are labeled from 1 to *n*. Eve... | 4,719 |
Title: Matvey's Birthday
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Today is Matvey's birthday. He never knows what to ask as a present so friends gave him a string *s* of length *n*. This string consists of only first eight English letters: 'a', 'b', ..., 'h'.
First question that co... | 4,720 |
Title: Snake
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let us remind you the rules of a very popular game called "Snake" (or sometimes "Boa", "Python" or "Worm").
The game field is represented by an *n*<=Γ<=*m* rectangular table. Some squares of the field are considered impassable (... | 4,721 |
Title: Case of Fugitive
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Andrewid the Android is a galaxy-famous detective. He is now chasing a criminal hiding on the planet Oxa-5, the planet almost fully covered with water.
The only dry land there is an archipelago of *n* narrow islands l... | 4,722 |
Title: The Maths Lecture
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Amr doesn't like Maths as he finds it really boring, so he usually sleeps in Maths lectures. But one day the teacher suspected that Amr is sleeping and asked him a question to make sure he wasn't.
First he gave Amr t... | 4,723 |
Title: Smallest number
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Recently, Vladimir got bad mark in algebra again. To avoid such unpleasant events in future he decided to train his arithmetic skills. He wrote four integer numbers *a*, *b*, *c*, *d* on the blackboard. During each of the n... | 4,724 |
Title: Garden
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Luba thinks about watering her garden. The garden can be represented as a segment of length *k*. Luba has got *n* buckets, the *i*-th bucket allows her to water some continuous subsegment of garden of length exactly *a**i* each ... | 4,725 |
Title: none
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 as a sequenc... | 4,726 |
Title: Sereja and Dima
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Sereja and Dima play a game. The rules of the game are very simple. The players have *n* cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns, Sereja moves first. Du... | 4,727 |
Title: Three displays
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
It is the middle of 2018 and Maria Stepanovna, who lives outside Krasnokamensk (a town in Zabaikalsky region), wants to rent three displays to highlight an important problem.
There are $n$ displays placed along a road, ... | 4,728 |
Title: Circles of Waiting
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A chip was placed on a field with coordinate system onto point (0,<=0).
Every second the chip moves randomly. If the chip is currently at a point (*x*,<=*y*), after a second it moves to the point (*x*<=-<=1,<=*y*) w... | 4,729 |
Title: Airplane Arrangements
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There is an airplane which has *n* rows from front to back. There will be *m* people boarding this airplane.
This airplane has an entrance at the very front and very back of the plane.
Each person has some assig... | 4,730 |
Title: Traveling Graph
Time Limit: 0 seconds
Memory Limit: 64 megabytes
Problem Description:
You are given undirected weighted graph. Find the length of the shortest cycle which starts from the vertex 1 and passes throught all the edges at least once. Graph may contain multiply edges between a pair of vertices and l... | 4,731 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Pasha is a good student and one of MoJaK's best friends. He always have a problem to think about. Today they had a talk about the following problem.
We have a forest (acyclic undirected graph) with *n* vertices and *m* edges. The... | 4,732 |
Title: Not Quick Transformation
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let *a* be an array consisting of *n* numbers. The array's elements are numbered from 1 to *n*, *even* is an array consisting of the numerals whose numbers are even in *a* (*even**i*<==<=*a*2*i*, 1<=β€<=2*i*<=β€<... | 4,733 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The game of bingo is played on a 5<=Γ<=5 square grid filled with distinct numbers between 1 and 75. In this problem you will consider a generalized version played on an *n*<=Γ<=*n* grid with distinct numbers between 1 and *m* (*m*... | 4,734 |
Title: Dima and Magic Guitar
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Dima loves Inna very much. He decided to write a song for her. Dima has a magic guitar with *n* strings and *m* frets. Dima makes the guitar produce sounds like that: to play a note, he needs to hold one of the st... | 4,735 |
Title: Police Stations
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Inzane finally found Zane with a lot of money to spare, so they together decided to establish a country of their own.
Ruling a country is not an easy job. Thieves and terrorists are always ready to ruin the country's p... | 4,736 |
Title: Image Preview
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya's telephone contains *n* photos. Photo number 1 is currently opened on the phone. It is allowed to move left and right to the adjacent photo by swiping finger over the screen. If you swipe left from the first photo,... | 4,737 |
Title: Restoring the Expression
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A correct expression of the form a+b=c was written; *a*, *b* and *c* are non-negative integers without leading zeros. In this expression, the plus and equally signs were lost. The task is to restore the express... | 4,738 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
When the river brought Gerda to the house of the Old Lady who Knew Magic, this lady decided to make Gerda her daughter. She wants Gerda to forget about Kay, so she puts all the roses from the garden underground.
Mole, who lives i... | 4,739 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Fibonacci numbers are the sequence of integers: *f*0<==<=0, *f*1<==<=1, *f*2<==<=1, *f*3<==<=2, *f*4<==<=3, *f*5<==<=5, ..., *f**n*<==<=*f**n*<=-<=2<=+<=*f**n*<=-<=1. So every next number is the sum of the previous two.
Bajtek ha... | 4,740 |
Title: Igloo Skyscraper
Time Limit: 3 seconds
Memory Limit: 256 megabytes
Problem Description:
Today the North Pole hosts an Olympiad in a sport called... toy igloo skyscrapers' building!
There are *n* walruses taking part in the contest. Each walrus is given a unique number from 1 to *n*. After start each walrus b... | 4,741 |
Title: Median on Segments (Permutations Edition)
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a permutation $p_1, p_2, \dots, p_n$. A permutation of length $n$ is a sequence such that each integer between $1$ and $n$ occurs exactly once in the sequence.
Find the number of... | 4,742 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little X has *n* distinct integers: *p*1,<=*p*2,<=...,<=*p**n*. He wants to divide all of them into two sets *A* and *B*. The following two conditions must be satisfied:
- If number *x* belongs to set *A*, then number *a*<=-<=*x... | 4,743 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There is a computer network consisting of *n* nodes numbered 1 through *n*. There are links in the network that connect pairs of nodes. A pair of nodes may have multiple links between them, but no node has a link to itself.
Each ... | 4,744 |
Title: The Child and Zoo
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Of course our child likes walking in a zoo. The zoo has *n* areas, that are numbered from 1 to *n*. The *i*-th area contains *a**i* animals in it. Also there are *m* roads in the zoo, and each road connects two distin... | 4,745 |
Title: Allowed Letters
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarp has just launched his new startup idea. The niche is pretty free and the key vector of development sounds really promising, so he easily found himself some investors ready to sponsor the company. However, he is... | 4,746 |
Title: k-String
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A string is called a *k*-string if it can be represented as *k* concatenated copies of some string. For example, the string "aabaabaabaab" is at the same time a 1-string, a 2-string and a 4-string, but it is not a 3-string, a ... | 4,747 |
Title: Modular Exponentiation
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The following problem is well-known: given integers *n* and *m*, calculate
where 2*n*<==<=2Β·2Β·...Β·2 (*n* factors), and denotes the remainder of division of *x* by *y*.
You are asked to solve the "reverse" prob... | 4,748 |
Title: Big Number and Remainder
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Stepan has a very big positive integer.
Let's consider all cyclic shifts of Stepan's integer (if we look at his integer like at a string) which are also integers (i.e. they do not have leading zeros). Let's ca... | 4,749 |
Title: Sand Fortress
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are going to the beach with the idea to build the greatest sand castle ever in your head! The beach is not as three-dimensional as you could have imagined, it can be decribed as a line of spots to pile up sand pillars... | 4,750 |
Title: Cinema
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Moscow is hosting a major international conference, which is attended by *n* scientists from different countries. Each of the scientists knows exactly one language. For convenience, we enumerate all languages of the world with i... | 4,751 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Emuskald is an avid horticulturist and owns the world's longest greenhouse β it is effectively infinite in length.
Over the years Emuskald has cultivated *n* plants in his greenhouse, of *m* different plant species numbered from ... | 4,752 |
Title: Rebranding
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The name of one small but proud corporation consists of *n* lowercase English letters. The Corporation has decided to try rebrandingΒ β an active marketing strategy, that includes a set of measures to change either the brand ... | 4,753 |
Title: Colorful Graph
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You've got an undirected graph, consisting of *n* vertices and *m* edges. We will consider the graph's vertices numbered with integers from 1 to *n*. Each vertex of the graph has a color. The color of the *i*-th vertex i... | 4,754 |
Title: Gerald is into Art
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Gerald bought two very rare paintings at the Sotheby's auction and he now wants to hang them on the wall. For that he bought a special board to attach it to the wall and place the paintings on the board. The board ha... | 4,755 |
Title: Hamburgers
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarpus thinks that there are only three decent ingredients to make hamburgers from: a bread, sausage and cheese. He ... | 4,756 |
Title: School
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
There are *n* students studying in the 6th grade, in group "B" of a berland secondary school. Every one of them has exactly one friend whom he calls when he has some news. Let us denote the friend of the person number *i* by *g*(*i*... | 4,757 |
Title: Hongcow Solves A Puzzle
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Hongcow likes solving puzzles.
One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an *n* by *m* grid of characters, where t... | 4,758 |
Title: Guards In The Storehouse
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Polycarp owns a shop in the capital of Berland. Recently the criminal activity in the capital increased, so Polycarp is thinking about establishing some better security in the storehouse of his shop.
The store... | 4,759 |
Title: K-Periodic Array
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
This task will exclusively concentrate only on the arrays where all elements equal 1 and/or 2.
Array *a* is *k*-period if its length is divisible by *k* and there is such array *b* of length *k*, that *a* is represent... | 4,760 |
Title: Three-dimensional Turtle Super Computer
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A super computer has been built in the Turtle Academy of Sciences. The computer consists of *n*Β·*m*Β·*k* CPUs. The architecture was the paralellepiped of size *n*<=Γ<=*m*<=Γ<=*k*, split into 1<=Γ... | 4,761 |
Title: Minimum Ternary String
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a ternary string (it is a string which consists only of characters '0', '1' and '2').
You can swap any two adjacent (consecutive) characters '0' and '1' (i.e. replace "01" with "10" or vice versa) ... | 4,762 |
Title: Fox And Names
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Fox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: "Fox"). She heard a rumor: the authors list on the paper is always sorted in the lexicographical order.
After checking some examp... | 4,763 |
Title: Fake News (hard)
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Now that you have proposed a fake post for the HC2 Facebook page, Heidi wants to measure the quality of the post before actually posting it. She recently came across a (possibly fake) article about the impact of fracta... | 4,764 |
Title: Field expansion
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
In one of the games Arkady is fond of the game process happens on a rectangular field. In the game process Arkady can buy extensions for his field, each extension enlarges one of the field sizes in a particular number o... | 4,765 |
Title: Sequence Transformation
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You've got a non-decreasing sequence *x*1,<=*x*2,<=...,<=*x**n* (1<=β€<=*x*1<=β€<=*x*2<=β€<=...<=β€<=*x**n*<=β€<=*q*). You've also got two integers *a* and *b* (*a*<=β€<=*b*;Β *a*Β·(*n*<=-<=1)<=<<=*q*).
Your task is... | 4,766 |
Title: Potions Homework
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Harry Water, Ronaldo, Her-my-oh-knee and their friends have started a new school year at their MDCS School of Speechcraft and Misery. At the time, they are very happy to have seen each other after a long time. The sun ... | 4,767 |
Title: Sea Battle
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Galya is playing one-dimensional Sea Battle on a 1<=Γ<=*n* grid. In this game *a* ships are placed on the grid. Each of the ships consists of *b* consecutive cells. No cell can be part of two ships, however, the ships can to... | 4,768 |
Title: Berland Elections
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The elections to Berland parliament are happening today. Voting is in full swing!
Totally there are *n* candidates, they are numbered from 1 to *n*. Based on election results *k* (1<=β€<=*k*<=β€<=*n*) top candidates wi... | 4,769 |
Title: Worms Evolution
Time Limit: 2 seconds
Memory Limit: 256 megabytes
Problem Description:
Professor Vasechkin is studying evolution of worms. Recently he put forward hypotheses that all worms evolve by division. There are *n* forms of worms. Worms of these forms have lengths *a*1, *a*2, ..., *a**n*. To prove his... | 4,770 |
Title: Tavas and Malekas
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 sleepin... | 4,771 |
Title: Castle Defense
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Today you are going to lead a group of elven archers to defend the castle that is attacked by an army of angry orcs. Three sides of the castle are protected by impassable mountains and the remaining side is occupied by a... | 4,772 |
Title: Encryption (medium)
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Heidi has now broken the first level of encryption of the Death Star plans, and is staring at the screen presenting her with the description of the next code she has to enter. It looks surprisingly similar to the fi... | 4,773 |
Title: Useful Decomposition
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Ramesses knows a lot about problems involving trees (undirected connected graphs without cycles)!
He created a new useful tree decomposition, but he does not know how to construct it, so he asked you for help!
Th... | 4,774 |
Title: Queue
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
During the lunch break all *n* Berland State University students lined up in the food court. However, it turned out that the food court, too, has a lunch break and it temporarily stopped working.
Standing in a queue that isn't b... | 4,775 |
Title: Fetch the Treasure
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Rainbow built *h* cells in a row that are numbered from 1 to *h* from left to right. There are *n* cells with treasure. We call each of these *n* cells "Treasure Cell". The *i*-th "Treasure Cell" is the *a**i*-th cel... | 4,776 |
Title: Tree Queries
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a tree consisting of *n* vertices (numbered from 1 to *n*). Initially all vertices are white. You have to process *q* queries of two different types:
1. 1 *x* β change the color of vertex *x* to black. It i... | 4,777 |
Title: Number Transformation II
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You are given a sequence of positive integers *x*1,<=*x*2,<=...,<=*x**n* and two non-negative integers *a* and *b*. Your task is to transform *a* into *b*. To do that, you can perform the following moves:
- s... | 4,778 |
Title: Maze
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Pavel loves grid mazes. A grid maze is an *n*<=Γ<=*m* rectangle maze where each cell is either empty, or is a wall. You can go from one cell to another only if both cells are empty and have a common side.
Pavel drew a grid maze w... | 4,779 |
Title: Jamie and Interesting Graph
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Jamie has recently found undirected weighted graphs with the following properties very interesting:
- The graph is connected and contains exactly *n* vertices and *m* edges. - All edge weights are integer... | 4,780 |
Title: Tree
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The Main Martian Tree grows on Mars. It is a binary tree (a rooted tree, with no more than two sons at each vertex) with $n$ vertices, where the root vertex has the number $1$. Its fruits are the Main Martian Fruits. It's summer n... | 4,781 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A flower shop has got *n* bouquets, and the *i*-th bouquet consists of *a**i* flowers. Vasya, the manager of the shop, decided to make large bouquets from these bouquets.
Vasya thinks that a bouquet is large if it is made of two... | 4,782 |
Title: Education Reform
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Yet another education system reform has been carried out in Berland recently. The innovations are as follows:
An academic year now consists of *n* days. Each day pupils study exactly one of *m* subjects, besides, each... | 4,783 |
Title: Adjacent Replacements
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Mishka got an integer array $a$ of length $n$ as a birthday present (what a surprise!).
Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjace... | 4,784 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A two dimensional array is called a bracket array if each grid contains one of the two possible brackets β "(" or ")". A path through the two dimensional array cells is called monotonous if any two consecutive cells in the path ar... | 4,785 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
There are *n* bears in the inn and *p* places to sleep. Bears will party together for some number of nights (and days).
Bears love drinking juice. They don't like wine but they can't distinguish it from juice by taste or smell.
... | 4,786 |
Title: Non-square Equation
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Let's consider equation:
where *x*,<=*n* are positive integers, *s*(*x*) is the function, equal to the sum of digits of number *x* in the decimal number system.
You are given an integer *n*, find the smallest posi... | 4,787 |
Title: Biridian Forest
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
You're a mikemon breeder currently in the middle of your journey to become a mikemon master. Your current obstacle is go through the infamous Biridian Forest.
The forest
The Biridian Forest is a two-dimensional grid c... | 4,788 |
Title: Two Buttons
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive integer. After clicking the red button, device multiplies the displayed number by t... | 4,789 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Limak is a little bear who learns to draw. People usually start with houses, fences and flowers but why would bears do it? Limak lives in the forest and he decides to draw a tree.
Recall that tree is a connected graph consisting ... | 4,790 |
Title: Ciel and Robot
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Fox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The command was represented by string *s*. Each character of *s* is one move operation. There are four move operations... | 4,791 |
Title: Alena And The Heater
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
"We've tried solitary confinement, waterboarding and listening to Just In Beaver, to no avail. We need something extreme."
"Little Alena got an array as a birthday present..."
The array *b* of length *n* is obtai... | 4,792 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Little Petya is now fond of data compression algorithms. He has already studied gz, bz, zip algorithms and many others. Inspired by the new knowledge, Petya is now developing the new compression algorithm which he wants to name di... | 4,793 |
Title: Remove Duplicates
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Petya has an array $a$ consisting of $n$ integers. He wants to remove duplicate (equal) elements.
Petya wants to leave only the rightmost entry (occurrence) for each element of the array. The relative order of the re... | 4,794 |
Title: Twins
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Imagine that you have a twin brother or sister. Having another person that looks exactly like you seems very unusual. It's hard to say if having something of an alter ego is good or bad. And if you do have a twin, then you very w... | 4,795 |
Title: Ravioli Sort
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
Everybody knows of [spaghetti sort](https://en.wikipedia.org/wiki/Spaghetti_sort). You decided to implement an analog sorting algorithm yourself, but as you survey your pantry you realize you're out of spaghetti! The only ... | 4,796 |
Title: none
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
A tree is a connected undirected graph consisting of *n* vertices and *n*<=<=-<=<=1 edges. Vertices are numbered 1 through *n*.
Limak is a little polar bear and Radewoosh is his evil enemy. Limak once had a tree but Radewoosh sto... | 4,797 |
Title: Closing ceremony
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
The closing ceremony of Squanch Code Cup is held in the big hall with *n*<=Γ<=*m* seats, arranged in *n* rows, *m* seats in a row. Each seat has two coordinates (*x*,<=*y*) (1<=β€<=*x*<=β€<=*n*, 1<=β€<=*y*<=β€<=*m*).
The... | 4,798 |
Title: Create a Maze
Time Limit: None seconds
Memory Limit: None megabytes
Problem Description:
ZS the Coder loves mazes. Your job is to create one so that he can play with it. A maze consists of *n*<=Γ<=*m* rooms, and the rooms are arranged in *n* rows (numbered from the top to the bottom starting from 1) and *m* c... | 4,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.