question_answer_string stringlengths 111 33.1k |
|---|
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Polycarp has a strict daily schedule. He has n alarms set for each day, and the i-th alarm rings each day at the same time during ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Marut loves good strings. According to him, good strings are those which contain either all alphabets of uppercase or lowercase.
W... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.There are 26 letters in the English alphabet and 6 of them are vowels: a,e,i,o,u,y.
Other 20 letters are called consonants.
Limak... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Being a programmer, you like arrays a lot. For your birthday, your friends have given you an array a consisting of n distinct inte... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Pablo Squarson is a well-known cubism artist. This year's theme for Pablo Squarson is "Squares". Today we are visiting his studio ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it.
We arrange all n cards in ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.In the city of Madrid, there are two types of roads - Boulevard and Woonerf.
As the people of Madrid are fond of eating, there is... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.A Professor of Physics gave projects to the students of his class. The students have to form a team of two for doing the project. ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.In a very ancient country the following game was popular. Two people play the game. Initially first player writes a string s1, con... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Problem
Michal Scofield and Lincon burrow are two brothers. By a murder allegation Lincon Burrow was sentenced to jail. Michal ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Nick has n bottles of soda left after his birthday. Each bottle is described by two values: remaining amount of soda ai and bottle... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Nick is attracted by everything unconventional. He doesn't like decimal number system any more, and he decided to study other numb... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.John Doe started thinking about graphs. After some thought he decided that he wants to paint an undirected graph, containing exact... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are u... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.All cities of Lineland are located on the Ox coordinate axis. Thus, each city is associated with its position xi — a coordinate on... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Maga and Alex are good at string manipulation problems. Just now they have faced a problem related to string. But it is not a stan... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.There used to be unrest in the Galactic Senate. Several thousand solar systems had declared their intentions to leave the Republic... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.When Masha came to math classes today, she saw two integer sequences of length n - 1 on the blackboard. Let's denote the elements ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Perhaps many have heard that the World Biathlon Championship has finished. Although our hero Valera was not present at this specta... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Sean is trying to save a large file to a USB flash drive. He has n USB flash drives with capacities equal to a1, a2, ..., an megab... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given an integer sequence 1, 2, ..., n. You have to divide it into two sets A and B in such a way that each element belong... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Brio wants to get a beautiful house constructed near the National Highway. As his in laws are very much fond of triangles, he deci... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Petya has n integers: 1, 2, 3, ..., n. He wants to split these integers in two non-empty groups in such a way that the absolute di... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.At first, there was a legend related to the name of the problem, but now it's just a formal statement.
You are given n points a_1... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Given the lengths of the edges of a tetrahedron
calculate the radius of a sphere inscribed in that tetrahedron
(i.e. a sphere tang... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he boug... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Tokitsukaze and CSL are playing a little game of stones.
In the beginning, there are n piles of stones, the i-th pile of which ha... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.The Smart Beaver from ABBYY has a lot of hobbies. One of them is constructing efficient hash tables. One of the most serious probl... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Problem
Alice and Bob are competing in the 50m dash.
However, in this world, the higher the AOJ rate is, the better, so the highe... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.We have N points in the two-dimensional plane. The coordinates of the i-th point are (X_i,Y_i).
Among them, we are looking for th... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.After Governor's attack on prison, Rick found himself surrounded by walkers. They are coming towards him from all sides. Now, supp... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \le... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Twilight Sparkle once got a crystal from the Crystal Mine. A crystal of size n (n is odd; n > 1) is an n × n matrix with a diamond... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.In Byteland,conversion of numbers between different bases has always been a herculian task.They always make errors in these conve... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Sorting is considered to be one of the most important skills to be learned in computer science and has it's applications in real p... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given a directed acyclic graph with n vertices and m edges. There are no self-loops or multiple edges between any pair of ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.India is a cricket crazy nation. Chang also loves cricket and computations related to cricket. Chang has created a Cricket app.Thi... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Given an array a of length n, tell us whether it has a non-empty subsequence such that the product of its elements is not a perfec... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given a string which comprises of lower case alphabets (a-z), upper case alphabets (A-Z), numbers, (0-9) and special chara... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Joisino the magical girl has decided to turn every single digit that exists on this world into 1.
Rewriting a digit i with j (0≤i... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You have been given n distinct integers a1, a2, ..., an. You can remove at most k of them. Find the minimum modular m (m > 0), so ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.A Garden with Ponds
Mr. Gardiner is a modern garden designer who is excellent at utilizing the terrain features. His design metho... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.There are n banks in the city where Vasya lives, they are located in a circle, such that any two banks are neighbouring if their i... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition."N" White Walkers are positioned in a circle from "1" to "N". First (No. 1) White Walker has a dragonglass . He kills the next ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In to... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.From tomorrow, the long-awaited summer vacation will begin. So I decided to invite my friends to go out to the sea.
However, many... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Athenaeus has just finished creating his latest musical composition and will present it tomorrow to the people of Athens. Unfortun... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Polycarpus works as a programmer in a start-up social network. His boss gave his a task to develop a mechanism for determining sug... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Initially Ildar has an empty array. He performs n steps. On each step he takes a subset of integers already added to the array and... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.<image>
Recently, a wild Krakozyabra appeared at Jelly Castle. It is, truth to be said, always eager to have something for dinner... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Gleb ordered pizza home. When the courier delivered the pizza, he was very upset, because several pieces of sausage lay on the cru... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.One day Kefa the parrot was walking down the street as he was on the way home from the restaurant when he saw something glittering... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Snuke built an online judge to hold a programming contest.
When a program is submitted to the judge, the judge returns a verdict,... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Alice and Bob are playing yet another card game. This time the rules are the following. There are n cards lying in a row in front ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.ICPC (International Connecting Points Company) starts to sell a new railway toy. It consists of a toy tramcar and many rail units ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Cowboy Vlad has a birthday today! There are n children who came to the celebration. In order to greet Vlad, the children decided t... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Chef had a hard time arguing with his friend, and after getting a great old kick Chef saw a colored array with N cells, numbered f... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.An equation is an equality containing one or more variables. Solving the equation consists of determining which values of the vari... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.DZY has a hash table with p buckets, numbered from 0 to p - 1. He wants to insert n numbers, in the order they are given, into the... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.A string is said to be complete if it contains all the characters from a to z. Given a string, check if it complete or not.
Input... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Given an array a1, a2, ..., an of n integers, find the largest number in the array that is not a perfect square.
A number x is sa... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given an alphabet consisting of n letters, your task is to make a string of the maximum possible length so that the follow... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given an integer sequence of length N, a_1,a_2,...,a_N.
For each 1≤i≤N, you have three choices: add 1 to a_i, subtract 1 ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.An array of positive integers a1, a2, ..., an is given. Let us consider its arbitrary subarray al, al + 1..., ar, where 1 ≤ l ≤ r ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Let's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row and j-th column contai... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Dima and his friends have been playing hide and seek at Dima's place all night. As a result, Dima's place got messy. In the mornin... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Today Vasya visited a widely known site and learned that the continuation of his favourite game Codecraft II will appear after exa... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Dima and Inna love spending time together. The problem is, Seryozha isn't too enthusiastic to leave his room for some reason. But ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Stepan likes to repeat vowel letters when he writes words. For example, instead of the word "pobeda" he can write "pobeeeedaaaaa".... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given a text consisting of n lines. Each line contains some space-separated words, consisting of lowercase English letters... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.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 subse... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.The last stage of Football World Cup is played using the play-off system.
There are n teams left in this stage, they are enumerat... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Little Bob comes to you for candies as you are his favorite coder! He wants X candies. You have N bags and the i^th bag contains A... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.AquaMoon has n friends. They stand in a row from left to right, and the i-th friend from the left wears a T-shirt with a number a_... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Polycarp has prepared n competitive programming problems. The topic of the i-th problem is a_i, and some problems' topics may coin... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.People in Cubeland use cubic coins. Not only the unit of currency is called a cube but also the coins are shaped like cubes and th... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.King Klee's kingdom is under attack. He leaves the task of protecting his kingdom to you as you are
Now you are given N teams of ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.There is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either `.` or `*`. The c... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Polycarp starts his own business. Tomorrow will be the first working day of his car repair shop. For now the car repair shop is ve... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given an infinite checkered field. You should get from a square (x1; y1) to a square (x2; y2). Using the shortest path is ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given an array a_1, a_2, ..., a_n. You can perform the following operation any number of times:
* Choose a pair of two ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition."Balloons should be captured efficiently", the game designer says. He is designing an oldfashioned game with two dimensional graph... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Emily's birthday is next week and Jack has decided to buy a present for her. He knows she loves books so he goes to the local book... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Alice is playing with some stones.
Now there are three numbered heaps of stones. The first of them contains a stones, the second ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Problem description
It is winter super sale and all the shops have various offers. Suraj selected N items to buy and he is standin... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.How many specific orders do you know? Ascending order, descending order, order of ascending length, order of ascending polar angle... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Champernown constant is an irrational number represented in decimal by "0." followed by concatenation of all positive integers in ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Utkarsh being a very talkative child, was scolded by his teacher multiple times. One day, the teacher became very angry and decide... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.There is a robot in a warehouse and n packages he wants to collect. The warehouse can be represented as a coordinate grid. Initial... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Things are heated up between the Finance team and the Marketing team, and they decide to have one-on-one fifa matches to settle it... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Milly is playing with an Array A of size N. She wants to convert this array into a magical array. This magical array satisfies the... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.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 ... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.You are given an undirected graph, constisting of n vertices and m edges. Each edge of the graph has some non-negative integer wri... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Little Elephant loves magic squares very much.
A magic square is a 3 × 3 table, each cell contains some positive integer. At that... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Create a program that takes two dates as input and outputs the number of days between the two dates.
Date 1 (y1, m1, d1) is the s... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.A histogram is made of a number of contiguous bars, which have same width.
For a given histogram with $N$ bars which have a width... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.Rhezo and his friend Vanya love problem solving. They have a problem set containing N problems, with points assigned to each. Rhez... |
Question: Generate an executable Python function generated from the given prompt. The function should take stdin as input and print the output. Simply call the function after the definition.There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M ro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.