messages list |
|---|
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "I would like to convert a Celsius temperature to a Fahrenheit temperature. Given a Celsius temperature as input, can you write the Python function to convert that into a Fahrenheit temperature?\n30"
... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Berland consists of n cities and m bidirectional roads connecting pairs of cities. There is no road connecting a city to itself, and between any pair of cities there is no more than one road. It is pos... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Eugeny has array a = a1, a2, ..., an, consisting of n integers. Each integer ai equals to -1, or to 1. Also, he has m queries:\n\n * Query number i is given as a pair of integers li, ri (1 ≤ li ≤ ri ≤... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "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 contains number i × j. The rows and columns are numbered starting from 1.\n\n... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "After Fox Ciel won an onsite round of a programming contest, she took a bus to return to her castle. The fee of the bus was 220 yen. She met Rabbit Hanako in the bus. They decided to play the following... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.\n\nHongcow has decided to try ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Return your final response within \\boxed{}. If $f(x)=\\frac{x^5-1}3$, find $f^{-1}(-31/96)$."
},
{
"role": "assistant",
"content": "<think>\n\nOkay, so I need to find the inverse function ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "An exam for n students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers (i and i + 1) always studied... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "There are a total of `n` courses you have to take, labeled from `0` to `n-1`.\n\nSome courses may have direct prerequisites, for example, to take course 0 you have first to take course 1, which is expr... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "One day Petya got a set of wooden cubes as a present from his mom. Petya immediately built a whole city from these cubes.\n\nThe base of the city is an n × n square, divided into unit squares. The squa... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Create a function in python that takes as input a dictionary of items with their prices and calculates the total price of the items.\n```python\nitems = {\n 'apple': 0.5,\n 'banana': 0.25,\n '... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Vasya works as a watchman in the gallery. Unfortunately, one of the most expensive paintings was stolen while he was on duty. He doesn't want to be fired, so he has to quickly restore the painting. He ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "On the eve of New Year in Dholakpur, Chota Bheem and Chutki are playing a game, described as follows. \n\nThere are two plates full of Laddus. Both can eat 'L' (L ≥ 1) laddus from any one plate or 'L' ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Given an IP address, remove leading zeros from the IP address. Note that our IP address here can be a little different. It can have numbers greater than 255. Also, it does not necessarily have 4 number... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "-"
},
{
"role": "assistant",
"content": "<think>\nOkay, let's see. The problem is to sum consecutive numbers that are the same in a list and return a new list with those sums. So, for examp... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": ".It was calculated that 75 men could complete a piece of work in 20 days. When work was scheduled to commence, it was found necessary to send 25 men to another project. How much longer will it take to ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How does the poem emphasize the idea of non-violence and avoiding any involvement in bloodshed?\nGenerate according to: which only deads to svarga and moksha.\nwhich battalions could not have brought a... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them aw... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Everyone loves a freebie. Especially students.\n\nIt is well-known that if in the night before exam a student opens window, opens the student's record-book and shouts loudly three times \"Fly, freebie,... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Tom is a string freak. He has got sequences of n words to manipulate. If in a sequence, two same words come together then hell destroy each other. He wants to know the number of words left in the sequ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "<image>\nInput\n\nThe input contains two integers a, b (1 ≤ a ≤ 10, 0 ≤ b ≤ 22·a - 1) separated by a single space.\n\nOutput\n\nOutput two integers separated by a single space.\n\nExamples\n\nInput\n\n... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "You are given a positive integer $n$. Your task is to find any three integers $a$, $b$ and $c$ ($0 \\le a, b, c \\le 10^9$) for which $(a\\oplus b)+(b\\oplus c)+(a\\oplus c)=n$, or determine that there... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Mashmokh is playing a new game. In the beginning he has k liters of water and p coins. Additionally he has a rooted tree (an undirected connected acyclic graph) that consists of m vertices. Each vertex... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Julia is going to cook a chicken in the kitchen of her dormitory. To save energy, the stove in the kitchen automatically turns off after k minutes after turning on.\n\nDuring cooking, Julia goes to the... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "A string is a **valid parentheses string** (denoted **VPS**) if it meets one of the following:\n\n* It is an empty string `\" \"`, or a single character not equal to `\"( \"` or `\") \"`,\n* It can... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Given a Binary Tree of size N, Print the corner nodes ie- the node at the leftmost and rightmost of each level.\nExample 1:\nInput :\n 1\n / \\\n 2 3\n / \\ / \\\n 4 5... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "##Overview\n\nWrite a helper function that takes in a Time object and converts it to a more human-readable format. You need only go up to '_ weeks ago'.\n```python\nto_pretty(0) => \"just now\"\n\nto_p... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "-"
},
{
"role": "assistant",
"content": "<think>\nOkay, let's see. I need to calculate A^B mod (1e9+7), where A and B can be really large numbers with up to 1e5 digits each. Oh right, becau... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a function that creates a new list by reversing the order of elements in the given list and then inserting a new element at the beginning.\n\nSolve the problem starting with the provided function... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Sergey just turned five years old! When he was one year old, his parents gave him a number; when he was two years old, his parents gave him an array of integers. On his third birthday he received a str... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Tattah's youngest brother, Tuftuf, is new to programming.\n\nSince his older brother is such a good programmer, his biggest dream is to outshine him. Tuftuf is a student at the German University in Cai... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Furik loves math lessons very much, so he doesn't attend them, unlike Rubik. But now Furik wants to get a good mark for math. For that Ms. Ivanova, his math teacher, gave him a new task. Furik solved t... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Given a list of strings, can you write a function to find the most common string in the list? If there are multiple strings that appear the same number of times, return any one of them."
},
{
"... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "If the price of an article went up by 60%, then by what percent should it be brought down to bring it back to its original price?\nAnswer Choices: (A) 16 2/3% (B) 37 1/2% (C) 16 7/3% (D) 16 6/3% (E) 16... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Assume that there is a list of numbers \"num_list\" [4, 8, 15, 16, 23, 42]. Write a program to remove all duplicates and return the sorted unique list."
},
{
"role": "assistant",
"content":... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Patrick likes to play baseball, but sometimes he will spend so many hours hitting home runs that his mind starts to get foggy! Patrick is sure that his scores across $n$ sessions follow the identity pe... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Andrew plays a game called \"Civilization\". Dima helps him.\n\nThe game has n cities and m bidirectional roads. The cities are numbered from 1 to n. Between any pair of cities there either is a single... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "There is a developed network of flights between Berland and Beerland. All of them belong to the Berland state company BerAvia. Each flight connects some Berland city with some Beerland city. For each f... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "The Balance of the World\n\nThe world should be finely balanced. Positive vs. negative, light vs. shadow, and left vs. right brackets. Your mission is to write a program that judges whether a string is... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Stepan has a very big positive integer.\n\nLet's consider all cyclic shifts of Stepan's integer (if we look at his integer like at a string) which are also integers (i.e. they do not have leading zeros... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Given the text: Hideo Kojima, creator of the Metal Gear franchise, has many stories to tell about his experience with the PlayStation over the past two decades. He was kind enough to share a few of the... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Let's play a traditional game Nim. You and I are seated across a table and we have a hundred stones on the table (we know the number of stones exactly). We play in turn and at each turn, you or I can r... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a python function to find the number of subarrays with sum equal to 0.\n\nSolve the problem starting with the provided function header.\n\nFunction header:\n```\ndef sub_array_sum(arr):\n```\n\nP... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a function that takes a list of integers and returns the length of the longest harmonious subsequence within the list. A harmonious subsequence is defined as a subsequence where the difference be... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a Python function that takes a positive integer as input and returns a list of two integers: the length (L) and the width (W) of a rectangle that meets the following criteria:\n1. The area of the... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "-"
},
{
"role": "assistant",
"content": "<think>\nOkay, I need to solve this programming problem. Let's read the problem statement carefully.\n\nSo, the problem is to determine for each tes... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Suppose we have a message consisting of 100 characters, and we want to hash it using the SHA-256 cryptographic hash function. How many bits will the resulting hash value have?"
},
{
"role": "as... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a function that given a list of words and a target word, returns the index of the word in the list if it exists, or -1 if it doesn't. However, instead of using a simple linear search, implement a... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a python function to find the minimum number of jumps to reach the end of the array where each element represents the maximum jump length at that position.\n\nSolve the problem starting with the ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a python function to find the sum of maximum subsequence sum such that no two elements in the subsequence are adjacent in the original array.\n\nSolve the problem starting with the provided funct... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "You are an AI assistant tasked with solving command-line tasks in a Linux environment. You will be given a task description and the output from previously executed commands. Your goal is to solve the t... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "You are asked to implement a function `four_square_sum(num)`, which takes a single integer `num` as input. The function should return a list of four non-negative integers whose squares add up to the gi... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "> I would, if I could,\n> If I couldn't how could I?\n> I couldn't, without I could, could I?\n> Could you, without you could, could ye?\n> Could ye? could ye?\n> Could you, without you could, cou... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a program to perform a Dijkstra's Shortest Path algorithm in Python, but use an adjacency matrix representation instead of the more common adjacency list representation. Your program should be ab... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "In 2005, Reverend Jim Wallis published a book, “God’s Politics: Why the Right Gets It Wrong and the Left Doesn’t Get it.” In an attempt to give you a bare bones summary, Wallace writes about how the po... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Little C loves number «3» very much. He loves all things about it.\n\nNow he is playing a game on a chessboard of size n × m. The cell in the x-th row and in the y-th column is called (x,y). Initially,... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Given a `text` string and `words` (a list of strings), return all index pairs `[i, j]` so that the substring `text[i]...text[j]` is in the list of `words`.\n\n\nExample 1:\nInput: text = \"thestoryofle... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "-"
},
{
"role": "assistant",
"content": "<think>\nOkay, I need to find the minimum number of operations required to break down a number N into some number of powers of 2. The allowed operat... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Given an integer array `nums` of unique elements, return all possible subsets (the power set).\n\nThe solution set must not contain duplicate subsets. Return the solution in any order.\n\n\nExample 1:\... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "A tuple of positive integers {x1, x2, ..., xk} is called simple if for all pairs of positive integers (i, j) (1 ≤ i < j ≤ k), xi + xj is a prime.\n\nYou are given an array a with n positive integers a1... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "A pharmacy is buying enough tubs for them to make their prescriptions this week. They already have 20 tubs left in storage but they need a total of 100 tubs for the week. Of the tubs they still need to... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "-"
},
{
"role": "assistant",
"content": "<think>\nOkay, let's see. I need to write a Python function called goose_filter that takes a list of bird names and returns a new list with all the ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Alex makes luxury dresses out of silk. Each dress needs 5 meters of silk and Alex has 600 meters of silk in storage. His friends also want to learn how to make these dresses so Alex gives all 5 of them... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Given integers c_{0}, c_{1}, …, c_{k-1} we can define the cost of a number 0 ≤ x < 2^{k} as p(x) = ∑_{i=0}^{k-1} \\left( \\left⌊ \\frac{x}{2^{i}} \\right⌋ mod 2 \\right) ⋅ c_{i}. In other words, the co... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Return your final response within \\boxed{}. An arithmetic sequence is a sequence in which each term after the first is obtained by adding a constant to the previous term. For example, $2,5,8,11,14$ is... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "The squarefree part of a positive integer is the largest divisor of that integer which itself has no square factors (other than 1). For example, the squareefree part of 12 is 6, since the only larger d... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a python function that takes a list of strings and returns the maximum length of a string that can be formed by concatenating strings from the list such that no character is used more than once.\... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a short story set in a medieval fantasy world about a young woman named Elspeth who discovers she has the ability to communicate with the wind, and must use her powers to save her village from a ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a function that reverses a string using slicing."
},
{
"role": "assistant",
"content": "<think>\nOkay, I need to write a Python function that reverses a string using slicing. Hmm, how... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a python function that checks if a given word follows a given pattern. A pattern is a string consisting of lowercase letters. The function should return True if the word matches the pattern and F... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a function to find the median of two sorted arrays of equal length.\n\nSolve the problem starting with the provided function header.\n\nFunction header:\n```\nclass Solution:\n\tdef median_sorted... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.\n\nFor class A, after \">'\" is followe... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "-"
},
{
"role": "assistant",
"content": "<think>\nOkay, let's tackle this problem. So Kenneth needs to generate a symmetrical owl portrait with the head \"0v0\" and a symmetrical plumage ma... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Given the array `restaurants` where `restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]`. You have to filter the restaurants using three filters.\n\nThe `veganFriendly` filter will be ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "You are given a 4x4 grid. You play a game — there is a sequence of tiles, each of them is either 2x1 or 1x2. Your task is to consequently place all tiles from the given sequence in the grid. When tile ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "-"
},
{
"role": "assistant",
"content": "<think>\nOkay, let's see. I need to solve this problem where Mary's recipe has measurements in tablespoons and teaspoons, and I need to append the e... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "It is dark times in Berland. Berlyand opposition, funded from a neighboring state, has organized a demonstration in Berland capital Bertown. Through the work of intelligence we know that the demonstrat... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Which of the following is the product of two integers whose sum is 18?\nAnswer Choices: (A) -42 (B) -28 (C) 12 (D) 26 (E) 32"
},
{
"role": "assistant",
"content": "Let's think about th... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "The L.C.M of two numbers is 2310 and their H.C.F is 30. If one number is 770 the Other is\nAnswer Choices: (A) 330 (B) 90 (C) 270 (D) 250 (E) 350"
},
{
"role": "assistant",
"content": "Let'... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Again, there are hard times in Berland! Many towns have such tensions that even civil war is possible. \n\nThere are n towns in Reberland, some pairs of which connected by two-way roads. It is not guar... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Generate response to the question/instruction based on a piece of given material\n\nQuestion/Instruction: What makes Stephen Park a unique location for the festival, and how does the festival take adva... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Note that girls in Arpa’s land are really attractive.\n\nArpa loves overnight parties. In the middle of one of these parties Mehrdad suddenly appeared. He saw n pairs of friends sitting around a table.... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Implement a function that checks if a given list is sorted in increasing order without using the built-in sorting functions. The list contains integers only. Return True if the given list is sorted in ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "The country of Reberland is the archenemy of Berland. Recently the authorities of Berland arrested a Reberlandian spy who tried to bring the leaflets intended for agitational propaganda to Berland ille... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "-"
},
{
"role": "assistant",
"content": "<think>\nOkay, let's see. I need to write a Python program that reads two integers, a and b, from standard input. Then, I have to perform two types ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "At the same store, Peter bought 2 pairs of pants and 5 shirts for $62 total, and Jessica bought 2 shirts for $20 total. Each pair of pants cost the same price, and each shirt cost the same price. How m... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "A progress bar is an element of graphical interface that displays the progress of a process for this very moment before it is completed. Let's take a look at the following form of such a bar.\n\nA bar ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "You are given a rectangular $n \\times m$ matrix $a$. In one move, you can choose any row and cyclically shift its elements. You can perform this operation any number of times (possibly zero) on each r... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Two passenger trains start at the same hour in the day from two different stations and move towards each other at the rate of 16 kmph and 21 kmph respectively. When they meet, it is found that one trai... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "The Guests at a football banquet consumed a total of 327 pounds of food. if no individual guest consumed more than 2 pounds of food, What is the minimum number of guests that could have attended the ba... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "problem\n\nGiven the lengths of $ 2 $ sides that are not the hypotenuse of a right triangle, $ A $ and $ B $. The side of length $ A $ overlaps the $ x $ axis, and the side of length $ B $ overlaps the... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Tanya wants to go on a journey across the cities of Berland. There are n cities situated along the main railroad line of Berland, and these cities are numbered from 1 to n. \n\nTanya plans her journey ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "You are given a sequence a_1, a_2, …, a_n of non-negative integers.\n\nYou need to find the largest number m of triples (i_1, j_1, k_1), (i_2, j_2, k_2), ..., (i_m, j_m, k_m) such that:\n\n * 1 ≤ i_p ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "You are given a string s of length n. Each character is either one of the first k lowercase Latin letters or a question mark.\n\nYou are asked to replace every question mark with one of the first k low... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "The tic-tac-toe game is starting on a tree of n vertices. Some vertices are already colored in white while the remaining are uncolored.\n\nThere are two players — white and black. The players make move... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "The **power** of the string is the maximum length of a non-empty substring that contains only one unique character.\n\nGiven a string `s`, return _the **power** of_ `s`.\n\n**Example 1:**\n\n**Input:**... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Alice and Bob are playing a game on a line with $n$ cells. There are $n$ cells labeled from $1$ through $n$. For each $i$ from $1$ to $n-1$, cells $i$ and $i+1$ are adjacent.\n\nAlice initially has a t... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Our hardworking chef is bored of sleeping in his restaurants. He has decided to settle down. The first thing he must do is to find a suitable location to build a palatial home.\n\n\nThink of the city a... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What Goes Up Must Come Down\n\nSeveral cards with numbers printed on them are lined up on the table.\n\nWe'd like to change their order so that first some are in non-decreasing order of the numbers on ... |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Find all valid combinations of `k` numbers that sum up to `n` such that the following conditions are true:\nOnly numbers `1` through `9` are used.\n\nEach number is used at most once.\n\nReturn a list ... |