question large_stringlengths 265 13.2k |
|---|
Solve the programming task below in a Python markdown code block.
There are N squares arranged in a row.
The squares are numbered 1, 2, ..., N, from left to right.
Snuke is painting each square in red, green or blue.
According to his aesthetic sense, the following M conditions must all be satisfied.
The i-th condition... |
Solve the programming task below in a Python markdown code block.
For integers b (b \geq 2) and n (n \geq 1), let the function f(b,n) be defined as follows:
- f(b,n) = n, when n < b
- f(b,n) = f(b,\,{\rm floor}(n / b)) + (n \ {\rm mod} \ b), when n \geq b
Here, {\rm floor}(n / b) denotes the largest integer not exce... |
Solve the programming task below in a Python markdown code block.
There is a string s of length 3 or greater.
No two neighboring characters in s are equal.
Takahashi and Aoki will play a game against each other.
The two players alternately performs the following operation, Takahashi going first:
- Remove one of the c... |
Solve the programming task below in a Python markdown code block.
The only difference between easy and hard versions is constraints.
Nauuo is a girl who loves random picture websites.
One day she made a random picture website by herself which includes $n$ pictures.
When Nauuo visits the website, she sees exactly on... |
Solve the programming task below in a Python markdown code block.
In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. For example, the sequence BDF is a subsequence of ABCDEF. A substring of a string is a ... |
Solve the programming task below in a Python markdown code block.
A monster is attacking the Cyberland!
Master Yang, a braver, is going to beat the monster. Yang and the monster each have 3 attributes: hitpoints (HP), offensive power (ATK) and defensive power (DEF).
During the battle, every second the monster's HP d... |
Solve the programming task below in a Python markdown code block.
Mad scientist Mike has just finished constructing a new device to search for extraterrestrial intelligence! He was in such a hurry to launch it for the first time that he plugged in the power wires without giving it a proper glance and started experimen... |
Solve the programming task below in a Python markdown code block.
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 make it work, you need to tie it to some ... |
Solve the programming task below in a Python markdown code block.
Limak is a little polar bear. He plays by building towers from blocks. Every block is a cube with positive integer length of side. Limak has infinitely many blocks of each side length.
A block with side a has volume a^3. A tower consisting of blocks wi... |
Solve the programming task below in a Python markdown code block.
Petya's friends made him a birthday present — a bracket sequence. Petya was quite disappointed with his gift, because he dreamed of correct bracket sequence, yet he told his friends nothing about his dreams and decided to fix present himself.
To make ... |
Solve the programming task below in a Python markdown code block.
SIHanatsuka - EMber SIHanatsuka - ATONEMENT
Back in time, the seven-year-old Nora used to play lots of games with her creation ROBO_Head-02, both to have fun and enhance his abilities.
One day, Nora's adoptive father, Phoenix Wyle, brought Nora $n$ bo... |
Solve the programming task below in a Python markdown code block.
During the research on properties of the greatest common divisor (GCD) of a set of numbers, Ildar, a famous mathematician, introduced a brand new concept of the weakened common divisor (WCD) of a list of pairs of integers.
For a given list of pairs of ... |
Solve the programming task below in a Python markdown code block.
We have a tree with N vertices. Vertex 1 is the root of the tree, and the parent of Vertex i (2 \leq i \leq N) is Vertex P_i.
To each vertex in the tree, Snuke will allocate a color, either black or white, and a non-negative integer weight.
Snuke has a ... |
Solve the programming task below in a Python markdown code block.
In "Takahashi-ya", a ramen restaurant, basically they have one menu: "ramen", but N kinds of toppings are also offered. When a customer orders a bowl of ramen, for each kind of topping, he/she can choose whether to put it on top of his/her ramen or not.... |
Solve the programming task below in a Python markdown code block.
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 words, for each $k \leq i \leq n$ i... |
Solve the programming task below in a Python markdown code block.
Given is a tree with N vertices numbered 1 to N, and N-1 edges numbered 1 to N-1.
Edge i connects Vertex a_i and b_i bidirectionally and has a length of 1.
Snuke will paint each vertex white or black.
The niceness of a way of painting the graph is \max(... |
Solve the programming task below in a Python markdown code block.
Nauuo is a girl who loves playing cards.
One day she was playing cards but found that the cards were mixed with some empty ones.
There are $n$ cards numbered from $1$ to $n$, and they were mixed with another $n$ empty cards. She piled up the $2n$ card... |
Solve the programming task below in a Python markdown code block.
You are given two strings $s$ and $t$. The string $s$ consists of lowercase Latin letters and at most one wildcard character '*', the string $t$ consists only of lowercase Latin letters. The length of the string $s$ equals $n$, the length of the string ... |
Solve the programming task below in a Python markdown code block.
Andrey needs one more problem to conduct a programming contest. He has n friends who are always willing to help. He can ask some of them to come up with a contest problem. Andrey knows one value for each of his fiends — the probability that this friend ... |
Solve the programming task below in a Python markdown code block.
On vacations n pupils decided to go on excursion and gather all together. They need to overcome the path with the length l meters. Each of the pupils will go with the speed equal to v_1. To get to the excursion quickly, it was decided to rent a bus, whi... |
Solve the programming task below in a Python markdown code block.
Jeff got 2n real numbers a_1, a_2, ..., a_2n as a birthday present. The boy hates non-integer numbers, so he decided to slightly "adjust" the numbers he's got. Namely, Jeff consecutively executes n operations, each of them goes as follows: choose index... |
Solve the programming task below in a Python markdown code block.
Polycarp takes part in a quadcopter competition. According to the rules a flying robot should:
start the race from some point of a field, go around the flag, close cycle returning back to the starting point.
Polycarp knows the coordinates of the ... |
Solve the programming task below in a Python markdown code block.
Let's introduce a number system which is based on a roman digits. There are digits I, V, X, L which correspond to the numbers $1$, $5$, $10$ and $50$ respectively. The use of other roman digits is not allowed.
Numbers in this system are written as a se... |
Solve the programming task below in a Python markdown code block.
A has a string consisting of some number of lowercase English letters 'a'. He gives it to his friend B who appends some number of letters 'b' to the end of this string. Since both A and B like the characters 'a' and 'b', they have made sure that at this... |
Solve the programming task below in a Python markdown code block.
Twilight Sparkle was playing Ludo with her friends Rainbow Dash, Apple Jack and Flutter Shy. But she kept losing. Having returned to the castle, Twilight Sparkle became interested in the dice that were used in the game.
The dice has m faces: the first ... |
Solve the programming task below in a Python markdown code block.
In the snake exhibition, there are $n$ rooms (numbered $0$ to $n - 1$) arranged in a circle, with a snake in each room. The rooms are connected by $n$ conveyor belts, and the $i$-th conveyor belt connects the rooms $i$ and $(i+1) \bmod n$. In the other ... |
Solve the programming task below in a Python markdown code block.
Mayor of city S just hates trees and lawns. They take so much space and there could be a road on the place they occupy!
The Mayor thinks that one of the main city streets could be considerably widened on account of lawn nobody needs anyway. Moreover, t... |
Solve the programming task below in a Python markdown code block.
Welcome to Innopolis city. Throughout the whole year, Innopolis citizens suffer from everlasting city construction.
From the window in your room, you see the sequence of n hills, where i-th of them has height a_{i}. The Innopolis administration wants ... |
Solve the programming task below in a Python markdown code block.
The new camp by widely-known over the country Spring Programming Camp is going to start soon. Hence, all the team of friendly curators and teachers started composing the camp's schedule. After some continuous discussion, they came up with a schedule $s$... |
Solve the programming task below in a Python markdown code block.
Sereja has an n × m rectangular table a, each cell of the table contains a zero or a number one. Sereja wants his table to meet the following requirement: each connected component of the same values forms a rectangle with sides parallel to the sides of ... |
Solve the programming task below in a Python markdown code block.
Sasha grew up and went to first grade. To celebrate this event her mother bought her a multiplication table $M$ with $n$ rows and $n$ columns such that $M_{ij}=a_i \cdot a_j$ where $a_1, \dots, a_n$ is some sequence of positive integers.
Of course, the... |
Solve the programming task below in a Python markdown code block.
Elections in Berland are coming. There are only two candidates — Alice and Bob.
The main Berland TV channel plans to show political debates. There are $n$ people who want to take part in the debate as a spectator. Each person is described by their infl... |
Solve the programming task below in a Python markdown code block.
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 fix all the bugs. The university has n students... |
Solve the programming task below in a Python markdown code block.
Ivan places knights on infinite chessboard. Initially there are $n$ knights. If there is free cell which is under attack of at least $4$ knights then he places new knight in this cell. Ivan repeats this until there are no such free cells. One can prove ... |
Solve the programming task below in a Python markdown code block.
In order to put away old things and welcome a fresh new year, a thorough cleaning of the house is a must.
Little Tommy finds an old polynomial and cleaned it up by taking it modulo another. But now he regrets doing this...
Given two integers p and k, ... |
Solve the programming task below in a Python markdown code block.
Mikhail the Freelancer dreams of two things: to become a cool programmer and to buy a flat in Moscow. To become a cool programmer, he needs at least p experience points, and a desired flat in Moscow costs q dollars. Mikhail is determined to follow his d... |
Solve the programming task below in a Python markdown code block.
Edogawa Conan got tired of solving cases, and invited his friend, Professor Agasa, over. They decided to play a game of cards. Conan has n cards, and the i-th card has a number a_{i} written on it.
They take turns playing, starting with Conan. In each ... |
Solve the programming task below in a Python markdown code block.
You are given two integers A and B.
Print a grid where each square is painted white or black that satisfies the following conditions, in the format specified in Output section:
- Let the size of the grid be h \times w (h vertical, w horizontal). Both h... |
Solve the programming task below in a Python markdown code block.
Nearly each project of the F company has a whole team of developers working on it. They often are in different rooms of the office in different cities and even countries. To keep in touch and track the results of the project, the F company conducts shar... |
Solve the programming task below in a Python markdown code block.
You are given two arrays $a$ and $b$ of positive integers, with length $n$ and $m$ respectively.
Let $c$ be an $n \times m$ matrix, where $c_{i,j} = a_i \cdot b_j$.
You need to find a subrectangle of the matrix $c$ such that the sum of its elements ... |
Solve the programming task below in a Python markdown code block.
Paul hates palindromes. He assumes that string s is tolerable if each its character is one of the first p letters of the English alphabet and s doesn't contain any palindrome contiguous substring of length 2 or more.
Paul has found a tolerable string s... |
Solve the programming task below in a Python markdown code block.
"Duel!"
Betting on the lovely princess Claris, the duel between Tokitsukaze and Quailty has started.
There are $n$ cards in a row. Each card has two sides, one of which has color. At first, some of these cards are with color sides facing up and others... |
Solve the programming task below in a Python markdown code block.
Recently a Golden Circle of Beetlovers was found in Byteland. It is a circle route going through $n \cdot k$ cities. The cities are numerated from $1$ to $n \cdot k$, the distance between the neighboring cities is exactly $1$ km.
Sergey does not like b... |
Solve the programming task below in a Python markdown code block.
Snuke has an integer sequence, a, of length N. The i-th element of a (1-indexed) is a_{i}.
He can perform the following operation any number of times:
- Operation: Choose integers x and y between 1 and N (inclusive), and add a_x to a_y.
He would like t... |
Solve the programming task below in a Python markdown code block.
Pari wants to buy an expensive chocolate from Arya. She has n coins, the value of the i-th coin is c_{i}. The price of the chocolate is k, so Pari will take a subset of her coins with sum equal to k and give it to Arya.
Looking at her coins, a question... |
Solve the programming task below in a Python markdown code block.
You have $n$ coins, each of the same value of $1$.
Distribute them into packets such that any amount $x$ ($1 \leq x \leq n$) can be formed using some (possibly one or all) number of these packets.
Each packet may only be used entirely or not used at a... |
Solve the programming task below in a Python markdown code block.
Many years have passed, and n friends met at a party again. Technologies have leaped forward since the last meeting, cameras with timer appeared and now it is not obligatory for one of the friends to stand with a camera, and, thus, being absent on the p... |
Solve the programming task below in a Python markdown code block.
Fox Ciel has n boxes in her room. They have the same size and weight, but they might have different strength. The i-th box can hold at most x_{i} boxes on its top (we'll call x_{i} the strength of the box).
Since all the boxes have the same size, Ciel... |
Solve the programming task below in a Python markdown code block.
You are given N points (x_i,y_i) located on a two-dimensional plane.
Consider a subset S of the N points that forms a convex polygon.
Here, we say a set of points S forms a convex polygon when there exists a convex polygon with a positive area that has ... |
Solve the programming task below in a Python markdown code block.
Given an array a_1, a_2, ..., a_{n} of n integers, find the largest number in the array that is not a perfect square.
A number x is said to be a perfect square if there exists an integer y such that x = y^2.
-----Input-----
The first line contains a... |
Solve the programming task below in a Python markdown code block.
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 $\frac{a_{i}}{1000}$. Today, on the party in honour of Sergiy of Vancouver they decided to prepare... |
Solve the programming task below in a Python markdown code block.
Kuro and Shiro are playing with a board composed of n squares lining up in a row.
The squares are numbered 1 to n from left to right, and Square s has a mark on it.
First, for each square, Kuro paints it black or white with equal probability, independen... |
Solve the programming task below in a Python markdown code block.
A positive integer $a$ is given. Baron Munchausen claims that he knows such a positive integer $n$ that if one multiplies $n$ by $a$, the sum of its digits decreases $a$ times. In other words, $S(an) = S(n)/a$, where $S(x)$ denotes the sum of digits of ... |
Solve the programming task below in a Python markdown code block.
Bike is interested in permutations. A permutation of length n is an integer sequence such that each integer from 0 to (n - 1) appears exactly once in it. For example, [0, 2, 1] is a permutation of length 3 while both [0, 2, 2] and [1, 2, 3] is not.
A p... |
Solve the programming task below in a Python markdown code block.
Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the capital of the country) for the problem preparation process.
There are n + 1 cities consecutively numbe... |
Solve the programming task below in a Python markdown code block.
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are parallel to the coordinate axes: the length of the side th... |
Solve the programming task below in a Python markdown code block.
Fox Ciel is playing a card game with her friend Jiro.
Jiro has n cards, each one has two attributes: position (Attack or Defense) and strength. Fox Ciel has m cards, each one has these two attributes too. It's known that position of all Ciel's cards is... |
Solve the programming task below in a Python markdown code block.
A popular reality show is recruiting a new cast for the third season! $n$ candidates numbered from $1$ to $n$ have been interviewed. The candidate $i$ has aggressiveness level $l_i$, and recruiting this candidate will cost the show $s_i$ roubles.
The s... |
Solve the programming task below in a Python markdown code block.
Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b of equal length are called equivalent in one of the two cases: They are equal. If we split string a into two halves of the same size a_1 and a... |
Solve the programming task below in a Python markdown code block.
Seyyed and MoJaK are friends of Sajjad. Sajjad likes a permutation. Seyyed wants to change the permutation in a way that Sajjad won't like it. Seyyed thinks more swaps yield more probability to do that, so he makes MoJaK to perform a swap between every ... |
Solve the programming task below in a Python markdown code block.
Polycarp is a beginner programmer. He is studying how to use a command line.
Polycarp faced the following problem. There are n files in a directory and he needs to delete some of them. Polycarp wants to run a single delete command with filename pattern... |
Solve the programming task below in a Python markdown code block.
Given is an integer sequence of length N: A_1, A_2, \cdots, A_N.
An integer sequence X, which is also of length N, will be chosen randomly by independently choosing X_i from a uniform distribution on the integers 1, 2, \ldots, A_i for each i (1 \leq i \... |
Solve the programming task below in a Python markdown code block.
Let N be an even number.
There is a tree with N vertices.
The vertices are numbered 1, 2, ..., N.
For each i (1 \leq i \leq N - 1), the i-th edge connects Vertex x_i and y_i.
Snuke would like to decorate the tree with ribbons, as follows.
First, he will... |
Solve the programming task below in a Python markdown code block.
Jon fought bravely to rescue the wildlings who were attacked by the white-walkers at Hardhome. On his arrival, Sam tells him that he wants to go to Oldtown to train at the Citadel to become a maester, so he can return and take the deceased Aemon's place... |
Solve the programming task below in a Python markdown code block.
Arseny likes to organize parties and invite people to it. However, not only friends come to his parties, but friends of his friends, friends of friends of his friends and so on. That's why some of Arseny's guests can be unknown to him. He decided to fix... |
Solve the programming task below in a Python markdown code block.
Limak is an old brown bear. He often plays poker with his friends. Today they went to a casino. There are n players (including Limak himself) and right now all of them have bids on the table. i-th of them has bid with size a_{i} dollars.
Each player ca... |
Solve the programming task below in a Python markdown code block.
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, and multiply each of them by -... |
Solve the programming task below in a Python markdown code block.
Limak is a little polar bear. Polar bears hate long strings and thus they like to compress them. You should also know that Limak is so young that he knows only first six letters of the English alphabet: 'a', 'b', 'c', 'd', 'e' and 'f'.
You are given a ... |
Solve the programming task below in a Python markdown code block.
Little Johnny has recently learned about set theory. Now he is studying binary relations. You've probably heard the term "equivalence relation". These relations are very important in many areas of mathematics. For example, the equality of the two number... |
Solve the programming task below in a Python markdown code block.
There is a polyline going through points (0, 0) – (x, x) – (2x, 0) – (3x, x) – (4x, 0) – ... - (2kx, 0) – (2kx + x, x) – ....
We know that the polyline passes through the point (a, b). Find minimum positive value x such that it is true or determine th... |
Solve the programming task below in a Python markdown code block.
A few years ago Sajjad left his school and register to another one due to security reasons. Now he wishes to find Amir, one of his schoolmates and good friends.
There are n schools numerated from 1 to n. One can travel between each pair of them, to do ... |
Solve the programming task below in a Python markdown code block.
What are you doing at the end of the world? Are you busy? Will you save us?
[Image]
Nephren is playing a game with little leprechauns.
She gives them an infinite array of strings, f_{0... ∞}.
f_0 is "What are you doing at the end of the world? Are... |
Solve the programming task below in a Python markdown code block.
You are given a rebus of form ? + ? - ? + ? = n, consisting of only question marks, separated by arithmetic operation '+' and '-', equality and positive integer n. The goal is to replace each question mark with some positive integer from 1 to n, such th... |
Solve the programming task below in a Python markdown code block.
Consider an N \times N matrix. Let us denote by a_{i, j} the entry in the i-th row and j-th column. For a_{i, j} where i=1 or j=1 holds, its value is one of 0, 1 and 2 and given in the input. The remaining entries are defined as follows:
- a_{i,j} = \m... |
Solve the programming task below in a Python markdown code block.
Panic is rising in the committee for doggo standardization — the puppies of the new brood have been born multi-colored! In total there are 26 possible colors of puppies in the nature and they are denoted by letters from 'a' to 'z' inclusive.
The commit... |
Solve the programming task below in a Python markdown code block.
Little penguin Polo loves his home village. The village has n houses, indexed by integers from 1 to n. Each house has a plaque containing an integer, the i-th house has a plaque containing integer p_{i} (1 ≤ p_{i} ≤ n).
Little penguin Polo loves walkin... |
Solve the programming task below in a Python markdown code block.
Consider a table of size $n \times m$, initially fully white. Rows are numbered $1$ through $n$ from top to bottom, columns $1$ through $m$ from left to right. Some square inside the table with odd side length was painted black. Find the center of this ... |
Solve the programming task below in a Python markdown code block.
This is a simplified version of the task Toy Train. These two versions differ only in the constraints. Hacks for this version are disabled.
Alice received a set of Toy Train™ from Bob. It consists of one train and a connected railway network of $n$ sta... |
Solve the programming task below in a Python markdown code block.
Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation a_{i}x + b_{i}y + c_{i} = 0, where a_{i} and b_{i} are not both equal to the zero. The roads divide the plane into connected regions, possibly of infini... |
Solve the programming task below in a Python markdown code block.
Artsem has a friend Saunders from University of Chicago. Saunders presented him with the following problem.
Let [n] denote the set {1, ..., n}. We will also write f: [x] → [y] when a function f is defined in integer points 1, ..., x, and all its values... |
Solve the programming task below in a Python markdown code block.
As a tradition, every year before IOI all the members of Natalia Fan Club are invited to Malek Dance Club to have a fun night together. Malek Dance Club has 2^{n} members and coincidentally Natalia Fan Club also has 2^{n} members. Each member of MDC is ... |
Solve the programming task below in a Python markdown code block.
A remote island chain contains n islands, labeled 1 through n. Bidirectional bridges connect the islands to form a simple cycle — a bridge connects islands 1 and 2, islands 2 and 3, and so on, and additionally a bridge connects islands n and 1. The cent... |
Solve the programming task below in a Python markdown code block.
You need to execute several tasks, each associated with number of processors it needs, and the compute power it will consume.
You have sufficient number of analog computers, each with enough processors for any task. Each computer can execute up to one ... |
Solve the programming task below in a Python markdown code block.
Recently a serious bug has been found in the FOS code. The head of the F company wants to find the culprit and punish him. For that, he set up an organizational meeting, the issue is: who's bugged the code? Each of the n coders on the meeting said: 'I k... |
Solve the programming task below in a Python markdown code block.
You have an array a with length n, you can perform operations. Each operation is like this: choose two adjacent elements from a, say x and y, and replace one of them with gcd(x, y), where gcd denotes the greatest common divisor.
What is the minimum num... |
Solve the programming task below in a Python markdown code block.
First-rate specialists graduate from Berland State Institute of Peace and Friendship. You are one of the most talented students in this university. The education is not easy because you need to have fundamental knowledge in different areas, which someti... |
Solve the programming task below in a Python markdown code block.
The famous global economic crisis is approaching rapidly, so the states of Berman, Berance and Bertaly formed an alliance and allowed the residents of all member states to freely pass through the territory of any of them. In addition, it was decided tha... |
Solve the programming task below in a Python markdown code block.
A bracketed sequence is called correct (regular) if by inserting "+" and "1" you can get a well-formed mathematical expression from it. For example, sequences "(())()", "()" and "(()(()))" are correct, while ")(", "(()" and "(()))(" are not.
The teache... |
Solve the programming task below in a Python markdown code block.
BigData Inc. is a corporation that has n data centers indexed from 1 to n that are located all over the world. These data centers provide storage for client data (you can figure out that client data is really big!).
Main feature of services offered by ... |
Solve the programming task below in a Python markdown code block.
Recently Ivan the Fool decided to become smarter and study the probability theory. He thinks that he understands the subject fairly well, and so he began to behave like he already got PhD in that area.
To prove his skills, Ivan decided to demonstrate h... |
Solve the programming task below in a Python markdown code block.
Let's call an array consisting of n integer numbers a_1, a_2, ..., a_{n}, beautiful if it has the following property:
consider all pairs of numbers x, y (x ≠ y), such that number x occurs in the array a and number y occurs in the array a; for each p... |
Solve the programming task below in a Python markdown code block.
Bessie the cow has just intercepted a text that Farmer John sent to Burger Queen! However, Bessie is sure that there is a secret message hidden inside.
The text is a string $s$ of lowercase Latin letters. She considers a string $t$ as hidden in string ... |
Solve the programming task below in a Python markdown code block.
Gerald has been selling state secrets at leisure. All the secrets cost the same: n marks. The state which secrets Gerald is selling, has no paper money, only coins. But there are coins of all positive integer denominations that are powers of three: 1 ma... |
Solve the programming task below in a Python markdown code block.
Note that girls in Arpa’s land are really attractive.
Arpa loves overnight parties. In the middle of one of these parties Mehrdad suddenly appeared. He saw n pairs of friends sitting around a table. i-th pair consisted of a boy, sitting on the a_{i}-th... |
Solve the programming task below in a Python markdown code block.
Your friend recently gave you some slimes for your birthday. You have n slimes all initially with value 1.
You are going to play a game with these slimes. Initially, you put a single slime by itself in a row. Then, you will add the other n - 1 slimes o... |
Solve the programming task below in a Python markdown code block.
Kolya has a string s of length n consisting of lowercase and uppercase Latin letters and digits.
He wants to rearrange the symbols in s and cut it into the minimum number of parts so that each part is a palindrome and all parts have the same lengths. A... |
Solve the programming task below in a Python markdown code block.
Polycarpus takes part in the "Field of Wonders" TV show. The participants of the show have to guess a hidden word as fast as possible. Initially all the letters of the word are hidden.
The game consists of several turns. At each turn the participant te... |
Solve the programming task below in a Python markdown code block.
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 in their assigned rooms. T... |
Solve the programming task below in a Python markdown code block.
Rikhail Mubinchik believes that the current definition of prime numbers is obsolete as they are too complex and unpredictable. A palindromic number is another matter. It is aesthetically pleasing, and it has a number of remarkable properties. Help Rikha... |
Solve the programming task below in a Python markdown code block.
Æsir - CHAOS Æsir - V.
"Everything has been planned out. No more hidden concerns. The condition of Cytus is also perfect.
The time right now...... 00:01:12......
It's time."
The emotion samples are now sufficient. After almost 3 years, it's time for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.