question large_stringlengths 265 13.2k |
|---|
Solve the programming task below in a Python markdown code block.
Little Artem has invented a time machine! He could go anywhere in time, but all his thoughts of course are with computer science. He wants to apply this time machine to a well-known data structure: multiset.
Artem wants to create a basic multiset of in... |
Solve the programming task below in a Python markdown code block.
Little boy Gerald studies at school which is quite far from his house. That's why he has to go there by bus every day. The way from home to school is represented by a segment of a straight line; the segment contains exactly n + 1 bus stops. All of them ... |
Solve the programming task below in a Python markdown code block.
Vasya learns to type. He has an unusual keyboard at his disposal: it is rectangular and it has n rows of keys containing m keys in each row. Besides, the keys are of two types. Some of the keys have lowercase Latin letters on them and some of the keys w... |
Solve the programming task below in a Python markdown code block.
City X consists of n vertical and n horizontal infinite roads, forming n × n intersections. Roads (both vertical and horizontal) are numbered from 1 to n, and the intersections are indicated by the numbers of the roads that form them.
Sand roads have l... |
Solve the programming task below in a Python markdown code block.
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror refle... |
Solve the programming task below in a Python markdown code block.
You have a team of N people. For a particular task, you can pick any non-empty subset of people. The cost of having x people for the task is x^{k}.
Output the sum of costs over all non-empty subsets of people.
-----Input-----
Only line of input con... |
Solve the programming task below in a Python markdown code block.
You are given a polynomial of degree N with integer coefficients: f(x)=a_Nx^N+a_{N-1}x^{N-1}+...+a_0. Find all prime numbers p that divide f(x) for every integer x.
Constraints
* 0 \leq N \leq 10^4
* |a_i| \leq 10^9(0\leq i\leq N)
* a_N \neq 0
* All v... |
Solve the programming task below in a Python markdown code block.
Sitting in a station waiting room, Joisino is gazing at her train ticket.
The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).
In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2... |
Solve the programming task below in a Python markdown code block.
## Task
You will receive a string consisting of lowercase letters, uppercase letters and digits as input. Your task is to return this string as blocks separated by dashes (`"-"`). The elements of a block should be sorted with respect to the hierarchy l... |
Solve the programming task below in a Python markdown code block.
Amidakuji is a traditional method of lottery in Japan.
To make an amidakuji, we first draw W parallel vertical lines, and then draw horizontal lines that connect them. The length of each vertical line is H+1 [cm], and the endpoints of the horizontal lin... |
Solve the programming task below in a Python markdown code block.
Sherlock Holmes found a mysterious correspondence of two VIPs and made up his mind to read it. But there is a problem! The correspondence turned out to be encrypted. The detective tried really hard to decipher the correspondence, but he couldn't underst... |
Solve the programming task below in a Python markdown code block.
The last contest held on Johnny's favorite competitive programming platform has been received rather positively. However, Johnny's rating has dropped again! He thinks that the presented tasks are lovely, but don't show the truth about competitors' skill... |
Solve the programming task below in a Python markdown code block.
Authors have come up with the string $s$ consisting of $n$ lowercase Latin letters.
You are given two permutations of its indices (not necessary equal) $p$ and $q$ (both of length $n$). Recall that the permutation is the array of length $n$ which conta... |
Solve the programming task below in a Python markdown code block.
You are given a set of $2n+1$ integer points on a Cartesian plane. Points are numbered from $0$ to $2n$ inclusive. Let $P_i$ be the $i$-th point. The $x$-coordinate of the point $P_i$ equals $i$. The $y$-coordinate of the point $P_i$ equals zero (initia... |
Solve the programming task below in a Python markdown code block.
An AI has infected a text with a character!!
This text is now **fully mutated** to this character.
If the text or the character are empty, return an empty string.
There will never be a case when both are empty as nothing is going on!!
**Note:** Th... |
Solve the programming task below in a Python markdown code block.
Kostya likes the number 4 much. Of course! This number has such a lot of properties, like:
- Four is the smallest composite number;
- It is also the smallest Smith number;
- The smallest non-cyclic group has four elements;
- Four is the maximal degree ... |
Solve the programming task below in a Python markdown code block.
Polycarp starts his own business. Tomorrow will be the first working day of his car repair shop. For now the car repair shop is very small and only one car can be repaired at a given time.
Polycarp is good at marketing, so he has already collected n re... |
Solve the programming task below in a Python markdown code block.
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 examples, she found out that sometime... |
Solve the programming task below in a Python markdown code block.
### Task:
You have to write a function `pattern` which returns the following Pattern(See Examples) upto (2n-1) rows, where n is parameter.
* Note:`Returning` the pattern is not the same as `Printing` the pattern.
#### Parameters:
pattern( ... |
Solve the programming task below in a Python markdown code block.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments parallel to the coo... |
Solve the programming task below in a Python markdown code block.
# Introduction
Fish are an integral part of any ecosystem. Unfortunately, fish are often seen as high maintenance. Contrary to popular belief, fish actually reduce pond maintenance as they graze on string algae and bottom feed from the pond floor. The... |
Solve the programming task below in a Python markdown code block.
Gigi is a clever monkey, living in the zoo, his teacher (animal keeper) recently taught him some knowledge of "0".
In Gigi's eyes, "0" is a character contains some circle(maybe one, maybe two).
So, a is a "0",b is a "0",6 is also a "0",and 8 have two ... |
Solve the programming task below in a Python markdown code block.
Create a function that will return true if all numbers in the sequence follow the same counting pattern. If the sequence of numbers does not follow the same pattern, the function should return false.
Sequences will be presented in an array of varied le... |
Solve the programming task below in a Python markdown code block.
Wherever the destination is, whoever we meet, let's render this song together.
On a Cartesian coordinate plane lies a rectangular stage of size w × h, represented by a rectangle with corners (0, 0), (w, 0), (w, h) and (0, h). It can be seen that no col... |
Solve the programming task below in a Python markdown code block.
XXI Berland Annual Fair is coming really soon! Traditionally fair consists of $n$ booths, arranged in a circle. The booths are numbered $1$ through $n$ clockwise with $n$ being adjacent to $1$. The $i$-th booths sells some candies for the price of $a_i$... |
Solve the programming task below in a Python markdown code block.
Frog Gorf is traveling through Swamp kingdom. Unfortunately, after a poor jump, he fell into a well of $n$ meters depth. Now Gorf is on the bottom of the well and has a long way up.
The surface of the well's walls vary in quality: somewhere they are sl... |
Solve the programming task below in a Python markdown code block.
Ivan had string s consisting of small English letters. However, his friend Julia decided to make fun of him and hid the string s. Ivan preferred making a new string to finding the old one.
Ivan knows some information about the string s. Namely, he rem... |
Solve the programming task below in a Python markdown code block.
Write a program which reads $n$ dices constructed in the same way as Dice I, and determines whether they are all different. For the determination, use the same way as Dice III.
Constraints
* $2 \leq n \leq 100$
* $0 \leq $ the integer assigned to a fa... |
Solve the programming task below in a Python markdown code block.
Polycarp was given an array of $a[1 \dots n]$ of $n$ integers. He can perform the following operation with the array $a$ no more than $n$ times:
Polycarp selects the index $i$ and adds the value $a_i$ to one of his choice of its neighbors. More formall... |
Solve the programming task below in a Python markdown code block.
Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one can find the solution of the problem of discrete logarithm!
... |
Solve the programming task below in a Python markdown code block.
Connected undirected graph without cycles is called a tree. Trees is a class of graphs which is interesting not only for people, but for ants too.
An ant stands at the root of some tree. He sees that there are n vertexes in the tree, and they are conne... |
Solve the programming task below in a Python markdown code block.
While Mahmoud and Ehab were practicing for IOI, they found a problem which name was Longest common subsequence. They solved it, and then Ehab challenged Mahmoud with another problem.
Given two strings a and b, find the length of their longest uncommon ... |
Solve the programming task below in a Python markdown code block.
The [Chinese zodiac](https://en.wikipedia.org/wiki/Chinese_zodiac) is a repeating cycle of 12 years, with each year being represented by an animal and its reputed attributes. The lunar calendar is divided into cycles of 60 years each, and each year has ... |
Solve the programming task below in a Python markdown code block.
Taro is addicted to a novel. The novel has n volumes in total, and each volume has a different thickness. Taro likes this novel so much that he wants to buy a bookshelf dedicated to it. However, if you put a large bookshelf in the room, it will be quite... |
Solve the programming task below in a Python markdown code block.
A binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is st... |
Solve the programming task below in a Python markdown code block.
The store sells $n$ beads. The color of each bead is described by a lowercase letter of the English alphabet ("a"–"z"). You want to buy some beads to assemble a necklace from them.
A necklace is a set of beads connected in a circle.
For example, if th... |
Solve the programming task below in a Python markdown code block.
# Task:
This kata asks you to make a custom esolang interpreter for the language [MiniBitMove](https://esolangs.org/wiki/MiniBitMove). MiniBitMove has only two commands and operates on a array of bits. It works like this:
- `1`: Flip the bit at the cur... |
Solve the programming task below in a Python markdown code block.
Codeforces user' handle color depends on his rating — it is red if his rating is greater or equal to 2400; it is orange if his rating is less than 2400 but greater or equal to 2200, etc. Each time participant takes part in a rated contest, his rating is... |
Solve the programming task below in a Python markdown code block.
Polycarp thinks about the meaning of life very often. He does this constantly, even when typing in the editor. Every time he starts brooding he can no longer fully concentrate and repeatedly presses the keys that need to be pressed only once. For exampl... |
Solve the programming task below in a Python markdown code block.
Once Bob got to a sale of old TV sets. There were n TV sets at that sale. TV set with index i costs ai bellars. Some TV sets have a negative price — their owners are ready to pay Bob if he buys their useless apparatus. Bob can «buy» any TV sets he wants... |
Solve the programming task below in a Python markdown code block.
You can't possibly imagine how cold our friends are this winter in Nvodsk! Two of them play the following game to warm up: initially a piece of paper has an integer q. During a move a player should write any integer number that is a non-trivial divisor ... |
Solve the programming task below in a Python markdown code block.
Consider creating the following number pattern.
4 8 2 3 1 0 8 3 7 6
2 0 5 4 1 8 1 0 3
2 5 9 5 9 9 1 3
7 4 4 4 8 0 4
1 8 8 2 8 4
9 6 0 0 2
5 6 0 2
1 6 2
7 8
Five
This pattern follows the rules below.
A B
C
In the sequence of numbers, C is the one... |
Solve the programming task below in a Python markdown code block.
There is a directed graph with N vertices numbered 1 to N and M edges.
The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge.
Additionally, there is a button on Vertex N.
We will play a game on this grap... |
Solve the programming task below in a Python markdown code block.
# Task
The sequence of `Chando` is an infinite sequence of all Chando's numbers in ascending order.
A number is called `Chando's` if it is an integer that can be represented as a sum of different positive integer powers of 5.
The first Chando's num... |
Solve the programming task below in a Python markdown code block.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, ypi ≤ 10000
* p0 ≠ p1 and p2 ≠ p3.
Input
The entire input ... |
Solve the programming task below in a Python markdown code block.
Write a function, which takes a non-negative integer (seconds) as input and returns the time in a human-readable format (`HH:MM:SS`)
* `HH` = hours, padded to 2 digits, range: 00 - 99
* `MM` = minutes, padded to 2 digits, range: 00 - 59
* `SS` = second... |
Solve the programming task below in a Python markdown code block.
Taro is playing with a puzzle that places numbers 1-9 in 9x9 squares. In this puzzle, you have to arrange the numbers according to the following rules.
* One number appears exactly once in the same column
* A number appears exactly once on the same lin... |
Solve the programming task below in a Python markdown code block.
Anya loves to watch horror movies. In the best traditions of horror, she will be visited by m ghosts tonight. Anya has lots of candles prepared for the visits, each candle can produce light for exactly t seconds. It takes the girl one second to light on... |
Solve the programming task below in a Python markdown code block.
Your search for Heidi is over – you finally found her at a library, dressed up as a human. In fact, she has spent so much time there that she now runs the place! Her job is to buy books and keep them at the library so that people can borrow and read the... |
Solve the programming task below in a Python markdown code block.
The robot is placed in the top left corner of a grid, consisting of $n$ rows and $m$ columns, in a cell $(1, 1)$.
In one step, it can move into a cell, adjacent by a side to the current one:
$(x, y) \rightarrow (x, y + 1)$;
$(x, y) \rightarrow (x + 1... |
Solve the programming task below in a Python markdown code block.
You are given two strings s and t consisting of small Latin letters, string s can also contain '?' characters.
Suitability of string s is calculated by following metric:
Any two letters can be swapped positions, these operations can be performed arbi... |
Solve the programming task below in a Python markdown code block.
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 is shining, birds are singing, flow... |
Solve the programming task below in a Python markdown code block.
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 the cells with positive n... |
Solve the programming task below in a Python markdown code block.
Write a function ```convert_temp(temp, from_scale, to_scale)``` converting temperature from one scale to another.
Return converted temp value.
Round converted temp value to an integer(!).
Reading: http://en.wikipedia.org/wiki/Conversion_of_units_of_... |
Solve the programming task below in a Python markdown code block.
The Metropolis computer network consists of n servers, each has an encryption key in the range from 0 to 2^k - 1 assigned to it. Let c_i be the encryption key assigned to the i-th server. Additionally, m pairs of servers are directly connected via a dat... |
Solve the programming task below in a Python markdown code block.
Unscramble the eggs.
The string given to your function has had an "egg" inserted directly after each consonant. You need to return the string before it became eggcoded.
## Example
Kata is supposed to be for beginners to practice regular expressions,... |
Solve the programming task below in a Python markdown code block.
The student council has a shared document file. Every day, some members of the student council write the sequence TMT (short for Towa Maji Tenshi) in it.
However, one day, the members somehow entered the sequence into the document at the same time, cre... |
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.
There are $n$ people who want to participate in a boat competition. The weight of the $i$-th participant is $w_i$. Only teams consisting of two people can participate in this competition. As an organizer, you think that it's fair to allow only teams wit... |
Solve the programming task below in a Python markdown code block.
Alice has a string $s$. She really likes the letter "a". She calls a string good if strictly more than half of the characters in that string are "a"s. For example "aaabb", "axaa" are good strings, and "baca", "awwwa", "" (empty string) are not.
Alice c... |
Solve the programming task below in a Python markdown code block.
As their story unravels, a timeless tale is told once again...
Shirahime, a friend of Mocha's, is keen on playing the music game Arcaea and sharing Mocha interesting puzzles to solve. This day, Shirahime comes up with a new simple puzzle and wants Moch... |
Solve the programming task below in a Python markdown code block.
Prior to having fancy iPhones, teenagers would wear out their thumbs sending SMS
messages on candybar-shaped feature phones with 3x4 numeric keypads.
------- ------- -------
| | | ABC | | DEF |
| 1 | | 2 | | 3 |
------- ------... |
Solve the programming task below in a Python markdown code block.
You want to go on a trip with a friend. However, friends who have a habit of spending money cannot easily save travel expenses. I don't know when my friends will go on a trip if they continue their current lives. So, if you want to travel early, you dec... |
Solve the programming task below in a Python markdown code block.
Recently, Norge found a string $s = s_1 s_2 \ldots s_n$ consisting of $n$ lowercase Latin letters. As an exercise to improve his typing speed, he decided to type all substrings of the string $s$. Yes, all $\frac{n (n + 1)}{2}$ of them!
A substring of $... |
Solve the programming task below in a Python markdown code block.
Masha and Grisha like studying sets of positive integers.
One day Grisha has written a set A containing n different integers a_{i} on a blackboard. Now he asks Masha to create a set B containing n different integers b_{j} such that all n^2 integers tha... |
Solve the programming task below in a Python markdown code block.
Lord Omkar has permitted you to enter the Holy Church of Omkar! To test your worthiness, Omkar gives you a password which you must interpret!
A password is an array $a$ of $n$ positive integers. You apply the following operation to the array: pick any ... |
Solve the programming task below in a Python markdown code block.
As Famil Door’s birthday is coming, some of his friends (like Gabi) decided to buy a present for him. His friends are going to buy a string consisted of round brackets since Famil Door loves string of brackets of length n more than any other strings!
T... |
Solve the programming task below in a Python markdown code block.
The "BerCorp" company has got n employees. These employees can use m approved official languages for the formal correspondence. The languages are numbered with integers from 1 to m. For each employee we have the list of languages, which he knows. This l... |
Solve the programming task below in a Python markdown code block.
The classic programming language of Bitland is Bit++. This language is so peculiar and complicated.
The language is that peculiar as it has exactly one variable, called x. Also, there are two operations:
Operation ++ increases the value of variable ... |
Solve the programming task below in a Python markdown code block.
This is the story of 20XX. The number of air passengers increased as a result of the stable energy supply by the renewable power network and the invention of liquefied synthetic fuel. However, the threat of terrorism by aircraft still exists, and the im... |
Solve the programming task below in a Python markdown code block.
Problem F Pizza Delivery
Alyssa is a college student, living in New Tsukuba City. All the streets in the city are one-way. A new social experiment starting tomorrow is on alternative traffic regulation reversing the one-way directions of street section... |
Solve the programming task below in a Python markdown code block.
Billy investigates the question of applying greedy algorithm to different spheres of life. At the moment he is studying the application of greedy algorithm to the problem about change. There is an amount of n coins of different face values, and the coin... |
Solve the programming task below in a Python markdown code block.
This problem is a simplified version of D2, but it has significant differences, so read the whole statement.
Polycarp has an array of $n$ ($n$ is even) integers $a_1, a_2, \dots, a_n$. Polycarp conceived of a positive integer $k$. After that, Polycarp ... |
Solve the programming task below in a Python markdown code block.
Bob is playing a game of Spaceship Solitaire. The goal of this game is to build a spaceship. In order to do this, he first needs to accumulate enough resources for the construction. There are $n$ types of resources, numbered $1$ through $n$. Bob needs a... |
Solve the programming task below in a Python markdown code block.
John Smith knows that his son, Thomas Smith, is among the best students in his class and even in his school. After the students of the school took the exams in English, German, Math, and History, a table of results was formed.
There are $n$ students, e... |
Solve the programming task below in a Python markdown code block.
You are given a matrix with $n$ rows (numbered from $1$ to $n$) and $m$ columns (numbered from $1$ to $m$). A number $a_{i, j}$ is written in the cell belonging to the $i$-th row and the $j$-th column, each number is either $0$ or $1$.
A chip is initia... |
Solve the programming task below in a Python markdown code block.
Here's a way to construct a list containing every positive rational number:
Build a binary tree where each node is a rational and the root is `1/1`, with the following rules for creating the nodes below:
* The value of the left-hand node below `a/b` is... |
Solve the programming task below in a Python markdown code block.
Salem gave you $n$ sticks with integer positive lengths $a_1, a_2, \ldots, a_n$.
For every stick, you can change its length to any other positive integer length (that is, either shrink or stretch it). The cost of changing the stick's length from $a$ to... |
Solve the programming task below in a Python markdown code block.
Polycarpus likes studying at school a lot and he is always diligent about his homework. Polycarpus has never had any problems with natural sciences as his great-great-grandfather was the great physicist Seinstein. On the other hand though, Polycarpus ha... |
Solve the programming task below in a Python markdown code block.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vectors <image>... |
Solve the programming task below in a Python markdown code block.
Your task is to make function, which returns the sum of a sequence of integers.
The sequence is defined by 3 non-negative values: **begin**, **end**, **step**.
If **begin** value is greater than the **end**, function should returns **0**
*Examples*
... |
Solve the programming task below in a Python markdown code block.
A Pythagorean triple is a triple of integer numbers $(a, b, c)$ such that it is possible to form a right triangle with the lengths of the first cathetus, the second cathetus and the hypotenuse equal to $a$, $b$ and $c$, respectively. An example of the P... |
Solve the programming task below in a Python markdown code block.
A thief sneaked into a museum with a lot of treasures with only one large furoshiki. There are many things I want to steal, but the weight that the furoshiki can withstand is limited, and if it exceeds this, the furoshiki will tear. Therefore, the thief... |
Solve the programming task below in a Python markdown code block.
## Emotional Sort ( ︶︿︶)
You'll have a function called "**sortEmotions**" that will return an array of **emotions** sorted. It has two parameters, the first parameter called "**arr**" will expect an array of **emotions** where an **emotion** will be on... |
Solve the programming task below in a Python markdown code block.
Kaavi, the mysterious fortune teller, deeply believes that one's fate is inevitable and unavoidable. Of course, she makes her living by predicting others' future. While doing divination, Kaavi believes that magic spells can provide great power for her t... |
Solve the programming task below in a Python markdown code block.
Implement the function unique_in_order which takes as argument a sequence and returns a list of items without any elements with the same value next to each other and preserving the original order of elements.
For example:
```python
unique_in_order('AA... |
Solve the programming task below in a Python markdown code block.
Example
Input
8
-10 0
-10 5
-5 5
-5 0
10 0
10 -5
5 -5
5 0
Output
50
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within ```python delimiters. |
Solve the programming task below in a Python markdown code block.
Hi there!
You have to implement the
`String get_column_title(int num) // syntax depends on programming language`
function that takes an integer number (index of the Excel column) and returns the string represents the title of this column.
#Intro
In... |
Solve the programming task below in a Python markdown code block.
$N$ sages are sitting around a round table with $N$ seats. Each sage holds chopsticks with his dominant hand to eat his dinner. The following happens in this situation.
* If sage $i$ is right-handed and a left-handed sage sits on his right, a level of ... |
Solve the programming task below in a Python markdown code block.
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: Make v_{i}-th array element equal to x_{i}. In other words, ... |
Solve the programming task below in a Python markdown code block.
There are N strings arranged in a row. It is known that, for any two adjacent strings, the string to the left is lexicographically smaller than the string to the right. That is, S_1<S_2<...<S_N holds lexicographically, where S_i is the i-th string from ... |
Solve the programming task below in a Python markdown code block.
An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code $091$), a colon (ASCII code $058$), some (possibly... |
Solve the programming task below in a Python markdown code block.
Someone give a strange birthday present to Ivan. It is hedgehog — connected undirected graph in which one vertex has degree at least 3 (we will call it center) and all other vertices has degree 1. Ivan thought that hedgehog is too boring and decided to ... |
Solve the programming task below in a Python markdown code block.
The only difference between easy and hard versions is the maximum value of $n$.
You are given a positive integer number $n$. You really love good numbers so you want to find the smallest good number greater than or equal to $n$.
The positive integer i... |
Solve the programming task below in a Python markdown code block.
# Covfefe
Your are given a string. You must replace the word(s) `coverage` by `covfefe`, however, if you don't find the word `coverage` in the string, you must add `covfefe` at the end of the string with a leading space.
For the languages where the s... |
Solve the programming task below in a Python markdown code block.
An expedition group flew from planet ACM-1 to Earth in order to study the bipedal species (its representatives don't even have antennas on their heads!).
The flying saucer, on which the brave pioneers set off, consists of three sections. These sections... |
Solve the programming task below in a Python markdown code block.
A telephone number is a sequence of exactly 11 digits, where the first digit is 8. For example, the sequence 80011223388 is a telephone number, but the sequences 70011223388 and 80000011223388 are not.
You are given a string $s$ of length $n$, consisti... |
Solve the programming task below in a Python markdown code block.
You are an upcoming movie director, and you have just released your first movie. You have also launched a simple review site with two buttons to press — upvote and downvote.
However, the site is not so simple on the inside. There are two servers, each ... |
Solve the programming task below in a Python markdown code block.
Vasya plays the Need For Brake. He plays because he was presented with a new computer wheel for birthday! Now he is sure that he will win the first place in the championship in his favourite racing computer game!
n racers take part in the championship... |
Solve the programming task below in a Python markdown code block.
A positive integer is called a 2-3-integer, if it is equal to 2^{x}·3^{y} for some non-negative integers x and y. In other words, these integers are such integers that only have 2 and 3 among their prime divisors. For example, integers 1, 6, 9, 16 and 1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.