question large_stringlengths 265 13.2k |
|---|
Solve the programming task below in a Python markdown code block.
Now Serval is a junior high school student in Japari Middle School, and he is still thrilled on math as before.
As a talented boy in mathematics, he likes to play with numbers. This time, he wants to play with numbers on a rooted tree.
A tree is a co... |
Solve the programming task below in a Python markdown code block.
Takahashi is about to assemble a character figure, consisting of N parts called Part 1, Part 2, ..., Part N and N-1 connecting components. Parts are distinguishable, but connecting components are not.
Part i has d_i holes, called Hole 1, Hole 2, ..., Ho... |
Solve the programming task below in a Python markdown code block.
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}.
Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
-----Constraints-----
- 1 \leq K \leq 200
- K is an integer.
-----Input-----
Input is given from Standar... |
Solve the programming task below in a Python markdown code block.
In a small restaurant there are a tables for one person and b tables for two persons.
It it known that n groups of people come today, each consisting of one or two people.
If a group consist of one person, it is seated at a vacant one-seater table. ... |
Solve the programming task below in a Python markdown code block.
Given an array (or list) of scores, return the array of _ranks_ for each value in the array. The largest value has rank 1, the second largest value has rank 2, and so on. Ties should be handled by assigning the same rank to all tied values. For example... |
Solve the programming task below in a Python markdown code block.
Sometimes it is hard to prepare tests for programming problems. Now Bob is preparing tests to new problem about strings — input data to his problem is one string. Bob has 3 wrong solutions to this problem. The first gives the wrong answer if the input d... |
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.
Write a function that accepts two arguments: an array/list of integers and another integer (`n`).
Determine the number of times where two integers in the array have a difference of `n`.
For example:
```
[1, 1, 5, 6, 9, 16, 27], n=4 --> 3 # (1,5), ... |
Solve the programming task below in a Python markdown code block.
At the start of each season, every player in a football team is assigned their own unique squad number. Due to superstition or their history certain numbers are more desirable than others.
Write a function generateNumber() that takes two arguments, an ... |
Solve the programming task below in a Python markdown code block.
Ancient Egyptians are known to have understood difficult concepts in mathematics. The ancient Egyptian mathematician Ahmes liked to write a kind of arithmetic expressions on papyrus paper which he called as Ahmes arithmetic expression.
An Ahmes arithme... |
Solve the programming task below in a Python markdown code block.
Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day,... |
Solve the programming task below in a Python markdown code block.
You are given n × m table. Each cell of the table is colored white or black. Find the number of non-empty sets of cells such that:
All cells in a set have the same color. Every two cells in a set share row or column.
-----Input-----
The first li... |
Solve the programming task below in a Python markdown code block.
One day in the IT lesson Anna and Maria learned about the lexicographic order.
String x is lexicographically less than string y, if either x is a prefix of y (and x ≠ y), or there exists such i (1 ≤ i ≤ min(|x|, |y|)), that xi < yi, and for any j (1 ≤ ... |
Solve the programming task below in a Python markdown code block.
The only difference between easy and hard versions is the length of the string.
You are given a string $s$ and a string $t$, both consisting only of lowercase Latin letters. It is guaranteed that $t$ can be obtained from $s$ by removing some (possibly,... |
Solve the programming task below in a Python markdown code block.
Nathan O. Davis is challenging a kind of shooter game. In this game, enemies emit laser beams from outside of the screen. A laser beam is a straight line with a certain thickness. Nathan moves a circular-shaped machine within the screen, in such a way i... |
Solve the programming task below in a Python markdown code block.
problem
Prepare the Othello board. The upper left is $ (1,1) $ and the lower right is $ (8,8) $. The board to be prepared here is $ (5,4) as follows. ) There is no $ black stone.
........
........
........
... ox ...
.... o ...
........
........
....... |
Solve the programming task below in a Python markdown code block.
Polycarp has just invented a new binary protocol for data transmission. He is encoding positive integer decimal number to binary string using following algorithm:
Each digit is represented with number of '1' characters equal to the value of that digi... |
Solve the programming task below in a Python markdown code block.
There are n stones arranged on an axis. Initially the i-th stone is located at the coordinate s_i. There may be more than one stone in a single place.
You can perform zero or more operations of the following type:
* take two stones with indices i a... |
Solve the programming task below in a Python markdown code block.
You and your best friend Stripes have just landed your first high school jobs! You'll be delivering newspapers to your neighbourhood on weekends. For your services you'll be charging a set price depending on the quantity of the newspaper bundles.
The c... |
Solve the programming task below in a Python markdown code block.
Let's call the set of positive integers $S$ correct if the following two conditions are met:
$S \subseteq \{1, 2, \dots, n\}$;
if $a \in S$ and $b \in S$, then $|a-b| \neq x$ and $|a-b| \neq y$.
For the given values $n$, $x$, and $y$, you have to fin... |
Solve the programming task below in a Python markdown code block.
Vasya trains to compose crossword puzzles. He can only compose crosswords of a very simplе type so far. All of them consist of exactly six words; the words can be read only from top to bottom vertically and from the left to the right horizontally. The w... |
Solve the programming task below in a Python markdown code block.
There is unrest in the Galactic Senate. Several thousand solar systems have declared their intentions to leave the Republic. Master Heidi needs to select the Jedi Knights who will go on peacekeeping missions throughout the galaxy. It is well-known that ... |
Solve the programming task below in a Python markdown code block.
There are n walruses standing in a queue in an airport. They are numbered starting from the queue's tail: the 1-st walrus stands at the end of the queue and the n-th walrus stands at the beginning of the queue. The i-th walrus has the age equal to ai.
... |
Solve the programming task below in a Python markdown code block.
Training is indispensable for achieving good results at ICPC. Rabbit wants to win at ICPC, so he decided to practice today as well.
Today's training is to perform a very large number of calculations to improve the calculation power and raise awareness.... |
Solve the programming task below in a Python markdown code block.
Two tortoises named ***A*** and ***B*** must run a race. ***A*** starts with an average speed of ```720 feet per hour```.
Young ***B*** knows she runs faster than ***A***, and furthermore has not finished her cabbage.
When she starts, at last, she can ... |
Solve the programming task below in a Python markdown code block.
For a non-negative integer N, define S(N) as the sum of the odd digits of N
plus twice the sum of the even digits of N.
For example, S(5)=5, S(456)=2*4+5+2*6=25, and S(314159)=3+1+2*4+1+5+9=27.
Define D(N) as the last digit of S(N).
So D(5)=5, D(456)=5,... |
Solve the programming task below in a Python markdown code block.
It is a holiday season, and Koala is decorating his house with cool lights! He owns $n$ lights, all of which flash periodically.
After taking a quick glance at them, Koala realizes that each of his lights can be described with two parameters $a_i$ and ... |
Solve the programming task below in a Python markdown code block.
Takahashi has many red balls and blue balls. Now, he will place them in a row.
Initially, there is no ball placed.
Takahashi, who is very patient, will do the following operation 10^{100} times:
- Place A blue balls at the end of the row of balls alrea... |
Solve the programming task below in a Python markdown code block.
A ski base is planned to be built in Walrusland. Recently, however, the project is still in the constructing phase. A large land lot was chosen for the construction. It contains n ski junctions, numbered from 1 to n. Initially the junctions aren't conne... |
Solve the programming task below in a Python markdown code block.
For a pole vaulter, it is very important to begin the approach run at the best possible starting mark. This is affected by numerous factors and requires fine-tuning in practice. But there is a guideline that will help a beginning vaulter start at approx... |
Solve the programming task below in a Python markdown code block.
Write a program which reverses a given string str.
Input
str (the size of str ≤ 20) is given in a line.
Output
Print the reversed str in a line.
Example
Input
w32nimda
Output
admin23w
Read the inputs from stdin solve the problem and write ... |
Solve the programming task below in a Python markdown code block.
Joe has been hurt on the Internet. Now he is storming around the house, destroying everything in his path.
Joe's house has n floors, each floor is a segment of m cells. Each cell either contains nothing (it is an empty cell), or has a brick or a concre... |
Solve the programming task below in a Python markdown code block.
Introduction
It's been more than 20 minutes since the negligent waiter has taken your order for the house special prime tofu steak with a side of chili fries.
Out of boredom, you start fiddling around with the condiments tray. To be efficient, you wan... |
Solve the programming task below in a Python markdown code block.
At the beginning of the new semester there is new schedule in the Berland State University. According to this schedule, n groups have lessons at the room 31. For each group the starting time of the lesson and the finishing time of the lesson are known. ... |
Solve the programming task below in a Python markdown code block.
Imagine that you are in a building that has exactly n floors. You can move between the floors in a lift. Let's number the floors from bottom to top with integers from 1 to n. Now you're on the floor number a. You are very bored, so you want to take the ... |
Solve the programming task below in a Python markdown code block.
You are given two strings x and y, both consist only of lowercase Latin letters. Let |s| be the length of string s.
Let's call a sequence a a merging sequence if it consists of exactly |x| zeros and exactly |y| ones in some order.
A merge z is produce... |
Solve the programming task below in a Python markdown code block.
The educational program (AHK Education) of the Aiz Broadcasting Association broadcasts a handicraft program for children, "Play with Tsukuro". This time I will make a box with sticks, but I would like to see if I can make a rectangular parallelepiped us... |
Solve the programming task below in a Python markdown code block.
# Definition
A number is a **_Special Number_** *if it’s digits only consist 0, 1, 2, 3, 4 or 5*
**_Given_** a number *determine if it special number or not* .
# Warm-up (Highly recommended)
# [Playing With Numbers Series](https://www.codewars.... |
Solve the programming task below in a Python markdown code block.
A queen is the strongest chess piece. In modern chess the queen can move any number of squares in any horizontal, vertical or diagonal direction (considering that there're no other pieces on its way). The queen combines the options given to the rook and... |
Solve the programming task below in a Python markdown code block.
When new students come to the Specialized Educational and Scientific Centre (SESC) they need to start many things from the beginning. Sometimes the teachers say (not always unfairly) that we cannot even count. So our teachers decided to teach us arithme... |
Solve the programming task below in a Python markdown code block.
Print all the integers that satisfies the following in ascending order:
- Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.
-----Constraints-----
- 1 \leq A \leq B \leq 10^9
... |
Solve the programming task below in a Python markdown code block.
In an embassy of a well-known kingdom an electronic queue is organised. Every person who comes to the embassy, needs to make the following three actions: show the ID, pay money to the cashier and be fingerprinted. Besides, the actions should be performe... |
Solve the programming task below in a Python markdown code block.
Recently Lynyrd and Skynyrd went to a shop where Lynyrd bought a permutation $p$ of length $n$, and Skynyrd bought an array $a$ of length $m$, consisting of integers from $1$ to $n$.
Lynyrd and Skynyrd became bored, so they asked you $q$ queries, each... |
Solve the programming task below in a Python markdown code block.
Falling Block Puzzle
Block drop
You are playing a falling block puzzle. As shown in the figure below, the field of this puzzle has a shape in which cubic cells are arranged in 2 squares x 2 squares in each row, and the rows are infinitely arranged on ... |
Solve the programming task below in a Python markdown code block.
This kata is part of the collection [Mary's Puzzle Books](https://www.codewars.com/collections/marys-puzzle-books).
Mary brought home a "spot the differences" book. The book is full of a bunch of problems, and each problem consists of two strings that ... |
Solve the programming task below in a Python markdown code block.
Heidi and Doctor Who hopped out of the TARDIS and found themselves at EPFL in 2018. They were surrounded by stormtroopers and Darth Vader was approaching. Miraculously, they managed to escape to a nearby rebel base but the Doctor was very confused. Heid... |
Solve the programming task below in a Python markdown code block.
# Summation Of Primes
The sum of the primes below or equal to 10 is **2 + 3 + 5 + 7 = 17**. Find the sum of all the primes **_below or equal to the number passed in_**.
From Project Euler's [Problem #10](https://projecteuler.net/problem=10 "Project Eu... |
Solve the programming task below in a Python markdown code block.
Write a program which judges wheather given length of three side form a right triangle. Print "YES" if the given sides (integers) form a right triangle, "NO" if not so.
Constraints
* 1 ≤ length of the side ≤ 1,000
* N ≤ 1,000
Input
Input consists of... |
Solve the programming task below in a Python markdown code block.
# Task
Mr.Nam has `n` candies, he wants to put one candy in each cell of a table-box. The table-box has `r` rows and `c` columns.
Each candy was labeled by its cell number. The cell numbers are in range from 1 to N and the direction begins from right... |
Solve the programming task below in a Python markdown code block.
Let's call a positive integer extremely round if it has only one non-zero digit. For example, $5000$, $4$, $1$, $10$, $200$ are extremely round integers; $42$, $13$, $666$, $77$, $101$ are not.
You are given an integer $n$. You have to calculate the nu... |
Solve the programming task below in a Python markdown code block.
Seen from above, there is a grid-like square shaped like Figure 1. The presence or absence of "walls" on each side of this grid is represented by a sequence of 0s and 1s. Create a program that stands at point A, puts your right hand on the wall, keeps w... |
Solve the programming task below in a Python markdown code block.
After a long party Petya decided to return home, but he turned out to be at the opposite end of the town from his home. There are $n$ crossroads in the line in the town, and there is either the bus or the tram station at each crossroad.
The crossroads ... |
Solve the programming task below in a Python markdown code block.
Highway 201 is the most busy street in Rockport. Traffic cars cause a lot of hindrances to races, especially when there are a lot of them. The track which passes through this highway can be divided into $n$ sub-tracks. You are given an array $a$ where $... |
Solve the programming task below in a Python markdown code block.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya has two strings a and b o... |
Solve the programming task below in a Python markdown code block.
The Little Elephant loves numbers.
He has a positive integer x. The Little Elephant wants to find the number of positive integers d, such that d is the divisor of x, and x and d have at least one common (the same) digit in their decimal representation... |
Solve the programming task below in a Python markdown code block.
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is ch... |
Solve the programming task below in a Python markdown code block.
Recently in Divanovo, a huge river locks system was built. There are now $n$ locks, the $i$-th of them has the volume of $v_i$ liters, so that it can contain any amount of water between $0$ and $v_i$ liters. Each lock has a pipe attached to it. When the... |
Solve the programming task below in a Python markdown code block.
You are given N items.
The value of the i-th item (1 \leq i \leq N) is v_i.
Your have to select at least A and at most B of these items.
Under this condition, find the maximum possible arithmetic mean of the values of selected items.
Additionally, f... |
Solve the programming task below in a Python markdown code block.
Pak Chanek plans to build a garage. He wants the garage to consist of a square and a right triangle that are arranged like the following illustration.
Define $a$ and $b$ as the lengths of two of the sides in the right triangle as shown in the illustrat... |
Solve the programming task below in a Python markdown code block.
The Super Duper Secret Meeting of the Super Duper Secret Military Squad takes place in a Super Duper Secret Place. The place is an infinite plane with introduced Cartesian coordinate system. The meeting table is represented as a rectangle whose sides ar... |
Solve the programming task below in a Python markdown code block.
People in the Tomskaya region like magic formulas very much. You can see some of them below.
Imagine you are given a sequence of positive integer numbers p_1, p_2, ..., p_{n}. Lets write down some magic formulas:$q_{i} = p_{i} \oplus(i \operatorname{mo... |
Solve the programming task below in a Python markdown code block.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.
Wet Shark thinks that two bishops attack eac... |
Solve the programming task below in a Python markdown code block.
Vasya has recently found out what a digital root of a number is and he decided to share his knowledge with you.
Let's assume that S(n) is the sum of digits of number n, for example, S(4098) = 4 + 0 + 9 + 8 = 21. Then the digital root of number n equals... |
Solve the programming task below in a Python markdown code block.
You are given an array $a$ of $n$ integers. You are asked to find out if the inequality $$\max(a_i, a_{i + 1}, \ldots, a_{j - 1}, a_{j}) \geq a_i + a_{i + 1} + \dots + a_{j - 1} + a_{j}$$ holds for all pairs of indices $(i, j)$, where $1 \leq i \leq j \... |
Solve the programming task below in a Python markdown code block.
Developing tools for creation of locations maps for turn-based fights in a new game, Petya faced the following problem.
A field map consists of hexagonal cells. Since locations sizes are going to be big, a game designer wants to have a tool for quick f... |
Solve the programming task below in a Python markdown code block.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
The Head Chef is receiving a lot of orders for cooking the best of the problems lately. For this, he organized an hiring event to hire some talented Chefs. He gave the follo... |
Solve the programming task below in a Python markdown code block.
Complete the code which should return `true` if the given object is a single ASCII letter (lower or upper case), `false` otherwise.
Write your solution by modifying this code:
```python
def is_letter(s):
```
Your solution should implemented in the ... |
Solve the programming task below in a Python markdown code block.
It's pretty straightforward. Your goal is to create a function that removes the first and last characters of a string. You're given one parameter, the original string. You don't have to worry with strings with less than two characters.
Write your solu... |
Solve the programming task below in a Python markdown code block.
IT City company developing computer games decided to upgrade its way to reward its employees. Now it looks the following way. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each tran... |
Solve the programming task below in a Python markdown code block.
The ancient Berlanders believed that the longer the name, the more important its bearer is. Thus, Berland kings were famous for their long names. But long names are somewhat inconvenient, so the Berlanders started to abbreviate the names of their kings.... |
Solve the programming task below in a Python markdown code block.
Vasiliy has an exam period which will continue for n days. He has to pass exams on m subjects. Subjects are numbered from 1 to m.
About every day we know exam for which one of m subjects can be passed on that day. Perhaps, some day you can't pass any e... |
Solve the programming task below in a Python markdown code block.
Old timers of Summer Informatics School can remember previous camps in which each student was given a drink of his choice on the vechorka (late-evening meal). Or may be the story was more complicated?
There are $n$ students living in a building, and fo... |
Solve the programming task below in a Python markdown code block.
Taro, a junior high school student, is working on his homework. Today's homework is to read Chinese classic texts.
As you know, Japanese language shares the (mostly) same Chinese characters but the order of words is a bit different. Therefore the notat... |
Solve the programming task below in a Python markdown code block.
There is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.
He can climb up one or two steps at a time.
However, the treads of the a_1-th, a_2-th, a_3-th, \ldots, a_M-th steps are broken, so it is d... |
Solve the programming task below in a Python markdown code block.
This is a harder version of the problem. In this version, $n \le 50\,000$.
There are $n$ distinct points in three-dimensional space numbered from $1$ to $n$. The $i$-th point has coordinates $(x_i, y_i, z_i)$. The number of points $n$ is even.
You'd l... |
Solve the programming task below in a Python markdown code block.
Reading books is one of Sasha's passions. Once while he was reading one book, he became acquainted with an unusual character. The character told about himself like that: "Many are my names in many countries. Mithrandir among the Elves, Tharkûn to the Dw... |
Solve the programming task below in a Python markdown code block.
Taro is not good at hide-and-seek. As soon as you hide, you will find it, and it will be difficult to find the hidden child. My father, who couldn't see it, made an ultra-high performance location search system. You can use it to know exactly where your... |
Solve the programming task below in a Python markdown code block.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the biggest of ... |
Solve the programming task below in a Python markdown code block.
There are n schoolchildren, boys and girls, lined up in the school canteen in front of the bun stall. The buns aren't ready yet and the line is undergoing some changes.
Each second all boys that stand right in front of girls, simultaneously swap places... |
Solve the programming task below in a Python markdown code block.
A sequence $(b_1, b_2, \ldots, b_k)$ is called strange, if the absolute difference between any pair of its elements is greater than or equal to the maximum element in the sequence. Formally speaking, it's strange if for every pair $(i, j)$ with $1 \le i... |
Solve the programming task below in a Python markdown code block.
You are given three integers A, B and C.
Determine if there exists an equilateral triangle whose sides have lengths A, B and C.
Constraints
* All values in input are integers.
* 1 \leq A,B,C \leq 100
Input
Input is given from Standard Input in the ... |
Solve the programming task below in a Python markdown code block.
Inna loves digit 9 very much. That's why she asked Dima to write a small number consisting of nines. But Dima must have misunderstood her and he wrote a very large number a, consisting of digits from 1 to 9.
Inna wants to slightly alter the number Dima... |
Solve the programming task below in a Python markdown code block.
I bought food at the store to make a lunch box to eat at lunch. At the store, I only got an elongated bag to put food in, so I had to stack all the food vertically and put it in the bag. I want to pack the bag with the heavy ones down so that it won't f... |
Solve the programming task below in a Python markdown code block.
problem
For the integer n (1 ≤ n), let Pn be a string of n + 1 I's and n O's starting with I and alternating, where I and O are the uppercase Ai and O, respectively. is there.
P1 | IOI
--- | ---
P2 | IOIOI
P3 | IOIOIOI
|. |
|. |
|. |
Pn | IOIOIO ... ... |
Solve the programming task below in a Python markdown code block.
Gottfried learned about binary number representation. He then came up with this task and presented it to you.
You are given a collection of $n$ non-negative integers $a_1, \ldots, a_n$. You are allowed to perform the following operation: choose two dis... |
Solve the programming task below in a Python markdown code block.
The goal of the matrix-chain multiplication problem is to find the most efficient way to multiply given $n$ matrices $M_1, M_2, M_3,...,M_n$.
Write a program which reads dimensions of $M_i$, and finds the minimum number of scalar multiplications to com... |
Solve the programming task below in a Python markdown code block.
Print all subsets of a set $S$, which contains $0, 1, ... n-1$ as elements. Note that we represent $0, 1, ... n-1$ as 00...0001, 00...0010, 00...0100, ..., 10...0000 in binary respectively and the integer representation of a subset is calculated by bitw... |
Solve the programming task below in a Python markdown code block.
# A History Lesson
The Pony Express was a mail service operating in the US in 1859-60.
It reduced the time for messages to travel between the Atlantic and Pacific coasts to about 10 days, before it was made obsolete by the transcontinental telegra... |
Solve the programming task below in a Python markdown code block.
Your security guard friend recently got a new job at a new security company. The company requires him to patrol an area of the city encompassing exactly N city blocks, but they let him choose which blocks. That is, your friend must walk the perimeter of... |
Solve the programming task below in a Python markdown code block.
Many countries have such a New Year or Christmas tradition as writing a letter to Santa including a wish list for presents. Vasya is an ordinary programmer boy. Like all ordinary boys, he is going to write the letter to Santa on the New Year Eve (we Rus... |
Solve the programming task below in a Python markdown code block.
Logical quantifiers are very useful tools for expressing claims about a set. For this problem, let's focus on the set of real numbers specifically. The set of real numbers includes zero and negatives. There are two kinds of quantifiers: universal ($\for... |
Solve the programming task below in a Python markdown code block.
Kawashiro Nitori is a girl who loves competitive programming.
One day she found a string and an integer. As an advanced problem setter, she quickly thought of a problem.
Given a string $s$ and a parameter $k$, you need to check if there exist $k+1$ no... |
Solve the programming task below in a Python markdown code block.
Students in a class are making towers of blocks. Each student makes a (non-zero) tower by stacking pieces lengthwise on top of each other. n of the students use pieces made of two blocks and m of the students use pieces made of three blocks.
The studen... |
Solve the programming task below in a Python markdown code block.
This contest, AtCoder Beginner Contest, is abbreviated as ABC.
When we refer to a specific round of ABC, a three-digit number is appended after ABC. For example, ABC680 is the 680th round of ABC.
What is the abbreviation for the N-th round of ABC? Write... |
Solve the programming task below in a Python markdown code block.
Complete the solution so that it returns true if it contains any duplicate argument values. Any number of arguments may be passed into the function.
The array values passed in will only be strings or numbers. The only valid return values are `true` and... |
Solve the programming task below in a Python markdown code block.
## Description
Given an array X of positive integers, its elements are to be transformed by running the following operation on them as many times as required:
```if X[i] > X[j] then X[i] = X[i] - X[j]```
When no more transformations are possible, ret... |
Solve the programming task below in a Python markdown code block.
Genos recently installed the game Zuma on his phone. In Zuma there exists a line of n gemstones, the i-th of which has color ci. The goal of the game is to destroy all the gemstones in the line as quickly as possible.
In one second, Genos is able to ch... |
Solve the programming task below in a Python markdown code block.
Little Chris is bored during his physics lessons (too easy), so he has built a toy box to keep himself occupied. The box is special, since it has the ability to change gravity.
There are n columns of toy cubes in the box arranged in a line. The i-th co... |
Solve the programming task below in a Python markdown code block.
We want to know the index of the vowels in a given word, for example, there are two vowels in the word super (the second and fourth letters).
So given a string "super", we should return a list of [2, 4].
Some examples:
Mmmm => []
... |
Solve the programming task below in a Python markdown code block.
Koa the Koala and her best friend want to play a game.
The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initially a score equal to 0. Koa starts.
Let's describe a move... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.