question large_stringlengths 265 13.2k |
|---|
Solve the programming task below in a Python markdown code block.
Alice and Bob play a game. The game consists of several sets, and each set consists of several rounds. Each round is won either by Alice or by Bob, and the set ends when one of the players has won $x$ rounds in a row. For example, if Bob won five rounds... |
Solve the programming task below in a Python markdown code block.
Sergey attends lessons of the N-ish language. Each lesson he receives a hometask. This time the task is to translate some sentence to the N-ish language. Sentences of the N-ish language can be represented as strings consisting of lowercase Latin letters... |
Solve the programming task below in a Python markdown code block.
There is a string s of length 3 or greater. No two neighboring characters in s are equal.
Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first:
* Remove one of the ... |
Solve the programming task below in a Python markdown code block.
Petya and Vasya are competing with each other in a new interesting game as they always do.
At the beginning of the game Petya has to come up with an array of N positive integers. Sum of all elements in his array should be equal to S. Then Petya has to ... |
Solve the programming task below in a Python markdown code block.
Snuke received a positive integer N from Takahashi. A positive integer m is called a favorite number when the following condition is satisfied:
* The quotient and remainder of N divided by m are equal, that is, \lfloor \frac{N}{m} \rfloor = N \bmod m h... |
Solve the programming task below in a Python markdown code block.
A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)
Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price o... |
Solve the programming task below in a Python markdown code block.
There is a queue for the self-checkout tills at the supermarket. Your task is write a function to calculate the total time required for all the customers to check out!
### input
```if-not:c
* customers: an array of positive integers representing the qu... |
Solve the programming task below in a Python markdown code block.
Chef likes cooking. But more than that, he likes to give gifts. And now he wants to give his girlfriend an unforgettable gift. But unfortunately he forgot the password to the safe where the money he saved for the gift is kept.
But he knows how to hack ... |
Solve the programming task below in a Python markdown code block.
Given few numbers, you need to print out the digits that are not being used.
Example:
```python
unused_digits(12, 34, 56, 78) # "09"
unused_digits(2015, 8, 26) # "3479"
```
Note:
- Result string should be sorted
- The test case won't pass Integer wi... |
Solve the programming task below in a Python markdown code block.
Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brought together the best mushroom gro... |
Solve the programming task below in a Python markdown code block.
Imagine that you have a twin brother or sister. Having another person that looks exactly like you seems very unusual. It's hard to say if having something of an alter ego is good or bad. And if you do have a twin, then you very well know what it's like.... |
Solve the programming task below in a Python markdown code block.
This kata is blatantly copied from inspired by This Kata
Welcome
this is the second in the series of the string iterations kata!
Here we go!
---------------------------------------------------------------------------------
We have a string s
Let'... |
Solve the programming task below in a Python markdown code block.
One quite ordinary day Valera went to school (there's nowhere else he should go on a week day). In a maths lesson his favorite teacher Ms. Evans told students about divisors. Despite the fact that Valera loved math, he didn't find this particular topic ... |
Solve the programming task below in a Python markdown code block.
Serval is fighting with a monster.
The health of the monster is H.
In one attack, Serval can decrease the monster's health by A.
There is no other way to decrease the monster's health.
Serval wins when the monster's health becomes 0 or below.
Find the n... |
Solve the programming task below in a Python markdown code block.
Monocarp has arranged $n$ colored marbles in a row. The color of the $i$-th marble is $a_i$. Monocarp likes ordered things, so he wants to rearrange marbles in such a way that all marbles of the same color form a contiguos segment (and there is only one... |
Solve the programming task below in a Python markdown code block.
You are given an array of n integer numbers a_0, a_1, ..., a_{n} - 1. Find the distance between two closest (nearest) minimums in it. It is guaranteed that in the array a minimum occurs at least two times.
-----Input-----
The first line contains posi... |
Solve the programming task below in a Python markdown code block.
Alice and Bob play ping-pong with simplified rules.
During the game, the player serving the ball commences a play. The server strikes the ball then the receiver makes a return by hitting the ball back. Thereafter, the server and receiver must alternate... |
Solve the programming task below in a Python markdown code block.
Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. However, he finds the game on 8 to 8 board to too simple, he uses an infinite one instead.
The first task he faced is to check wh... |
Solve the programming task below in a Python markdown code block.
There are N stores called Store 1, Store 2, \cdots, Store N. Takahashi, who is at his house at time 0, is planning to visit some of these stores.
It takes Takahashi one unit of time to travel from his house to one of the stores, or between any two stor... |
Solve the programming task below in a Python markdown code block.
Programmer Vasya is studying a new programming language &K*. The &K* language resembles the languages of the C family in its syntax. However, it is more powerful, which is why the rules of the actual C-like languages are unapplicable to it. To fully und... |
Solve the programming task below in a Python markdown code block.
There are N cats. We number them from 1 through N.
Each of the cats wears a hat. Cat i says: "there are exactly a_i different colors among the N - 1 hats worn by the cats except me."
Determine whether there exists a sequence of colors of the hats that... |
Solve the programming task below in a Python markdown code block.
# Task
Consider a `bishop`, a `knight` and a `rook` on an `n Γ m` chessboard. They are said to form a `triangle` if each piece attacks exactly one other piece and is attacked by exactly one piece.
Calculate the number of ways to choose positions of... |
Solve the programming task below in a Python markdown code block.
This is the easy version of the problem. The difference between the versions is in the constraints on the array elements. You can make hacks only if all versions of the problem are solved.
You are given an array [a_1, a_2, ..., a_n].
Your goal is to ... |
Solve the programming task below in a Python markdown code block.
You are given a string s consisting of lowercase English letters and a number k. Let's call a string consisting of lowercase English letters beautiful if the number of occurrences of each letter in that string is divisible by k. You are asked to find th... |
Solve the programming task below in a Python markdown code block.
This is the easy version of the problem. The only difference is that in this version q = 1. You can make hacks only if both versions of the problem are solved.
There is a process that takes place on arrays a and b of length n and length n-1 respectivel... |
Solve the programming task below in a Python markdown code block.
Polycarp must pay exactly $n$ burles at the checkout. He has coins of two nominal values: $1$ burle and $2$ burles. Polycarp likes both kinds of coins equally. So he doesn't want to pay with more coins of one type than with the other.
Thus, Polycarp wa... |
Solve the programming task below in a Python markdown code block.
Gaius Julius Caesar, a famous general, loved to line up his soldiers. Overall the army had n1 footmen and n2 horsemen. Caesar thought that an arrangement is not beautiful if somewhere in the line there are strictly more that k1 footmen standing successi... |
Solve the programming task below in a Python markdown code block.
Consider integer coordinates x, y in the Cartesian plan and three functions f, g, h
defined by:
```
f: 1 <= x <= n, 1 <= y <= n --> f(x, y) = min(x, y)
g: 1 <= x <= n, 1 <= y <= n --> g(x, y) = max(x, y)
h: 1 <= x <= n, 1 <= y <= n --> h(x, y) = x + y
`... |
Solve the programming task below in a Python markdown code block.
You have been blessed as a child of Omkar. To express your gratitude, please solve this problem for Omkar!
An array a of length n is called complete if all elements are positive and don't exceed 1000, and for all indices x,y,z (1 β€ x,y,z β€ n), a_{x}+a_... |
Solve the programming task below in a Python markdown code block.
Vova decided to clean his room. The room can be represented as the coordinate axis $OX$. There are $n$ piles of trash in the room, coordinate of the $i$-th pile is the integer $p_i$. All piles have different coordinates.
Let's define a total cleanup as... |
Solve the programming task below in a Python markdown code block.
You are a coach of a group consisting of $n$ students. The $i$-th student has programming skill $a_i$. All students have distinct programming skills. You want to divide them into teams in such a way that: No two students $i$ and $j$ such that $|a_i - a... |
Solve the programming task below in a Python markdown code block.
This is an easier version of the next problem. In this version, $q = 0$.
A sequence of integers is called nice if its elements are arranged in blocks like in $[3, 3, 3, 4, 1, 1]$. Formally, if two elements are equal, everything in between must also be ... |
Solve the programming task below in a Python markdown code block.
Vasya likes taking part in Codeforces contests. When a round is over, Vasya follows all submissions in the system testing tab.
There are $n$ solutions, the $i$-th of them should be tested on $a_i$ tests, testing one solution on one test takes $1$ secon... |
Solve the programming task below in a Python markdown code block.
The game of Berland poker is played with a deck of $n$ cards, $m$ of which are jokers. $k$ players play this game ($n$ is divisible by $k$).
At the beginning of the game, each player takes $\frac{n}{k}$ cards from the deck (so each card is taken by exa... |
Solve the programming task below in a Python markdown code block.
Jou and Yae are a good couple. Jou is collecting prizes for capsule toy vending machines (Gachapon), and even when they go out together, when they find Gachapon, they seem to get so hot that they try it several times. Yae was just looking at Jou, who lo... |
Solve the programming task below in a Python markdown code block.
There is a long plate s containing n digits. Iahub wants to delete some digits (possibly none, but he is not allowed to delete all the digits) to form his "magic number" on the plate, a number that is divisible by 5. Note that, the resulting number may ... |
Solve the programming task below in a Python markdown code block.
One day, Chef prepared D brand new dishes. He named the i-th dish by a string Si. After the cooking, he decided to categorize each of these D dishes as special or not.
A dish Si is called special if it's name (i.e. the string Si) can be represented in ... |
Solve the programming task below in a Python markdown code block.
A sequence of square brackets is regular if by inserting symbols "+" and "1" into it, you can get a regular mathematical expression from it. For example, sequences "[[]][]", "[]" and "[[][[]]]" β are regular, at the same time "][", "[[]" and "[[]]][" β ... |
Solve the programming task below in a Python markdown code block.
Given is a string S consisting of L and R.
Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left.
The character written on the leftmost square is ... |
Solve the programming task below in a Python markdown code block.
In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are on each floor, but he remembers that the flats are numbered from 1 from lower to upper floors. That is, the first... |
Solve the programming task below in a Python markdown code block.
**This Kata is intended as a small challenge for my students**
Create a function, called ``removeVowels`` (or ``remove_vowels``), that takes a string argument and returns that same string with all vowels removed (vowels are "a", "e", "i", "o", "u").
R... |
Solve the programming task below in a Python markdown code block.
An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contains only letters is an isogram. Assume the empty string is an isogram. Ignore letter case.
```python
is_... |
Solve the programming task below in a Python markdown code block.
Read problems statements in Mandarin Chinese and Russian.
Yesterday Chef had a great party and doesn't remember the way he celebreated it. But he found a strange paper in his kitchen containing n digits (lets give them indices from 1 to n and name th... |
Solve the programming task below in a Python markdown code block.
There are n cities situated along the main road of Berland. Cities are represented by their coordinates β integer numbers a_1, a_2, ..., a_{n}. All coordinates are pairwise distinct.
It is possible to get from one city to another only by bus. But all b... |
Solve the programming task below in a Python markdown code block.
A correct expression of the form a+b=c was written; a, b and c are non-negative integers without leading zeros. In this expression, the plus and equally signs were lost. The task is to restore the expression. In other words, one character '+' and one ch... |
Solve the programming task below in a Python markdown code block.
Polycarp lives on a coordinate line at the point $x = 0$. He goes to his friend that lives at the point $x = a$. Polycarp can move only from left to right, he can pass one unit of length each second.
Now it's raining, so some segments of his way are in... |
Solve the programming task below in a Python markdown code block.
Daruma Otoshi
You are playing a variant of a game called "Daruma Otoshi (Dharma Block Striking)".
At the start of a game, several wooden blocks of the same size but with varying weights are stacked on top of each other, forming a tower. Another block ... |
Solve the programming task below in a Python markdown code block.
Methodius received an email from his friend Polycarp. However, Polycarp's keyboard is broken, so pressing a key on it once may cause the corresponding symbol to appear more than once (if you press a key on a regular keyboard, it prints exactly one symbo... |
Solve the programming task below in a Python markdown code block.
Sunuke received a d-dimensional hypercube with a side length of l1 Γ ... Γ ld as a birthday present. Sunuke placed this rectangular parallelepiped so that the range of the i-th coordinate was 0 or more and li or less, and ate the part that satisfied x1 ... |
Solve the programming task below in a Python markdown code block.
As you have noticed, there are lovely girls in Arpaβs land.
People in Arpa's land are numbered from 1 to n. Everyone has exactly one crush, i-th person's crush is person with the number crush_{i}. [Image]
Someday Arpa shouted Owf loudly from the top ... |
Solve the programming task below in a Python markdown code block.
Yuki made a sugoroku so that everyone can play at the children's association event. In this sugoroku, squares are lined up in a ring, and each square has an integer of 1 or more written on it.
The player chooses a square as a starting point and places ... |
Solve the programming task below in a Python markdown code block.
Anatoly lives in the university dorm as many other students do. As you know, cockroaches are also living there together with students. Cockroaches might be of two colors: black and red. There are n cockroaches living in Anatoly's room.
Anatoly just mad... |
Solve the programming task below in a Python markdown code block.
We have a tree with N vertices. The vertices are numbered 0 through N - 1, and the i-th edge (0 β€ i < N - 1) comnnects Vertex a_i and b_i. For each pair of vertices u and v (0 β€ u, v < N), we define the distance d(u, v) as the number of edges in the pat... |
Solve the programming task below in a Python markdown code block.
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try ... |
Solve the programming task below in a Python markdown code block.
You can print your name on a billboard ad. Find out how much it will cost you. Each letter has a default price of Β£30, but that can be different if you are given 2 parameters instead of 1.
You can not use multiplier "*" operator.
If your name would be... |
Solve the programming task below in a Python markdown code block.
# Task
John is new to spreadsheets. He is well aware of rows and columns, but he is not comfortable with spreadsheets numbering system.
```
Spreadsheet Row Column
A1 R1C1
D5 R5C4
AA48 ... |
Solve the programming task below in a Python markdown code block.
The north country is conquered by the great shogun-sama (which means king). Recently many beautiful dice which were made by order of the great shogun-sama were given to all citizens of the country. All citizens received the beautiful dice with a tear of... |
Solve the programming task below in a Python markdown code block.
Petya is having a party soon, and he has decided to invite his $n$ friends.
He wants to make invitations in the form of origami. For each invitation, he needs two red sheets, five green sheets, and eight blue sheets. The store sells an infinite number ... |
Solve the programming task below in a Python markdown code block.
Your program fails again. This time it gets "Wrong answer on test 233".
This is the harder version of the problem. In this version, $1 \le n \le 2\cdot10^5$. You can hack this problem if you locked it. But you can hack the previous problem only if you ... |
Solve the programming task below in a Python markdown code block.
Bad news came to Mike's village, some thieves stole a bunch of chocolates from the local factory! Horrible!
Aside from loving sweet things, thieves from this area are known to be very greedy. So after a thief takes his number of chocolates for himself... |
Solve the programming task below in a Python markdown code block.
You are given an array $a$ of length $n$. The array is called 3SUM-closed if for all distinct indices $i$, $j$, $k$, the sum $a_i + a_j + a_k$ is an element of the array. More formally, $a$ is 3SUM-closed if for all integers $1 \leq i < j < k \leq n$, t... |
Solve the programming task below in a Python markdown code block.
You throw a ball vertically upwards with an initial speed `v (in km per hour)`. The height `h` of the ball at each time `t`
is given by `h = v*t - 0.5*g*t*t` where `g` is Earth's gravity `(g ~ 9.81 m/s**2)`. A device is recording at every **tenth
of sec... |
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 cards and drew... |
Solve the programming task below in a Python markdown code block.
Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are?
Constraints
* 1 β€ N,A,B β€ 10^9
* A and B are integers.
Input
Input is given from... |
Solve the programming task below in a Python markdown code block.
As we know, DZY loves playing games. One day DZY decided to play with a n Γ m matrix. To be more precise, he decided to modify the matrix with exactly k operations.
Each modification is one of the following:
1. Pick some row of the matrix and decrea... |
Solve the programming task below in a Python markdown code block.
Polo, the Penguin, likes numbers. He says that the goodness of a number is itself multiplied by the number of digits in it's decimal representation. For example, the goodness of the integer 474 is 474*3 = 1422.
Help him to count the sum of goodness of a... |
Solve the programming task below in a Python markdown code block.
There are $n$ people sitting in a circle, numbered from $1$ to $n$ in the order in which they are seated. That is, for all $i$ from $1$ to $n-1$, the people with id $i$ and $i+1$ are adjacent. People with id $n$ and $1$ are adjacent as well.
The person... |
Solve the programming task below in a Python markdown code block.
Little Tanya decided to present her dad a postcard on his Birthday. She has already created a message β string s of length n, consisting of uppercase and lowercase English letters. Tanya can't write yet, so she found a newspaper and decided to cut out t... |
Solve the programming task below in a Python markdown code block.
This is related to my other Kata about cats and dogs.
# Kata Task
I have a cat and a dog which I got as kitten / puppy.
I forget when that was, but I do know their current ages as `catYears` and `dogYears`.
Find how long I have owned each of my pets... |
Solve the programming task below in a Python markdown code block.
It is Borya's eleventh birthday, and he has got a great present: n cards with numbers. The i-th card has the number a_{i} written on it. Borya wants to put his cards in a row to get one greater number. For example, if Borya has cards with numbers 1, 31,... |
Solve the programming task below in a Python markdown code block.
Roma works in a company that sells TVs. Now he has to prepare a report for the last year.
Roma has got a list of the company's incomes. The list is a sequence that consists of n integers. The total income of the company is the sum of all integers in se... |
Solve the programming task below in a Python markdown code block.
-----Problem Statement-----
Chef studies combinatorics. He tries to group objects by their rang (a positive integer associated with each object). He also gives the formula for calculating the number of different objects with rang N as following:
the nu... |
Solve the programming task below in a Python markdown code block.
Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller?
-----Constraints-----
- 1 \leq a \leq... |
Solve the programming task below in a Python markdown code block.
A TV program called "Saizo" is popular in a certain country. In this program, participants challenge field athletics and get a prize if they successfully capture it.
Field athletics are made by arranging blocks of different heights in a row, and how to... |
Solve the programming task below in a Python markdown code block.
It's now 260 AD. Shapur, being extremely smart, became the King of Persia. He is now called Shapur, His majesty King of kings of Iran and Aniran.
Recently the Romans declared war on Persia. They dreamed to occupy Armenia. In the recent war, the Romans ... |
Solve the programming task below in a Python markdown code block.
We have a board with H horizontal rows and W vertical columns of squares. There is a bishop at the top-left square on this board. How many squares can this bishop reach by zero or more movements?
Here the bishop can only move diagonally. More formally,... |
Solve the programming task below in a Python markdown code block.
The goal of 8 Queens Problem is to put eight queens on a chess-board such that none of them threatens any of others. A queen threatens the squares in the same row, in the same column, or on the same diagonals as shown in the following figure.
<image>
... |
Solve the programming task below in a Python markdown code block.
## Task
Find the sum of the first `n` elements in the RecamΓ‘n Sequence.
Input range:
```python
1000 tests
0 <= n <= 2,500,000
```
___
## Sequence
The sequence is formed using the next formula:
* We start with `0`
* At each step `i`, we subtract `i... |
Solve the programming task below in a Python markdown code block.
Snuke has N integers: 1,2,\ldots,N. He will choose K of them and give those to Takahashi.
How many ways are there to choose K consecutive integers?
Constraints
* All values in input are integers.
* 1 \leq K \leq N \leq 50
Input
Input is given from ... |
Solve the programming task below in a Python markdown code block.
Sasha grew up and went to first grade. To celebrate this event her mother bought her a multiplication table $M$ with $n$ rows and $n$ columns such that $M_{ij}=a_i \cdot a_j$ where $a_1, \dots, a_n$ is some sequence of positive integers.
Of course, the... |
Solve the programming task below in a Python markdown code block.
You are given a program that consists of $n$ instructions. Initially a single variable $x$ is assigned to $0$. Afterwards, the instructions are of two types:
increase $x$ by $1$;
decrease $x$ by $1$.
You are given $m$ queries of the following format:... |
Solve the programming task below in a Python markdown code block.
Developers often face with regular expression patterns. A pattern is usually defined as a string consisting of characters and metacharacters that sets the rules for your search. These patterns are most often used to check whether a particular string mee... |
Solve the programming task below in a Python markdown code block.
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1^{n} + 2^{n} + 3^{n} + 4^{n})Β modΒ 5
for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g.... |
Solve the programming task below in a Python markdown code block.
Kuroni is very angry at the other setters for using him as a theme! As a punishment, he forced them to solve the following problem:
You have an array $a$ consisting of $n$ positive integers. An operation consists of choosing an element and either addin... |
Solve the programming task below in a Python markdown code block.
You have multiset of n strings of the same length, consisting of lowercase English letters. We will say that those strings are easy to remember if for each string there is some position i and some letter c of the English alphabet, such that this string ... |
Solve the programming task below in a Python markdown code block.
Sonya decided to organize an exhibition of flowers. Since the girl likes only roses and lilies, she decided that only these two kinds of flowers should be in this exhibition.
There are $n$ flowers in a row in the exhibition. Sonya can put either a rose... |
Solve the programming task below in a Python markdown code block.
Long ago, when Petya was a schoolboy, he was very much interested in the Petr# language grammar. During one lesson Petya got interested in the following question: how many different continuous substrings starting with the sbegin and ending with the send... |
Solve the programming task below in a Python markdown code block.
Let's denote a m-free matrix as a binary (that is, consisting of only 1's and 0's) matrix such that every square submatrix of size m Γ m of this matrix contains at least one zero.
Consider the following problem:
You are given two integers n and m. Yo... |
Solve the programming task below in a Python markdown code block.
In Aizuwakamatsu City, there is a first city called "Tokaichi" on January 10th every year. This Tokaichi has a history of about 600 years and is the largest first city in the Aizu region. It is also well known that Okiagari-koboshi, a familiar lucky cha... |
Solve the programming task below in a Python markdown code block.
Vasya wants to climb up a stair of certain amount of steps (Input parameter 1). There are 2 simple rules that he has to stick to.
1. Vasya can climb 1 or 2 steps at each move.
2. Vasya wants the number of moves to be a multiple of a certain integer. (I... |
Solve the programming task below in a Python markdown code block.
Patrick has just finished writing a message to his sweetheart Stacey when he noticed that the message didn't look fancy. Patrick was nervous while writing the message, so some of the letters there were lowercase and some of them were uppercase.
Patrick... |
Solve the programming task below in a Python markdown code block.
There are N people (with different names) and K clubs. For each club you know the list of members (so you have K unordered lists). Each person can be a member of many clubs (and also 0 clubs) and two different clubs might have exactly the same members. ... |
Solve the programming task below in a Python markdown code block.
Mike received an array $a$ of length $n$ as a birthday present and decided to test how pretty it is.
An array would pass the $i$-th prettiness test if there is a way to get an array with a sum of elements totaling $s_i$, using some number (possibly zer... |
Solve the programming task below in a Python markdown code block.
Given is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S. If S_{i,j} is `1`, there is an edge connecting Vertex i and j; otherwise, there is no such edge.
... |
Solve the programming task below in a Python markdown code block.
You like playing chess tournaments online.
In your last tournament you played $n$ games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get $0$ points. When you win you get $1$ or $2$ points: if... |
Solve the programming task below in a Python markdown code block.
Vasya commutes by train every day. There are n train stations in the city, and at the i-th station it's possible to buy only tickets to stations from i + 1 to a_{i} inclusive. No tickets are sold at the last station.
Let Ο_{i}, j be the minimum number ... |
Solve the programming task below in a Python markdown code block.
After many years of research, Ikta has acquired the ability to predict the future! The time and money he spent on this research was enormous, but it's finally time to be rewarded. To get the money back, Ikta decided to start investing in stocks.
Ikta d... |
Solve the programming task below in a Python markdown code block.
Programmer Vasya is studying a new programming language &K*. The &K* language resembles the languages of the C family in its syntax. However, it is more powerful, which is why the rules of the actual C-like languages are unapplicable to it. To fully und... |
Solve the programming task below in a Python markdown code block.
AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W.
If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], and... |
Solve the programming task below in a Python markdown code block.
Adam Ivan is working as a system administrator at Soy Group, Inc. He is now facing at a big trouble: a number of computers under his management have been infected by a computer virus. Unfortunately, anti-virus system in his company failed to detect this... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.