formatted_conversations stringlengths 1.13k 138k |
|---|
user: 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.-----Indian National Olympiad in Informatics 2014-----
Nikhil’s slogan has won the contest conducted by Drongo Airlines and he is enti... |
user: 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 walking on an infinite straight street. Initially, both are at the position $X=0$ and they start walking in the dire... |
user: 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 a string consisting of only lowercase English alphabets, your task is to find the smallest palindromic substring.
In case there ... |
user: 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 has $N$ markers. There is a cap on each marker. For each valid $i$, the $i$-th marker has colour $a_i$. Initially, for each valid... |
user: 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.Harish has decided to go to Arya's hotel this morning. We all know he is crazy for masala dosas. And as usual he is always hungry. He ... |
user: 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.Gargi is thinking of a solution to a problem. Meanwhile, her friend asks her to solve another problem. Since Gargi is busy in her own ... |
user: 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.Rodriguez is a happy and content farmer. He has got a square field of side length $x$. Miguel, his son has himself grown into a man an... |
user: 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.Calculate the power of an army of numbers from 1 to $N$, both included.
-----Input:-----
- First line will contain a single integer $... |
user: 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.Mr. X stays in a mansion whose door opens in the North. He travels every morning to meet his friend Ms. Y walking a predefined path.
... |
user: 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 field with plants — a grid with $N$ rows (numbered $1$ through $N$) and $M$ columns (numbered $1$ through $M$); out of its ... |
user: 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 a positive integer K > 2, with prime
factorization:
K = p1^a1 * p2^a2 ... * pn^an
Compute the following:
S = a1*p1 + a2*p2 ..... |
user: 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.Rakesh has built a model rocket and wants to test how stable it is. He usually uses a magic box which runs some tests on the rocket an... |
user: 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.Yesterday, Chef found $K$ empty boxes in the cooler and decided to fill them with apples. He ordered $N$ apples, where $N$ is a multip... |
user: 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 want to build a temple for snakes. The temple will be built on a mountain range, which can be thought of as n blocks, where height... |
user: 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 received a new sequence $A_1, A_2, \ldots, A_N$. He does not like arbitrarily ordered sequences, so he wants to permute the eleme... |
user: 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 has a cubic die with 6 faces kept on an infinite plane. Each face has a distinct integer in the range [1,6] written on it, but t... |
user: 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 Government of Siruseri is no different from any other when it comes to being "capital-centric" in its policies. Recently the gover... |
user: 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 villages in a Chefland. Some of the villages have electricity facilities, other doesn't. You can consider the villages arr... |
user: 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.It's autumn now, the time of the leaf fall.
Sergey likes to collect fallen leaves in autumn. In his city, he can find fallen leaves of... |
user: 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 has a number N, Cheffina challenges the chef to check the divisibility of all the permutation of N by 2. If any of the permutatio... |
user: 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.Akshay is interested in mathematics, one day he came across a problem of modulus operator.He has a list of M integers say arr[M] and ... |
user: 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.Saket loves to play with strings. One day , while he was having fun with Cyclic Permutations of available strings to him, he observed ... |
user: 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.Everyone loves short problem statements.
Given a function $ f(x) $ find its minimum value over the range $ 0 < x < π/2$
$
f(x) = ( x^2... |
user: 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.Tara was completing an Algorithms assignment and got stuck on a question. She thought of who can help her, and got reminded of Kabir w... |
user: 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.Sereja has a string A consisting of n lower case English letters.
Sereja calls two strings X and Y each of length n similar if they ... |
user: 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 two binary strings $S$ and $P$, each with length $N$. A binary string contains only characters '0' and '1'. For each val... |
user: 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 has just found a recipe book, where every dish consists of exactly four ingredients.
He is going to choose some two dishes and pr... |
user: 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 likes to travel a lot. Every day Chef tries to visit as much cities as possible. Recently he had a quite a few trips of great Che... |
user: 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 has an array of N natural numbers. Cheffina challenges the chef to choose the two numbers from the array and following the condit... |
user: 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.Indian National Olympiad in Informatics 2012
The Republic of Tutaria is celebrating its 37th year of independence. To mark the occasio... |
user: 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 MEX of a set of integers is defined as the smallest non-negative integer that does not belong to this set. For example, $\mathrm{M... |
user: 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.Pushkar is very good in Number Theory. He takes two numbers $A\ and\ B$ and declares them a Pushkar Pair. Pushkar Pair has a property ... |
user: 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$ of length $n$. A subsequence of this array is valid, if it satisfies these two conditions:
- There shouldn'... |
user: 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.Sultan, the freestyle wrestler, you all know him. He broke multiple records in the history of all wrestling leagues. Now 20 years have... |
user: 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 binary string S of N bits. The bits in the string are indexed starting from 1. S[i] denotes the ith bit of S.
Let's s... |
user: 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 permutation of length n is an array of size n consisting of n distinct integers in the range [1, n]. For example, (3, 2, 4, 1) is a ... |
user: 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.Nobody knows, but $N$ frogs live in Chef's garden.
Now they are siting on the X-axis and want to speak to each other. One frog can sen... |
user: 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 six days, professor GukiZ decided to give more candies to his students. Like last time, he has $N$ students, numbered $1$ throug... |
user: 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 Integer N, write a program to reverse it.
-----Input-----
The first line contains an integer T, total number of testcases. ... |
user: 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.Tanish is the president of the chemistry club at his school. He considers everyone who doesn't like chemistry as his enemy. After year... |
user: 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."Ring Ring!!"
Sherlock's phone suddenly started ringing. And it was none other than Jim Moriarty..
"Long time no see ! You miss me r... |
user: 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.Xorgon is an extremely delicious treat formed by the sequence $S$ of binary integers $s_1, s_2,..,s_N$. A really interesting property ... |
user: 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.Naman owns a very famous Ice Cream parlour in Pune. He has a wide range of flavours with different pricing.
Every flavour costs ₹ X ... |
user: 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 two points $P$ and $Q$ and an opaque sphere in a three-dimensional space. The point $P$ is not moving, while $Q$ is movi... |
user: 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 of Chef's friends offered him a deal: during $D$ days, they are going to exchange money. For each $i$ ($1 \le i \le D$), on the $i... |
user: 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 chef was not happy with the binary number system, so he designed a new machine which is having 6 different states, i.e. in binary ... |
user: 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.If Give an integer N . Write a program to obtain the sum of the first and last digits of this number.
-----Input-----
The first line... |
user: 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.Rani is teaching Raju maths via a game called N-Cube, which involves three sections involving N.
Rani gives Raju a number N, and Raju... |
user: 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's dog Snuffles has so many things to play with! This time around, Snuffles has an array A containing N integers: A1, A2, ..., AN.... |
user: 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.Dustin, is the head of an Intelligence agency. He wants to send a secret message S$S$ to his colleague.The message is a single word co... |
user: 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.As lockdown is going on so no is allowed to go outside , so Chef has come with an innovative idea for food home delivery using drone. ... |
user: 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, Tanya was studying graph theory. She is very inquisitive, so the following problem soon came to her mind.
Find the number of ... |
user: 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 is a very experienced and well-known cook. He has participated in many cooking competitions in the past — so many that he does no... |
user: 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.Zonal Computing Olympiad 2013, 10 Nov 2012
Little Red Riding Hood is carrying a basket with berries through the forest to her grandmo... |
user: 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 upon a time there were three best friends Abhinav, Harsh, and Akash decided to form a
team and take part in ICPC from KIIT. Parti... |
user: 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 has provided with a sequence of integers of length $N$ arranged in an unsorted fashion.
The elements of the sequence are ordered ... |
user: 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.Chefina has two sequences $A_1, A_2, \ldots, A_N$ and $B_1, B_2, \ldots, B_N$. She views two sequences with length $N$ as identical if... |
user: 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 likes to solve difficult tasks. This time, he tried to solve the Big Famous Unsolvable $A+B=C$. One of his friends played a prank... |
user: 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 Chefland, there is a very famous street where $N$ types of street food (numbered $1$ through $N$) are offered. For each valid $i$, ... |
user: 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 of size N. Let us list down all the subarrays of the given array. There will be a total of N * (N + 1) / 2 su... |
user: 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 Chef was playing with numbers. He loves Lowest Common Multiple (LCM) too much and he is a very curious guy. He always try to d... |
user: 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.Zaikia has $N$ sticks of distinct positive lengths $A_1,A_2,\dots,A_N$. For no good reason at all, he wants to know if there is a trip... |
user: 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 is frustrated in this lockown. So to overcome this he plans to travel various mountains.
He is very strange so he sets some condi... |
user: 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.Indian National Olympiad in Informatics 2013
Calvin wakes up early one morning and finds that all his friends in the hostel are asleep... |
user: 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.Harsh, like usual, started studying 6 months before for his end semester examinations. He was going to complete his 8th revision of th... |
user: 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.Johnny has some difficulty memorizing the small prime numbers. So, his computer science teacher has asked him to play with the followi... |
user: 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.This is another problem about Indraneel's library. His library has one long shelf. His books are numbered and he identifies the books ... |
user: 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.Amit is going on a date and he wants to gift his date an array of positive numbers. But he is running short on money. He already has a... |
user: 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 all know Gru loves Agnes very much. One day Agnes asked Gru to answer some of her queries. She lined up $N$ minions in a straight l... |
user: 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.Motu wants to learn Cricket from a coach, but firstly coach wants to test his IQ level, so he gave Motu $1$ $Red$ $ball$ and $1$ $Blac... |
user: 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 $n$ intervals on the $X$ axis. Each interval $i$ is specified by its ends $[L_i, R_i]$. You want to color each interval ... |
user: 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.Doubleville, a small town in Texas, was attacked by the aliens. They have abducted some of the residents and taken them to the a space... |
user: 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 likes problems which using some math. Now he asks you to solve next one. You have 4 integers, Chef wondering is there non-empty s... |
user: 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.Corruption is on the rise in the country of Freedonia, Gru's home. Gru wants to end this for good and for that he needs the help of hi... |
user: 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.Our Chef is doing what he is best at, COOKING A BARBECUE for his guests. He has invited all of us, and taking the help of his apprenti... |
user: 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 rectangular table R consisting of N rows and M columns. Rows are enumerated from 1 to N from top to bottom. Columns ... |
user: 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.Limak has a string S, that consists of N lowercase English letters.
Limak then created a new string by repeating S exactly K times.
Fo... |
user: 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 lives in a big apartment in Chefland. The apartment charges maintenance fees that he is supposed to pay monthly on time. But Chef... |
user: 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.Bear Limak has a sequence of N non-negative integers A1, A2, ..., AN. He defines the score of a segment (consecutive subsequence) as i... |
user: 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 has a sequence $A_1, A_2, \ldots, A_N$. This sequence has exactly $2^N$ subsequences. Chef considers a subsequence of $A$ interes... |
user: 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.Galileo's latest project involves determining the density of stars in certain regions of the sky. For this purpose he started looking ... |
user: 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.Striver$Striver$ wants to strive hard in order to reach his goals, hence asks his mentor to give him a question for which he has to st... |
user: 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 is stuck in a two dimensional maze having N rows and M columns. He needs to get out of the maze as soon as possible and arrive at... |
user: 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.Find sum of all the numbers that are multiples of 10 and are less than or equal to a given number "N". (quotes for clarity and be care... |
user: 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.Dhiraj loves Chocolates.He loves chocolates so much that he can eat up to $1000$ chocolates a day. But his mom is fed up by this habit... |
user: 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 Petrozavodsk camp takes place in about one month. Jafar wants to participate in the camp, but guess what? His coach is Yalalovichi... |
user: 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 chef is trying to solve some pattern problems, Chef wants your help to code it. Chef has one number K to form a new pattern. Help ... |
user: 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 N integer sequences A1, A2, ..., AN. Each of these sequences contains N elements. You should pick N elements, one from e... |
user: 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.Give me Biscuit
Sunny wants to make slices of biscuit of size c * d into identical pieces.
but each piece is a square having maximum... |
user: 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 Statement-----
Harry Potter has one biscuit and zero rupee in his pocket. He will perform the following operations exactl... |
user: 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.Did you know that the people of America eat around 100 acres of pizza per day ? Having read this fact on internet, two chefs from the ... |
user: 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.Coach Moony wants the best team to represent their college in ICPC. He has $N$ students standing in a circle with certain rating $X_i$... |
user: 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 all know how great ABD aka AB-DE-VILLIERS is. However his team mates were jealous of him and posed a problem for him to solve.The p... |
user: 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 has a sequence of positive integers $A_1, A_2, \ldots, A_N$. He wants to split this sequence into two non-empty (not necessarily ... |
user: 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 new Formula 1 season is about to begin and Chef has got the chance to work with the Formula 1 technical team.
Recently, the pre-... |
user: 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 beautiful sequence is defined as a sequence that do not have any repeating elements in it.
You will be given any random sequence of ... |
user: 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.Accepts a string from the user and print the reverse string as the output without using any built-in function.
-----Input:-----
Each ... |
user: 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 dataset consisting of $N$ items. Each item is a pair of a word and a boolean denoting whether the given word is a spam... |
user: 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.
Dominic Toretto has taken his crew to compete in this years' Race Wars, a crew-on-crew tournament in which each m... |
user: 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.For Diwali, Chef arranges all $K$ laddus in a row in his sweet shop. Whenever a customer comes to buy laddus, chef follows a rule that... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.