text stringlengths 424 69.5k |
|---|
### Prompt
Develop a solution in Cpp to the problem described below:
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the biggest... |
### Prompt
Your task is to create a Cpp solution to the following problem:
A number of skyscrapers have been built in a line. The number of skyscrapers was chosen uniformly at random between 2 and 314! (314 factorial, a very large number). The height of each skyscraper was chosen randomly and independently, with heig... |
### Prompt
Construct a Cpp code solution to the problem outlined:
Squirrel Liss lived in a forest peacefully, but unexpected trouble happens. Stones fall from a mountain. Initially Squirrel Liss occupies an interval [0, 1]. Next, n stones will fall and Liss will escape from the stones. The stones are numbered from 1 ... |
### Prompt
Generate a cpp solution to the following problem:
Calendars in widespread use today include the Gregorian calendar, which is the de facto international standard, and is used almost everywhere in the world for civil purposes. The Gregorian reform modified the Julian calendar's scheme of leap years as follow... |
### Prompt
Develop a solution in cpp to the problem described below:
We have a grid with A horizontal rows and B vertical columns, with the squares painted white. On this grid, we will repeatedly apply the following operation:
* Assume that the grid currently has a horizontal rows and b vertical columns. Choose "ver... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
Little Vasya has received a young builderβs kit. The kit consists of several wooden bars, the lengths of all of them are known. The bars can be put one on the top of the other if their lengths are the same.
Vasya wants to construct the mi... |
### 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
Your challenge is to write a CPP solution to the following problem:
There are n people and k keys on a straight line. Every person wants to get to the office which is located on the line as well. To do that, he needs to reach some point with a key, take the key and then go to the office. Once a key is take... |
### Prompt
In CPP, your task is to solve the following problem:
Xenia the programmer has a tree consisting of n nodes. We will consider the tree nodes indexed from 1 to n. We will also consider the first node to be initially painted red, and the other nodes β to be painted blue.
The distance between two tree nodes v... |
### Prompt
Develop a solution in CPP to the problem described below:
A tree is a connected undirected graph consisting of n vertices and n - 1 edges. Vertices are numbered 1 through n.
Limak is a little polar bear and Radewoosh is his evil enemy. Limak once had a tree but Radewoosh stolen it. Bear is very sad now be... |
### Prompt
Generate a CPP solution to the following problem:
There are N people standing in a row from west to east. Each person is facing east or west. The directions of the people is given as a string S of length N. The i-th person from the west is facing east if S_i = `E`, and west if S_i = `W`.
You will appoint ... |
### Prompt
Please formulate a Cpp solution to the following problem:
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has found one!
Why not make her own Codeforces, with black... |
### Prompt
Construct a CPP code solution to the problem outlined:
Berland starts to seize the initiative on the war with Flatland. To drive the enemy from their native land, the berlanders need to know exactly how many more flatland soldiers are left in the enemy's reserve. Fortunately, the scouts captured an enemy i... |
### Prompt
Please create a solution in cpp to the following problem:
During the lesson small girl Alyona works with one famous spreadsheet computer program and learns how to edit tables.
Now she has a table filled with integers. The table consists of n rows and m columns. By ai, j we will denote the integer located ... |
### Prompt
In Cpp, your task is to solve the following problem:
You are given n arrays that can have different sizes. You also have a table with w columns and n rows. The i-th array is placed horizontally in the i-th row. You can slide each array within its row as long as it occupies several consecutive cells and lie... |
### Prompt
Create a solution in CPP for the following problem:
Sometimes Mister B has free evenings when he doesn't know what to do. Fortunately, Mister B found a new game, where the player can play against aliens.
All characters in this game are lowercase English letters. There are two players: Mister B and his com... |
### Prompt
Create a solution in Cpp for the following problem:
Polycarpus has a sequence, consisting of n non-negative integers: a1, a2, ..., an.
Let's define function f(l, r) (l, r are integer, 1 β€ l β€ r β€ n) for sequence a as an operation of bitwise OR of all the sequence elements with indexes from l to r. Formall... |
### Prompt
In CPP, your task is to solve the following problem:
You are given a table consisting of n rows and m columns. Each cell of the table contains either 0 or 1. In one move, you are allowed to pick any row or any column and invert all values, that is, replace 0 by 1 and vice versa.
What is the minimum number... |
### Prompt
Please provide a cpp coded solution to the problem described below:
You are given an integer x of n digits a_1, a_2, β¦, a_n, which make up its decimal notation in order from left to right.
Also, you are given a positive integer k < n.
Let's call integer b_1, b_2, β¦, b_m beautiful if b_i = b_{i+k} for eac... |
### Prompt
Develop a solution in cpp to the problem described below:
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 t... |
### Prompt
Develop a solution in CPP to the problem described below:
The protection of a popular program developed by one of IT City companies is organized the following way. After installation it outputs a random five digit number which should be sent in SMS to a particular phone number. In response an SMS activatio... |
### Prompt
Develop a solution in Cpp to the problem described below:
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. Paul can... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
A positive integer may be expressed as a sum of different prime numbers (primes), in one way or another. Given two positive integers n and k, you should count the number of ways to express n as a sum of k different primes. Here, two ways a... |
### Prompt
Construct a cpp code solution to the problem outlined:
We have a long seat of width X centimeters. There are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length Y centimeters.
We would like to seat as many people as possible, but they are all very shy, ... |
### Prompt
In Cpp, your task is to solve the following problem:
problem
AOR Ika is studying to pass the test.
AOR Ika-chan solved the $ N $ question. After that, round the solved problem according to the following procedure.
1. Check the correctness of the answer.
2. If the answer is correct, write a circle mark, ... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
Dima took up the biology of bacteria, as a result of his experiments, he invented k types of bacteria. Overall, there are n bacteria at his laboratory right now, and the number of bacteria of type i equals ci. For convenience, we will assu... |
### Prompt
Your challenge is to write 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 s... |
### Prompt
Construct a Cpp code solution to the problem outlined:
Summer holidays! Someone is going on trips, someone is visiting grandparents, but someone is trying to get a part-time job. This summer Noora decided that she wants to earn some money, and took a job in a shop as an assistant.
Shop, where Noora is wor... |
### Prompt
Generate a CPP solution to the following problem:
You are given an H Γ W grid.
The squares in the grid are described by H strings, S_1,...,S_H.
The j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \leq i \leq H,1 \leq j \leq W).
`.` st... |
### Prompt
Please create a solution in Cpp to the following problem:
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several... |
### Prompt
Generate a cpp solution to the following problem:
You are given the set of vectors on the plane, each of them starting at the origin. Your task is to find a pair of vectors with the minimal non-oriented angle between them.
Non-oriented angle is non-negative value, minimal between clockwise and countercloc... |
### Prompt
Please formulate a Cpp solution to the following problem:
Gerald has n younger brothers and their number happens to be even. One day he bought n2 candy bags. One bag has one candy, one bag has two candies, one bag has three candies and so on. In fact, for each integer k from 1 to n2 he has exactly one bag ... |
### Prompt
Generate 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. Then you try to t... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Just to remind, girls in Arpa's land are really nice.
Mehrdad wants to invite some Hoses to the palace for a dancing party. Each Hos has some weight wi and some beauty bi. Also each Hos may have some friends. Hoses are divided in some friends... |
### Prompt
In Cpp, your task is to solve the following problem:
Cheaterius is a famous in all the Berland astrologist, magician and wizard, and he also is a liar and a cheater. One of his latest inventions is Cheaterius' amulets! They bring luck and wealth, but are rather expensive. Cheaterius makes them himself. The... |
### Prompt
Please formulate a CPP solution to the following problem:
Kuroni has n daughters. As gifts for them, he bought n necklaces and n bracelets:
* the i-th necklace has a brightness a_i, where all the a_i are pairwise distinct (i.e. all a_i are different),
* the i-th bracelet has a brightness b_i, where a... |
### Prompt
Develop a solution in cpp to the problem described below:
You are given sequence a1, a2, ..., an and m queries lj, rj (1 β€ lj β€ rj β€ n). For each query you need to print the minimum distance between such pair of elements ax and ay (x β y), that:
* both indexes of the elements lie within range [lj, rj], ... |
### Prompt
Please provide a Cpp coded solution to the problem described below:
I: Ravage
Santa Claus was caught in the illuminations of the city and broke it.
There are N light bulbs in the illumination, and the $ i $ th light bulb only comes on when the voltage is above $ A_i $ and below $ B_i $.
The voltage shou... |
### Prompt
Generate a cpp solution to the following problem:
Vasya often uses public transport. The transport in the city is of two types: trolleys and buses. The city has n buses and m trolleys, the buses are numbered by integers from 1 to n, the trolleys are numbered by integers from 1 to m.
Public transport is no... |
### Prompt
Your task is to create a CPP solution to the following problem:
Ichihime is the current priestess of the Mahjong Soul Temple. She claims to be human, despite her cat ears.
These days the temple is holding a math contest. Usually, Ichihime lacks interest in these things, but this time the prize for the win... |
### Prompt
Develop a solution in Cpp to the problem described below:
We have a tree with N vertices and N-1 edges, respectively numbered 1, 2,\cdots, N and 1, 2, \cdots, N-1. Edge i connects Vertex u_i and v_i.
For integers L, R (1 \leq L \leq R \leq N), let us define a function f(L, R) as follows:
* Let S be the s... |
### Prompt
Develop a solution in cpp to the problem described below:
Given n integers a1, a2,β¦, an and n integers p1, p2,β¦, pn, integer m. The operation of selecting the kth integer ak with a probability of pk [%] is performed for each k (1 β€ k β€ n), and 0 or more and n or less integers are selected. Find the expecte... |
### Prompt
In cpp, your task is to solve the following problem:
Hamed has recently found a string t and suddenly became quite fond of it. He spent several days trying to find all occurrences of t in other strings he had. Finally he became tired and started thinking about the following problem. Given a string s how ma... |
### Prompt
Your challenge is to write 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... |
### Prompt
Please provide a CPP coded solution to the problem described below:
In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.
City i is established in year Y_i and belongs to Prefecture P_i.
You can assume that there are no multiple cities that are establi... |
### Prompt
Generate a Cpp solution to the following problem:
Two deer, AtCoDeer and TopCoDeer, are playing a game called Honest or Dishonest. In this game, an honest player always tells the truth, and an dishonest player always tell lies. You are given two characters a and b as the input. Each of them is either `H` o... |
### Prompt
In CPP, your task is to solve the following problem:
Let's denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the following sum:
<image>
Find the sum modulo 1073741824 (230).
Input
The first line contains three space-separat... |
### Prompt
Please formulate a Cpp solution to the following problem:
Ninja Atsushi guards the town from the roof of the Ninja Building from early morning to late night every day. This Ninja Building is two adjacent buildings of the same floor, and Atsushi's daily routine is to jump between buildings and head to the r... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
According to a new ISO standard, a flag of every country should have a chequered field n Γ m, each square should be of one of 10 colours, and the flag should be Β«stripedΒ»: each horizontal row of the flag should contain squares of the same ... |
### Prompt
Create a solution in CPP for the following problem:
You are playing a solitaire puzzle called "Connect", which uses several letter tiles.
There are R Γ C empty cells. For each i (1 β€ i β€ R), you must put a string si (1 β€ |si| β€ C) in the i-th row of the table, without changing the letter order. In other w... |
### Prompt
Generate a CPP solution to the following problem:
On the Internet, data is divided into packets, and each packet is transferred to a destination via a relay device called a router. Each router determines the next router to forward from the destination described in the packet. In addition, a value called TT... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Sherlock Holmes found a mysterious correspondence of two VIPs and made up his mind to read it. But there is a problem! The correspondence turned out to be encrypted. The detective tried really hard to decipher the correspondence, but he couldn... |
### Prompt
Your task is to create a Cpp solution to the following problem:
You are given a permutation p of numbers 1, 2, ..., n. Let's define f(p) as the following sum:
<image>
Find the lexicographically m-th permutation of length n in the set of permutations having the maximum possible value of f(p).
Input
The ... |
### Prompt
Your challenge is to write a Cpp solution to the following problem:
It is known that passages in Singer house are complex and intertwined. Let's define a Singer k-house as a graph built by the following process: take complete binary tree of height k and add edges from each vertex to all its successors, if ... |
### Prompt
Please create a solution in Cpp to the following problem:
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest sub... |
### Prompt
Construct a cpp code solution to the problem outlined:
You're playing a game called Osu! Here's a simplified version of it. There are n clicks in a game. For each click there are two outcomes: correct or bad. Let us denote correct as "O", bad as "X", then the whole play can be encoded as a sequence of n ch... |
### Prompt
Develop a solution in Cpp to the problem described below:
Problem Statement
The Animal School is a primary school for animal children. You are a fox attending this school.
One day, you are given a problem called "Arithmetical Restorations" from the rabbit teacher, Hanako. Arithmetical Restorations are th... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
The beauty of a sequence a of length n is defined as a_1 \oplus \cdots \oplus a_n, where \oplus denotes the bitwise exclusive or (XOR).
You are given a sequence A of length N. Snuke will insert zero or more partitions in A to divide it in... |
### Prompt
Please create a solution in Cpp to the following problem:
You are given a sequence with N integers: A = \\{ A_1, A_2, \cdots, A_N \\}. For each of these N integers, we will choose a color and paint the integer with that color. Here the following condition must be satisfied:
* If A_i and A_j (i < j) are pa... |
### Prompt
Construct a cpp code solution to the problem outlined:
Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclusion that he has no ready creations, and decided to write ... |
### Prompt
Your challenge is to write a CPP solution to the following problem:
Mr. Bender has a digital table of size n Γ n, each cell can be switched on or off. He wants the field to have at least c switched on squares. When this condition is fulfilled, Mr Bender will be happy.
We'll consider the table rows numbere... |
### Prompt
Please formulate a cpp solution to the following problem:
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
Develop a solution in cpp to the problem described below:
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 c... |
### Prompt
Please provide a CPP coded solution to the problem described below:
Little Mishka enjoys programming. Since her birthday has just passed, her friends decided to present her with array of non-negative integers a1, a2, ..., an of n elements!
Mishka loved the array and she instantly decided to determine its ... |
### Prompt
Please create a solution in cpp to the following problem:
A lot of students spend their winter holidays productively. Vlad has advanced very well in doing so! For three days already, fueled by salads and tangerines β the leftovers from New Year celebration β he has been calibrating his rating in his favori... |
### Prompt
Develop a solution in Cpp to the problem described below:
There are n cities in Treeland connected with n - 1 bidirectional roads in such that a way that any city is reachable from any other; in other words, the graph of cities and roads is a tree. Treeland is preparing for a seasonal virus epidemic, and c... |
### Prompt
Develop a solution in cpp to the problem described below:
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... |
### Prompt
Create a solution in cpp for the following problem:
A class of students wrote a multiple-choice test.
There are n students in the class. The test had m questions, each of them had 5 possible answers (A, B, C, D or E). There is exactly one correct answer for each question. The correct answer for question i... |
### Prompt
Create a solution in cpp for 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 to find... |
### Prompt
Create a solution in Cpp for the following problem:
Once upon a time in the thicket of the mushroom forest lived mushroom gnomes. They were famous among their neighbors for their magic mushrooms. Their magic nature made it possible that between every two neighboring mushrooms every minute grew another mush... |
### Prompt
Please create a solution in Cpp to the following problem:
Give a pair of integers (A, B) such that A^5-B^5 = X. It is guaranteed that there exists such a pair for the given integer X.
Constraints
* 1 \leq X \leq 10^9
* X is an integer.
* There exists a pair of integers (A, B) satisfying the condition in ... |
### Prompt
Please formulate a cpp solution to the following problem:
You are given two strings s and t. In a single move, you can choose any of two strings and delete the first (that is, the leftmost) character. After a move, the length of the string decreases by 1. You can't choose a string if it is empty.
For exam... |
### Prompt
Please create a solution in Cpp to the following problem:
You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries:
* Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l... |
### Prompt
Generate a cpp solution to the following problem:
Sonya has an array a_1, a_2, β¦, a_n consisting of n integers and also one non-negative integer x. She has to perform m queries of two types:
* 1 i y: replace i-th element by value y, i.e. to perform an operation a_{i} := y;
* 2 l r: find the number of... |
### Prompt
Your challenge is to write a cpp solution to the following problem:
Johnny is playing a well-known computer game. The game are in some country, where the player can freely travel, pass quests and gain an experience.
In that country there are n islands and m bridges between them, so you can travel from any... |
### Prompt
Construct a cpp code solution to the problem outlined:
Okabe needs to renovate the Future Gadget Laboratory after he tried doing some crazy experiments! The lab is represented as an n by n square grid of integers. A good lab is defined as a lab in which every number not equal to 1 can be expressed as the s... |
### Prompt
Create a solution in CPP for the following problem:
Thought it is already the XXI century, the Mass Media isn't very popular in Walrusland. The cities get news from messengers who can only travel along roads. The network of roads in Walrusland is built so that it is possible to get to any city from any oth... |
### Prompt
Create a solution in CPP for the following problem:
There are n cups of different sizes and three trays (bon festivals) A, B, and C, and these cups are placed on top of each of the three trays in a pile. However, in any tray, the smallest cup in the tray is on the bottom, the second smallest cup is on top,... |
### Prompt
Create a solution in Cpp for the following problem:
N programmers are going to participate in the preliminary stage of DDCC 20XX. Due to the size of the venue, however, at most 9 contestants can participate in the finals.
The preliminary stage consists of several rounds, which will take place as follows:
... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Gerald got tired of playing board games with the usual six-sided die, and he bought a toy called Randomizer. It functions as follows.
A Randomizer has its own coordinate plane on which a strictly convex polygon is painted, the polygon is call... |
### Prompt
Please create a solution in CPP to the following problem:
You are given a rectangular grid with n rows and m columns. The cell located on the i-th row from the top and the j-th column from the left has a value a_{ij} written in it.
You can perform the following operation any number of times (possibly zero... |
### Prompt
In cpp, your task is to solve the following problem:
B: Hokkaido University Hard
Note
Please note that the question settings are the same as question A, except for the constraints.
story
Homura-chan, who passed Hokkaido University and is excited about the beginning of a new life. But in front of her, a... |
### Prompt
Your task is to create a Cpp solution to the following problem:
<image>
The International Clown and Pierrot Competition (ICPC), is one of the most distinguished and also the most popular events on earth in the show business.
One of the unique features of this contest is the great number of judges that so... |
### Prompt
Your task is to create a CPP solution to the following problem:
A non-empty string is called palindrome, if it reads the same from the left to the right and from the right to the left. For example, "abcba", "a", and "abba" are palindromes, while "abab" and "xy" are not.
A string is called a substring of a... |
### Prompt
Construct a cpp code solution to the problem outlined:
Buses run between the cities A and B, the first one is at 05:00 AM and the last one departs not later than at 11:59 PM. A bus from the city A departs every a minutes and arrives to the city B in a ta minutes, and a bus from the city B departs every b m... |
### Prompt
Develop a solution in cpp to the problem described below:
In the popular spreadsheets systems (for example, in Excel) the following numeration of columns is used. The first column has number A, the second β number B, etc. till column 26 that is marked by Z. Then there are two-letter numbers: column 27 has ... |
### Prompt
Your task is to create a Cpp solution to the following problem:
Johnny has just found the new, great tutorial: "How to become a grandmaster?". The tutorial tells many strange and unexpected for Johnny things, such as you have to be patient or that very important is solving many harder and harder problems. ... |
### Prompt
Please create a solution in Cpp to the following problem:
Mishka is a little polar bear. As known, little bears loves spending their free time playing dice for chocolates. Once in a wonderful sunny morning, walking around blocks of ice, Mishka met her friend Chris, and they started playing the game.
Rules... |
### Prompt
Create a solution in cpp for the following problem:
Taro is playing with a puzzle that places numbers 1-9 in 9x9 squares. In this puzzle, you have to arrange the numbers according to the following rules.
* One number appears exactly once in the same column
* A number appears exactly once on the same line
... |
### Prompt
Generate a Cpp solution to the following problem:
A lot of people associate Logo programming language with turtle graphics. In this case the turtle moves along the straight line and accepts commands "T" ("turn around") and "F" ("move 1 unit forward").
You are given a list of commands that will be given to... |
### Prompt
Construct a Cpp code solution to the problem outlined:
Nothing has changed since the last round. Dima and Inna still love each other and want to be together. They've made a deal with Seryozha and now they need to make a deal with the dorm guards...
There are four guardposts in Dima's dorm. Each post conta... |
### Prompt
Construct a cpp code solution to the problem outlined:
Guy-Manuel and Thomas have an array a of n integers [a_1, a_2, ..., a_n]. In one step they can add 1 to any element of the array. Formally, in one step they can choose any integer index i (1 β€ i β€ n) and do a_i := a_i + 1.
If either the sum or the pro... |
### Prompt
In Cpp, your task is to solve the following problem:
Peterson loves to learn new languages, but his favorite hobby is making new ones. Language is a set of words, and word is a sequence of lowercase Latin letters.
Peterson makes new language every morning. It is difficult task to store the whole language,... |
### Prompt
In CPP, your task is to solve the following problem:
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power ... |
### Prompt
Your task is to create a cpp solution to the following problem:
You are given a simple weighted connected undirected graph, consisting of n vertices and m edges.
A path in the graph of length k is a sequence of k+1 vertices v_1, v_2, ..., v_{k+1} such that for each i (1 β€ i β€ k) the edge (v_i, v_{i+1}) is... |
### Prompt
Create a solution in cpp for the following problem:
One day Natalia was walking in the woods when she met a little mushroom gnome. The gnome told her the following story:
Everybody knows that the mushroom gnomes' power lies in the magic mushrooms that grow in the native woods of the gnomes. There are n tr... |
### Prompt
Generate a cpp solution to the following problem:
You will be given a string S of length 3 representing the weather forecast for three days in the past.
The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.
... |
### Prompt
Please create a solution in Cpp to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
### Prompt
Please formulate a Cpp solution to the following problem:
Dr. Bruce Banner hates his enemies (like others don't). As we all know, he can barely talk when he turns into the incredible Hulk. That's why he asked you to help him to express his feelings.
Hulk likes the Inception so much, and like that his feel... |
### Prompt
In cpp, your task is to solve the following problem:
You are given an integer N. Find the number of the positive divisors of N!, modulo 10^9+7.
Constraints
* 1β€Nβ€10^3
Input
The input is given from Standard Input in the following format:
N
Output
Print the number of the positive divisors of N!, mod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.