domain stringclasses 7
values | sub_source stringclasses 15
values | coding_subclass stringclasses 6
values | messages listlengths 2 24 | tools listlengths 1 94 ⌀ |
|---|---|---|---|---|
Coding | Nemotron-OpenCode-general | engineering_oop_api | [
{
"role": "user",
"content": "\"I'm building a task management system for a team of developers working on multiple projects simultaneously. Each project has different phases (planning, development, testing, deployment) and each phase can have multiple tasks assigned to different team members with varying pr... | [
{
"type": "function",
"function": {
"name": "invalid",
"description": "Do not use",
"parameters": "{\"$schema\": \"https://json-schema.org/draft/2020-12/schema\", \"type\": \"object\", \"properties\": {\"tool\": {\"type\": \"string\"}, \"error\": {\"type\": \"string\"}}, \"required\": [\"t... |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Gerda is travelling through a road network that consists of n intersections (numbered from 1) and m bidirectional roads (numbered from 1). If Gerda steps on road i at a moment that is not later than i, she will leave that road exactly at moment i. If she steps on road i after m... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate unique sample IDs for a research project. The sample IDs follow a specific format: \"YYYY-GCRSR-XXXX\", where \"YYYY\" is the year, \"GCRSR\" is a project code, and \"XXXX\" is a unique 4-digit identifier. Write a Python f... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are given a list of non-negative integers representing the heights of vertical lines at their respective indices. Find two lines such that, together with the x-axis, they form a container that holds the maximum possible area, subject to the following constraint:\n\n- The he... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a given request and extracts important information from it. The function should take a dictionary representing a web request environment as input. The keys in the dictionary include 'REQUEST_METHOD', 'REQUEST_URI', and opti... | null |
Coding | Nemotron-OpenCode-general | engineering_oop_api | [
{
"role": "user",
"content": "Research and provide recommendations for automatically categorizing documents (PDFs, Word docs, text files) into categories like financial, legal, technical, marketing, and general. Consider approaches that analyze both content and metadata (file names, creation dates, author i... | [
{
"type": "function",
"function": {
"name": "invalid",
"description": "Do not use",
"parameters": "{\"$schema\": \"https://json-schema.org/draft/2020-12/schema\", \"type\": \"object\", \"properties\": {\"tool\": {\"type\": \"string\"}, \"error\": {\"type\": \"string\"}}, \"required\": [\"t... |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Write a Python program that reads an integer n from standard input, and calculates the Fibonacci sequence up to the nth number (that is, computes Fibonacci(n)), using a recursive approach. Each recursive call must be delayed by the current Fibonacci number's value in millisecon... | null |
Coding | Nemotron-OpenCode-general | engineering_oop_api | [
{
"role": "user",
"content": "\"I'm trying to understand how the React Fiber reconciliation algorithm works under the hood, specifically the work loop implementation in the React DOM renderer. Can you explain how the `workLoopSync` and `workLoopConcurrent` functions coordinate with the scheduler to prioriti... | [
{
"type": "function",
"function": {
"name": "invalid",
"description": "Do not use",
"parameters": "{\"$schema\": \"https://json-schema.org/draft/2020-12/schema\", \"type\": \"object\", \"properties\": {\"tool\": {\"type\": \"string\"}, \"error\": {\"type\": \"string\"}}, \"required\": [\"t... |
Coding | Nemotron-OpenCode-general | engineering_oop_api | [
{
"role": "user",
"content": "\"I'm working on a research project where I need to document our experimental methodology and results for a machine learning model we've developed. I want to create a comprehensive technical report that includes sections for abstract, introduction, related work, methodology, ex... | [
{
"type": "function",
"function": {
"name": "invalid",
"description": "Do not use",
"parameters": "{\"$schema\": \"https://json-schema.org/draft/2020-12/schema\", \"type\": \"object\", \"properties\": {\"tool\": {\"type\": \"string\"}, \"error\": {\"type\": \"string\"}}, \"required\": [\"t... |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Crazy Computer\n\nIf the time gap between typing two consecutive words exceeds a threshold, the screen is cleared.\n\nFormally, you are given a positive integer c. The i-th word is typed at second t_i (1 ≤ t_1 < t_2 < … < t_n). While typing proceeds, the screen behaves as follo... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Create a program that simulates a modified game of Hangman, where instead of guessing letters, a player guesses NATO phonetic codes corresponding to each letter in a target word. The program should allow the player to guess phonetic codes for letters, and also allow a one-time ... | null |
Coding | Nemotron-OpenCode-general | engineering_oop_api | [
{
"role": "user",
"content": "\"Can you explain how this React custom hook for managing WebSocket connections with automatic reconnection and message queuing works under the hood? I'm particularly interested in understanding the race conditions it's trying to prevent and whether the exponential backoff impl... | [
{
"type": "function",
"function": {
"name": "invalid",
"description": "Do not use",
"parameters": "{\"$schema\": \"https://json-schema.org/draft/2020-12/schema\", \"type\": \"object\", \"properties\": {\"tool\": {\"type\": \"string\"}, \"error\": {\"type\": \"string\"}}, \"required\": [\"t... |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are given an array of n k-bit integers a1 , a2 , … , an . A number is called k-bit if 0 ≤ x ≤ 2^k − 1.\n\nIn one move you may choose an index i (1 ≤ i ≤ n) and replace ai by its k-bit complement ȧi , that is, by the number whose k bits are the opposite of the bits of ai (f... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are given a list of students. Each student is described by a dictionary containing the student's name and their grades. Grades can be integers (regular scores) or floats (extra credit scores). Only regular scores (integers, or floats whose value is an integer) should be inc... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Given a string consisting of alphabetic and numeric characters, generate all possible combinations where each alphabetic character can be either lowercase or uppercase, while numeric characters remain unchanged. For each input string, print a list of all lexicographically sorte... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are given a list of dictionaries, each representing a person with possible keys 'name' and 'age'. Some dictionaries may be missing one or both of these keys. Your task is to process this data to print a description of each person, in the format:\n\n<name> is <age> years old... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a name and a resource group name as inputs and generates a unique identifier for a Spatial Anchors Account. The unique identifier should be formatted as 'account-{name}-{resource_group_name}-{random_number}', where 'random_... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a script is run from the root directory of a non-repository and whether a virtual environment (venv) is activated. Your function should perform the following steps:\n1. Check if the script is run from the root directory of ... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Design a program that defines an `Employee` class with the following specifications:\n\n- Attributes: `name`, `id`, and `salary`.\n- Provides methods to set and get each attribute.\n- Maintains a record of all salary changes made to the employee in chronological order (includin... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Numbers Game – Sum of Sub-strings\n\nYou are given a positive integer written as a string without leading zeros. Consider every contiguous substring of this string and interpret each substring as an integer (in base 10). Compute the sum of all these integers.\n\nBecause the an... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Write a program that reads two lines from standard input. The first line contains a string (possibly with punctuation and mixed case letters). The second line contains a list of stop words separated by spaces. Your task is to identify the most frequently occurring word in the s... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Given a list of integers, generate and print all possible permutations of the list, each as a separate line. Each permutation should be printed as a list (in Python list format).\n\nInput Format:\n- The first line contains an integer n, the length of the list (1 ≤ n ≤ 8).\n- Th... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Write a program that determines if a given string is a palindrome, considering only alphanumeric characters and ignoring cases. The program should handle Unicode characters correctly as single characters.\n\nInput:\nA single string s is given via standard input (one line).\n\nO... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Keith Numbers (also called repfigit numbers) form a rare integer sequence that begins\n14, 19, 28, 47, 61, 75, 197, 742, ...\nA positive integer n with d decimal digits is a Keith number if, when you start with its digits and repeatedly append the sum of the previous d terms, t... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a given error message indicates that an artifact is missing. The function should take a string input, `error_message`, and return a boolean value. Specifically, the function should return `True` if the string 'does not... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You own N second-hand books. Each book i has a standard price Ci yen and belongs to a genre Gi (1 ≤ Gi ≤ 10).\n\nWhen you sell several books of the same genre to the JOI second-hand bookstore at the same time, the store adds a bonus to the price of every book of that genre: if ... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Write a program that reads a single line of input representing a nested list. The program should flatten the list recursively, find all unique integers, and print the sum of those integers that are prime numbers. Only integers are considered in the summation. Nested lists can b... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Write a program that prints the first 20 prime numbers, one per line.\n\nInput\n\nThere is no input.\n\nOutput\n\nPrint the first 20 prime numbers, each on its own line.",
"tool_calls": null
},
{
"role": "assistant",
"content": "def prime_generator():\n yield... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Write a program that reads a list of integers from standard input (all on one line, separated by spaces) and outputs a new list on a single line. The output list should have all the even numbers (excluding zeros) sorted in ascending order, while keeping the odd numbers and any ... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts the repository name from a given GitHub URL. The function should take the URL as input and return the repository name. Create a function called `extract_repo_name` that takes a GitHub URL as a string input and returns... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Chef has N vases standing in a row, initially numbered 1..N from the left. After the rearrangement Chef wants the vase that is now in position i to end up in position p_i (1 ≤ i ≤ N). In other words the whole row must be permuted by p.\n\nChef can move vases in two different ... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Write a program that reads a list of integers from standard input and prints the sum of the two largest numbers in the list. If the list contains fewer than two integers, the program should print an error message: \"List must contain at least two numbers\".\n\nInput:\nA single ... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Given three integers l, r and a, compute the following value:\n\n S = ( \\sum_{i=l}^{r} f(i) ) mod a\n\nwhere f(x) is the sum of the digits of x written in decimal notation.\n\nInput\nThe input consists of a single line containing three integers separated by spaces:\n\nl r a... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a string representing a SQL table definition and returns a list of its primary key (PK) and foreign key (FK) columns. The SQL table definition will always follow the format of having the primary key defined as 'PRIMARY KEY' ... | null |
Coding | Dolci-Python-Algorithms | engineering_oop_api | [
{
"role": "user",
"content": "Implement a Python program that sorts a list of integers using a hybrid sorting algorithm. The algorithm should use QuickSort for subarrays larger than 10 elements, and switch to Insertion Sort for subarrays of size 10 or less. The implementation must not create any extra list ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Calculus class...is awesome! But you are a programmer with no time for mindless repetition. Your teacher spent a whole day covering differentiation of polynomials, and by the time the bell rang, you had already conjured up a program to automate the process.\n\nYou realize that ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "In the Kingdom of AtCoder, people use a language called Taknese, which uses lowercase English letters.\nIn Taknese, the plural form of a noun is spelled based on the following rules:\n - If a noun's singular form does not end with s, append s to the end of the singular form.\n ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Given is a string S. Replace every character in S with x and print the result.\n\n-----Constraints-----\n - S is a string consisting of lowercase English letters.\n - The length of S is between 1 and 100 (inclusive).\n\n-----Input-----\nInput is given from Standard Input in the... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Given a collection of numbers that might contain duplicates, return all possible unique permutations.\n\nExample:\n\n\nInput: [1,1,2]\nOutput:\n[\n [1,1,2],\n [1,2,1],\n [2,1,1]\n]\n",
"tool_calls": null
},
{
"role": "assistant",
"content": "```python\nimport... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "# Making Change\n\nComplete the method that will determine the minimum number of coins needed to make change for a given amount in American currency.\n\nCoins used will be half-dollars, quarters, dimes, nickels, and pennies, worth 50¢, 25¢, 10¢, 5¢ and 1¢, respectively. They'll... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "The [Ones' Complement](https://en.wikipedia.org/wiki/Ones%27_complement) of a binary number is the number obtained by swapping all the 0s for 1s and all the 1s for 0s. For example:\n\n```\nonesComplement(1001) = 0110\nonesComplement(1001) = 0110\n```\n\nFor any given binary num... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Given an array nums[] of N positive integers. Find the minimum number of operations required to modify the array such that array elements are in strictly increasing order (A[i] < A[i+1]).\nChanging a number to greater or lesser than original number is counted as one operation.\... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Complete the function so that it returns the number of seconds that have elapsed between the start and end times given. \n\n##### Tips:\n- The start/end times are given as Date (JS/CoffeeScript), DateTime (C#), Time (Nim), datetime(Python) and Time (Ruby) instances. \n- The s... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "We held two competitions: Coding Contest and Robot Maneuver.\n\nIn each competition, the contestants taking the 3-rd, 2-nd, and 1-st places receive 100000, 200000, and 300000 yen (the currency of Japan), respectively. Furthermore, a contestant taking the first place in both com... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "The new PIN is hard to remember. I was told that I shouldn't take notes, but I don't think I can remember them. Therefore, I decided to embed a numerical value in the text and make a note of the PIN. Here, the sum of all the numbers is the PIN.\n\nCreate a program that reads th... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "# Description:\n\nRemove the minimum number of exclamation marks from the start/end of each word in the sentence to make their amount equal on both sides.\n\n### Notes:\n* Words are separated with spaces\n* Each word will include at least 1 letter\n* There will be no exclamatio... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "For a set $S$ of integers, perform a sequence of the following operations. Note that each value in $S$ must be unique.\n\n* insert($x$): Insert $x$ to $S$ and report the number of elements in $S$ after the operation.\n* find($x$): Report the number of $x$ in $S$ (0 or 1).\n\nCo... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Hackers! Hackers! Everywhere!\nSome days back your email ID was hacked. Some one read the personal messages and Love Letters you sent to your girl friend. That's a terrible thing, well, you know how are the boys at ISM. So, you have decided that from now onwards you will write ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "It has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board.\n\nThe bulletin board is in the form of a grid with N rows and N columns, and the notice will occupy a rectangular region with H rows and W column... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "<image>\n\nInput\n\nThe input contains two integers a1, a2 (0 ≤ ai ≤ 32), separated by a single space.\n\nOutput\n\nOutput a single integer.\n\nExamples\n\nInput\n\n1 1\n\n\nOutput\n\n0\n\n\nInput\n\n3 7\n\n\nOutput\n\n0\n\n\nInput\n\n13 10\n\n\nOutput\n\n1\n",
"tool_calls"... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "You probably know the 42 number as \"The answer to life, the universe and everything\" according to Douglas Adams' \"The Hitchhiker's Guide to the Galaxy\". For Freud, the answer was quite different.\n\nIn the society he lived in, people-women in particular- had to repress thei... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Create a function that returns the total of a meal including tip and tax. You should not tip on the tax.\n\nYou will be given the subtotal, the tax as a percentage and the tip as a percentage. Please round your result to two decimal places.\n",
"tool_calls": null
},
{
... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Gerald bought two very rare paintings at the Sotheby's auction and he now wants to hang them on the wall. For that he bought a special board to attach it to the wall and place the paintings on the board. The board has shape of an a_1 × b_1 rectangle, the paintings have shape of... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "You're given a mystery `puzzlebox` object. Examine it to make the tests pass and solve this kata.\n",
"tool_calls": null
},
{
"role": "assistant",
"content": "```python\nanswer = puzzlebox.lock(puzzlebox.key.hole)\n```",
"tool_calls": null
}
] | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "You are given a binary string s and an integer m. You need to return an integer r. Where r = k%m, k is the binary equivalent of string s.\nExample 1:\nInput:\ns = \"101\" \nm = 2\nOutput:\n1\nExplanation: Here k=5 because (101)_{2} = (5)_{10}.\nHence 5 mod 2 = 1.\nExample 2:\nI... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "There are N people. The name of the i-th person is S_i.\nWe would like to choose three people so that the following conditions are met:\n - The name of every chosen person begins with M, A, R, C or H.\n - There are no multiple people whose names begin with the same letter.\nHow... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "There are N coins placed on the road where arr[i] is the denomination of i^{th} coin. A Fox is looking to collect some of these coins. The fox is very greedy and follows a weird pattern of collecting coins: the fox collects coins in only increasing order of their denomination s... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. \"Do I give such a hard task?\" — the HR manager thought. \"Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rat... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "A pronic number is a number which is the product of two consecutive integers. Find all Pronic Numbers less than or equal to the given integer N.\nThe first few Pronic numbers are: 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132 and so on.\nExample 1:\nInput:\nN = 6\nOutput:\n0 2... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "# Task\n You are implementing your own HTML editor. To make it more comfortable for developers you would like to add an auto-completion feature to it.\n\n Given the starting HTML tag, find the appropriate end tag which your editor should propose.\n\n# Example\n\n For startTag =... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "No description!!!\n\nInput :: [10,20,25,0]\n\nOutput :: [\"+0\", \"+10\", \"+15\", \"-10\"] \n\n`Show some love, rank and upvote!`\n",
"tool_calls": null
},
{
"role": "assistant",
"content": "```python\nimport sys\nimport ast\nimport json\n\ndef main():\n da... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Three poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right.\nWe will call the arrangement of the poles beautiful if the tops of the poles lie on the same line, that is, b-a = c-b.\nDetermine whether the arrangement of the poles is beau... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "The Collatz conjecture (also known as 3n+1 conjecture) is a conjecture that applying the following algorithm to any number we will always eventually reach one:\n\n```\n[This is writen in pseudocode]\nif(number is even) number = number / 2\nif(number is odd) number = 3*number + ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Snuke has a favorite restaurant.\nThe price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer.\nSo far, Snuke has ordered N meals at the restaurant.\nLet the amount... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "It's the most hotly anticipated game of the school year - Gryffindor vs Slytherin! Write a function which returns the winning team. \n\nYou will be given two arrays with two values. \n\nThe first given value is the number of points scored by the team's Chasers and the second a ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "There is a 120 minute videotape with standard recording. When I set the VCR counter to 00:00:00 with the tape completely rewound and recorded in standard recording mode, I got a certain counter value. Enter this counter value (hours, minutes, seconds), find the length of the re... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Regular Tic-Tac-Toe is boring.\n\nThat's why in this Kata you will be playing Tic-Tac-Toe in **3D** using a 4 x 4 x 4 matrix!\n\n\n\n# Kata Task\n\nPlay the game. Work out who wins.\n\nReturn a string\n\n* `O wins after moves`\n* `X wins after moves`\n* `No winner`\n\n# Rule... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "You're given a sequence of N distinct integers. You need to find a subsequence of length K with the maximum possible median.\n\nThe median of a sequence is the value of the element which is in the middle of the sequence after sorting it in non-decreasing order. If the length of... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Clash of clans is a very popular game. Each player in the game is allocated a base with certain hit points the player can train a limited number of troops on the base. There are three types of troops: Barbarian, Archers and Giants. The Cost of training a Barbarian is 100, an Ar... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "There is a social networking site in which users can send friend request to other users and can also follow. Let's say if user A sends friend request to B and if B accepts then A and B are called as friends and if B rejects the request then just A will follow B.\n\nYou will be... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Recall that string $a$ is a subsequence of a string $b$ if $a$ can be obtained from $b$ by deletion of several (possibly zero or all) characters. For example, for the string $a$=\"wowwo\", the following strings are subsequences: \"wowwo\", \"wowo\", \"oo\", \"wow\", \"\", and o... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Arkady is playing Battleship. The rules of this game aren't really important.\n\nThere is a field of $n \\times n$ cells. There should be exactly one $k$-decker on the field, i. e. a ship that is $k$ cells long oriented either horizontally or vertically. However, Arkady doesn't... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Prof. M went to unknown world where words are considered to be powerful according to their weights. But Prof. M doesn't know how to calculate weight of words. He will tell you a word and you have to tell its weight. \nYou know that weight of a word is equal to sum weight of ind... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Young Mirko is a smart, but mischievous boy who often wanders around parks looking for new ideas. This time he’s come across pensioners playing the card game Belote. They’ve invited him to help them determine the total number of points in a game.\n\nEach card can be uniquely de... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "As the guys fried the radio station facilities, the school principal gave them tasks as a punishment. Dustin's task was to add comments to nginx configuration for school's website. The school has n servers. Each server has a name and an ip (names aren't necessarily unique, but ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "As usual, those who called wolves get together on 8 p.m. at the supermarket. The thing they want is only one, a box lunch that is labeled half price. Scrambling for a few discounted box lunch, they fiercely fight every day. And those who are blessed by hunger and appetite the b... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Misha decided to help Pasha and Akim be friends again. He had a cunning plan — to destroy all the laughy mushrooms. He knows that the laughy mushrooms can easily burst when they laugh. Mushrooms grow on the lawns. There are a[t] mushrooms on the t-th lawn.\n\nMisha knows that t... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "**Story** \nOn some island lives a chameleon population. Chameleons here can be of only one of three colors - red, green and blue. Whenever two chameleons of different colors meet, they can change their colors to a third one (i.e. when red and blue chameleons meet, they can bo... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "As a huge fan of the popular collectible card game Numinous Wilds: the Elven Reign Chronicles (NWERC), you have a large collection of cards which you carefully organise by their rarity. One day you notice that someone has touched your collection, and that some of the cards are ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "You have to create a function,named `insertMissingLetters`, that takes in a `string` and outputs the same string processed in a particular way.\n\nThe function should insert **only after the first occurrence** of each character of the input string, all the **alphabet letters** ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "When Valera has got some free time, he goes to the library to read some books. Today he's got t free minutes to read. That's why Valera took n books in the library and for each book he estimated the time he is going to need to read it. Let's number the books by integers from 1 ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "<image>\n\n\nMy grandmother uses a balance. The balance will balance if you place the same size on both of the two dishes, otherwise it will tilt to the heavier side. The weights of the 10 weights are 1g, 2g, 4g, 8g, 16g, 32g, 64g, 128g, 256g, 512g in order of lightness.\n\nMy ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "You are given an array a_1, a_2, ..., a_n. All a_i are pairwise distinct.\n\nLet's define function f(l, r) as follows: \n\n * let's define array b_1, b_2, ..., b_{r - l + 1}, where b_i = a_{l - 1 + i}; \n * sort array b in increasing order; \n * result of the function f(l, r... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "In 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\nThere are five means of transport in this empire:\n - Train: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n - Bus: travels from ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "You are given a line of $n$ colored squares in a row, numbered from $1$ to $n$ from left to right. The $i$-th square initially has the color $c_i$.\n\nLet's say, that two squares $i$ and $j$ belong to the same connected component if $c_i = c_j$, and $c_i = c_k$ for all $k$ sati... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Having gained some experience with Prime Numbers, Robin now seeks Revenge from Bruce. So, while they are on their way from the Airport to the Summit, Robin comes up with a new Prime based Puzzle for Bruce.\n\nHe asks him to find rad(n) for t numbers which he lists before Bruce ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Given a number X and another number Y . There are a total N cycles , and alternatively we perform operation on each number . In each cycle , we multiply the number by 2 . Starting with X .\nSuppose after all the N cycles, the number X has become W and number Y has become Z .... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Utkarsh is forced to play yet another one of Ashish's games. The game progresses turn by turn and as usual, Ashish moves first.\n\nConsider the 2D plane. There is a token which is initially at (0,0). In one move a player must increase either the x coordinate or the y coordinate... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Read problems statements in Russian here \nThe Head Chef has been playing with Fibonacci numbers for long . He has learnt several tricks related to Fibonacci numbers . Now he wants to test his chefs in the skills . \n \nA fibonacci number is defined by the recurrence :\n \nf(n)... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "You are given an array A of size N. The array contains almost distinct elements with some duplicated. You have to print the elements in sorted order which appears more than once. \nInput Format:\nThe first line of input contains T, denoting the number of testcases. T testcases ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "There are 3 problems in a contest namely A, B, C respectively. Alice bets Bob that problem C is the hardest while Bob says that problem B will be the hardest. \n\nYou are given three integers S_{A}, S_{B}, S_{C} which denotes the number of successful submissions of the problems... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Boboniu likes playing chess with his employees. As we know, no employee can beat the boss in the chess game, so Boboniu has never lost in any round.\n\nYou are a new applicant for his company. Boboniu will test you with the following chess question:\n\nConsider a $n\\times m$ g... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "One day Alice was cleaning up her basement when she noticed something very curious: an infinite set of wooden pieces! Each piece was made of five square tiles, with four tiles adjacent to the fifth center tile: [Image] By the pieces lay a large square wooden board. The board ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "A Little Elephant and his friends from the Zoo of Lviv like candies very much.\n\nThere are N elephants in the Zoo. The elephant with number K (1 ≤ K ≤ N) will be happy if he receives at least A_{K} candies. There are C candies in all in the Zoo.\n\nThe Zoo staff is interested ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Lily Aldrin, as the slap bet commissioner, needs to resolve issues regarding slap bets due with Barney and Marshall. She has mandated that there be a fixed period of time in which the slaps may be used.\n\nSo, she draws two lines representing the given two time slots, each of ... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Finally, \"Hayabusa2\" will be launched at the end of this month. When Hayabusa came back four years ago, I think many people remember the excitement all over Japan. Seven years ago, \"Kaguya\" was launched and sent many clear images to the earth while orbiting the moon.\n\n<im... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "The hero of justice, the Spider, can pull a rope out of his arm and jump from building to building. However, due to the short rope, you can only move to buildings that are less than 50 distances from you. To move to a building farther away, you have to jump to another building.... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Snuke loves permutations. He is making a permutation of length N.\n\nSince he hates the integer K, his permutation will satisfy the following:\n\n* Let the permutation be a_1, a_2, ..., a_N. For each i = 1,2,...,N, |a_i - i| \\neq K.\n\n\n\nAmong the N! permutations of length N... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Today DZY begins to play an old game. In this game, he is in a big maze with n rooms connected by m corridors (each corridor allows to move in both directions). You can assume that all the rooms are connected with corridors directly or indirectly.\n\nDZY has got lost in the maz... | null |
Coding | competitive-programming-python | cp_python_stdin | [
{
"role": "user",
"content": "Your mission in this problem is to write a computer program that manipulates molecular for- mulae in virtual chemistry. As in real chemistry, each molecular formula represents a molecule consisting of one or more atoms. However, it may not have chemical reality.\n\nThe followin... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.