question large_stringlengths 265 13.2k |
|---|
Solve the programming task below in a Python markdown code block.
problem
There are fine icicles under the eaves of JOI's house in Canada. Because of this, JOI decided to investigate the icicles.
There are N (2 ≤ N ≤ 100000 = 105) icicles under the eaves of JOI's house. These icicles are aligned and i cm (1 ≤ i ≤ N)... |
Solve the programming task below in a Python markdown code block.
Third day at your new cryptoanalyst job and you come across your toughest assignment yet. Your job is to implement a simple keyword cipher. A keyword cipher is a type of monoalphabetic substitution where two parameters are provided as such (string, keyw... |
Solve the programming task below in a Python markdown code block.
Valery is very interested in magic. Magic attracts him so much that he sees it everywhere. He explains any strange and weird phenomenon through intervention of supernatural forces. But who would have thought that even in a regular array of numbers Valer... |
Solve the programming task below in a Python markdown code block.
Jabber ID on the national Berland service «Babber» has a form <username>@<hostname>[/resource], where
* <username> — is a sequence of Latin letters (lowercase or uppercase), digits or underscores characters «_», the length of <username> is between 1... |
Solve the programming task below in a Python markdown code block.
Snuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:
- Throw the die. The current score is the result of the die.
- As long as the score is between 1 and K-... |
Solve the programming task below in a Python markdown code block.
Oh, New Year. The time to gather all your friends and reflect on the heartwarming events of the past year...
$n$ friends live in a city which can be represented as a number line. The $i$-th friend lives in a house with an integer coordinate $x_i$. The ... |
Solve the programming task below in a Python markdown code block.
# Rock Paper Scissors
Let's play! You have to return which player won! In case of a draw return `Draw!`.
Examples:

Write your solution by modifying this code:
```python
def rps(p1, p2):
```
Yo... |
Solve the programming task below in a Python markdown code block.
Given a string (`str`) containing a base-10 integer between `0` and `10000`, convert the integer to its binary representation. At that point, obtain a count of the maximum amount of consecutive 0s. From there, return the count in written form with a cap... |
Solve the programming task below in a Python markdown code block.
You are given a text that consists of lowercase Latin letters, spaces and punctuation marks (dot, comma, exclamation mark and question mark). A word is defined as a sequence of consecutive Latin letters.
Your task is to add spaces to the text by the fo... |
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 develop physical strength and judgment by running on a straight road. The rabbit is now standing ... |
Solve the programming task below in a Python markdown code block.
You are planning to buy an apartment in a $n$-floor building. The floors are numbered from $1$ to $n$ from the bottom to the top. At first for each floor you want to know the minimum total time to reach it from the first (the bottom) floor.
Let: $a_i$... |
Solve the programming task below in a Python markdown code block.
How many ways are there to choose two distinct positive integers totaling N, disregarding the order?
Constraints
* 1 \leq N \leq 10^6
* N is an integer.
Input
Input is given from Standard Input in the following format:
N
Output
Print the answer... |
Solve the programming task below in a Python markdown code block.
Berland is going through tough times — the dirt price has dropped and that is a blow to the country's economy. Everybody knows that Berland is the top world dirt exporter!
The President of Berland was forced to leave only k of the currently existing n ... |
Solve the programming task below in a Python markdown code block.
Two players are playing a game. First each of them writes an integer from 1 to 6, and then a dice is thrown. The player whose written number got closer to the number on the dice wins. If both payers have the same difference, it's a draw.
The first play... |
Solve the programming task below in a Python markdown code block.
In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks.
More precisely, two different numbers $a$ and $b$ are friends if $gcd(a,b)$, $\frac{a}{gcd(a,b)}$, $\frac{b}{gcd(a,b)}$ can form sides ... |
Solve the programming task below in a Python markdown code block.
The best night ever in the world has come! It's 8 p.m. of December 24th, yes, the night of Cristmas Eve. Santa Clause comes to a silent city with ringing bells. Overtaking north wind, from a sleigh a reindeer pulls she shoot presents to soxes hanged nea... |
Solve the programming task below in a Python markdown code block.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
Phantasialand boasts of its famous theme park. The park is frequently visited. It is quite large park that some tourists visit it more than once to fully appreciate its offe... |
Solve the programming task below in a Python markdown code block.
You are given an array $a$ consisting of $n$ integers.
Your task is to say the number of such positive integers $x$ such that $x$ divides each number from the array. In other words, you have to find the number of common divisors of all elements in the ... |
Solve the programming task below in a Python markdown code block.
Count the number of distinct sequences a_1, a_2, ..., a_{n} (1 ≤ a_{i}) consisting of positive integers such that gcd(a_1, a_2, ..., a_{n}) = x and $\sum_{i = 1}^{n} a_{i} = y$. As this number could be large, print the answer modulo 10^9 + 7.
gcd here ... |
Solve the programming task below in a Python markdown code block.
There is a grid with N rows and N columns of squares. Let (i, j) be the square at the i-th row from the top and the j-th column from the left.
Each of the central (N-2) \times (N-2) squares in the grid has a black stone on it.
Each of the 2N - 1 squares... |
Solve the programming task below in a Python markdown code block.
Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468.
Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420.
We sh... |
Solve the programming task below in a Python markdown code block.
There is an apple tree that bears apples of N colors. The N colors of these apples are numbered 1 to N, and there are a_i apples of Color i.
You and Lunlun the dachshund alternately perform the following operation (starting from you):
* Choose one or ... |
Solve the programming task below in a Python markdown code block.
You will be given a contest schedule for D days and M queries of schedule modification. In the i-th query, given integers d_i and q_i, change the type of contest to be held on day d_i to q_i, and then output the final satisfaction at the end of day D on... |
Solve the programming task below in a Python markdown code block.
These days Arkady works as an air traffic controller at a large airport. He controls a runway which is usually used for landings only. Thus, he has a schedule of planes that are landing in the nearest future, each landing lasts $1$ minute.
He was asked... |
Solve the programming task below in a Python markdown code block.
# Definition
**_Disarium number_** is the number that *The sum of its digits powered with their respective positions is equal to the number itself*.
____
# Task
**_Given_** a number, **_Find if it is Disarium or not_** .
____
# Warm-up (Highly rec... |
Solve the programming task below in a Python markdown code block.
Let’s get to know our hero: Agent #134 - Mr. Slayer.
He was sent by his CSV agency to Ancient Rome in order to resolve some important national issues. However, something incredible has happened - the enemies have taken Julius Caesar as a prisoner!!!
C... |
Solve the programming task below in a Python markdown code block.
For long time scientists study the behavior of sharks. Sharks, as many other species, alternate short movements in a certain location and long movements between locations.
Max is a young biologist. For $n$ days he watched a specific shark, and now he k... |
Solve the programming task below in a Python markdown code block.
A linear congruential generator produces a series R(⋅) of pseudo-random numbers by the following for- mulas:
<image>
where S, A, C, and M are all parameters. In this problem, 0 ≤ S, A, C ≤ 15 and M = 256.
Now suppose we have some input string I(⋅), w... |
Solve the programming task below in a Python markdown code block.
Many internet protocols these days include the option of associating a
media type with the content being sent.
The type is usually inferred from the file extension.
You are to write a program that facilitates the lookup of media types for
a number of fi... |
Solve the programming task below in a Python markdown code block.
Our brave travelers reached an island where pirates had buried treasure. However as the ship was about to moor, the captain found out that some rat ate a piece of the treasure map.
The treasure map can be represented as a rectangle n × m in size. Each ... |
Solve the programming task below in a Python markdown code block.
Since the giant heads have appeared in the sky all humanity is in danger, so all Ricks and Mortys from all parallel universes are gathering in groups to find a solution to get rid of them.
There are n parallel universes participating in this event (n ... |
Solve the programming task below in a Python markdown code block.
Every Turkish citizen has an identity number whose validity can be checked by these set of rules:
- It is an 11 digit number
- First digit can't be zero
- Take the sum of 1st, 3rd, 5th, 7th and 9th digit and multiply it by 7.
Then subtract the sum of 2... |
Solve the programming task below in a Python markdown code block.
Makoto has a big blackboard with a positive integer $n$ written on it. He will perform the following action exactly $k$ times:
Suppose the number currently written on the blackboard is $v$. He will randomly pick one of the divisors of $v$ (possibly $1$... |
Solve the programming task below in a Python markdown code block.
Life is not easy. Sometimes it is beyond your control. Now, as contestants of ACM ICPC, you might be just tasting the bitter of life. But don't worry! Do not look only on the dark side of life, but look also on the bright side. Life may be an enjoyable ... |
Solve the programming task below in a Python markdown code block.
Nikolay has only recently started in competitive programming, but already qualified to the finals of one prestigious olympiad. There going to be $n$ participants, one of whom is Nikolay. Like any good olympiad, it consists of two rounds. Tired of the tr... |
Solve the programming task below in a Python markdown code block.
It's the fourth quater of the Super Bowl and your team is down by 4 points. You're 10 yards away from the endzone, if your team doesn't score a touchdown in the next four plays you lose. On a previous play, you were injured and rushed to the hospital. Y... |
Solve the programming task below in a Python markdown code block.
Problem C: Earn Big
A group of N people is trying to challenge the following game to earn big money.
First, N participants are isolated from each other. From this point, they are not allowed to contact each other, or to leave any information for other... |
Solve the programming task below in a Python markdown code block.
Since Grisha behaved well last year, at New Year's Eve he was visited by Ded Moroz who brought an enormous bag of gifts with him! The bag contains n sweet candies from the good ol' bakery, each labeled from 1 to n corresponding to its tastiness. No two ... |
Solve the programming task below in a Python markdown code block.
You are given an undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M. In addition, each vertex has a label, `A` or `B`. The label of Vertex i is s_i. Edge i bidirectionally connects ... |
Solve the programming task below in a Python markdown code block.
Create a function that takes a number and finds the factors of it, listing them in **descending** order in an **array**.
If the parameter is not an integer or less than 1, return `-1`. In C# return an empty array.
For Example:
`factors(54)` should ret... |
Solve the programming task below in a Python markdown code block.
AtCoDeer has three cards, one red, one green and one blue.
An integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.
We will arrange the cards in the order red, green and blue from l... |
Solve the programming task below in a Python markdown code block.
In some village, there are 999 towers that are 1,(1+2),(1+2+3),...,(1+2+3+...+999) meters high from west to east, at intervals of 1 meter.
It had been snowing for a while before it finally stopped. For some two adjacent towers located 1 meter apart, we ... |
Solve the programming task below in a Python markdown code block.
In the popular spreadsheets systems (for example, in Excel) the following numeration of columns is used. The first column has number A, the second — number B, etc. till column 26 that is marked by Z. Then there are two-letter numbers: column 27 has numb... |
Solve the programming task below in a Python markdown code block.
You're given Q queries of the form (L, R).
For each query you have to find the number of such x that L ≤ x ≤ R and there exist integer numbers a > 0, p > 1 such that x = a^{p}.
-----Input-----
The first line contains the number of queries Q (1 ≤ Q ... |
Solve the programming task below in a Python markdown code block.
problem
Play by arranging white and black stones on the table. First, place the stones on the left edge of the table. Then place the stones in the second place from the left. Repeat this n times to arrange n stones in a horizontal row. However, when pl... |
Solve the programming task below in a Python markdown code block.
After the contest in comparing numbers, Shapur's teacher found out that he is a real genius and that no one could possibly do the calculations faster than him even using a super computer!
Some days before the contest, the teacher took a very simple-loo... |
Solve the programming task below in a Python markdown code block.
Based on the information of the time when study started and the time when study ended, check whether the total time studied in one day is t or more, and if not, create a program to find the shortage time. Time is one unit per hour, and minutes and secon... |
Solve the programming task below in a Python markdown code block.
Berland has n cities connected by m bidirectional roads. No road connects a city to itself, and each pair of cities is connected by no more than one road. It is not guaranteed that you can get from any city to any other one, using only the existing road... |
Solve the programming task below in a Python markdown code block.
Open Binary and Object Group organizes a programming contest every year. Mr. Hex belongs to this group and joins the judge team of the contest. This year, he created a geometric problem with its solution for the contest. The problem required a set of po... |
Solve the programming task below in a Python markdown code block.
As you could know there are no male planes nor female planes. However, each plane on Earth likes some other plane. There are n planes on Earth, numbered from 1 to n, and the plane with number i likes the plane with number f_{i}, where 1 ≤ f_{i} ≤ n and ... |
Solve the programming task below in a Python markdown code block.
Three swimmers decided to organize a party in the swimming pool! At noon, they started to swim from the left side of the pool.
It takes the first swimmer exactly $a$ minutes to swim across the entire pool and come back, exactly $b$ minutes for the seco... |
Solve the programming task below in a Python markdown code block.
There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and there can not be two or more particles located in the s... |
Solve the programming task below in a Python markdown code block.
You are given an array $a$ of $n$ integers, and another integer $k$ such that $2k \le n$.
You have to perform exactly $k$ operations with this array. In one operation, you have to choose two elements of the array (let them be $a_i$ and $a_j$; they can ... |
Solve the programming task below in a Python markdown code block.
Heiankyo is known as a town with a grid of roads.
Hokusai, a cat who lives in Heiankyo, has to go from his home to a secret place on the outskirts of town every day for patrol. However, I get tired of following the same path every day, and there is a r... |
Solve the programming task below in a Python markdown code block.
Do you know "sed," a tool provided with Unix? Its most popular use is to substitute every occurrence of a string contained in the input string (actually each input line) with another string β. More precisely, it proceeds as follows.
1. Within the inpu... |
Solve the programming task below in a Python markdown code block.
Top-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills.
Her problem is following: for given string, consisting of only 0 and 1, tell if it's possible to remove some digits in such a way, that re... |
Solve the programming task below in a Python markdown code block.
So the Beautiful Regional Contest (BeRC) has come to an end! $n$ students took part in the contest. The final standings are already known: the participant in the $i$-th place solved $p_i$ problems. Since the participants are primarily sorted by the numb... |
Solve the programming task below in a Python markdown code block.
Read problems statements in Mandarin Chinese .
You are given two strings A and B of the same length. Each string contains N Lower case Latin character (from 'a' to 'z'). A shift operation will remove the first character of a string and add the same ch... |
Solve the programming task below in a Python markdown code block.
Read problems statements in Mandarin Chinese and Russian.
Alok-nath is man of equality. He needs your help to divide his “sanskars” evenly amongst all his followers. By doing this, Alok-nath can create equality amongst his followers and he'll be call... |
Solve the programming task below in a Python markdown code block.
Codehorses has just hosted the second Codehorses Cup. This year, the same as the previous one, organizers are giving T-shirts for the winners.
The valid sizes of T-shirts are either "M" or from $0$ to $3$ "X" followed by "S" or "L". For example, sizes ... |
Solve the programming task below in a Python markdown code block.
# Description
"It's the end of trick-or-treating and we have a list/array representing how much candy each child in our group has made out with. We don't want the kids to start arguing, and using our parental intuition we know trouble is brewing as many... |
Solve the programming task below in a Python markdown code block.
Everybody knows the classic ["half your age plus seven"](https://en.wikipedia.org/wiki/Age_disparity_in_sexual_relationships#The_.22half-your-age-plus-seven.22_rule) dating rule that a lot of people follow (including myself). It's the 'recommended' age ... |
Solve the programming task below in a Python markdown code block.
This time the Berland Team Olympiad in Informatics is held in a remote city that can only be reached by one small bus. Bus has n passenger seats, seat i can be occupied only by a participant from the city a_{i}.
Today the bus has completed m trips, eac... |
Solve the programming task below in a Python markdown code block.
E869120 has A 1-yen coins and infinitely many 500-yen coins.
Determine if he can pay exactly N yen using only these coins.
-----Constraints-----
- N is an integer between 1 and 10000 (inclusive).
- A is an integer between 0 and 1000 (inclusive).
--... |
Solve the programming task below in a Python markdown code block.
There is a square grid of size $n \times n$. Some cells are colored in black, all others are colored in white. In one operation you can select some rectangle and color all its cells in white. It costs $\min(h, w)$ to color a rectangle of size $h \times ... |
Solve the programming task below in a Python markdown code block.
Auction
square1001 You were watching a certain auction.
An auction is a transaction in which when there are a large number of buyers and the number of items is limited, the one with the highest price is given the right to buy. (From the 7th edition of... |
Solve the programming task below in a Python markdown code block.
Devu is a renowned classical singer. He is invited to many big functions/festivals. Recently he was invited to "All World Classical Singing Festival". Other than Devu, comedian Churu was also invited.
Devu has provided organizers a list of the songs an... |
Solve the programming task below in a Python markdown code block.
In the $2022$ year, Mike found two binary integers $a$ and $b$ of length $n$ (both of them are written only by digits $0$ and $1$) that can have leading zeroes. In order not to forget them, he wanted to construct integer $d$ in the following way:
he cr... |
Solve the programming task below in a Python markdown code block.
Consider a simplified penalty phase at the end of a football match.
A penalty phase consists of at most $10$ kicks, the first team takes the first kick, the second team takes the second kick, then the first team takes the third kick, and so on. The tea... |
Solve the programming task below in a Python markdown code block.
Given an array $a$ of length $n$ and an integer $k$, find the number of indices $1 \leq i \leq n - k$ such that the subarray $[a_i, \dots, a_{i+k}]$ with length $k+1$ (not with length $k$) has the following property:
If you multiply the first element b... |
Solve the programming task below in a Python markdown code block.
Takahashi has a string S consisting of lowercase English letters.
Starting with this string, he will produce a new one in the procedure given as follows.
The procedure consists of Q operations. In Operation i (1 \leq i \leq Q), an integer T_i is provide... |
Solve the programming task below in a Python markdown code block.
# Base reduction
## Input
A positive integer:
```
0 < n < 1000000000
```
## Output
The end result of the base reduction.
If it cannot be fully reduced (reduced down to a single-digit number), return -1.
Assume that if 150 conversions from base 11 ... |
Solve the programming task below in a Python markdown code block.
You are playing a game called Guru Guru Gururin. In this game, you can move with the vehicle called Gururin. There are two commands you can give to Gururin: 'R' and 'L'. When 'R' is sent, Gururin rotates clockwise by 90 degrees. Otherwise, when 'L' is s... |
Solve the programming task below in a Python markdown code block.
You are given $q$ queries in the following form:
Given three integers $l_i$, $r_i$ and $d_i$, find minimum positive integer $x_i$ such that it is divisible by $d_i$ and it does not belong to the segment $[l_i, r_i]$.
Can you answer all the queries?
R... |
Solve the programming task below in a Python markdown code block.
*This kata is based on [Project Euler Problem 539](https://projecteuler.net/problem=539)*
##Object
Find the last number between 1 and `n` (inclusive) that survives the elimination process
####How It Works
Start with the first number on the left then... |
Solve the programming task below in a Python markdown code block.
From 1603 to 1867, people call that era the EDO era. EDO stands for Enhanced Driving Operation, the most advanced space navigation technology at the time, and was developed by Dr. Izy in 1603.
You are a space adventurer, flying around the universe and ... |
Solve the programming task below in a Python markdown code block.
Your friend Cody has to sell a lot of jam, so he applied a good 25% discount to all his merchandise.
Trouble is that he mixed all the prices (initial and discounted), so now he needs your cool coding skills to filter out only the discounted prices.
Fo... |
Solve the programming task below in a Python markdown code block.
Capitalization is writing a word with its first letter as a capital letter. Your task is to capitalize the given word.
Note, that during capitalization all the letters except the first one remains unchanged.
-----Input-----
A single line contains a ... |
Solve the programming task below in a Python markdown code block.
Write a program which reads an integer and prints sum of its digits.
Input
The input consists of multiple datasets. For each dataset, an integer x is given in a line. The number of digits in x does not exceed 1000.
The input ends with a line includ... |
Solve the programming task below in a Python markdown code block.
Your task is to calculate logical value of boolean array. Test arrays are one-dimensional and their size is in the range 1-50.
Links referring to logical operations: [AND](https://en.wikipedia.org/wiki/Logical_conjunction), [OR](https://en.wikipedia.or... |
Solve the programming task below in a Python markdown code block.
Scheduling is how the processor decides which jobs(processes) get to use the processor and for how long. This can cause a lot of problems. Like a really long process taking the entire CPU and freezing all the other processes. One solution is Shortest Jo... |
Solve the programming task below in a Python markdown code block.
Takahashi, who is A years old, is riding a Ferris wheel.
It costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who ... |
Solve the programming task below in a Python markdown code block.
The Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this challenge to the ABBYY Cup contestants.
The magic square i... |
Solve the programming task below in a Python markdown code block.
International Christmas Present Company (ICPC) is a company to employ Santa and deliver presents on Christmas. Many parents request ICPC to deliver presents to their children at specified time of December 24. Although same Santa can deliver two or more ... |
Solve the programming task below in a Python markdown code block.
Airport Codes
Airport code
In the Kingdom of JAG, airport codes are assigned to each domestic airport for identification.
Airport codes are assigned according to the following rules based on the name of the airport in lowercase English alphabet:
1. ... |
Solve the programming task below in a Python markdown code block.
Eshag has an array $a$ consisting of $n$ integers.
Eshag can perform the following operation any number of times: choose some subsequence of $a$ and delete every element from it which is strictly larger than $AVG$, where $AVG$ is the average of the num... |
Solve the programming task below in a Python markdown code block.
Rikhail Mubinchik believes that the current definition of prime numbers is obsolete as they are too complex and unpredictable. A palindromic number is another matter. It is aesthetically pleasing, and it has a number of remarkable properties. Help Rikha... |
Solve the programming task below in a Python markdown code block.
Have you ever played Hanabi? If not, then you've got to try it out! This problem deals with a simplified version of the game.
Overall, the game has 25 types of cards (5 distinct colors and 5 distinct values). Borya is holding n cards. The game is somew... |
Solve the programming task below in a Python markdown code block.
Once again, Boris needs the help of Anton in creating a task. This time Anton needs to solve the following problem:
There are two arrays of integers $a$ and $b$ of length $n$. It turned out that array $a$ contains only elements from the set $\{-1, 0, 1... |
Solve the programming task below in a Python markdown code block.
Inna and Dima bought a table of size n × m in the shop. Each cell of the table contains a single letter: "D", "I", "M", "A".
Inna loves Dima, so she wants to go through his name as many times as possible as she moves through the table. For that, Inna a... |
Solve the programming task below in a Python markdown code block.
### Task
You've just moved into a perfectly straight street with exactly ```n``` identical houses on either side of the road. Naturally, you would like to find out the house number of the people on the other side of the street. The street looks somethin... |
Solve the programming task below in a Python markdown code block.
# Task
You are given a string `s`. Let's call its substring a group, if all letters in it are adjacent and the same(such as `"aa","bbb","cccc"`..). Let's call the substiring with 2 or more adjacent group a big group(such as `"aabb","bbccc"`...).
You... |
Solve the programming task below in a Python markdown code block.
Let's call beauty of an array $b_1, b_2, \ldots, b_n$ ($n > 1$) — $\min\limits_{1 \leq i < j \leq n} |b_i - b_j|$.
You're given an array $a_1, a_2, \ldots a_n$ and a number $k$. Calculate the sum of beauty over all subsequences of the array of length ... |
Solve the programming task below in a Python markdown code block.
Given a string, turn each letter into its ASCII character code and join them together to create a number - let's call this number `total1`:
```
'ABC' --> 'A' = 65, 'B' = 66, 'C' = 67 --> 656667
```
Then replace any incidence of the number `7` with the... |
Solve the programming task below in a Python markdown code block.
Construct a function 'coordinates', that will return the distance between two points on a cartesian plane, given the x and y coordinates of each point.
There are two parameters in the function, ```p1``` and ```p2```. ```p1``` is a list ```[x1,y1]``` wh... |
Solve the programming task below in a Python markdown code block.
Gerald plays the following game. He has a checkered field of size n × n cells, where m various cells are banned. Before the game, he has to put a few chips on some border (but not corner) board cells. Then for n - 1 minutes, Gerald every minute moves ea... |
Solve the programming task below in a Python markdown code block.
In the world of DragonBool there are fierce warriors called Soints. Also there are even fiercer warriors called Sofloats – the mortal enemies of Soints.
The power of each warrior is determined by the amount of chakra he possesses which is some positive... |
Solve the programming task below in a Python markdown code block.
The objective of this Kata is to write a function that creates a dictionary of factors for a range of numbers.
The key for each list in the dictionary should be the number. The list associated with each key should possess the factors for the number.
I... |
Solve the programming task below in a Python markdown code block.
Given the triangle of consecutive odd numbers:
```
1
3 5
7 9 11
13 15 17 19
21 23 25 27 29
...
```
Calculate the row sums of this triangle from the row index (starting at index 1) e.g.:
... |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.