text stringlengths 424 69.5k |
|---|
### Prompt
Your task is to create a CPP solution to the following problem:
Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string s' as a result. Then he calculates <image> that is defined as the maximal number of non-overlapping substrings equal to p that can be... |
### Prompt
In CPP, your task is to solve the following problem:
There are n points on a plane. The i-th point has coordinates (x_i, y_i). You have two horizontal platforms, both of length k. Each platform can be placed anywhere on a plane but it should be placed horizontally (on the same y-coordinate) and have intege... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
Today Pari and Arya are playing a game called Remainders.
Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the value <image>. There are n ancient numbers c1, c2, ..., cn and Pari has to tell Arya <i... |
### Prompt
Create a solution in Cpp for the following problem:
Vitaly has an array of n distinct integers. Vitaly wants to divide this array into three non-empty sets so as the following conditions hold:
1. The product of all numbers in the first set is less than zero ( < 0).
2. The product of all numbers in t... |
### Prompt
Please formulate a Cpp solution to the following problem:
Recently a new building with a new layout was constructed in Monocarp's hometown. According to this new layout, the building consists of three types of apartments: three-room, five-room, and seven-room apartments. It's also known that each room of e... |
### Prompt
Generate a CPP solution to the following problem:
A schoolboy Petya studies square equations. The equations that are included in the school curriculum, usually look simple:
x2 + 2bx + c = 0 where b, c are natural numbers.
Petya noticed that some equations have two real roots, some of them have only one ... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Last year Bob earned by selling memory sticks. During each of n days of his work one of the two following events took place:
* A customer came to Bob and asked to sell him a 2x MB memory stick. If Bob had such a stick, he sold it and got 2... |
### Prompt
Construct a Cpp code solution to the problem outlined:
Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's introduce a coordinate system so that the car ... |
### Prompt
Please provide a Cpp coded solution to the problem described below:
Tavas is a strange creature. Usually "zzz" comes out of people's mouth while sleeping, but string s of length n comes out from Tavas' mouth instead.
<image>
Today Tavas fell asleep in Malekas' place. While he was sleeping, Malekas did a ... |
### Prompt
Please formulate a cpp solution to the following problem:
Takahashi has N days of summer vacation.
His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.
He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.
What is th... |
### Prompt
Please create a solution in cpp to the following problem:
You are given a n Γ m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the centers of '*'-cells. A right triangle is a triangle i... |
### Prompt
Your task is to create a cpp solution to the following problem:
The Little Elephant loves to play with color cards.
He has n cards, each has exactly two colors (the color of the front side and the color of the back side). Initially, all the cards lay on the table with the front side up. In one move the Li... |
### Prompt
Please formulate a cpp solution to the following problem:
There are N children, numbered 1, 2, ..., N.
Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets.
For each i (1 \leq i \leq N), Child i will be happy if he/she ge... |
### Prompt
Please formulate a CPP solution to the following problem:
After the big birthday party, Katie still wanted Shiro to have some more fun. Later, she came up with a game called treasure hunt. Of course, she invited her best friends Kuro and Shiro to play with her.
The three friends are very smart so they pas... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
A prime number n (11, 19, 23, etc.) that divides by 4 and has 3 has an interesting property. The results of calculating the remainder of the square of a natural number (1, 2, ..., n -1) of 1 or more and less than n divided by n are the sam... |
### Prompt
Your task is to create a cpp solution to the following problem:
After years of hard work scientists invented an absolutely new e-reader display. The new display has a larger resolution, consumes less energy and its production is cheaper. And besides, one can bend it. The only inconvenience is highly unusua... |
### Prompt
Generate a Cpp solution to the following problem:
You are given a connected undirected graph without cycles (that is, a tree) of n vertices, moreover, there is a non-negative integer written on every edge.
Consider all pairs of vertices (v, u) (that is, there are exactly n^2 such pairs) and for each pair ... |
### Prompt
Please create a solution in Cpp to the following problem:
The only difference between easy and hard versions is the size of the input.
You are given a string s consisting of n characters, each character is 'R', 'G' or 'B'.
You are also given an integer k. Your task is to change the minimum number of char... |
### Prompt
Generate a CPP solution to the following problem:
You are given two strings s and t consisting of lowercase Latin letters. Also you have a string z which is initially empty. You want string z to be equal to string t. You can perform the following operation to achieve this: append any subsequence of s at th... |
### Prompt
Develop a solution in CPP to the problem described below:
<image>
To monitor cryptocurrency exchange rates trader William invented a wonderful device consisting of n lights arranged in a row. The device functions in the following way:
Initially, all lights on William's device are turned off. At the begin... |
### Prompt
Please formulate a Cpp solution to the following problem:
Shaass has n books. He wants to make a bookshelf for all his books. He wants the bookshelf's dimensions to be as small as possible. The thickness of the i-th book is ti and its pages' width is equal to wi. The thickness of each book is either 1 or 2... |
### Prompt
Please provide a CPP coded solution to the problem described below:
Ivan has an array consisting of n elements. Each of the elements is an integer from 1 to n.
Recently Ivan learned about permutations and their lexicographical order. Now he wants to change (replace) minimum number of elements in his array... |
### Prompt
Construct a Cpp code solution to the problem outlined:
You are given two strings s and t, each of length n and consisting of lowercase Latin alphabets. You want to make s equal to t.
You can perform the following operation on s any number of times to achieve it β
* Choose any substring of s and rotat... |
### Prompt
Your task is to create a cpp solution to the following problem:
As Famil Doorβs birthday is coming, some of his friends (like Gabi) decided to buy a present for him. His friends are going to buy a string consisted of round brackets since Famil Door loves string of brackets of length n more than any other s... |
### Prompt
Please create a solution in Cpp to the following problem:
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... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
"This problem is rubbish! There is not statement, and there are only 5 test cases. The problemsetter took liberties with this problem!" β people complained in the comments to one round on Codeforces. And even more... No, wait, the checker ... |
### Prompt
Please create a solution in Cpp to the following problem:
Taro Aizu's company has a boss who hates being indivisible. When Taro goes out to eat with his boss, he pays by splitting the bill, but when the payment amount is not divisible by the number of participants, his boss always pays for it.
One day, Ta... |
### Prompt
Construct a Cpp code solution to the problem outlined:
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n Γ n grid. The rows are numbered 1 through n from top to bottom, and the columns ar... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
While doing some spring cleaning, Daniel found an old calculator that he loves so much. However, it seems like it is broken. When he tries to compute 1 + 3 using the calculator, he gets 2 instead of 4. But when he tries computing 1 + 4, he... |
### Prompt
Develop a solution in Cpp to the problem described below:
The bear decided to store some raspberry for the winter. He cunningly found out the price for a barrel of honey in kilos of raspberry for each of the following n days. According to the bear's data, on the i-th (1 β€ i β€ n) day, the price for one barr... |
### Prompt
Please create a solution in Cpp to the following problem:
Petya learned a new programming language CALPAS. A program in this language always takes one non-negative integer and returns one non-negative integer as well.
In the language, there are only three commands: apply a bitwise operation AND, OR or XOR... |
### Prompt
Please provide a cpp coded solution to the problem described below:
Little Chris is participating in a graph cutting contest. He's a pro. The time has come to test his skills to the fullest.
Chris is given a simple undirected connected graph with n vertices (numbered from 1 to n) and m edges. The problem ... |
### Prompt
In Cpp, your task is to solve the following problem:
Tanechka is shopping in the toy shop. There are exactly n toys in the shop for sale, the cost of the i-th toy is i burles. She wants to choose two toys in such a way that their total cost is k burles. How many ways to do that does she have?
Each toy app... |
### Prompt
Your task is to create a cpp solution to the following problem:
Takahashi will play a game using a piece on an array of squares numbered 1, 2, \cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \cdots, N: P_1, P_2, \cdots, P_N.
Now, he will choose one square and... |
### Prompt
Please provide a CPP coded solution to the problem described below:
To celebrate the second ABBYY Cup tournament, the Smart Beaver decided to throw a party. The Beaver has a lot of acquaintances, some of them are friends with each other, and some of them dislike each other. To make party successful, the Sm... |
### Prompt
Create a solution in cpp for the following problem:
The problem describes the properties of a command line. The description somehow resembles the one you usually see in real operating systems. However, there are differences in the behavior. Please make sure you've read the statement attentively and use it ... |
### Prompt
Construct a cpp code solution to the problem outlined:
Someday, Drazil wanted to go on date with Varda. Drazil and Varda live on Cartesian plane. Drazil's home is located in point (0, 0) and Varda's home is located in point (a, b). In each step, he can move in a unit distance in horizontal or vertical dire... |
### Prompt
Your task is to create a Cpp solution to the following problem:
There are n problems prepared for the next Codeforces round. They are arranged in ascending order by their difficulty, and no two problems have the same difficulty. Moreover, there are m pairs of similar problems. Authors want to split problem... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
Let's call an array good if there is an element in the array that equals to the sum of all other elements. For example, the array a=[1, 3, 3, 7] is good because there is the element a_4=7 which equals to the sum 1 + 3 + 3.
You are given a... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Paw the Spider is making a web. Web-making is a real art, Paw has been learning to do it his whole life. Let's consider the structure of the web.
<image>
There are n main threads going from the center of the web. All main threads are located... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
A car number in Berland consists of exactly n digits. A number is called beautiful if it has at least k equal digits. Vasya wants to change the digits in his car's number so that the number became beautiful. To replace one of n digits Vasy... |
### Prompt
Please create a solution in Cpp to the following problem:
Chris the Rabbit found the traces of an ancient Martian civilization. The brave astronomer managed to see through a small telescope an architecture masterpiece β "A Road to the Sun". The building stands on cubical stones of the same size. The founda... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
Little Petya loves inequations. Help him find n positive integers a1, a2, ..., an, such that the following two conditions are satisfied:
* a12 + a22 + ... + an2 β₯ x
* a1 + a2 + ... + an β€ y
Input
The first line contains three space-... |
### Prompt
Please provide a Cpp coded solution to the problem described below:
At University A, there were many mistakes in entering IDs.
Therefore, University A decided to issue a new ID to prevent typos.
There is a way to check if the new ID is correct to prevent typos.
γ» Calculate the sum of all digits.
γ» Howev... |
### Prompt
Generate a CPP solution to the following problem:
To become the king of Codeforces, Kuroni has to solve the following problem.
He is given n numbers a_1, a_2, ..., a_n. Help Kuroni to calculate β_{1β€ i<jβ€ n} |a_i - a_j|. As result can be very big, output it modulo m.
If you are not familiar with short no... |
### Prompt
Please formulate a cpp solution to the following problem:
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya recently learned to det... |
### Prompt
Construct a CPP code solution to the problem outlined:
Recently Polycarpus has learned the "bitwise AND" operation (which is also called "AND") of non-negative integers. Now he wants to demonstrate the school IT teacher his superb manipulation with the learned operation.
For that Polycarpus came to school... |
### Prompt
Develop a solution in cpp to the problem described below:
The Berland Kingdom is a set of n cities connected with each other with n - 1 railways. Each road connects exactly two different cities. The capital is located in city 1. For each city there is a way to get from there to the capital by rail.
In the... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
Let's call an undirected graph of n vertices p-interesting, if the following conditions fulfill:
* the graph contains exactly 2n + p edges;
* the graph doesn't contain self-loops and multiple edges;
* for any integer k (1 β€ k β€ n... |
### Prompt
Construct a Cpp code solution to the problem outlined:
You are given two integers a and b.
In one move, you can choose some integer k from 1 to 10 and add it to a or subtract it from a. In other words, you choose an integer k β [1; 10] and perform a := a + k or a := a - k. You may use different values of ... |
### Prompt
Construct a Cpp code solution to the problem outlined:
You are given an undirected graph with N vertices and M edges. Here, N-1β€Mβ€N holds and the graph is connected. There are no self-loops or multiple edges in this graph.
The vertices are numbered 1 through N, and the edges are numbered 1 through M. Edge... |
### Prompt
Create a solution in Cpp for the following problem:
You are given an array a_1, a_2, β¦, a_n of integers. This array is non-increasing.
Let's consider a line with n shops. The shops are numbered with integers from 1 to n from left to right. The cost of a meal in the i-th shop is equal to a_i.
You should p... |
### Prompt
Your task is to create a cpp solution to the following problem:
Find the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x that a β€ x β€ b and x is divisible by k.
Input
The only line contains three space-separated integers k, a and b ... |
### Prompt
Please formulate a CPP solution to the following problem:
Winters are just damn freezing cold in Nvodsk! That's why a group of n friends prefers to take a taxi, order a pizza and call girls. The phone numbers in the city consist of three pairs of digits (for example, 12-34-56). Each friend has a phonebook ... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
While playing yet another strategy game, Mans has recruited n [Swedish heroes](https://www.youtube.com/watch?v=5sGOwFVUU0I), whose powers which can be represented as an array a.
Unfortunately, not all of those mighty heroes were created a... |
### Prompt
Generate a Cpp solution to the following problem:
You are given n segments on a number line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide.
The intersection of a sequence of s... |
### Prompt
Develop a solution in CPP to the problem described below:
There are n Christmas trees on an infinite number line. The i-th tree grows at the position x_i. All x_i are guaranteed to be distinct.
Each integer point can be either occupied by the Christmas tree, by the human or not occupied at all. Non-intege... |
### Prompt
Please create a solution in cpp to the following problem:
Let's introduce the designation <image>, where x is a string, n is a positive integer and operation " + " is the string concatenation operation. For example, [abc, 2] = abcabc.
We'll say that string s can be obtained from string t, if we can remove... |
### Prompt
Please create a solution in CPP to the following problem:
There are n incoming messages for Vasya. The i-th message is going to be received after ti minutes. Each message has a cost, which equals to A initially. After being received, the cost of a message decreases by B each minute (it can become negative)... |
### Prompt
Create a solution in cpp for the following problem:
You are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different.
Constraints
* 2 β€ |S| β€ 26, where |S| denotes the length of S.
* S consists of lowercase English letters.
Input
Input is given f... |
### Prompt
Create a solution in Cpp for the following problem:
One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b blue socks.
According to the latest fashion, hipsters should wear the socks of different colors: a red one on the left foot, a blue one on the r... |
### Prompt
Generate a CPP solution to the following problem:
You successfully found poor Arkady near the exit of the station you've perfectly predicted. You sent him home on a taxi and suddenly came up with a question.
There are n crossroads in your city and several bidirectional roads connecting some of them. A tax... |
### Prompt
Please provide a Cpp coded solution to the problem described below:
Leonid works for a small and promising start-up that works on decoding the human genome. His duties include solving complex problems of finding certain patterns in long strings consisting of letters 'A', 'T', 'G' and 'C'.
Let's consider t... |
### Prompt
Please create a solution in cpp to the following problem:
There are n psychos standing in a line. Each psycho is assigned a unique integer from 1 to n. At each step every psycho who has an id greater than the psycho to his right (if exists) kills his right neighbor in the line. Note that a psycho might kil... |
### Prompt
Please formulate a cpp solution to the following problem:
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n sides).
T... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
The prison of your city has n prisoners. As the prison can't accommodate all of them, the city mayor has decided to transfer c of the prisoners to a prison located in another city.
For this reason, he made the n prisoners to stand in a li... |
### Prompt
Develop a solution in CPP to the problem described below:
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m integers l_1, l_2, β¦, l_m (1 β€ l_i β€ n)
Dreamoon will p... |
### Prompt
Please create a solution in Cpp to the following problem:
For a dynamic list $L$ of integers, perform a sequence of the following operations. $L$ has a special element called END at the end of the list and an element of $L$ is indicated by a cursor.
* insert($x$): Insert $x$ before the element indicated b... |
### Prompt
Develop a solution in cpp to the problem described below:
Luba thinks about watering her garden. The garden can be represented as a segment of length k. Luba has got n buckets, the i-th bucket allows her to water some continuous subsegment of garden of length exactly ai each hour. Luba can't water any part... |
### Prompt
Please formulate a CPP solution to the following problem:
Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.
Today Vasya got bored and decided to take a walk in the yard. Vasya lives in entrance a and he decided that ... |
### Prompt
Construct a Cpp code solution to the problem outlined:
The Fair Nut found a string s. The string consists of lowercase Latin letters. The Nut is a curious guy, so he wants to find the number of strictly increasing sequences p_1, p_2, β¦, p_k, such that:
1. For each i (1 β€ i β€ k), s_{p_i} = 'a'.
2. Fo... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
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].
Yo... |
### Prompt
Create a solution in Cpp for the following problem:
You are given n points on a plane. All points are different.
Find the number of different groups of three points (A, B, C) such that point B is the middle of segment AC.
The groups of three points are considered unordered, that is, if point B is the mi... |
### Prompt
Generate a CPP solution to the following problem:
At University A, there were many mistakes in entering IDs.
Therefore, University A decided to issue a new ID to prevent typos.
There is a way to check if the new ID is correct to prevent typos.
γ» Calculate the sum of all digits.
γ» However, the number of ... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Takahashi and Aoki are playing a stone-taking game. Initially, there are N piles of stones, and the i-th pile contains A_i stones and has an associated integer K_i.
Starting from Takahashi, Takahashi and Aoki take alternate turns to perform t... |
### Prompt
Please create a solution in cpp to the following problem:
Limak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is made of hi identical blocks. For clarification see picture for the first sample.
Limak will repeat the following... |
### Prompt
Please provide a Cpp coded solution to the problem described below:
Given the number n, find the smallest positive integer which has exactly n divisors. It is guaranteed that for the given n the answer will not exceed 1018.
Input
The first line of the input contains integer n (1 β€ n β€ 1000).
Output
Out... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
It's the year 4527 and the tanks game that we all know and love still exists. There also exists Great Gena's code, written in 2016. The problem this code solves is: given the number of tanks that go into the battle from each country, find ... |
### Prompt
Generate a Cpp solution to the following problem:
You are visiting a large electronics store to buy a refrigerator and a microwave.
The store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \le i \le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave... |
### Prompt
Construct a Cpp code solution to the problem outlined:
Everybody knows that the Berland citizens are keen on health, especially students. Berland students are so tough that all they drink is orange juice!
Yesterday one student, Vasya and his mates made some barbecue and they drank this healthy drink only.... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
Dima and Anya love playing different games. Now Dima has imagined a new game that he wants to play with Anya.
Dima writes n pairs of integers on a piece of paper (li, ri) (1 β€ li < ri β€ p). Then players take turns. On his turn the player ... |
### Prompt
Your task is to create a CPP solution to the following problem:
Polycarpus got an internship in one well-known social network. His test task is to count the number of unique users who have visited a social network during the day. Polycarpus was provided with information on all user requests for this time p... |
### Prompt
Generate a Cpp solution to the following problem:
You are given several queries. In the i-th query you are given a single positive integer ni. You are to represent ni as a sum of maximum possible number of composite summands and print this maximum number, or print -1, if there are no such splittings.
An i... |
### Prompt
Generate a CPP solution to the following problem:
Anton likes to play chess, and so does his friend Danik.
Once they have played n games in a row. For each game it's known who was the winner β Anton or Danik. None of the games ended with a tie.
Now Anton wonders, who won more games, he or Danik? Help him... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
The GCD table G of size n Γ n for an array of positive integers a of length n is defined by formula
<image>
Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is diviso... |
### Prompt
Please create a solution in Cpp to the following problem:
Consider the following process. You have a binary string (a string where each character is either 0 or 1) w of length n and an integer x. You build a new binary string s consisting of n characters. The i-th character of s is chosen as follows:
* ... |
### Prompt
Your task is to create a cpp solution to the following problem:
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. The... |
### Prompt
Create a solution in cpp for the following problem:
A string is called bracket sequence if it does not contain any characters other than "(" and ")". A bracket sequence is called regular (shortly, RBS) if it is possible to obtain correct arithmetic expression by inserting characters "+" and "1" into this s... |
### Prompt
Please create a solution in CPP to the following problem:
Three planets X, Y and Z within the Alpha planetary system are inhabited with an advanced civilization. The spaceports of these planets are connected by interplanetary space shuttles. The flight scheduler should decide between 1, 2 and 3 return flig... |
### Prompt
Construct a cpp code solution to the problem outlined:
The finalists of the "Russian Code Cup" competition in 2214 will be the participants who win in one of the elimination rounds.
The elimination rounds are divided into main and additional. Each of the main elimination rounds consists of c problems, the... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Spongebob is already tired trying to reason his weird actions and calculations, so he simply asked you to find all pairs of n and m, such that there are exactly x distinct squares in the table consisting of n rows and m columns. For example, i... |
### Prompt
Construct a Cpp code solution to the problem outlined:
A positive integer number n is written on a blackboard. It consists of not more than 105 digits. You have to transform it into a beautiful number by erasing some of the digits, and you want to erase as few digits as possible.
The number is called beau... |
### Prompt
Please provide a cpp coded solution to the problem described below:
A very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, his exploration is just walking through the catacombs.
Catacombs consist of several rooms and bidirectional passages between some ... |
### Prompt
Construct a CPP code solution to the problem outlined:
The pandemic is upon us, and the world is in shortage of the most important resource: toilet paper. As one of the best prepared nations for this crisis, BubbleLand promised to help all other world nations with this valuable resource. To do that, the co... |
### Prompt
Please create a solution in Cpp to the following problem:
George woke up and saw the current time s on the digital clock. Besides, George knows that he has slept for time t.
Help George! Write a program that will, given time s and t, determine the time p when George went to bed. Note that George could ha... |
### Prompt
In Cpp, your task is to solve the following problem:
One day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangular a mm Γ b mm sheet of paper (a > b). Usually the first step in making an origami is making a square piece of paper from the rectangular sheet by fold... |
### Prompt
Create a solution in Cpp for the following problem:
Berland β is a huge country with diverse geography. One of the most famous natural attractions of Berland is the "Median mountain range". This mountain range is n mountain peaks, located on one straight line and numbered in order of 1 to n. The height of ... |
### Prompt
Please create a solution in cpp to the following problem:
Polycarp has just launched his new startup idea. The niche is pretty free and the key vector of development sounds really promising, so he easily found himself some investors ready to sponsor the company. However, he is yet to name the startup!
Act... |
### Prompt
Generate a cpp solution to the following problem:
In the spirit of the holidays, Saitama has given Genos two grid paths of length n (a weird gift even by Saitama's standards). A grid path is an ordered sequence of neighbouring squares in an infinite grid. Two squares are neighbouring if they share a side.
... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Santa Claus has n tangerines, and the i-th of them consists of exactly ai slices. Santa Claus came to a school which has k pupils. Santa decided to treat them with tangerines.
However, there can be too few tangerines to present at least one t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.