question large_stringlengths 265 13.2k |
|---|
Solve the programming task below in a Python markdown code block.
Overall there are m actors in Berland. Each actor has a personal identifier β an integer from 1 to m (distinct actors have distinct identifiers). Vasya likes to watch Berland movies with Berland actors, and he has k favorite actors. He watched the movie... |
Solve the programming task below in a Python markdown code block.
Gildong has an interesting machine that has an array $a$ with $n$ integers. The machine supports two kinds of operations:
Increase all elements of a suffix of the array by $1$.
Decrease all elements of a suffix of the array by $1$.
A suffix is a subs... |
Solve the programming task below in a Python markdown code block.
Caisa is going to have a party and he needs to buy the ingredients for a big chocolate cake. For that he is going to the biggest supermarket in town.
Unfortunately, he has just s dollars for sugar. But that's not a reason to be sad, because there are n... |
Solve the programming task below in a Python markdown code block.
Lunar New Year is approaching, and Bob is planning to go for a famous restaurant β "Alice's".
The restaurant "Alice's" serves $n$ kinds of food. The cost for the $i$-th kind is always $c_i$. Initially, the restaurant has enough ingredients for serving ... |
Solve the programming task below in a Python markdown code block.
My washing machine uses ```water``` amount of water to wash ```clothes``` amount of clothes. You are given a ```load``` amount of clothes to wash. For each single item of load above the standard amount of clothes, the washing machine will use 10% more ... |
Solve the programming task below in a Python markdown code block.
Medicine faculty of Berland State University has just finished their admission campaign. As usual, about $80\%$ of applicants are girls and majority of them are going to live in the university dormitory for the next $4$ (hopefully) years.
The dormitory... |
Solve the programming task below in a Python markdown code block.
Count how often sign changes in array.
### result
number from `0` to ... . Empty array returns `0`
### example
Write your solution by modifying this code:
```python
def catch_sign_change(lst):
```
Your solution should implemented in the function ... |
Solve the programming task below in a Python markdown code block.
- Kids drink toddy.
- Teens drink coke.
- Young adults drink beer.
- Adults drink whisky.
Make a function that receive age, and return what they drink.
**Rules:**
- Children under 14 old.
- Teens under 18 old.
- Young under 21 old.
- Adults have 21 o... |
Solve the programming task below in a Python markdown code block.
Dee is lazy but she's kind and she likes to eat out at all the nice restaurants and gastropubs in town. To make paying quick and easy she uses a simple mental algorithm she's called The Fair %20 Rule. She's gotten so good she can do this in a few second... |
Solve the programming task below in a Python markdown code block.
For a sequence of integers $A = \\{a_0, a_1, ..., a_{n-1}\\}$ which is sorted by ascending order, eliminate all equivalent elements.
Constraints
* $1 \leq n \leq 100,000$
* $-1000,000,000 \leq a_i \leq 1,000,000,000$
* $a_0 \leq a_1 \leq ... \leq a_{n... |
Solve the programming task below in a Python markdown code block.
The vowel substrings in the word `codewarriors` are `o,e,a,io`. The longest of these has a length of 2. Given a lowercase string that has alphabetic characters only (both vowels and consonants) and no spaces, return the length of the longest vowel subst... |
Solve the programming task below in a Python markdown code block.
Andrew often reads articles in his favorite magazine 2Char. The main feature of these articles is that each of them uses at most two distinct letters. Andrew decided to send an article to the magazine, but as he hasn't written any article, he just decid... |
Solve the programming task below in a Python markdown code block.
Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of geometric data, you'd better try some programming exercise... |
Solve the programming task below in a Python markdown code block.
Farmer Bob have a big farm, where he growths chickens, rabbits and cows. It is very difficult to count the number of animals for each type manually, so he diceded to buy a system to do it. But he bought a cheap system that can count only total number of... |
Solve the programming task below in a Python markdown code block.
So many wall designs to choose from! Even modulo 106 + 3, it's an enormous number. Given that recently Heidi acquired an unlimited supply of bricks, her choices are endless! She really needs to do something to narrow them down.
Heidi is quick to come u... |
Solve the programming task below in a Python markdown code block.
Polycarp and Vasiliy love simple logical games. Today they play a game with infinite chessboard and one pawn for each player. Polycarp and Vasiliy move in turns, Polycarp starts. In each turn Polycarp can move his pawn from cell (x, y) to (x - 1, y) or ... |
Solve the programming task below in a Python markdown code block.
Takahashi is distributing N balls to K persons.
If each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?
Const... |
Solve the programming task below in a Python markdown code block.
There is a bus route as shown in Figure 1. There are 10 stops, each numbered 0-9. The bus turns back at stop 0, but the other side is a circulation route, which circulates in the order of 5 β 6 β 7 β 8 β 9 β 5 as shown in the figure.
<image>
For this... |
Solve the programming task below in a Python markdown code block.
In Dark Souls, players level up trading souls for stats. 8 stats are upgradable this way: vitality, attunement, endurance, strength, dexterity, resistance, intelligence, and faith. Each level corresponds to adding one point to a stat of the player's cho... |
Solve the programming task below in a Python markdown code block.
A number m of the form 10x + y is divisible by 7 if and only if x β 2y is divisible by 7. In other words, subtract twice the last digit
from the number formed by the remaining digits. Continue to do this until a number known to be divisible or not by 7... |
Solve the programming task below in a Python markdown code block.
Limak is a grizzly bear who desires power and adoration. He wants to win in upcoming elections and rule over the Bearland.
There are n candidates, including Limak. We know how many citizens are going to vote for each candidate. Now i-th candidate would... |
Solve the programming task below in a Python markdown code block.
problem
JOI took six subjects: physics, chemistry, biology, earth science, history, and geography. Each test was scored on a 100-point scale.
JOI chooses 3 subjects from 4 subjects of physics, chemistry, biology, and earth science, and 1 subject from ... |
Solve the programming task below in a Python markdown code block.
Last year the world's largest square was built in Berland. It is known that the square can be represented as an infinite plane with an introduced Cartesian system of coordinates. On that square two sets of concentric circles were painted. Let's call the... |
Solve the programming task below in a Python markdown code block.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n Γ m chessboard, a very tasty candy and two numbers a and b.
Dima put the chessboard in front of Inna a... |
Solve the programming task below in a Python markdown code block.
In the game Lizard Era: Beginning the protagonist will travel with three companions: Lynn, Meliana and Worrigan. Overall the game has n mandatory quests. To perform each of them, you need to take exactly two companions.
The attitude of each of the comp... |
Solve the programming task below in a Python markdown code block.
Example
Input
acmicpc
tsukuba
Output
No
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.
Given a non-negative number, return the next bigger polydivisible number, or an empty value like `null` or `Nothing`.
A number is polydivisible if its first digit is cleanly divisible by `1`, its first two digits by `2`, its first three by `3`, and so ... |
Solve the programming task below in a Python markdown code block.
Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).
-----Constraints-----
- 1 \leq N \leq 10^4
- 1 \leq A \leq B \leq 36
- All input values are integers.
-----Input-----
I... |
Solve the programming task below in a Python markdown code block.
Slava plays his favorite game "Peace Lightning". Now he is flying a bomber on a very specific map.
Formally, map is a checkered field of size 1 Γ n, the cells of which are numbered from 1 to n, in each cell there can be one or several tanks. Slava does... |
Solve the programming task below in a Python markdown code block.
We have a graph with N vertices, numbered 0 through N-1. Edges are yet to be added.
We will process Q queries to add edges. In the i-th (1β¦iβ¦Q) query, three integers A_i, B_i and C_i will be given, and we will add infinitely many edges to the graph as ... |
Solve the programming task below in a Python markdown code block.
One tradition of ACM-ICPC contests is that a team gets a balloon for every solved problem. We assume that the submission time doesn't matter and teams are sorted only by the number of balloons they have. It means that one's place is equal to the number ... |
Solve the programming task below in a Python markdown code block.
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparation is str... |
Solve the programming task below in a Python markdown code block.
Palindromic characteristics of string s with length |s| is a sequence of |s| integers, where k-th number is the total number of non-empty substrings of s which are k-palindromes.
A string is 1-palindrome if and only if it reads the same backward as for... |
Solve the programming task below in a Python markdown code block.
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 ai animals in it. Also there are m roads in the zoo, and each road connects two distinct areas. Naturally the zoo is connected, so you... |
Solve the programming task below in a Python markdown code block.
Monocarp plays a computer game. There are $n$ different sets of armor and $m$ different weapons in this game. If a character equips the $i$-th set of armor and wields the $j$-th weapon, their power is usually equal to $i + j$; but some combinations of a... |
Solve the programming task below in a Python markdown code block.
Create a function `longer` that accepts a string and sorts the words in it based on their respective lengths in an ascending order. If there are two words of the same lengths, sort them alphabetically. Look at the examples below for more details.
```py... |
Solve the programming task below in a Python markdown code block.
We have an integer array with unique elements and we want to do the permutations that have an element fixed, in other words, these permutations should have a certain element at the same position than the original.
These permutations will be called: **p... |
Solve the programming task below in a Python markdown code block.
You are given a rectangular table 3 Γ n. Each cell contains an integer. You can move from one cell to another if they share a side.
Find such path from the upper left cell to the bottom right cell of the table that doesn't visit any of the cells twice,... |
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.
Write a function that reverses the bits in an integer.
For example, the number `417` is `110100001` in binary. Reversing the binary is `100001011` which is `267`.
You can assume that the number is not negative.
Write your solution by modifying this c... |
Solve the programming task below in a Python markdown code block.
In this kata you need to write a function that will receive two strings (```n1``` and ```n2```), each representing an integer as a binary number. A third parameter will be provided (```o```) as a string representing one of the following operators: add, ... |
Solve the programming task below in a Python markdown code block.
Recently Polycarp noticed that some of the buttons of his keyboard are malfunctioning. For simplicity, we assume that Polycarp's keyboard contains $26$ buttons (one for each letter of the Latin alphabet). Each button is either working fine or malfunctio... |
Solve the programming task below in a Python markdown code block.
Arkady is playing Battleship. The rules of this game aren't really important.
There is a field of $n \times n$ cells. There should be exactly one $k$-decker on the field, i.Β e. a ship that is $k$ cells long oriented either horizontally or vertically. H... |
Solve the programming task below in a Python markdown code block.
Little Chris knows there's no fun in playing dominoes, he thinks it's too random and doesn't require skill. Instead, he decided to play with the dominoes and make a "domino show".
Chris arranges n dominoes in a line, placing each piece vertically uprig... |
Solve the programming task below in a Python markdown code block.
There is always an integer in Takahashi's mind.
Initially, the integer in Takahashi's mind is 0. Takahashi is now going to eat four symbols, each of which is + or -. When he eats +, the integer in his mind increases by 1; when he eats -, the integer in ... |
Solve the programming task below in a Python markdown code block.
# Description
Given a number `n`, you should find a set of numbers for which the sum equals `n`. This set must consist exclusively of values that are a power of `2` (eg: `2^0 => 1, 2^1 => 2, 2^2 => 4, ...`).
The function `powers` takes a single parame... |
Solve the programming task below in a Python markdown code block.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
Chef's team is going to participate at the legendary math battles. One of the main task in the competition is to calculate the number of ways to create a number by adding so... |
Solve the programming task below in a Python markdown code block.
Take debugging to a whole new level:
Given a string, remove every *single* bug.
This means you must remove all instances of the word 'bug' from within a given string, *unless* the word is plural ('bugs').
For example, given 'obugobugobuoobugsoo', you... |
Solve the programming task below in a Python markdown code block.
Pavel made a photo of his favourite stars in the sky. His camera takes a photo of all points of the sky that belong to some rectangle with sides parallel to the coordinate axes.
Strictly speaking, it makes a photo of all points with coordinates (x, y),... |
Solve the programming task below in a Python markdown code block.
Kevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maximum point values of 500, 1000, 1500, 2000, and 2500, respectively. Despite the challenging tasks, Kevin was uncowed and bu... |
Solve the programming task below in a Python markdown code block.
For given integer n, count the totatives of n, that is, the positive integers less than or equal to n that are relatively prime to n.
Input
n
An integer n (1 β€ n β€ 1000000000).
Output
The number of totatives in a line.
Examples
Input
6
Out... |
Solve the programming task below in a Python markdown code block.
Consider the following array:
```
[1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 12345678910, 1234567891011...]
```
If we join these blocks of numbers, we come up with an infinite sequence which starts with `112123123412345123456...`.... |
Solve the programming task below in a Python markdown code block.
Your wizard cousin works at a Quidditch stadium and wants you to write a function that calculates the points for the Quidditch scoreboard!
# Story
Quidditch is a sport with two teams. The teams score goals by throwing the Quaffle through a hoop, each... |
Solve the programming task below in a Python markdown code block.
3R2 as DJ Mashiro - Happiness Breeze Ice - DJ Mashiro is dead or alive
NEKO#Ξ¦ΟΞ¦ has just got a new maze game on her PC!
The game's main puzzle is a maze, in the forms of a $2 \times n$ rectangle grid. NEKO's task is to lead a Nekomimi girl from cell $... |
Solve the programming task below in a Python markdown code block.
There is a legend in the IT City college. A student that failed to answer all questions on the game theory exam is given one more chance by his professor. The student has to play a game with the professor.
The game is played on a square field consistin... |
Solve the programming task below in a Python markdown code block.
Implement a function which behaves like the uniq command in UNIX.
It takes as input a sequence and returns a sequence in which all duplicate elements following each other have been reduced to one instance.
Example:
```
["a", "a", "b", "b", "c", "a", ... |
Solve the programming task below in a Python markdown code block.
Wet Shark once had 2 sequences:
{a_n}= {a_1, a_2, a_3, ... , a_(109)}
{b_n} = {b_1, b_2, b_3, ... , b_(109)}
However, he only kept one element from each sequence. Luckily, both the elements that Wet Shark kept have the same index in Wet Shark's seq... |
Solve the programming task below in a Python markdown code block.
When preparing a tournament, Codeforces coordinators try treir best to make the first problem as easy as possible. This time the coordinator had chosen some problem and asked $n$ people about their opinions. Each person answered whether this problem is ... |
Solve the programming task below in a Python markdown code block.
## Task:
Your task is to write a function which returns the sum of following series upto nth term(parameter).
Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +...
## Rules:
* You need to round the answer to 2 decimal places and return it as String.... |
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.
The only difference between the easy and hard versions is that tokens of type O do not appear in the input of the easy version.
Errichto gave Monogon the following challenge in order to intimidate him from taking his top contributor spot on Codeforces.... |
Solve the programming task below in a Python markdown code block.
Floating-Point Numbers
In this problem, we consider floating-point number formats, data representation formats to approximate real numbers on computers.
Scientific notation is a method to express a number, frequently used for numbers too large or too ... |
Solve the programming task below in a Python markdown code block.
**This Kata is intended as a small challenge for my students**
All Star Code Challenge #16
Create a function called noRepeat() that takes a string argument and returns a single letter string of the **first** not repeated character in the entire string... |
Solve the programming task below in a Python markdown code block.
Given an array of integers, return the smallest common factors of all integers in the array.
When i say **Smallest Common Factor** i mean the smallest number above 1 that can divide all numbers in the array without a remainder.
If there are no common ... |
Solve the programming task below in a Python markdown code block.
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
* $add(v,w)$: add $w$ to all edges from the root to node $u$
* $getSum(u)$: report the sum of weights of all edges from the root to node $u$
The given tree ... |
Solve the programming task below in a Python markdown code block.
Vasya adores sport programming. He can't write programs but he loves to watch the contests' progress. Vasya even has a favorite coder and Vasya pays special attention to him.
One day Vasya decided to collect the results of all contests where his favori... |
Solve the programming task below in a Python markdown code block.
It is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.
Given an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.
-----Constraints-----
- 1 \leq r \leq 100
- r is an integer.
----... |
Solve the programming task below in a Python markdown code block.
Berland has a long and glorious history. To increase awareness about it among younger citizens, King of Berland decided to compose an anthem.
Though there are lots and lots of victories in history of Berland, there is the one that stand out the most. K... |
Solve the programming task below in a Python markdown code block.
## The galactic games have begun!
It's the galactic games! Beings of all worlds come together to compete in several interesting sports, like nroogring, fredling and buzzing (the beefolks love the last one). However, there's also the traditional maratho... |
Solve the programming task below in a Python markdown code block.
In olden days finding square roots seemed to be difficult but nowadays it can be easily done using in-built functions available across many languages
.
Assume that you happen to hear the above words and you want to give a try in finding the square roo... |
Solve the programming task below in a Python markdown code block.
Some time ago Mister B detected a strange signal from the space, which he started to study.
After some transformation the signal turned out to be a permutation p of length n or its cyclic shift. For the further investigation Mister B need some basis, t... |
Solve the programming task below in a Python markdown code block.
We have two distinct integers A and B.
Print the integer K such that |A - K| = |B - K|.
If such an integer does not exist, print IMPOSSIBLE instead.
-----Constraints-----
- All values in input are integers.
- 0 \leq A,\ B \leq 10^9
- A and B are dis... |
Solve the programming task below in a Python markdown code block.
Of the real numbers, those with a circular decimal part and those with a finite number of digits can be expressed as fractions.
Given a real number that can be represented by a fraction, write a program that outputs an irreducible fraction equal to ... |
Solve the programming task below in a Python markdown code block.
Vasiliy is fond of solving different tasks. Today he found one he wasn't able to solve himself, so he asks you to help.
Vasiliy is given n strings consisting of lowercase English letters. He wants them to be sorted in lexicographical order (as in the d... |
Solve the programming task below in a Python markdown code block.
You are given $n$ one-dimensional segments (each segment is denoted by two integers β its endpoints).
Let's define the function $f(x)$ as the number of segments covering point $x$ (a segment covers the point $x$ if $l \le x \le r$, where $l$ is the lef... |
Solve the programming task below in a Python markdown code block.
The restaurant AtCoder serves the following five dishes:
- ABC Don (rice bowl): takes A minutes to serve.
- ARC Curry: takes B minutes to serve.
- AGC Pasta: takes C minutes to serve.
- APC Ramen: takes D minutes to serve.
- ATC Hanbagu (hamburger ... |
Solve the programming task below in a Python markdown code block.
Xenia is a girl being born a noble. Due to the inflexibility and harshness of her family, Xenia has to find some ways to amuse herself.
Recently Xenia has bought $n_r$ red gems, $n_g$ green gems and $n_b$ blue gems. Each of the gems has a weight.
Now,... |
Solve the programming task below in a Python markdown code block.
Hideo Kojima has just quit his job at Konami. Now he is going to find a new place to work. Despite being such a well-known person, he still needs a CV to apply for a job.
During all his career Hideo has produced n games. Some of them were successful, s... |
Solve the programming task below in a Python markdown code block.
You want to make change for $ n $ cents. Assuming that you have infinite supply of coins of 1, 5, 10 and / or 25 cents coins respectively, find the minimum number of coins you need.
Constraints
* $ 1 \ le n \ le 10 ^ 9 $
Input
$ n $
The integer $... |
Solve the programming task below in a Python markdown code block.
This year in Equestria was a year of plenty, so Applejack has decided to build some new apple storages. According to the advice of the farm designers, she chose to build two storages with non-zero area: one in the shape of a square and another one in th... |
Solve the programming task below in a Python markdown code block.
A permutation of length $n$ is an array consisting of $n$ distinct integers from $1$ to $n$ in arbitrary order. For example, $[2,3,1,5,4]$ is a permutation, but $[1,2,2]$ is not a permutation ($2$ appears twice in the array) and $[1,3,4]$ is also not a ... |
Solve the programming task below in a Python markdown code block.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
You are given two integer arrays A and B each of size N. Let us define interaction of arrays A and B to be the sum of A[i] * B[i] for each i from 1 to N.
You want to maximi... |
Solve the programming task below in a Python markdown code block.
Your friend is developing a computer game. He has already decided how the game world should look like β it should consist of n locations connected by m two-way passages. The passages are designed in such a way that it should be possible to get from any ... |
Solve the programming task below in a Python markdown code block.
The town sheriff dislikes odd numbers and wants all odd numbered families out of town! In town crowds can form and individuals are often mixed with other people and families. However you can distinguish the family they belong to by the number on the shi... |
Solve the programming task below in a Python markdown code block.
Sometimes Mister B has free evenings when he doesn't know what to do. Fortunately, Mister B found a new game, where the player can play against aliens.
All characters in this game are lowercase English letters. There are two players: Mister B and his c... |
Solve the programming task below in a Python markdown code block.
<image>
There used to be a game called Joseph's potatoes. Let's say n people are participating. Participants form a circle facing the center and are numbered starting from 1. One hot potato is given to participant n (the large number 30 inside the fig... |
Solve the programming task below in a Python markdown code block.
There is a straight snowy road, divided into n blocks. The blocks are numbered from 1 to n from left to right. If one moves from the i-th block to the (i + 1)-th block, he will leave a right footprint on the i-th block. Similarly, if one moves from the ... |
Solve the programming task below in a Python markdown code block.
You have a new professor of graph theory and he speaks very quickly. You come up with the following plan to keep up with his lecture and make notes.
You know two languages, and the professor is giving the lecture in the first one. The words in both lan... |
Solve the programming task below in a Python markdown code block.
Write a function to calculate compound tax using the following table:
For $10 and under, the tax rate should be 10%.
For $20 and under, the tax rate on the first $10 is %10, and the tax on the rest is 7%.
For $30 and under, the tax rate on the first $1... |
Solve the programming task below in a Python markdown code block.
In music, if you double (or halve) the pitch of any note you will get to the same note again.
"Concert A" is fixed at 440 Hz, and every other note is defined based on that. 880 Hz is also an A, as is 1760 Hz, as is 220 Hz.
There are 12 notes in Wester... |
Solve the programming task below in a Python markdown code block.
Moamen and Ezzat are playing a game. They create an array $a$ of $n$ non-negative integers where every element is less than $2^k$.
Moamen wins if $a_1 \,\&\, a_2 \,\&\, a_3 \,\&\, \ldots \,\&\, a_n \ge a_1 \oplus a_2 \oplus a_3 \oplus \ldots \oplus a_n... |
Solve the programming task below in a Python markdown code block.
Given is a positive integer N. Consider repeatedly applying the operation below on N:
- First, choose a positive integer z satisfying all of the conditions below:
- z can be represented as z=p^e, where p is a prime number and e is a positive integer;
... |
Solve the programming task below in a Python markdown code block.
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 has no intermediate stops. So ... |
Solve the programming task below in a Python markdown code block.
Evlampiy has found one more cool application to process photos. However the application has certain limitations.
Each photo i has a contrast v_{i}. In order for the processing to be truly of high quality, the application must receive at least k photos ... |
Solve the programming task below in a Python markdown code block.
Vladimir would like to prepare a present for his wife: they have an anniversary! He decided to buy her exactly $n$ flowers.
Vladimir went to a flower shop, and he was amazed to see that there are $m$ types of flowers being sold there, and there is unli... |
Solve the programming task below in a Python markdown code block.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
Zombies zombies everywhere!!Β
In a parallel world of zombies, there are N zombies. There are infinite number of unused cars, each of same model only differentiated by the the... |
Solve the programming task below in a Python markdown code block.
Write a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.
Constraints
* $0 \leq S \leq 86400$
Input
An integer $S$ is given in a l... |
Solve the programming task below in a Python markdown code block.
You are given four integer values $a$, $b$, $c$ and $m$.
Check if there exists a string that contains:
$a$ letters 'A';
$b$ letters 'B';
$c$ letters 'C';
no other letters;
exactly $m$ pairs of adjacent equal letters (exactly $m$ such positions $i$... |
Solve the programming task below in a Python markdown code block.
Your mission in this problem is to write a computer program that manipulates molecular for- mulae in virtual chemistry. As in real chemistry, each molecular formula represents a molecule consisting of one or more atoms. However, it may not have chemical... |
Solve the programming task below in a Python markdown code block.
Valera is a lazy student. He has m clean bowls and k clean plates.
Valera has made an eating plan for the next n days. As Valera is lazy, he will eat exactly one dish per day. At that, in order to eat a dish, he needs exactly one clean plate or bowl. ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.