text stringlengths 424 69.5k |
|---|
### Prompt
Please provide a CPP coded solution to the problem described below:
The ancient Berlanders believed that the longer the name, the more important its bearer is. Thus, Berland kings were famous for their long names. But long names are somewhat inconvenient, so the Berlanders started to abbreviate the names o... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
Arthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new table is unstable.
In total the table Arthur bought has n legs, the length of the i-th leg is li.
Arthur decided to make the table ... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
In Omkar's last class of math, he learned about the least common multiple, or LCM. LCM(a, b) is the smallest positive integer x which is divisible by both a and b.
Omkar, having a laudably curious mind, immediately thought of a problem in... |
### Prompt
In CPP, your task is to solve the following problem:
Hilbert's Hotel is a very unusual hotel since the number of rooms is infinite! In fact, there is exactly one room for every integer, including zero and negative integers. Even stranger, the hotel is currently at full capacity, meaning there is exactly on... |
### Prompt
Generate a Cpp solution to the following problem:
The Hedgehog recently remembered one of his favorite childhood activities, β solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands of tiny pieces of the picture, looking for the required items on... |
### Prompt
Please create a solution in Cpp to the following problem:
A chessboard n Γ m in size is given. During the zero minute we repaint all the black squares to the 0 color. During the i-th minute we repaint to the i color the initially black squares that have exactly four corner-adjacent squares painted i - 1 (a... |
### Prompt
Create a solution in cpp for the following problem:
The Berland capital is shaken with three bold crimes committed by the Pihsters, a notorious criminal gang.
The Berland capital's map is represented by an n Γ m rectangular table. Each cell of the table on the map represents some districts of the capital.... |
### Prompt
Please create a solution in cpp to the following problem:
Only T milliseconds left before the start of well-known online programming contest Codehorses Round 2017.
Polycarp needs to download B++ compiler to take part in the contest. The size of the file is f bytes.
Polycarp's internet tariff allows to do... |
### Prompt
Please formulate a CPP solution to the following problem:
Sereja adores trees. Today he came up with a revolutionary new type of binary root trees.
His new tree consists of n levels, each vertex is indexed by two integers: the number of the level and the number of the vertex on the current level. The tree... |
### Prompt
Your task is to create a Cpp solution to the following problem:
It is lunch time for Mole. His friend, Marmot, prepared him a nice game for lunch.
Marmot brought Mole n ordered piles of worms such that i-th pile contains ai worms. He labeled all these worms with consecutive integers: worms in first pile a... |
### Prompt
Your task is to create a CPP solution to the following problem:
Paul is at the orchestra. The string section is arranged in an r Γ c rectangular grid and is filled with violinists with the exception of n violists. Paul really likes violas, so he would like to take a picture including at least k of them. Pa... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
Dreamoon likes sequences very much. So he created a problem about the sequence that you can't find in OEIS:
You are given two integers d, m, find the number of arrays a, satisfying the following constraints:
* The length of a is n, n ... |
### Prompt
Please provide a Cpp coded solution to the problem described below:
Polycarp is practicing his problem solving skill. He has a list of n problems with difficulties a_1, a_2, ..., a_n, respectively. His plan is to practice for exactly k days. Each day he has to solve at least one problem from his list. Poly... |
### Prompt
Your task is to create a CPP solution to the following problem:
Given is a string S. Let T be the concatenation of K copies of S. We can repeatedly perform the following operation: choose a character in T and replace it with a different character. Find the minimum number of operations required to satisfy t... |
### Prompt
Construct a CPP code solution to the problem outlined:
There are many anime that are about "love triangles": Alice loves Bob, and Charlie loves Bob as well, but Alice hates Charlie. You are thinking about an anime which has n characters. The characters are labeled from 1 to n. Every pair of two characters ... |
### Prompt
Generate a Cpp solution to the following problem:
Miki is a high school student. She has a part time job, so she cannot take enough sleep on weekdays. She wants to take good sleep on holidays, but she doesn't know the best length of sleeping time for her. She is now trying to figure that out with the follo... |
### Prompt
Construct a CPP code solution to the problem outlined:
Michael has just bought a new electric car for moving across city. Michael does not like to overwork, so each day he drives to only one of two his jobs.
Michael's day starts from charging his electric car for getting to the work and back. He spends 10... |
### Prompt
Develop a solution in Cpp to the problem described below:
A and B are preparing themselves for programming contests.
The University where A and B study is a set of rooms connected by corridors. Overall, the University has n rooms connected by n - 1 corridors so that you can get from any room to any other ... |
### Prompt
Please provide a CPP coded solution to the problem described below:
The Bitlandians are quite weird people. They have their own problems and their own solutions. They have their own thoughts and their own beliefs, they have their own values and their own merits. They have their own dishes and their own sau... |
### Prompt
Please provide a cpp coded solution to the problem described below:
Famous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event. There will be n players participating, and the tournament will follow knockout rules from the very first game. That means, that i... |
### Prompt
Please provide a CPP coded solution to the problem described below:
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 numb... |
### Prompt
Create a solution in cpp for the following problem:
Anya loves to watch horror movies. In the best traditions of horror, she will be visited by m ghosts tonight. Anya has lots of candles prepared for the visits, each candle can produce light for exactly t seconds. It takes the girl one second to light one ... |
### Prompt
In CPP, your task is to solve the following problem:
Two people play the following string game. Initially the players have got some string s. The players move in turns, the player who cannot make a move loses.
Before the game began, the string is written on a piece of paper, one letter per cell.
<image>... |
### Prompt
Please provide a CPP coded solution to the problem described below:
Momiji has got a rooted tree, consisting of n nodes. The tree nodes are numbered by integers from 1 to n. The root has number 1. Momiji decided to play a game on this tree.
The game consists of several steps. On each step, Momiji chooses ... |
### Prompt
Generate a cpp solution to the following problem:
You have n problems. You have estimated the difficulty of the i-th one as integer ci. Now you want to prepare a problemset for a contest, using some of the problems you've made.
A problemset for the contest must consist of at least two problems. You think ... |
### Prompt
Please formulate a CPP solution to the following problem:
There is a long-established secondhand bookstore called JOI secondhand bookstore in your town, and you often use the JOI secondhand bookstore. Each book has a standard price, and you can buy it at that price if you go to the JOI secondhand bookstore... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
Very soon Berland will hold a School Team Programming Olympiad. From each of the m Berland regions a team of two people is invited to participate in the olympiad. The qualifying contest to form teams was held and it was attended by n Berla... |
### Prompt
Please formulate a Cpp solution to the following problem:
You are given a grid with n rows and m columns, where each cell has a non-negative integer written on it. We say the grid is good if for each cell the following condition holds: if it has a number k > 0 written on it, then exactly k of its neighbori... |
### Prompt
Please formulate a CPP solution to the following problem:
There are N rabbits on a number line. The rabbits are conveniently numbered 1 through N. The coordinate of the initial position of rabbit i is x_i.
The rabbits will now take exercise on the number line, by performing sets described below. A set con... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Piegirl found the red button. You have one last chance to change the inevitable end.
The circuit under the button consists of n nodes, numbered from 0 to n - 1. In order to deactivate the button, the n nodes must be disarmed in a particular o... |
### Prompt
Please formulate a CPP solution to the following problem:
Barney lives in country USC (United States of Charzeh). USC has n cities numbered from 1 through n and n - 1 roads between them. Cities and roads of USC form a rooted tree (Barney's not sure why it is rooted). Root of the tree is the city number 1. ... |
### Prompt
Create a solution in CPP for the following problem:
In Berland recently a new collection of toys went on sale. This collection consists of 109 types of toys, numbered with integers from 1 to 109. A toy from the new collection of the i-th type costs i bourles.
Tania has managed to collect n different types... |
### Prompt
Create a solution in CPP for the following problem:
Polycarp has spent the entire day preparing problems for you. Now he has to sleep for at least a minutes to feel refreshed.
Polycarp can only wake up by hearing the sound of his alarm. So he has just fallen asleep and his first alarm goes off in b minute... |
### Prompt
Please create a solution in CPP to the following problem:
Well, here is another math class task. In mathematics, GCD is the greatest common divisor, and it's an easy task to calculate the GCD between two positive integers.
A common divisor for two positive numbers is a number which both numbers are divisi... |
### Prompt
Please formulate a cpp solution to the following problem:
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 ... |
### Prompt
Develop a solution in cpp to the problem described below:
Write a program to simulate rolling a dice, which can be constructed by the following net.
<image>
<image>
As shown in the figures, each face is identified by a different label from 1 to 6.
Write a program which reads integers assigned to eac... |
### Prompt
Develop a solution in Cpp to the problem described below:
Problem statement
N first-year students of the Faculty of Information Science and Technology of R University take the final exam of the lecture called Programming Exercise 1. The test is a perfect score of m. In other words, the score that one stud... |
### Prompt
Develop a solution in Cpp to the problem described below:
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
Create a solution in cpp for the following problem:
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflect... |
### Prompt
Generate a Cpp solution to the following problem:
You have array a1, a2, ..., an. Segment [l, r] (1 β€ l β€ r β€ n) is good if ai = ai - 1 + ai - 2, for all i (l + 2 β€ i β€ r).
Let's define len([l, r]) = r - l + 1, len([l, r]) is the length of the segment [l, r]. Segment [l1, r1], is longer than segment [l2, ... |
### Prompt
Please formulate a Cpp solution to the following problem:
D: Indecision-Indecision-
problem
Ebi-chan has been addicted to gal games lately, and her goal now is to capture two heroines at the same time.
Ebi-chan can use several events to increase her liking from the heroine, but only one heroine can be s... |
### Prompt
Generate a cpp solution to the following problem:
You are fed up with your messy room, so you decided to clean it up.
Your room is a bracket sequence s=s_{1}s_{2}... s_{n} of length n. Each character of this string is either an opening bracket '(' or a closing bracket ')'.
In one operation you can choose... |
### Prompt
Your task is to create a CPP solution to the following problem:
Joisino has a bar of length N, which has M marks on it. The distance from the left end of the bar to the i-th mark is X_i.
She will place several squares on this bar. Here, the following conditions must be met:
* Only squares with integral l... |
### Prompt
Construct a cpp code solution to the problem outlined:
Let N be a positive odd number.
There are N coins, numbered 1, 2, \ldots, N. For each i (1 \leq i \leq N), when Coin i is tossed, it comes up heads with probability p_i and tails with probability 1 - p_i.
Taro has tossed all the N coins. Find the pro... |
### Prompt
Please create a solution in cpp to the following problem:
There are N towns in the State of Atcoder, connected by M bidirectional roads.
The i-th road connects Town A_i and B_i and has a length of C_i.
Joisino is visiting R towns in the state, r_1,r_2,..,r_R (not necessarily in this order).
She will fly... |
### Prompt
Please create a solution in Cpp to the following problem:
Snuke has N strings. The i-th string is s_i.
Let us concatenate these strings into one string after arranging them in some order. Find the maximum possible number of occurrences of `AB` in the resulting string.
Constraints
* 1 \leq N \leq 10^{4}
... |
### Prompt
Please formulate a cpp solution to the following problem:
Alice, Bob and Charlie are playing Card Game for Three, as below:
* At first, each of the three players has a deck consisting of some number of cards. Alice's deck has N cards, Bob's deck has M cards, and Charlie's deck has K cards. Each card has a... |
### Prompt
Please create a solution in cpp to the following problem:
Andrewid the Android is a galaxy-famous detective. He is now investigating the case of vandalism at the exhibition of contemporary art.
The main exhibit is a construction of n matryoshka dolls that can be nested one into another. The matryoshka dol... |
### Prompt
Construct a Cpp code solution to the problem outlined:
Summer is coming! It's time for Iahub and Iahubina to work out, as they both want to look hot at the beach. The gym where they go is a matrix a with n lines and m columns. Let number a[i][j] represents the calories burned by performing workout at the c... |
### Prompt
In Cpp, your task is to solve the following problem:
There is a string S consisting of digits `1`, `2`, ..., `9`. Lunlun, the Dachshund, will take out three consecutive digits from S, treat them as a single integer X and bring it to her master. (She cannot rearrange the digits.)
The master's favorite numb... |
### Prompt
Create a solution in Cpp for the following problem:
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i.
Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus th... |
### Prompt
Construct a CPP code solution to the problem outlined:
After the Search Ultimate program that searched for strings in a text failed, Igor K. got to think: "Why on Earth does my program work so slowly?" As he double-checked his code, he said: "My code contains no errors, yet I know how we will improve Searc... |
### Prompt
Please create a solution in Cpp to the following problem:
You are given a string s, consisting only of characters '0' or '1'. Let |s| be the length of s.
You are asked to choose some integer k (k > 0) and find a sequence a of length k such that:
* 1 β€ a_1 < a_2 < ... < a_k β€ |s|;
* a_{i-1} + 1 < a_... |
### Prompt
In CPP, your task is to solve the following problem:
The process of mammoth's genome decoding in Berland comes to its end!
One of the few remaining tasks is to restore unrecognized nucleotides in a found chain s. Each nucleotide is coded with a capital letter of English alphabet: 'A', 'C', 'G' or 'T'. Unr... |
### Prompt
Please formulate a cpp solution to the following problem:
Peter has a sequence of integers a1, a2, ..., an. Peter wants all numbers in the sequence to equal h. He can perform the operation of "adding one on the segment [l, r]": add one to all elements of the sequence with indices from l to r (inclusive). A... |
### Prompt
Please provide a Cpp coded solution to the problem described below:
This winter is so... well, you've got the idea :-) The Nvodsk road system can be represented as n junctions connected with n - 1 bidirectional roads so that there is a path between any two junctions. The organizers of some event want to ch... |
### Prompt
Please formulate a Cpp solution to the following problem:
You are playing a very popular game called Cubecraft. Initially, you have one stick and want to craft k torches. One torch can be crafted using one stick and one coal.
Hopefully, you've met a very handsome wandering trader who has two trade offers:... |
### Prompt
Please create a solution in CPP to the following problem:
Fox Ciel has n boxes in her room. They have the same size and weight, but they might have different strength. The i-th box can hold at most xi boxes on its top (we'll call xi the strength of the box).
Since all the boxes have the same size, Ciel c... |
### Prompt
Construct a Cpp code solution to the problem outlined:
You have an array a_1, a_2, ..., a_n.
Let's call some subarray a_l, a_{l + 1}, ... , a_r of this array a subpermutation if it contains all integers from 1 to r-l+1 exactly once. For example, array a = [2, 2, 1, 3, 2, 3, 1] contains 6 subarrays which ... |
### Prompt
Generate a cpp solution to the following problem:
Since next season are coming, you'd like to form a team from two or three participants. There are n candidates, the i-th candidate has rank a_i. But you have weird requirements for your teammates: if you have rank v and have chosen the i-th and j-th candida... |
### Prompt
Please provide a CPP coded solution to the problem described below:
The Smart Beaver from ABBYY has a long history of cooperating with the "Institute of Cytology and Genetics". Recently, the Institute staff challenged the Beaver with a new problem. The problem is as follows.
There is a collection of n pro... |
### Prompt
Please create a solution in Cpp to the following problem:
In the Isle of Guernsey there are n different types of coins. For each i (1 β€ i β€ n), coin of type i is worth ai cents. It is possible that ai = aj for some i and j (i β j).
Bessie has some set of these coins totaling t cents. She tells Jessie q p... |
### Prompt
Please formulate a cpp solution to the following problem:
Given is an integer S. Find how many sequences there are whose terms are all integers greater than or equal to 3, and whose sum is equal to S. The answer can be very large, so output it modulo 10^9 + 7.
Constraints
* 1 \leq S \leq 2000
* All value... |
### Prompt
Construct a cpp code solution to the problem outlined:
A and B are preparing themselves for programming contests.
The University where A and B study is a set of rooms connected by corridors. Overall, the University has n rooms connected by n - 1 corridors so that you can get from any room to any other one... |
### Prompt
Develop a solution in CPP to the problem described below:
Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns, Sereja moves first. During his turn a player can take ... |
### Prompt
Please formulate a cpp solution to the following problem:
Andrewid the Android is a galaxy-famous detective. He is now chasing a criminal hiding on the planet Oxa-5, the planet almost fully covered with water.
The only dry land there is an archipelago of n narrow islands located in a row. For more comfort... |
### Prompt
Please provide a cpp coded solution to the problem described below:
In the country of Never, there are n cities and a well-developed road system. There is exactly one bidirectional road between every pair of cities, thus, there are as many as <image> roads! No two roads intersect, and no road passes throug... |
### Prompt
In CPP, your task is to solve the following problem:
In a flower bed, there are N flowers, numbered 1,2,......,N. Initially, the heights of all flowers are 0. You are given a sequence h=\\{h_1,h_2,h_3,......\\} as input. You would like to change the height of Flower k to h_k for all k (1 \leq k \leq N), by... |
### Prompt
Please formulate a Cpp solution to the following problem:
You are given a string s consisting of exactly n characters, and each character is either '0', '1' or '2'. Such strings are called ternary strings.
Your task is to replace minimum number of characters in this string with other characters to obtain ... |
### Prompt
Your task is to create a Cpp solution to the following problem:
You are given an undirected unweighted connected graph consisting of n vertices and m edges. It is guaranteed that there are no self-loops or multiple edges in the given graph.
Your task is to choose at most βn/2β vertices in this graph so ea... |
### Prompt
Please provide a cpp coded solution to the problem described below:
Karnaugh is a poor farmer who has a very small field. He wants to reclaim wasteland in the kingdom to get a new field. But the king who loves regular shape made a rule that a settler can only get a rectangular land as his field. Thus, Karn... |
### Prompt
Construct a cpp code solution to the problem outlined:
There are n products in the shop. The price of the i-th product is a_i. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.
In fact, the owner of the shop can change the price of some produc... |
### Prompt
Generate a Cpp solution to the following problem:
You have matrix a of size n Γ n. Let's number the rows of the matrix from 1 to n from top to bottom, let's number the columns from 1 to n from left to right. Let's use aij to represent the element on the intersection of the i-th row and the j-th column.
M... |
### Prompt
Construct a cpp code solution to the problem outlined:
You are given an angle ang.
The Jury asks You to find such regular n-gon (regular polygon with n vertices) that it has three vertices a, b and c (they can be non-consecutive) with \angle{abc} = ang or report that there is no such n-gon.
<image>
If ... |
### Prompt
Develop a solution in Cpp to the problem described below:
One day, Snuke was given a permutation of length N, a_1, a_2, ..., a_N, from his friend.
Find the following:
<image>
Constraints
* 1 β¦ N β¦ 200,000
* (a_1, a_2, ..., a_N) is a permutation of (1, 2, ..., N).
Input
The input is given from Standar... |
### Prompt
Create a solution in cpp for the following problem:
Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path.
You are given l and r. For all integers from l to r, inclusive, we wrote down all of their integer divisors except 1. Find t... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
You are given a string s consisting of lowercase Latin letters "a", "b" and "c" and question marks "?".
Let the number of question marks in the string s be k. Let's replace each question mark with one of the letters "a", "b" and "c". Here... |
### Prompt
Generate a cpp solution to the following problem:
Taro is planning a long trip by train during the summer vacation. However, in order for Taro, who is a high school student, to travel as far as possible during the summer vacation, which has only one month, he cannot make a good plan unless he finds the che... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
The Smart Beaver from ABBYY has once again surprised us! He has developed a new calculating device, which he called the "Beaver's Calculator 1.0". It is very peculiar and it is planned to be used in a variety of scientific problems.
To te... |
### Prompt
Create a solution in cpp for the following problem:
You found a mysterious function f. The function takes two strings s1 and s2. These strings must consist only of lowercase English letters, and must be the same length.
The output of the function f is another string of the same length. The i-th character ... |
### Prompt
Please provide a cpp coded solution to the problem described below:
The king's birthday dinner was attended by k guests. The dinner was quite a success: every person has eaten several dishes (though the number of dishes was the same for every person) and every dish was served alongside with a new set of ki... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
A robber has attempted to rob a bank but failed to complete his task. However, he had managed to open all the safes.
Oleg the bank client loves money (who doesn't), and decides to take advantage of this failed robbery and steal some money... |
### Prompt
Create a solution in Cpp for the following problem:
Okabe and Super Hacker Daru are stacking and removing boxes. There are n boxes numbered from 1 to n. Initially there are no boxes on the stack.
Okabe, being a control freak, gives Daru 2n commands: n of which are to add a box to the top of the stack, and... |
### Prompt
Generate a cpp solution 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 with a ... |
### Prompt
Please provide a cpp coded solution to the problem described below:
Oleg the bank client checks share prices every day. There are n share prices he is interested in. Today he observed that each second exactly one of these prices decreases by k rubles (note that each second exactly one price changes, but at... |
### Prompt
Your task is to create a CPP solution to the following problem:
You have a description of a lever as string s. We'll represent the string length as record |s|, then the lever looks as a horizontal bar with weights of length |s| - 1 with exactly one pivot. We will assume that the bar is a segment on the Ox ... |
### Prompt
Please provide a Cpp coded solution to the problem described below:
Let's call beauty of an array b_1, b_2, β¦, b_n (n > 1) β min_{1 β€ i < j β€ n} |b_i - b_j|.
You're given an array a_1, a_2, β¦ a_n and a number k. Calculate the sum of beauty over all subsequences of the array of length exactly k. As this nu... |
### Prompt
Construct a CPP code solution to the problem outlined:
The official capital and the cultural capital of Berland are connected by a single road running through n regions. Each region has a unique climate, so the i-th (1 β€ i β€ n) region has a stable temperature of ti degrees in summer.
This summer a group o... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
Joe has been hurt on the Internet. Now he is storming around the house, destroying everything in his path.
Joe's house has n floors, each floor is a segment of m cells. Each cell either contains nothing (it is an empty cell), or has a bri... |
### Prompt
Create a solution in CPP for the following problem:
There is a cube which consists of n Γ n Γ n small cubes. Small cubes have marks on their surfaces. An example where n = 4 is shown in the following figure.
<image>
Then, as shown in the figure above (right), make a hole that penetrates horizontally or... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
You are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned values from 0 to 2^{32}-1. The function conta... |
### Prompt
Please provide a cpp coded solution to the problem described below:
How to make a cake you'll never eat.
Ingredients.
* 2 carrots
* 0 calories
* 100 g chocolate spread
* 1 pack of flour
* 1 egg
Method.
1. Put calories into the mixing bowl.
2. Take carrots from refrigerator.
3. Chop ... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
Life is not easy for the perfectly common variable named Vasya. Wherever it goes, it is either assigned a value, or simply ignored, or is being used!
Vasya's life goes in states of a program. In each state, Vasya can either be used (for e... |
### Prompt
In Cpp, your task is to solve the following problem:
Vladimir wants to modernize partitions in his office. To make the office more comfortable he decided to remove a partition and plant several bamboos in a row. He thinks it would be nice if there are n bamboos in a row, and the i-th from the left is ai me... |
### Prompt
In cpp, your task is to solve the following problem:
Recently, Vladimir got bad mark in algebra again. To avoid such unpleasant events in future he decided to train his arithmetic skills. He wrote four integer numbers a, b, c, d on the blackboard. During each of the next three minutes he took two numbers f... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
Little Chris is bored during his physics lessons (too easy), so he has built a toy box to keep himself occupied. The box is special, since it has the ability to change gravity.
There are n columns of toy cubes in the box arranged in a lin... |
### Prompt
Construct a CPP code solution to the problem outlined:
Someone give a strange birthday present to Ivan. It is hedgehog β connected undirected graph in which one vertex has degree at least 3 (we will call it center) and all other vertices has degree 1. Ivan thought that hedgehog is too boring and decided to... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
The fundamental prerequisite for justice is not to be correct, but to be strong. That's why justice is always the victor.
The Cinderswarm Bee. Koyomi knows it.
The bees, according to their nature, live in a tree. To be more specific, a c... |
### Prompt
Develop a solution in Cpp to the problem described below:
Snuke loves permutations. He is making a permutation of length N.
Since he hates the integer K, his permutation will satisfy the following:
* Let the permutation be a_1, a_2, ..., a_N. For each i = 1,2,...,N, |a_i - i| \neq K.
Among the N! perm... |
### Prompt
Develop a solution in Cpp to the problem described below:
PolandBall is playing a game with EnemyBall. The rules are simple. Players have to say words in turns. You cannot say a word which was already said. PolandBall starts. The Ball which can't say a new word loses.
You're given two lists of words famil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.