text stringlengths 424 69.5k |
|---|
### Prompt
Please formulate a CPP solution to the following problem:
You are given an array s consisting of n integers.
You have to find any array t of length k such that you can cut out maximum number of copies of array t from array s.
Cutting out the copy of t means that for each element t_i of array t you have t... |
### Prompt
Please formulate a Cpp solution to the following problem:
Alice and Bob like games. And now they are ready to start a new game. They have placed n chocolate bars in a line. Alice starts to eat chocolate bars one by one from left to right, and Bob β from right to left. For each chocololate bar the time, nee... |
### Prompt
In Cpp, your task is to solve the following problem:
A frog lives on the axis Ox and needs to reach home which is in the point n. She starts from the point 1. The frog can jump to the right at a distance not more than d. So, after she jumped from the point x she can reach the point x + a, where a is an int... |
### Prompt
Construct a CPP code solution to the problem outlined:
Karen has just arrived at school, and she has a math test today!
<image>
The test is about basic addition and subtraction. Unfortunately, the teachers were too busy writing tasks for Codeforces rounds, and had no time to make an actual test. So, they... |
### Prompt
Generate a Cpp solution to the following problem:
You need to execute several tasks, each associated with number of processors it needs, and the compute power it will consume.
You have sufficient number of analog computers, each with enough processors for any task. Each computer can execute up to one task... |
### Prompt
Create a solution in cpp for the following problem:
Yaroslav has an array that consists of n integers. In one second Yaroslav can swap two neighboring array elements. Now Yaroslav is wondering if he can obtain an array where any two neighboring elements would be distinct in a finite time.
Help Yaroslav.
... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one of the playing teams. If a team wins the matc... |
### Prompt
Develop a solution in CPP to the problem described below:
Mike is trying rock climbing but he is awful at it.
There are n holds on the wall, i-th hold is at height ai off the ground. Besides, let the sequence ai increase, that is, ai < ai + 1 for all i from 1 to n - 1; we will call such sequence a track.... |
### Prompt
Please provide a Cpp coded solution to the problem described below:
You are given array a_1, a_2, ..., a_n. You need to split it into k subsegments (so every element is included in exactly one subsegment).
The weight of a subsegment a_l, a_{l+1}, ..., a_r is equal to (r - l + 1) β
max_{l β€ i β€ r}(a_i). Th... |
### Prompt
Please create a solution in Cpp to the following problem:
10^{10^{10}} participants, including Takahashi, competed in two programming contests. In each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.
The score of a participant is the product of his/her ranks in the two con... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
Takahashi is meeting up with Aoki.
They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.
Takahashi will leave his house now and go straight to the place at a speed of S meters per minute... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
Write a program which reads a sequence of integers $A = \\{a_0, a_1, ..., a_{n-1}\\}$ and rotate specified elements by a list of the following operation:
* rotate($b, m, e$): For each integer $k$ ($0 \leq k < (e - b)$), move element $b + ... |
### Prompt
Create a solution in cpp for the following problem:
Yaroslav calls an array of r integers a1, a2, ..., ar good, if it meets the following conditions: |a1 - a2| = 1, |a2 - a3| = 1, ..., |ar - 1 - ar| = 1, |ar - a1| = 1, at that <image>.
An array of integers b1, b2, ..., br is called great, if it meets the... |
### Prompt
Create a solution in CPP for the following problem:
There are N cards. The two sides of each of these cards are distinguishable. The i-th of these cards has an integer A_i printed on the front side, and another integer B_i printed on the back side. We will call the deck of these cards X. There are also N+1... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
You are given n strings s_1, s_2, β¦, s_n consisting of lowercase Latin letters.
In one operation you can remove a character from a string s_i and insert it to an arbitrary position in a string s_j (j may be equal to i). You may perform th... |
### Prompt
Generate a CPP solution to the following problem:
Squirrel Liss loves nuts. Liss asks you to plant some nut trees.
There are n positions (numbered 1 to n from west to east) to plant a tree along a street. Trees grow one meter per month. At the beginning of each month you should process one query. The quer... |
### Prompt
Generate a cpp solution to the following problem:
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime:
1. Find two consecutive characters i... |
### Prompt
Generate a Cpp solution to the following problem:
A tree of size n is an undirected connected graph consisting of n vertices without cycles.
Consider some tree with n vertices. We call a tree invariant relative to permutation p = p1p2... pn, if for any two vertices of the tree u and v the condition holds:... |
### Prompt
Develop a solution in cpp to the problem described below:
Breaking Good is a new video game which a lot of gamers want to have. There is a certain level in the game that is really difficult even for experienced gamers.
Walter William, the main character of the game, wants to join a gang called Los Hermano... |
### Prompt
Please provide a cpp coded solution to the problem described below:
Let's look at the following process: initially you have an empty stack and an array s of the length l. You are trying to push array elements to the stack in the order s_1, s_2, s_3, ... s_{l}. Moreover, if the stack is empty or the element... |
### Prompt
In Cpp, your task is to solve the following problem:
Valera takes part in the Berland Marathon. The marathon race starts at the stadium that can be represented on the plane as a square whose lower left corner is located at point with coordinates (0, 0) and the length of the side equals a meters. The sides ... |
### Prompt
Your task is to create a CPP solution to the following problem:
[3R2 as DJ Mashiro - Happiness Breeze](https://open.spotify.com/track/2qGqK8GRS65Wlf20qUBEak)
[Ice - DJ Mashiro is dead or alive](https://soundcloud.com/iceloki/dj-mashiro-is-dead-or-alive)
NEKO#Ξ¦ΟΞ¦ has just got a new maze game on her PC!
T... |
### Prompt
Generate a Cpp solution to the following problem:
Taro and Hanako are playing card games. They have n cards each, and they compete n turns. At each turn Taro and Hanako respectively puts out a card. The name of the animal consisting of alphabetical letters is written on each card, and the bigger one in lex... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Holidays have finished. Thanks to the help of the hacker Leha, Noora managed to enter the university of her dreams which is located in a town Pavlopolis. It's well known that universities provide students with dormitory for the period of unive... |
### Prompt
Please create a solution in CPP to the following problem:
Given a string consisting of only numbers from 0 to 9, consider the operation of creating a new string from that string according to the following rules. Read the given string one character at a time from the left end. Go, if the same number a conti... |
### Prompt
Create a solution in Cpp for the following problem:
Mahmoud wants to send a message to his friend Ehab. Their language consists of n words numbered from 1 to n. Some words have the same meaning so there are k groups of words such that all the words in some group have the same meaning.
Mahmoud knows that t... |
### Prompt
Please create a solution in CPP to the following problem:
Alice and Bob decided to eat some fruit. In the kitchen they found a large bag of oranges and apples. Alice immediately took an orange for herself, Bob took an apple. To make the process of sharing the remaining fruit more fun, the friends decided t... |
### Prompt
Generate a cpp solution to the following problem:
Karen is getting ready for a new school day!
<image>
It is currently hh:mm, given in a 24-hour format. As you know, Karen loves palindromes, and she believes that it is good luck to wake up when the time is a palindrome.
What is the minimum number of min... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
In this task you need to process a set of stock exchange orders and use them to create order book.
An order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price pi, direction di β buy... |
### Prompt
Please create a solution in cpp to the following problem:
Tachibana Kanade likes Mapo Tofu very much. One day, the canteen cooked all kinds of tofu to sell, but not all tofu is Mapo Tofu, only those spicy enough can be called Mapo Tofu.
Each piece of tofu in the canteen is given a m-based number, all numb... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i. e. points were subtracted). Initially the participant had some score, and each the marks were one by... |
### Prompt
Develop a solution in CPP to the problem described below:
You are given an array of positive integers a1, a2, ..., an Γ T of length n Γ T. We know that for any i > n it is true that ai = ai - n. Find the length of the longest non-decreasing sequence of the given array.
Input
The first line contains two s... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present β a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: med... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Doubly linked list is one of the fundamental data structures. A doubly linked list is a sequence of elements, each containing information about the previous and the next elements of the list. In this problem all lists have linear structure. I.... |
### Prompt
Create a solution in cpp for the following problem:
Construct a dice from a given sequence of integers in the same way as Dice I.
You are given integers on the top face and the front face after the dice was rolled in the same way as Dice I. Write a program to print an integer on the right side face.
<im... |
### Prompt
Construct a cpp code solution to the problem outlined:
On the way to Rio de Janeiro Ostap kills time playing with a grasshopper he took with him in a special box. Ostap builds a line of length n such that some cells of this line are empty and some contain obstacles. Then, he places his grasshopper to one o... |
### Prompt
Please provide a cpp coded solution to the problem described below:
Two players A and B have a list of n integers each. They both want to maximize the subtraction between their score and their opponent's score.
In one turn, a player can either add to his score any element from his list (assuming his list... |
### Prompt
Please provide a cpp coded solution to the problem described below:
In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each animal spitted. Now he wants to know if in the zoo... |
### Prompt
Please formulate a CPP solution to the following problem:
You are given an array a consisting of 500000 integers (numbered from 1 to 500000). Initially all elements of a are zero.
You have to process two types of queries to this array:
* 1 x y β increase a_x by y;
* 2 x y β compute β_{i β R(x, y)} a... |
### Prompt
Construct a Cpp code solution to the problem outlined:
A rooted tree is a non-directed connected graph without any cycles with a distinguished vertex, which is called the tree root. Consider the vertices of a rooted tree, that consists of n vertices, numbered from 1 to n. In this problem the tree root is t... |
### Prompt
Please create a solution in Cpp to the following problem:
The nation of Panel holds an annual show called The Number Games, where each district in the nation will be represented by one contestant.
The nation has n districts numbered from 1 to n, each district has exactly one path connecting it to every ot... |
### Prompt
Generate a CPP solution to the following problem:
There are n cities in Berland. Some pairs of cities are connected by roads. All roads are bidirectional. Each road connects two different cities. There is at most one road between a pair of cities. The cities are numbered from 1 to n.
It is known that, fro... |
### Prompt
Please formulate a cpp solution to the following problem:
AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd.
Constraints
* 1 β€ a,b β€ 10000
* a and b are integers.
Input
Input is given from Standard Input in the following format:
a b
Outp... |
### Prompt
Please provide a CPP coded solution to the problem described below:
Takahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison.
Eating a cookie containing poison results in a stomachache, and eating a cookie containing poison while havi... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
Let A = {a1, a2, ..., an} be any permutation of the first n natural numbers {1, 2, ..., n}. You are given a positive integer k and another sequence B = {b1, b2, ..., bn}, where bi is the number of elements aj in A to the left of the elemen... |
### Prompt
In cpp, your task is to solve the following problem:
You are both a shop keeper and a shop assistant at a small nearby shop. You have n goods, the i-th good costs a_i coins.
You got tired of remembering the price of each product when customers ask for it, thus you decided to simplify your life. More preci... |
### Prompt
Generate a CPP solution to the following problem:
You are given names of two days of the week.
Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the first day of the week you are given, while the first day of the next month was equal to the se... |
### Prompt
In CPP, your task is to solve the following problem:
Let's call two numbers similar if their binary representations contain the same number of digits equal to 1. For example:
* 2 and 4 are similar (binary representations are 10 and 100);
* 1337 and 4213 are similar (binary representations are 1010011... |
### Prompt
Construct a CPP code solution to the problem outlined:
You are given two positive integers n and k. Print the k-th positive integer that is not divisible by n.
For example, if n=3, and k=7, then all numbers that are not divisible by 3 are: 1, 2, 4, 5, 7, 8, 10, 11, 13 .... The 7-th number among them is 10... |
### Prompt
Please provide a CPP coded solution to the problem described below:
Gennady owns a small hotel in the countryside where he lives a peaceful life. He loves to take long walks, watch sunsets and play cards with tourists staying in his hotel. His favorite game is called "Mau-Mau".
To play Mau-Mau, you need a... |
### Prompt
Develop a solution in CPP to the problem described below:
The "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.
The thinker thinks of a four-digit number in the decimal system. All the digits in the number are different and the number may hav... |
### Prompt
Please provide a cpp coded solution to the problem described below:
Petr wants to make a calendar for current month. For this purpose he draws a table in which columns correspond to weeks (a week is seven consequent days from Monday to Sunday), rows correspond to weekdays, and cells contain dates. For exam... |
### Prompt
In CPP, your task is to solve the following problem:
Gerald found a table consisting of n rows and m columns. As a prominent expert on rectangular tables, he immediately counted the table's properties, that is, the minimum of the numbers in the corners of the table (minimum of four numbers). However, he di... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
You are given two integers n and k.
You need to construct k regular polygons having same [circumcircle](https://en.wikipedia.org/wiki/Circumscribed_circle), with distinct number of sides l between 3 and n.
<image> Illustration for the f... |
### Prompt
Your task is to create a cpp solution to the following problem:
Petya and Vasya decided to play a game. They have n cards (n is an even number). A single integer is written on each card.
Before the game Petya will choose an integer and after that Vasya will choose another integer (different from the numbe... |
### Prompt
In Cpp, your task is to solve the following problem:
Unlike Knights of a Round Table, Knights of a Polygonal Table deprived of nobility and happy to kill each other. But each knight has some power and a knight can kill another knight if and only if his power is greater than the power of victim. However, ev... |
### Prompt
Generate a Cpp solution to the following problem:
This is an interactive problem. Remember to flush your output while communicating with the testing program. You may use fflush(stdout) in C++, system.out.flush() in Java, stdout.flush() in Python or flush(output) in Pascal to flush the output. If you use so... |
### Prompt
Develop a solution in Cpp to the problem described below:
Just in case somebody missed it: this winter is totally cold in Nvodsk! It is so cold that one gets funny thoughts. For example, let's say there are strings with the length exactly n, based on the alphabet of size m. Any its substring with length eq... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
Nothing is eternal in the world, Kostya understood it on the 7-th of January when he saw partially dead four-color garland.
Now he has a goal to replace dead light bulbs, however he doesn't know how many light bulbs for each color are req... |
### Prompt
In CPP, your task is to solve the following problem:
Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)
Here, the price before tax must be ... |
### Prompt
Develop a solution in cpp to the problem described below:
It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day he invents some game and plays in it alone or with friends.
Today he invented one simple game to play with Lena, with whom he shares a desk. The rule... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
The annual college sports-ball tournament is approaching, which for trademark reasons we'll refer to as Third Month Insanity. There are a total of 2N teams participating in the tournament, numbered from 1 to 2N. The tournament lasts N roun... |
### Prompt
Generate a CPP solution to the following problem:
Nikola owns a large warehouse which is illuminated by N light bulbs, numbered 1 to N. At the exit of the warehouse, there are S light switches, numbered 1 to S. Each switch swaps the on/off state for some light bulbs, so if a light bulb is off, flipping the... |
### Prompt
Please create a solution in CPP to the following problem:
In a far away kingdom lives a very greedy king. To defend his land, he built n guard towers. Apart from the towers the kingdom has two armies, each headed by a tyrannical and narcissistic general. The generals can't stand each other, specifically, t... |
### Prompt
In Cpp, your task is to solve the following problem:
The only difference between easy and hard versions is the constraints.
Polycarp has to write a coursework. The coursework consists of m pages.
Polycarp also has n cups of coffee. The coffee in the i-th cup has a_i caffeine in it. Polycarp can drink som... |
### Prompt
Create a solution in CPP for the following problem:
You are given two arrays a and b of positive integers, with length n and m respectively.
Let c be an n Γ m matrix, where c_{i,j} = a_i β
b_j.
You need to find a subrectangle of the matrix c such that the sum of its elements is at most x, and its area ... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Being bored of exploring the Moon over and over again Wall-B decided to explore something he is made of β binary numbers. He took a binary number and decided to count how many times different substrings of length two appeared. He stored those ... |
### Prompt
Generate a cpp solution to the following problem:
When the river brought Gerda to the house of the Old Lady who Knew Magic, this lady decided to make Gerda her daughter. She wants Gerda to forget about Kay, so she puts all the roses from the garden underground.
Mole, who lives in this garden, now can watc... |
### Prompt
Construct a cpp code solution to the problem outlined:
There is a rectangular grid of size n Γ m. Each cell has a number written on it; the number on the cell (i, j) is a_{i, j}. Your task is to calculate the number of paths from the upper-left cell (1, 1) to the bottom-right cell (n, m) meeting the follow... |
### Prompt
Your task is to create a CPP solution to the following problem:
Takahashi has come to a party as a special guest. There are N ordinary guests at the party. The i-th ordinary guest has a power of A_i.
Takahashi has decided to perform M handshakes to increase the happiness of the party (let the current happ... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
You are given an array consisting of n integers a_1, a_2, ..., a_n. Initially a_x = 1, all other elements are equal to 0.
You have to perform m operations. During the i-th operation, you choose two indices c and d such that l_i β€ c, d β€ r... |
### Prompt
In cpp, your task is to solve the following problem:
One day Vasya was going home when he saw a box lying on the road. The box can be represented as a rectangular parallelepiped. Vasya needed no time to realize that the box is special, as all its edges are parallel to the coordinate axes, one of its vertic... |
### Prompt
Develop a solution in Cpp to the problem described below:
Polycarp loves ciphers. He has invented his own cipher called repeating.
Repeating cipher is used for strings. To encrypt the string s=s_{1}s_{2} ... s_{m} (1 β€ m β€ 10), Polycarp uses the following algorithm:
* he writes down s_1 ones,
* he w... |
### Prompt
Please create a solution in cpp to the following problem:
You've got an n Γ m pixel picture. Each pixel can be white or black. Your task is to change the colors of as few pixels as possible to obtain a barcode picture.
A picture is a barcode if the following conditions are fulfilled:
* All pixels in e... |
### Prompt
Please provide a CPP coded solution to the problem described below:
Petya and Vasya are brothers. Today is a special day for them as their parents left them home alone and commissioned them to do n chores. Each chore is characterized by a single parameter β its complexity. The complexity of the i-th chore ... |
### Prompt
Construct a Cpp code solution to the problem outlined:
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 dur... |
### Prompt
Please create a solution in CPP to the following problem:
You are given two positive integers a and b. In one move you can increase a by 1 (replace a with a+1). Your task is to find the minimum number of moves you need to do in order to make a divisible by b. It is possible, that you have to make 0 moves, ... |
### Prompt
Please create a solution in cpp to the following problem:
Tomorrow is a difficult day for Polycarp: he has to attend a lectures and b practical classes at the university! Since Polycarp is a diligent student, he is going to attend all of them.
While preparing for the university, Polycarp wonders whether h... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
Thor is getting used to the Earth. As a gift Loki gave him a smartphone. There are n applications on this phone. Thor is fascinated by this phone. He has only one minor issue: he can't count the number of unread notifications generated by ... |
### Prompt
Develop a solution in CPP to the problem described below:
You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th character.
Let's introduce several definitions:
* A substring s[i..j] (1 β€ i β€ j β€ |s|) of string s is string sisi + 1...sj.
* The prefix of string s of ... |
### Prompt
Construct a Cpp code solution to the problem outlined:
The hero of our story, Valera, and his best friend Arcady are still in school, and therefore they spend all the free time playing turn-based strategy "GAGA: Go And Go Again". The gameplay is as follows.
There are two armies on the playing field each ... |
### Prompt
Please create a solution in Cpp to the following problem:
The capital of Berland has n multifloor buildings. The architect who built up the capital was very creative, so all the houses were built in one row.
Let's enumerate all the houses from left to right, starting with one. A house is considered to be ... |
### Prompt
Please create a solution in CPP to the following problem:
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 little pro... |
### Prompt
Please create a solution in cpp to the following problem:
Input
The first line contains a single integer n (1 β€ n β€ 1000) β the number of points on a plane.
Each of the next n lines contains two real coordinates xi and yi of the <image> point, specified with exactly 2 fractional digits. All coordinates... |
### Prompt
Please create a solution in cpp to the following problem:
Vasya has a string s of length n consisting only of digits 0 and 1. Also he has an array a of length n.
Vasya performs the following operation until the string becomes empty: choose some consecutive substring of equal characters, erase it from the... |
### Prompt
Please create a solution in CPP to the following problem:
You are at the top left cell (1, 1) of an n Γ m labyrinth. Your goal is to get to the bottom right cell (n, m). You can only move right or down, one cell per step. Moving right from a cell (x, y) takes you to the cell (x, y + 1), while moving down t... |
### Prompt
Please formulate a cpp solution to the following problem:
Way to go! Heidi now knows how many brains there must be for her to get one. But throwing herself in the midst of a clutch of hungry zombies is quite a risky endeavor. Hence Heidi wonders: what is the smallest number of brains that must be in the ch... |
### Prompt
Please provide a cpp coded solution to the problem described below:
Seisu-ya, a store specializing in non-negative integers, sells N non-negative integers. The i-th integer is A_i and has a utility of B_i. There may be multiple equal integers with different utilities.
Takahashi will buy some integers in t... |
### Prompt
Please provide a CPP coded solution to the problem described below:
Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the `0` key, the `1` key and the backspace key.
To begin with, he is using a plain text editor with this keyboard. This editor always d... |
### Prompt
Please provide a Cpp coded solution to the problem described below:
Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a1, a2, ..., an. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order ex... |
### Prompt
Please formulate a CPP solution to the following problem:
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j).
There is a lowercase English letter written in eac... |
### Prompt
Your task is to create a cpp solution to the following problem:
There are r red and g green blocks for construction of the red-green tower. Red-green tower can be built following next rules:
* Red-green tower is consisting of some number of levels;
* Let the red-green tower consist of n levels, then ... |
### Prompt
In cpp, your task is to solve the following problem:
You are a car race organizer and would like to arrange some races in Linear Kingdom.
Linear Kingdom has n consecutive roads spanning from left to right. The roads are numbered from 1 to n from left to right, thus the roads follow in the order of their n... |
### Prompt
Generate a Cpp solution to the following problem:
There's a famous museum in the city where KleofΓ‘Ε‘ lives. In the museum, n exhibits (numbered 1 through n) had been displayed for a long time; the i-th of those exhibits has value vi and mass wi.
Then, the museum was bought by a large financial group and s... |
### Prompt
Please provide a CPP coded solution to the problem described below:
Little Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns out to be pretty hard for her, because she is too young. Therefore, her brother Sergey always helps her.
Sergey gives Nastya the w... |
### Prompt
Please create a solution in Cpp to the following problem:
There is a right triangle with legs of length a and b. Your task is to determine whether it is possible to locate the triangle on the plane in such a way that none of its sides is parallel to the coordinate axes. All the vertices must have integer c... |
### Prompt
Generate a cpp solution to the following problem:
Just in case somebody missed it: this winter is totally cold in Nvodsk! It is so cold that one gets funny thoughts. For example, let's say there are strings with the length exactly n, based on the alphabet of size m. Any its substring with length equal to k... |
### Prompt
Construct a Cpp code solution to the problem outlined:
Student Arseny likes to plan his life for n days ahead. He visits a canteen every day and he has already decided what he will order in each of the following n days. Prices in the canteen do not change and that means Arseny will spend ci rubles during t... |
### Prompt
Generate a CPP solution to the following problem:
Ori and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins... nothing happened.
Ori was very surprised, but Sein gave the exp... |
### Prompt
In Cpp, your task is to solve the following problem:
Write a program which reads a sequence of integers $A = \\{a_0, a_1, ..., a_{n-1}\\}$ and swap specified elements by a list of the following operation:
* swapRange($b, e, t$): For each integer $k$ ($0 \leq k < (e - b)$, swap element $(b + k)$ and elemen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.