messages listlengths 2 2 | env stringclasses 1
value |
|---|---|
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAnia has a large integer S. Its decimal representation has length n and doesn't contain any leading zeroes. Ania is allowed to change at most k digits of S. She wants to do it in such a way that S stil... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nChef has with him an array A of length N. In one move, he can delete any element from A.\n\nFind the minimum number of deletions Chef must make so that the following condition holds:\nLet B denote the ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nPetya works as a PR manager for a successful Berland company BerSoft. He needs to prepare a presentation on the company income growth since 2001 (the year of its founding) till now. Petya knows that in... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nVanya is doing his maths homework. He has an expression of form $x_{1} \\diamond x_{2} \\diamond x_{3} \\diamond \\ldots \\diamond x_{n}$, where x_1, x_2, ..., x_{n} are digits from 1 to 9, and sign [I... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAquaMoon 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_i written on it. Each friend has a direction (left or right). In the be... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nExamples\n\nInput\n\n4 5 2\n0 1 2 1\n0 2 1 2\n1 2 1 1\n1 3 1 3\n2 3 2 1\n\n\nOutput\n\n6\n\n\nInput\n\n\n\n\nOutput\n\nThe input will be stdin and you should print your solution to stdout\n\n\nNow solv... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\nOne day, Empi... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nVasya is choosing a laptop. The shop has *n* laptops to all tastes.\n\nVasya is interested in the following properties: processor speed, ram and hdd. Vasya is a programmer and not a gamer which is why ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nThere are N squares aligned in a row. The i-th square from the left contains an integer a_i.\n\nInitially, all the squares are white. Snuke will perform the following operation some number of times:\n\... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAndrewid the Android is a galaxy-known detective. Now he does not investigate any case and is eating chocolate out of boredom.\n\nA bar of chocolate can be presented as an n × n table, where each cell ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nDuring a break in the buffet of the scientific lyceum of the Kingdom of Kremland, there was formed a queue of $n$ high school students numbered from $1$ to $n$. Initially, each student $i$ is on positi... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nMelody Pond was stolen from her parents as a newborn baby by Madame Kovarian, to become a weapon of the Silence in their crusade against the Doctor. Madame Kovarian changed Melody's name to River Song,... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a positive integer $n$.\n\nLet $S(x)$ be sum of digits in base 10 representation of $x$, for example, $S(123) = 1 + 2 + 3 = 6$, $S(0) = 0$.\n\nYour task is to find two integers $a, b$, su... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nYou a captain of a ship. Initially you are standing in a point $(x_1, y_1)$ (obviously, all positions in the sea can be described by cartesian plane) and you want to travel to a point $(x_2, y_2)$. \n\... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two strings A and B representing essays of two students who are suspected cheaters. For any two strings C, D we define their similarity score S(C,D) as 4⋅ LCS(C,D) - |C| - |D|, where LCS(... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S of length N consisting of lowercase English letters.\nProcess Q queries of the following two types:\n - Type 1: change the i_q-th character of S to c_q. (Do nothing if the i_q-... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nThere are N squares numbered 1 to N from left to right. Each square has a character written on it, and Square i has a letter s_i. Besides, there is initially one golem on each square.\n\nSnuke cast Q s... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nProblem\n\nGiven a permutation of length $ N $ $ P = \\\\ {P_1, P_2, \\ ldots, P_N \\\\} $ and the integer $ K $.\nDetermine if the permutation $ P $ can be monotonically increased by repeating the fol... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nRead problems statements in Mandarin chinese, Russian and Vietnamese as well. \n\nChef is working at his dream workplace with $N-1$ of his friends! Like any dream workplace, this one also has dream wor... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nShe is an extraordinary girl. She works for a library. Since she is young and cute, she is forced to do a lot of laborious jobs. The most annoying job for her is to put returned books into shelves, car... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY came up with another splendid problem for the ABBYY Cup participants! This time the Beaver invites the contest participants to check out a problem on sorting documents by th... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a tree with n nodes, numerated from 0 to n-1. For each k between 0 and n, inclusive, you have to count the number of unordered pairs (u,v), u ≠ v, such that the MEX of all the node labels... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nDeadpool wants to decorate his girlfriend’s house with a series of bulbs. The number of bulbs is M. Initially, all the bulbs are switched off. Deadpool finds that there are K numbers of buttons, each ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nIahub got lost in a very big desert. The desert can be represented as a n × n square matrix, where each cell is a zone of the desert. The cell (i, j) represents the cell at row i and column j (1 ≤ i, j... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAyush is learning how to decrease a number by one, but he does it wrong with a number consisting of two or more digits. Ayush subtracts one from a number by the following algorithm:\nif the last digit ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nRead problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.\n\nEidi gifts are a tradition in which children receive money from elder relatives during the Eid... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nBerland annual chess tournament is coming!\n\nOrganizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second te... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAs Famil Door’s birthday is coming, some of his friends (like Gabi) decided to buy a present for him. His friends are going to buy a string consisted of round brackets since Famil Door loves string of ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nThere is a square grid of size $n \\times n$. Some cells are colored in black, all others are colored in white. In one operation you can select some rectangle and color all its cells in white. It costs... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nThe chef won a duet singing award at Techsurge & Mridang 2012. From that time he is obsessed with the number 2.\n\nHe just started calculating the powers of two. And adding the digits of the results.\n... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAyush is a cashier at the shopping center. Recently his department has started a ''click and collect\" service which allows users to shop online. \n\nThe store contains k items. n customers have alread... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\n-----Constrai... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAppleman and Toastman play a game. Initially Appleman gives one group of *n* numbers to the Toastman, then they start to complete the following tasks:\n - Each time Toastman gets a group of numbers, h... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nInna loves sleeping very much, so she needs n alarm clocks in total to wake up. Let's suppose that Inna's room is a 100 × 100 square with the lower left corner at point (0, 0) and with the upper right ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nFor the human eye, primary colours are red, green, and blue. \n\nCombining 1 drop each of any two primary colours produces a new type of secondary colour. For example, mixing red and green gives yellow... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nBerland regional ICPC contest has just ended. There were m participants numbered from 1 to m, who competed on a problemset of n problems numbered from 1 to n.\n\nNow the editorial is about to take plac... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nКак известно, в теплую погоду многие жители крупных городов пользуются сервисами городского велопроката. Вот и Аркадий сегодня будет добираться от школы до дома, используя городские велосипеды.\n\nШкол... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nDuring her tantrums the princess usually smashes some collectable porcelain. Every furious shriek is accompanied with one item smashed.\n\nThe collection of porcelain is arranged neatly on n shelves. W... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nYou're given an integer N. Write a program to calculate the sum of all the digits of N. \n\n-----Input-----\n\nThe first line contains an integer T, the total number of testcases. Then follow T lines, ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nChef Jessie has a lot of recipes with her (N). She often remembered the starting few characters of the recipe and forgot the rest. As all the great chefs do, Jessie also numbered the recipes depending ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp is working on a new project called \"Polychat\". Following modern tendencies in IT, he decided, that this project should contain chat as well. To achieve this goal, Polycarp has spent several ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAlperen is standing at the point $(0,0)$. He is given a string $s$ of length $n$ and performs $n$ moves. The $i$-th move is as follows:\n\nif $s_i = {L}$, then move one unit left;\n\nif $s_i = {R}$, th... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAn array B of length M consisting of only distinct elements is said to be *good* if the following condition holds:\nLet i be the index of the maximum element of B.\nThen, B[1,i] must be in ascending or... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nC: Mod! Mod!\n\nstory\n\nThat's right! I'm looking for eyewitness testimony! A phantom thief has appeared in Aizu! Everyone's horse stick was stolen! Who is the culprit! ?? Unravel! Mod! Mod!\n\nProble... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nMasha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numbered i ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nRead problem statements in [Russian] and [Mandarin Chinese].\n\nA great deal of energy is lost as metabolic heat when the organisms from one trophic level are consumed by the next level. \n\nSuppose in... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nApart from Nian, there is a daemon named Sui, which terrifies children and causes them to become sick. Parents give their children money wrapped in red packets and put them under the pillow, so that wh... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAs you could know there are no male planes nor female planes. However, each plane on Earth likes some other plane. There are n planes on Earth, numbered from 1 to n, and the plane with number i likes t... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nThere is a chess board of size $n \\times m$. The rows are numbered from $1$ to $n$, the columns are numbered from $1$ to $m$.\n\nLet's call a cell isolated if a knight placed in that cell can't move t... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two arrays $A$ = $A_{1}, A_{2}, \\ldots, A_{N}$ and $B$ = $B_{1}, B_{2}, \\ldots, B_{N}$. We want to make these two arrays identical. That is, for each $1 ≤ i ≤ N$, we want to make $A_{i}... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer N.\n\nFor two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in th... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nIn this task you need to process a set of stock exchange orders and use them to create order book.\n\nAn order is an instruction of some participant to buy or sell stocks on stock exchange. The order n... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nAfter all the events in Orlando we all know, Sasha and Roma decided to find out who is still the team's biggest loser. Thankfully, Masha found somewhere a revolver with a rotating cylinder of n bullet ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nA string S is called *Chef's favourite* if every substring chef in S must have a substring code before it.\n\nYou are given a string S of size N that contains both code and chef as a substring. Please ... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nA string is called bracket sequence if it does not contain any characters other than \"(\" and \")\". A bracket sequence is called regular if it it is possible to obtain correct arithmetic expression b... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nKuro has recently won the \"Most intelligent cat ever\" contest. The three friends then decided to go to Katie's home to celebrate Kuro's winning. After a big meal, they took a small break then started... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nTeja likes cricket very much and likes to watch it all the time, but he is bored of watching the\nmatches alone and asks his friend to give him company. But his friend doesn’t know how to read\ncricket... | affine:ded |
[
{
"role": "user",
"content": "Solve the following coding problem using the programming language python:\n\nOn a two-dimensional plane, there are m lines drawn parallel to the x axis, and n lines drawn parallel to the y axis. Among the lines parallel to the x axis, the i-th from the bottom is represented by ... | affine:ded |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 1