chosen listlengths 2 2 | rejected listlengths 2 2 |
|---|---|
[
{
"content": "Question:\nIn 2N - 1 boxes there are apples and oranges. Your task is to choose N boxes so, that they will contain not less than half of all the apples and not less than half of all the oranges.\n\nInput\n\nThe first input line contains one number T — amount of tests. The description of each test ... | [
{
"content": "Question:\nIn 2N - 1 boxes there are apples and oranges. Your task is to choose N boxes so, that they will contain not less than half of all the apples and not less than half of all the oranges.\n\nInput\n\nThe first input line contains one number T — amount of tests. The description of each test ... |
[
{
"content": "Question:\nThe programmers from the R2 company love playing 2048. One day, they decided to invent their own simplified version of this game — 2k on a stripe.\n\nImagine an infinite in one direction stripe, consisting of unit squares (the side of each square is equal to the height of the stripe). E... | [
{
"content": "Question:\nThe programmers from the R2 company love playing 2048. One day, they decided to invent their own simplified version of this game — 2k on a stripe.\n\nImagine an infinite in one direction stripe, consisting of unit squares (the side of each square is equal to the height of the stripe). E... |
[
{
"content": "Question:\nНа тренировку по подготовке к соревнованиям по программированию пришли n команд. Тренер для каждой команды подобрал тренировку, комплект задач для i-й команды занимает a_{i} страниц. В распоряжении тренера есть x листов бумаги, у которых обе стороны чистые, и y листов, у которых только ... | [
{
"content": "Question:\nНа тренировку по подготовке к соревнованиям по программированию пришли n команд. Тренер для каждой команды подобрал тренировку, комплект задач для i-й команды занимает a_{i} страниц. В распоряжении тренера есть x листов бумаги, у которых обе стороны чистые, и y листов, у которых только ... |
[
{
"content": "Question:\nThere are several rectangular sheets placed on a flat surface. Create a program to find the area and perimeter of the part covered by these sheets.\n\nHowever, when the plane is regarded as the coordinate plane, the arrangement of the sheets shall satisfy the following conditions (1) an... | [
{
"content": "Question:\nThere are several rectangular sheets placed on a flat surface. Create a program to find the area and perimeter of the part covered by these sheets.\n\nHowever, when the plane is regarded as the coordinate plane, the arrangement of the sheets shall satisfy the following conditions (1) an... |
[
{
"content": "Question:\nPolycarp has a cat and his cat is a real gourmet! Dependent on a day of the week he eats certain type of food: on Mondays, Thursdays and Sundays he eats fish food; on Tuesdays and Saturdays he eats rabbit stew; on other days of week he eats chicken stake. \n\nPolycarp plans to go on ... | [
{
"content": "Question:\nPolycarp has a cat and his cat is a real gourmet! Dependent on a day of the week he eats certain type of food: on Mondays, Thursdays and Sundays he eats fish food; on Tuesdays and Saturdays he eats rabbit stew; on other days of week he eats chicken stake. \n\nPolycarp plans to go on ... |
[
{
"content": "Question:\nMonocarp and Polycarp are learning new programming techniques. Now they decided to try pair programming.\n\nIt's known that they have worked together on the same file for $n + m$ minutes. Every minute exactly one of them made one change to the file. Before they started, there were alrea... | [
{
"content": "Question:\nMonocarp and Polycarp are learning new programming techniques. Now they decided to try pair programming.\n\nIt's known that they have worked together on the same file for $n + m$ minutes. Every minute exactly one of them made one change to the file. Before they started, there were alrea... |
[
{
"content": "Question:\nGiven are N points (x_i, y_i) in a two-dimensional plane.\nFind the minimum radius of a circle such that all the points are inside or on it.\n\n-----Constraints-----\n - 2 \\leq N \\leq 50\n - 0 \\leq x_i \\leq 1000\n - 0 \\leq y_i \\leq 1000\n - The given N points are all different.\n ... | [
{
"content": "Question:\nGiven are N points (x_i, y_i) in a two-dimensional plane.\nFind the minimum radius of a circle such that all the points are inside or on it.\n\n-----Constraints-----\n - 2 \\leq N \\leq 50\n - 0 \\leq x_i \\leq 1000\n - 0 \\leq y_i \\leq 1000\n - The given N points are all different.\n ... |
[
{
"content": "Question:\nGiven a string s, process q queries, each having one of the following forms:\n\n * 1 i c — Change the i-th character in the string to c. \n * 2 l r y — Consider the substring of s starting at position l and ending at position r. Output the number of times y occurs as a substring in it... | [
{
"content": "Question:\nGiven a string s, process q queries, each having one of the following forms:\n\n * 1 i c — Change the i-th character in the string to c. \n * 2 l r y — Consider the substring of s starting at position l and ending at position r. Output the number of times y occurs as a substring in it... |
[
{
"content": "Question:\nIahub is a big fan of tourists. He wants to become a tourist himself, so he planned a trip. There are n destinations on a straight road that Iahub wants to visit. Iahub starts the excursion from kilometer 0. The n destinations are described by a non-negative integers sequence a_1, a_2, ... | [
{
"content": "Question:\nIahub is a big fan of tourists. He wants to become a tourist himself, so he planned a trip. There are n destinations on a straight road that Iahub wants to visit. Iahub starts the excursion from kilometer 0. The n destinations are described by a non-negative integers sequence a_1, a_2, ... |
[
{
"content": "Question:\nYou are given a number $n$ (divisible by $3$) and an array $a[1 \\dots n]$. In one move, you can increase any of the array elements by one. Formally, you choose the index $i$ ($1 \\le i \\le n$) and replace $a_i$ with $a_i + 1$. You can choose the same index $i$ multiple times for diffe... | [
{
"content": "Question:\nYou are given a number $n$ (divisible by $3$) and an array $a[1 \\dots n]$. In one move, you can increase any of the array elements by one. Formally, you choose the index $i$ ($1 \\le i \\le n$) and replace $a_i$ with $a_i + 1$. You can choose the same index $i$ multiple times for diffe... |
[
{
"content": "Question:\nWe have a long seat of width X centimeters.\nThere are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length Y centimeters.\nWe would like to seat as many people as possible, but they are all very shy, and there must be a gap of length ... | [
{
"content": "Question:\nWe have a long seat of width X centimeters.\nThere are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length Y centimeters.\nWe would like to seat as many people as possible, but they are all very shy, and there must be a gap of length ... |
[
{
"content": "Question:\nPeter got a new snow blower as a New Year present. Of course, Peter decided to try it immediately. After reading the instructions he realized that it does not work like regular snow blowing machines. In order to make it work, you need to tie it to some point that it does not cover, and ... | [
{
"content": "Question:\nPeter got a new snow blower as a New Year present. Of course, Peter decided to try it immediately. After reading the instructions he realized that it does not work like regular snow blowing machines. In order to make it work, you need to tie it to some point that it does not cover, and ... |
[
{
"content": "Question:\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\nThe Head Chef is receiving a lot of orders for cooking the best of the problems lately. For this, he organized an hiring event to hire some talented Chefs. He gave the following problem to test the skills ... | [
{
"content": "Question:\nRead problems statements in Mandarin Chinese, Russian and Vietnamese as well. \n\nThe Head Chef is receiving a lot of orders for cooking the best of the problems lately. For this, he organized an hiring event to hire some talented Chefs. He gave the following problem to test the skills ... |
[
{
"content": "Question:\nThe Smart Beaver from ABBYY began to develop a new educational game for children. The rules of the game are fairly simple and are described below.\n\nThe playing field is a sequence of n non-negative integers ai numbered from 1 to n. The goal of the game is to make numbers a1, a2, ..., ... | [
{
"content": "Question:\nThe Smart Beaver from ABBYY began to develop a new educational game for children. The rules of the game are fairly simple and are described below.\n\nThe playing field is a sequence of n non-negative integers ai numbered from 1 to n. The goal of the game is to make numbers a1, a2, ..., ... |
[
{
"content": "Question:\nRecall that a binary search tree is a rooted binary tree, whose nodes each store a key and each have at most two distinguished subtrees, left and right. The key in each node must be greater than any key stored in the left subtree, and less than any key stored in the right subtree.\n\nTh... | [
{
"content": "Question:\nRecall that a binary search tree is a rooted binary tree, whose nodes each store a key and each have at most two distinguished subtrees, left and right. The key in each node must be greater than any key stored in the left subtree, and less than any key stored in the right subtree.\n\nTh... |
[
{
"content": "Question:\nPolycarp loves geometric progressions very much. Since he was only three years old, he loves only the progressions of length three. He also has a favorite integer k and a sequence a, consisting of n integers.\n\nHe wants to know how many subsequences of length three can be selected from... | [
{
"content": "Question:\nPolycarp loves geometric progressions very much. Since he was only three years old, he loves only the progressions of length three. He also has a favorite integer k and a sequence a, consisting of n integers.\n\nHe wants to know how many subsequences of length three can be selected from... |
[
{
"content": "Question:\nLet $n$ be a positive integer. Let $a, b, c$ be nonnegative integers such that $a + b + c = n$.\n\nAlice and Bob are gonna play rock-paper-scissors $n$ times. Alice knows the sequences of hands that Bob will play. However, Alice has to play rock $a$ times, paper $b$ times, and scissors ... | [
{
"content": "Question:\nLet $n$ be a positive integer. Let $a, b, c$ be nonnegative integers such that $a + b + c = n$.\n\nAlice and Bob are gonna play rock-paper-scissors $n$ times. Alice knows the sequences of hands that Bob will play. However, Alice has to play rock $a$ times, paper $b$ times, and scissors ... |
[
{
"content": "Question:\nWe often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the price for a kilo. But in some supermarkets, when asked how much the items are, the clerk will say that $a$ yuan for $b$ kilos (You don't need to care about what \"yuan\" is), the same as $a/b$ ... | [
{
"content": "Question:\nWe often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the price for a kilo. But in some supermarkets, when asked how much the items are, the clerk will say that $a$ yuan for $b$ kilos (You don't need to care about what \"yuan\" is), the same as $a/b$ ... |
[
{
"content": "Question:\nOne of Arkady's friends works at a huge radio telescope. A few decades ago the telescope has sent a signal $s$ towards a faraway galaxy. Recently they've received a response $t$ which they believe to be a response from aliens! The scientists now want to check if the signal $t$ is simila... | [
{
"content": "Question:\nOne of Arkady's friends works at a huge radio telescope. A few decades ago the telescope has sent a signal $s$ towards a faraway galaxy. Recently they've received a response $t$ which they believe to be a response from aliens! The scientists now want to check if the signal $t$ is simila... |
[
{
"content": "Question:\nProblem A Secret of Chocolate Poles\n\nWendy, the master of a chocolate shop, is thinking of displaying poles of chocolate disks in the showcase. She can use three kinds of chocolate disks: white thin disks, dark thin disks, and dark thick disks. The thin disks are $1$ cm thick, and the... | [
{
"content": "Question:\nProblem A Secret of Chocolate Poles\n\nWendy, the master of a chocolate shop, is thinking of displaying poles of chocolate disks in the showcase. She can use three kinds of chocolate disks: white thin disks, dark thin disks, and dark thick disks. The thin disks are $1$ cm thick, and the... |
[
{
"content": "Question:\nThere are $n$ children numbered from $1$ to $n$ in a kindergarten. Kindergarten teacher gave $a_i$ ($1 \\leq a_i \\leq n$) candies to the $i$-th child. Children were seated in a row in order from $1$ to $n$ from left to right and started eating candies. \n\nWhile the $i$-th child was ea... | [
{
"content": "Question:\nThere are $n$ children numbered from $1$ to $n$ in a kindergarten. Kindergarten teacher gave $a_i$ ($1 \\leq a_i \\leq n$) candies to the $i$-th child. Children were seated in a row in order from $1$ to $n$ from left to right and started eating candies. \n\nWhile the $i$-th child was ea... |
[
{
"content": "Question:\nLeha decided to move to a quiet town Vičkopolis, because he was tired by living in Bankopolis. Upon arrival he immediately began to expand his network of hacked computers. During the week Leha managed to get access to n computers throughout the town. Incidentally all the computers, whic... | [
{
"content": "Question:\nLeha decided to move to a quiet town Vičkopolis, because he was tired by living in Bankopolis. Upon arrival he immediately began to expand his network of hacked computers. During the week Leha managed to get access to n computers throughout the town. Incidentally all the computers, whic... |
[
{
"content": "Question:\nMike is trying rock climbing but he is awful at it. \n\nThere are n holds on the wall, i-th hold is at height a_{i} off the ground. Besides, let the sequence a_{i} increase, that is, a_{i} < a_{i} + 1 for all i from 1 to n - 1; we will call such sequence a track. Mike thinks that the tr... | [
{
"content": "Question:\nMike is trying rock climbing but he is awful at it. \n\nThere are n holds on the wall, i-th hold is at height a_{i} off the ground. Besides, let the sequence a_{i} increase, that is, a_{i} < a_{i} + 1 for all i from 1 to n - 1; we will call such sequence a track. Mike thinks that the tr... |
[
{
"content": "Question:\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n* 1 \\leq N,K \\leq 2\\times 10^5\n* N and K a... | [
{
"content": "Question:\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K. The order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n* 1 \\leq N,K \\leq 2\\times 10^5\n* N and K a... |
[
{
"content": "Question:\nAyush, Ashish and Vivek are busy preparing a new problem for the next Codeforces round and need help checking if their test cases are valid.\n\nEach test case consists of an integer $n$ and two arrays $a$ and $b$, of size $n$. If after some (possibly zero) operations described below, ar... | [
{
"content": "Question:\nAyush, Ashish and Vivek are busy preparing a new problem for the next Codeforces round and need help checking if their test cases are valid.\n\nEach test case consists of an integer $n$ and two arrays $a$ and $b$, of size $n$. If after some (possibly zero) operations described below, ar... |
[
{
"content": "Question:\nYou are given a string S consisting of digits between 1 and 9, inclusive.\nYou can insert the letter + into some of the positions (possibly none) between two letters in this string.\nHere, + must not occur consecutively after insertion.\nAll strings that can be obtained in this way can ... | [
{
"content": "Question:\nYou are given a string S consisting of digits between 1 and 9, inclusive.\nYou can insert the letter + into some of the positions (possibly none) between two letters in this string.\nHere, + must not occur consecutively after insertion.\nAll strings that can be obtained in this way can ... |
[
{
"content": "Question:\nTakahashi is growing a plant. Its height at the time of germination is 0\\,\\mathrm{cm}. Considering the day of germination as day 0, its height increases by 2^i\\,\\mathrm{cm} day i's night (0 \\le i).\nTakahashi's height is H\\,\\mathrm{cm}.\nEvery morning, Takahashi measures his heig... | [
{
"content": "Question:\nTakahashi is growing a plant. Its height at the time of germination is 0\\,\\mathrm{cm}. Considering the day of germination as day 0, its height increases by 2^i\\,\\mathrm{cm} day i's night (0 \\le i).\nTakahashi's height is H\\,\\mathrm{cm}.\nEvery morning, Takahashi measures his heig... |
[
{
"content": "Question:\nVasya is writing an operating system shell, and it should have commands for working with directories. To begin with, he decided to go with just two commands: cd (change the current directory) and pwd (display the current directory).\n\nDirectories in Vasya's operating system form a trad... | [
{
"content": "Question:\nVasya is writing an operating system shell, and it should have commands for working with directories. To begin with, he decided to go with just two commands: cd (change the current directory) and pwd (display the current directory).\n\nDirectories in Vasya's operating system form a trad... |
[
{
"content": "Question:\nYou are working for the Gryzzl company, headquartered in Pawnee, Indiana.\n\nThe new national park has been opened near Pawnee recently and you are to implement a geolocation system, so people won't get lost. The concept you developed is innovative and minimalistic. There will be $n$ an... | [
{
"content": "Question:\nYou are working for the Gryzzl company, headquartered in Pawnee, Indiana.\n\nThe new national park has been opened near Pawnee recently and you are to implement a geolocation system, so people won't get lost. The concept you developed is innovative and minimalistic. There will be $n$ an... |
[
{
"content": "Question:\nA permutation is a sequence of integers p_1, p_2, ..., p_{n}, consisting of n distinct positive integers, each of them doesn't exceed n. Let's denote the i-th element of permutation p as p_{i}. We'll call number n the size of permutation p_1, p_2, ..., p_{n}.\n\nNickolas adores permutat... | [
{
"content": "Question:\nA permutation is a sequence of integers p_1, p_2, ..., p_{n}, consisting of n distinct positive integers, each of them doesn't exceed n. Let's denote the i-th element of permutation p as p_{i}. We'll call number n the size of permutation p_1, p_2, ..., p_{n}.\n\nNickolas adores permutat... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 16