data_source stringclasses 4
values | prompt listlengths 1 1 | ability stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
taco | [
{
"content": "Polycarp owns a shop in the capital of Berland. Recently the criminal activity in the capital increased, so Polycarp is thinking about establishing some better security in the storehouse of his shop.\n\nThe storehouse can be represented as a matrix with n rows and m columns. Each element of the ma... | code | {
"ground_truth": "{\"inputs\": [\"50 5\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxx.x\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\nx.xxx\\nxxxxx\\nxxxxx\\nxxxx... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "There is a weighted tree with n nodes and n-1 edges. The nodes are conveniently labeled from 1 to n. The weights are positive integers at most 100. Define the distance between two nodes to be the sum of edges on the unique path between the nodes. You would like to find the diameter of the tree. Di... | code | {
"ground_truth": "{\"inputs\": [\"2\\n5\\n9\\n6\\n10\\n9\\n10\\n2\\n99\\n\", \"2\\n5\\n1 2 3\\n2 3 4\\n2 4 5\\n4 5 1\\n2\\n1 2 99\\n\", \"2\\n5\\n1 3 3\\n2 3 4\\n2 4 5\\n4 5 1\\n2\\n1 2 99\\n\", \"2\\n5\\n9\\n12\\n10\\n9\\n10\\n2\\n99\\n\", \"2\\n5\\n17\\n12\\n10\\n9\\n10\\n2\\n99\\n\", \"2\\n5\\n1 3 4\\n2 3 4\\n2 4... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Given a rooted tree with n nodes. The Night King removes exactly one node from the tree and all the edges associated with it. Doing this splits the tree and forms a forest. The node which is removed is not a part of the forest.\n\nThe root of a tree in the forest is the node in that tree which doe... | code | {
"ground_truth": "{\"inputs\": [\"2\\n2 1\\n0 2\\n\", \"10\\n0 1\\n1 2\\n1 3\\n1 4\\n2 5\\n2 6\\n3 7\\n4 8\\n4 9\\n5 10\\n\", \"15\\n0 1\\n1 2\\n1 3\\n3 4\\n1 5\\n2 6\\n6 7\\n5 8\\n8 9\\n6 10\\n5 11\\n10 12\\n2 13\\n11 14\\n1 15\\n\", \"12\\n0 1\\n1 2\\n1 3\\n1 4\\n4 5\\n1 6\\n1 7\\n5 8\\n2 9\\n8 10\\n1 11\\n6 12\\n... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You are given a string s, consisting of lowercase Latin letters. While there is at least one character in the string s that is repeated at least twice, you perform the following operation: \n\n * you choose the index i (1 ≤ i ≤ |s|) such that the character at position i occurs at least two times ... | code | {
"ground_truth": "{\"inputs\": [\"6\\ncodeforces\\naezakmi\\nabacaba\\nconvexhull\\nswflldjgpaxs\\nmyneeocktxpqjpz\\n\", \"1\\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "There are N towns in a coordinate plane. Town i is located at coordinates (x_i, y_i). The distance between Town i and Town j is \\sqrt{\\left(x_i-x_j\\right)^2+\\left(y_i-y_j\\right)^2}.\nThere are N! possible paths to visit all of these towns once. Let the length of a path be the distance covered... | code | {
"ground_truth": "{\"inputs\": [\"3\\n0 0\\n1 0\\n0 1\\n\", \"2\\n-879 981\\n-866 890\\n\", \"8\\n-406 10\\n512 859\\n494 362\\n-955 -475\\n128 553\\n-986 -885\\n763 77\\n449 310\\n\", \"8\\n0 -656\\n0 -709\\n0 76\\n0 184\\n0 -985\\n0 -822\\n0 418\\n0 -247\\n\", \"8\\n898 1000\\n85 1000\\n980 1000\\n359 1000\\n-560 ... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Example\n\nInput\n\n2 2 2 0 0 0 5\n\n\nOutput\n\n1 3 3 1 0\n\nWrite Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "user"
}
] | code | {
"ground_truth": "{\"inputs\": [\"4 2 2 0 0 0 5\", \"4 2 2 0 0 0 10\", \"4 2 2 0 0 0 14\", \"4 2 2 0 0 0 6\", \"2 2 3 0 0 0 5\", \"4 2 3 0 0 0 14\", \"4 2 3 0 0 0 6\", \"4 2 2 1 0 0 10\", \"4 2 4 0 0 0 6\", \"2 2 3 0 0 0 3\", \"4 2 3 0 0 0 8\", \"4 2 3 0 0 1 6\", \"2 2 2 0 0 1 5\", \"2 2 2 1 0 0 10\", \"4 2 4 0 0 0 ... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "Mishka started participating in a programming contest. There are $n$ problems in the contest. Mishka's problem-solving skill is equal to $k$.\n\nMishka arranges all problems from the contest into a list. Because of his weird principles, Mishka only solves problems from one of the ends of the list.... | code | {
"ground_truth": "{\n \"inputs\": [\n \"8 4\\n4 2 3 1 5 1 6 4\\n\",\n \"5 2\\n3 1 2 1 3\\n\",\n \"5 100\\n12 34 55 43 21\\n\",\n \"100 100\\n44 47 36 83 76 94 86 69 31 2 22 77 37 51 10 19 25 78 53 25 1 29 48 95 35 53 22 72 49 86 60 38 13 91 89 18 54 19 71 2 25 33 65 49 53 5 95 90 100 68 25 5 87 48 45 72... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "The restaurant AtCoder serves the following five dishes:\n\n* ABC Don (rice bowl): takes A minutes to serve.\n* ARC Curry: takes B minutes to serve.\n* AGC Pasta: takes C minutes to serve.\n* APC Ramen: takes D minutes to serve.\n* ATC Hanbagu (hamburger patty): takes E minutes to serve.\n\n\n\nHe... | code | {
"ground_truth": "{\"inputs\": [\"123\\n123\\n123\\n123\\n123\", \"29\\n20\\n7\\n35\\n120\", \"101\\n86\\n119\\n108\\n57\", \"123\\n123\\n161\\n123\\n123\", \"29\\n20\\n13\\n35\\n120\", \"101\\n86\\n119\\n108\\n92\", \"123\\n123\\n161\\n123\\n163\", \"29\\n20\\n9\\n35\\n120\", \"101\\n86\\n119\\n125\\n92\", \"123\\n... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "The New Year holidays are over, but Resha doesn't want to throw away the New Year tree. He invited his best friends Kerim and Gural to help him to redecorate the New Year tree.\n\nThe New Year tree is an undirected tree with n vertices and root in the vertex 1.\n\nYou should process the queries of... | code | {
"ground_truth": "{\"inputs\": [\"7 10\\n1 1 1 1 1 1 1\\n1 2\\n1 3\\n1 4\\n3 5\\n3 6\\n3 7\\n1 3 2\\n2 1\\n1 4 3\\n2 1\\n1 2 5\\n2 1\\n1 6 4\\n2 1\\n2 2\\n2 3\\n\", \"23 30\\n1 2 2 6 5 3 2 1 1 1 2 4 5 3 4 4 3 3 3 3 3 4 6\\n1 2\\n1 3\\n1 4\\n2 5\\n2 6\\n3 7\\n3 8\\n4 9\\n4 10\\n4 11\\n6 12\\n6 13\\n7 14\\n7 15\\n7 16... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Write a program which reads a $n \\times m$ matrix $A$ and a $m \\times l$ matrix $B$, and prints their product, a $n \\times l$ matrix $C$. An element of matrix $C$ is obtained by the following formula:\n\n\\\\[ c_{ij} = \\sum_{k=1}^m a_{ik}b_{kj} \\\\]\n\nwhere $a_{ij}$, $b_{ij}$ and $c_{ij}$ ar... | code | {
"ground_truth": "{\"inputs\": [\"3 2 3\\n1 2\\n0 3\\n4 5\\n1 2 1\\n0 3 2\", \"3 2 3\\n1 2\\n0 3\\n4 5\\n1 2 1\\n1 3 2\", \"3 2 3\\n1 2\\n1 3\\n4 5\\n1 2 1\\n1 3 2\", \"3 2 3\\n1 2\\n2 3\\n4 5\\n1 2 1\\n1 3 2\", \"3 2 3\\n1 2\\n2 3\\n4 5\\n1 2 2\\n1 3 2\", \"3 2 3\\n1 2\\n3 3\\n4 5\\n1 2 2\\n1 3 2\", \"3 2 3\\n1 1\\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given a permutation $A = (a_1, a_2, \\dots , a_ N)$ of the integers $1, 2, \\dots , N$, we define the greedily increasing subsequence (GIS) in the following way.\n\nLet $g_1 = a_1$. For every $i > 1$, let $g_ i$ be the leftmost integer in $A$ that is strictly larger than $g_{i-1}$. If there for a ... | code | {
"ground_truth": "{\"inputs\": [\"7\\n2 3 1 5 4 7 6\\n\", \"5\\n1 2 3 4 5\\n\", \"5\\n5 4 3 2 1\\n\"], \"outputs\": [\"4\\n2 3 5 7\\n\", \"5\\n1 2 3 4 5\\n\", \"1\\n5\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codeforces | [
{
"content": "Title: Help Chef Gerasim\n\nTime Limit: 0 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nIn a far away kingdom young pages help to set the table for the King. As they are terribly mischievous, one needs to keep an eye on the control whether they have set everything correctly. This... | code | {
"ground_truth": "{\"inputs\": [\"5\\n270\\n250\\n250\\n230\\n250\", \"5\\n250\\n250\\n250\\n250\\n250\", \"5\\n270\\n250\\n249\\n230\\n250\", \"4\\n200\\n190\\n210\\n200\", \"4\\n1\\n2\\n3\\n4\", \"1\\n0\", \"2\\n0\\n0\", \"2\\n0\\n1\", \"2\\n0\\n2\", \"2\\n1\\n0\", \"2\\n1\\n1\", \"2\\n1\\n2\", \"2\\n2\\n0\", \"2\... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Consider a permutation p_1, p_2, ... p_n of integers from 1 to n. We call a sub-segment p_l, p_{l+1}, ..., p_{r-1}, p_{r} of the permutation an interval if it is a reordering of some set of consecutive integers. For example, the permutation (6,7,1,8,5,3,2,4) has the intervals (6,7), (5,3,2,4), (3,... | code | {
"ground_truth": "{\"inputs\": [\"4 998244353\\n1\\n4\\n5\\n9\\n\", \"1 437122297\\n20\\n\", \"9 386018153\\n1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n\", \"5 386018153\\n1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n\", \"5 386018153\\n1\\n2\\n3\\n4\\n6\\n6\\n7\\n8\\n9\\n\", \"5 386018153\\n1\\n2\\n3\\n1\\n6\\n6\\n7\\n8\\n9\\n\", ... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "There is a group of N friends who wish to enroll in a course together. The course has a maximum capacity of M students that can register for it. If there are K other students who have already enrolled in the course, determine if it will still be possible for all the N friends to do so or not.\n\n-... | code | {
"ground_truth": "{\"inputs\": [\"2\\n100 100 0\\n100 100 99\\n\"], \"outputs\": [\"Yes\\nNo\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You are given a sequence of integers a1, a2, ..., an. Let <image>, and <image> for 1 ≤ i < n. Here, <image> denotes the modulus operation. Find the maximum value of f(x, 1) over all nonnegative integers x. \n\nInput\n\nThe first line contains a single integer n (1 ≤ n ≤ 200000) — the length of the... | code | {
"ground_truth": "{\"inputs\": [\"5\\n5 4 3 2 1\\n\", \"4\\n5 10 5 10\\n\", \"2\\n10 5\\n\", \"10\\n857470351 127268738 976762190 700120990 190561544 955496074 185447813 550302189 543162371 132648585\\n\", \"50\\n4613788045939 2137011228504 1068505614252 534252807126 267126403563 133563201781 66781600890 33390800445... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "You are given array a with n elements and the number m. Consider some subsequence of a and the value of least common multiple (LCM) of its elements. Denote LCM as l. Find any longest subsequence of a with the value l ≤ m.\n\nA subsequence of a is an array we can get by erasing some elements of a. ... | code | {
"ground_truth": "{\n \"inputs\": [\n \"7 8\\n6 2 9 2 7 2 3\\n\",\n \"6 4\\n2 2 2 3 3 3\\n\",\n \"10 50\\n39 22 60 88 11 65 41 85 65 100\\n\",\n \"100 343\\n999 284 486 785 176 742 856 415 992 601 600 122 460 214 338 92 627 913 376 835 384 914 335 179 409 957 96 784 531 43 584 206 971 799 592 801 870 97... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Learn, learn and learn again — Valera has to do this every day. He is studying at mathematical school, where math is the main discipline. The mathematics teacher loves her discipline very much and tries to cultivate this love in children. That's why she always gives her students large and difficul... | code | {
"ground_truth": "{\"inputs\": [\"5\\n-4 2 0 5 0\\n\", \"3\\n-1 -2 -3\\n\", \"5\\n-1 10 -5 10 -2\\n\", \"4\\n-83 -87 42 -96\\n\", \"100\\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Your friend Rick is trying to send you a message, but he is concerned that it would get intercepted by his partner. He came up with a solution:\n\n1) Add digits in random places within the message.\n\n2) Split the resulting message in two. He wrote down every second character on one page, and the ... | code | {
"ground_truth": "{\"fn_name\": \"interweave\", \"inputs\": [[\"\", \"\"], [\"hlo\", \"el\"], [\"h3lo\", \"el4\"]], \"outputs\": [[\"\"], [\"hello\"], [\"hello\"]]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Jaggi and Jojo are interested in problems related with Grids. They were trying different problem on grids, when they found this one. Given a grid of size NXN. Its bottom-left point is (0,0) and top-right element is (N-1,N-1).\n\nWe can traverse the grid in either top or right direction. You have ... | code | {
"ground_truth": "{\"inputs\": [\"5\\n1000 5\\n4 6\\n8 9\\n15 20\\n40 44\\n50 55\\n1000 2\\n500 500\\n600 660\\n90 1\\n45 46\\n5 1\\n2 2\\n1000 0\"], \"outputs\": [\"991895746\\n675373970\\n517613418\\n36\\n965601742\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "The developers of Looksery have to write an efficient algorithm that detects faces on a picture. Unfortunately, they are currently busy preparing a contest for you, so you will have to do it for them. \n\nIn this problem an image is a rectangular table that consists of lowercase Latin letters. A f... | code | {
"ground_truth": "{\"inputs\": [\"4 2\\nxx\\ncf\\nae\\nxx\\n\", \"4 4\\nxxxx\\nxfax\\nxcex\\nxxxx\\n\", \"1 4\\nface\\n\", \"2 3\\nfac\\ncef\\n\", \"2 5\\nacdmw\\nefazb\\n\", \"5 5\\nacnbx\\nefacp\\nlrefa\\norqce\\nzvbay\\n\", \"5 5\\nbyjvu\\nkmaca\\nalefe\\nwcacg\\nrefez\\n\", \"5 5\\nkjxbw\\neacra\\nxefhx\\nucmcz\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "A test for allergy is conducted over the course of several days, and consists of exposing you to different substances (so called allergens). The goal is to decide exactly which of the allergens you are allergic to. Each allergen has a live duration $D$ measured in whole days, indicating exactly ho... | code | {
"ground_truth": "{\"inputs\": [\"3\\n2\\n2\\n2\\n\", \"5\\n1\\n4\\n2\\n5\\n2\\n\"], \"outputs\": [\"5\\n\", \"10\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "You are given a string s consisting of characters \"1\", \"0\", and \"?\". The first character of s is guaranteed to be \"1\". Let m be the number of characters in s.\n\nCount the number of ways we can choose a pair of integers a, b that satisfies the following: \n\n * 1 ≤ a < b < 2^m \n * When ... | code | {
"ground_truth": "{\"inputs\": [\"1000?1?001100011000010??01001?1110010010?110?01100\\n\", \"11011?10110?1?110?1?0?01011?1?11???100?0?110?1????\\n\", \"1001000100\\n\", \"1?1????1???101111?1??11?????1?1???0????1?0?????????1??01???1?111?1??11????11??111???11?????1?01??0?1??01?1?01???1?0???01100??10???1?1????1?????0?1... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Students Vasya and Petya are studying at the BSU (Byteland State University). At one of the breaks they decided to order a pizza. In this problem pizza is a circle of some radius. The pizza was delivered already cut into n pieces. The i-th piece is a sector of angle equal to ai. Vasya and Petya wa... | code | {
"ground_truth": "{\"inputs\": [\"4\\n170 30 150 10\\n\", \"3\\n100 100 160\\n\", \"4\\n90 90 90 90\\n\", \"1\\n360\\n\", \"4\\n70 80 110 100\\n\", \"8\\n10 10 70 70 90 90 10 10\\n\", \"5\\n211 113 25 9 2\\n\", \"9\\n40 20 20 20 20 20 20 40 160\\n\", \"130\\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Scott Lang is at war with Darren Cross. There are n chairs in a hall where they are, numbered with 1, 2, ..., n from left to right. The i-th chair is located at coordinate xi. Scott is on chair number s and Cross is on chair number e. Scott can jump to all other chairs (not only neighboring chairs... | code | {
"ground_truth": "{\"inputs\": [\"7 4 3\\n8 11 12 16 17 18 20\\n17 16 20 2 20 5 13\\n17 8 8 16 12 15 13\\n12 4 16 4 15 7 6\\n8 14 2 11 17 12 8\\n\", \"3 1 3\\n140847557 466570047 534914399\\n93013372 106184897 87868332\\n798881865 348785541 412639907\\n541420868 474507814 209232335\\n35025208 96472847 130874791\\n\"... | {
"index": 0,
"split": "dummy"
} |
codeforces | [
{
"content": "Title: Energy exchange\n\nTime Limit: 2 seconds\n\nMemory Limit: 256 megabytes\n\nProblem Description:\nIt is well known that the planet suffers from the energy crisis. Little Petya doesn't like that and wants to save the world. For this purpose he needs every accumulator to contain the same amoun... | code | {
"ground_truth": "{\"inputs\": [\"3 50\\n4 2 1\", \"2 90\\n1 11\", \"5 26\\n42 65 23 43 64\", \"5 45\\n964 515 454 623 594\", \"1 20\\n784\", \"10 20\\n812 896 36 596 709 641 679 778 738 302\", \"10 83\\n689 759 779 927 15 231 976 943 604 917\", \"11 1\\n235 280 196 670 495 379 391 280 847 875 506\", \"12 71\\n472 1... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Ichiro likes baseball and has decided to write a program which simulates baseball.\n\nThe program reads events in an inning and prints score in that inning. There are only three events as follows:\n\nSingle hit\n\n* put a runner on the first base.\n* the runner in the first base advances to the se... | code | {
"ground_truth": "{\"inputs\": [\"2\\nHIT\\nOUT\\nHOMERUN\\nHIT\\nHIT\\nHOMERUN\\nHIT\\nOUT\\nHIT\\nHIT\\nHIT\\nHIT\\nOUT\\nHIT\\nHIT\\nOUT\\nHIT\\nOUT\\nOUT\"], \"outputs\": [\"7\\n0\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Paul hates palindromes. He assumes that string s is tolerable if each its character is one of the first p letters of the English alphabet and s doesn't contain any palindrome contiguous substring of length 2 or more.\n\nPaul has found a tolerable string s of length n. Help him find the lexicograph... | code | {
"ground_truth": "{\"inputs\": [\"3 3\\ncba\\n\", \"3 4\\ncba\\n\", \"4 4\\nabcd\\n\", \"2 2\\nab\\n\", \"2 2\\nba\\n\", \"1 2\\na\\n\", \"1 2\\nb\\n\", \"1 1\\na\\n\", \"3 4\\ncdb\\n\", \"7 26\\nzyxzyxz\\n\", \"10 5\\nabcabcabca\\n\", \"10 10\\nfajegfaicb\\n\", \"1 26\\no\\n\", \"1 2\\nb\\n\", \"1 26\\nz\\n\", \"3 ... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "The time on the planet Lapituletti goes the same way it goes on Earth but a day lasts h hours and each hour lasts m minutes. The inhabitants of that planet use digital clocks similar to earth ones. Clocks display time in a format HH:MM (the number of hours in decimal is displayed first, then (afte... | code | {
"ground_truth": "{\"inputs\": [\"5\\n24 60\\n12:21\\n24 60\\n23:59\\n90 80\\n52:26\\n1 100\\n00:01\\n10 10\\n04:04\\n\", \"15\\n1 1\\n00:00\\n1 100\\n00:01\\n100 100\\n02:82\\n10 10\\n04:04\\n100 100\\n99:00\\n100 2\\n30:00\\n50 3\\n30:00\\n51 3\\n30:01\\n52 16\\n21:12\\n100 20\\n20:07\\n23 100\\n21:45\\n11 11\\n02... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "Door's family is going celebrate Famil Doors's birthday party. They love Famil Door so they are planning to make his birthday cake weird!\n\nThe cake is a n × n square consisting of equal squares with side length 1. Each square is either empty or consists of a single chocolate. They bought the cak... | code | {
"ground_truth": "{\n \"inputs\": [\n \"3\\n.CC\\nC..\\nC.C\\n\",\n \"4\\nCC..\\nC..C\\n.CC.\\n.CC.\\n\",\n \"5\\n.CCCC\\nCCCCC\\n.CCC.\\nCC...\\n.CC.C\\n\",\n \"6\\nC.CC.C\\n..C..C\\nC..C.C\\n.CCC.C\\nCC....\\nCC....\\n\",\n \"7\\n.CC..CC\\nCC.C..C\\nC.C..C.\\nC...C.C\\nCCC.CCC\\n.CC...C\\n.C.CCC.\\... | {
"index": 0,
"split": "dummy"
} |
codeforces | [
{
"content": "Title: Making Sequences is Fun\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nWe'll define *S*(*n*) for positive integer *n* as follows: the number of the *n*'s digits in the decimal base. For example, *S*(893)<==<=3, *S*(114514)<==<=6.\n\nYou want to make a c... | code | {
"ground_truth": "{\"inputs\": [\"9 1 1\", \"77 7 7\", \"114 5 14\", \"1 1 2\", \"462 183 8\", \"462 183 8\", \"462 183 8\", \"462 183 8\", \"462 183 8\", \"462 183 8\", \"462 183 8\", \"10000000000000000 1 1\", \"2155990066796462 2710473050636183 563261158\", \"552719169048748 7822730034794389 374302919\", \"689578... | {
"index": 0,
"split": "dummy"
} |
codeforces | [
{
"content": "Title: Football Kit\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nConsider a football tournament where *n* teams participate. Each team has two football kits: for home games, and for away games. The kit for home games of the *i*-th team has color *x**i* and t... | code | {
"ground_truth": "{\"inputs\": [\"2\\n1 2\\n2 1\", \"3\\n1 2\\n2 1\\n1 3\", \"2\\n1 2\\n1 2\", \"2\\n1 2\\n3 4\", \"3\\n1 100000\\n1 100000\\n100000 2\", \"5\\n3 2\\n3 4\\n2 5\\n3 2\\n4 3\", \"6\\n2 3\\n2 1\\n2 1\\n3 2\\n3 2\\n3 1\", \"10\\n2 1\\n1 3\\n4 1\\n2 3\\n4 1\\n1 4\\n2 4\\n2 1\\n2 3\\n3 4\", \"30\\n1 10\\n1... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Problem description :\nThe fight between Raghu and Rannvijay is becoming more intense.This time Rannvijay asked Raghu a question.\nHe gives him a number N and asked him to find the number of all pairs (a, b) of positive integers such that\n1 <= a < b <= N and the sum a + b divides the product a * ... | code | {
"ground_truth": "{\"inputs\": [\"2\\n2\\n15\", \"2\\n3\\n15\", \"2\\n3\\n29\", \"2\\n3\\n14\", \"2\\n1\\n11\", \"2\\n1\\n2\", \"2\\n6\\n2\", \"2\\n16\\n1\", \"2\\n32\\n0\", \"2\\n61\\n0\", \"2\\n85\\n1\", \"2\\n116\\n3\", \"2\\n116\\n6\", \"2\\n156\\n6\", \"2\\n234\\n6\", \"2\\n234\\n20\", \"2\\n65\\n20\", \"2\\n74... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Sorting arrays is traditionally associated with high-level languages. How hard can it be in Befunge? Sort the given array in non-descending order.\n\nInput\n\nThe first line of input contains an integer n (1 ≤ n ≤ 100) — the size of the array. The following n lines contain the elements of the arra... | code | {
"ground_truth": "{\"inputs\": [\"5\\n7\\n1\\n9\\n7\\n3\\n\", \"10\\n60\\n1\\n60\\n1\\n60\\n1\\n60\\n1\\n60\\n1\\n\"], \"outputs\": [\"1 3 7 7 9 \\n\", \"1 1 1 1 1 60 60 60 60 60 \\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "A policeman wants to catch a thief. Both the policeman and the thief can only move on a line on integer coordinates between $0$ and $N$ (inclusive).\nInitially, the policeman is at a coordinate $x$ and the thief is at a coordinate $y$. During each second, each of them must move to the left or righ... | code | {
"ground_truth": "{\"inputs\": [\"5\\n3 5 1 10\\n4 1 2 10\\n2 7 3 10\\n6 9 3 20\\n5 8 1 10\\n\", \"1\\n1 9 2 10\\n\", \"1\\n2 8 3 10\\n\", \"2\\n1 5 2 10\\n2 6 2 10\\n\", \"1\\n500000000 1000000000 500000000 1000000000\\n\", \"1\\n0 1000000000 500000000 1000000000\\n\", \"1\\n0 1000000000 1000000000 1000000000\\n\",... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Vicky, the Artist, had two lists A and B, such that B was a permutation of A. Vicky was very proud of these lists. Unfortunately, while transporting them from one exhibition to another, some numbers were left out of A. Can you find the missing numbers?\nIf a number occurs multiple times in the lis... | code | {
"ground_truth": "{\"inputs\": [\"10\\n203 204 205 206 207 208 203 204 205 206\\n13\\n203 204 204 205 206 207 205 208 203 206 205 206 204\\n\\nSAMPLE\", \"10\\n203 204 205 206 207 208 203 204 205 206\\n13\\n203 204 204 205 206 207 205 208 203 206 205 206 204\\n\\nRAMPLE\", \"10\\n203 204 205 206 207 208 203 204 205 ... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Chandu and Kundu are bored of dramatic games around. As they are very good friends and scholars they decided to discover a new game. \nIn total they had N number of marbles with value inscribed on each of them from 1 to N. \nChandu being from royal family has a treasure box. He emptied the box fo... | code | {
"ground_truth": "{\"inputs\": [\"85\\n25 43 35 23 9 3 38 28 29 1 7 18 36 37 12 32 5 41 17 13 19 26 14 8 10 16 21 33 11 39 2 27 15 40 30 22 20 34 31 42 4 6 24\\n75\\n16 23 42 8 2 27 24 5 17 19 20 28 38 30 21 4 43 44 34 31 12 35 39 22 11 7 6 45 14 32 9 15 36 10 26 29 33 40 37 41 13 1 18 25 3\\n54\\n11 9 21 38 42 24 2... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "Alice, Bob and Charlie are playing Card Game for Three, as below:\n - At first, each of the three players has a deck consisting of some number of cards. Each card has a letter a, b or c written on it. The orders of the cards in the decks cannot be rearranged.\n - The players take turns. Alice goes... | code | {
"ground_truth": "{\"inputs\": [\"aca\\naccc\\nca\\n\", \"abcb\\naacb\\nbccc\\n\"], \"outputs\": [\"A\\n\", \"C\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "In this problem we are concerned with words constructed using the lowercase letters of the English alphabet - that is, a,b,c,…,z. These words need not necessarily be meaningful: any sequence of letters forms a word. For example, abbca is a word.\nWe say that we can \"hop\" from the word $w_1$ to t... | code | {
"ground_truth": "{\"inputs\": [\"5\\nabcde\\nabc\\nab\\na\\nbcdef\\n\", \"4\\nab\\nbc\\ncd\\nde\\n\"], \"outputs\": [\"3\", \"1\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Sereja has painted n distinct points on the plane. The coordinates of each point are integers. Now he is wondering: how many squares are there with sides parallel to the coordinate axes and with points painted in all its four vertexes? Help him, calculate this number.\n\nInput\n\nThe first line co... | code | {
"ground_truth": "{\"inputs\": [\"81\\n9 4\\n6 8\\n6 4\\n4 6\\n4 8\\n9 10\\n0 2\\n5 4\\n8 9\\n7 7\\n10 5\\n4 4\\n7 8\\n3 7\\n2 1\\n5 5\\n2 7\\n8 6\\n2 8\\n10 7\\n5 8\\n0 10\\n10 0\\n4 9\\n4 2\\n10 3\\n6 6\\n3 8\\n5 3\\n8 8\\n10 9\\n1 1\\n0 9\\n8 1\\n1 8\\n0 7\\n10 4\\n3 6\\n7 6\\n1 9\\n8 3\\n8 10\\n4 5\\n3 4\\n7 5\\... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "One tradition of welcoming the New Year is launching fireworks into the sky. Usually a launched firework flies vertically upward for some period of time, then explodes, splitting into several parts flying in different directions. Sometimes those parts also explode after some period of time, splitt... | code | {
"ground_truth": "{\"inputs\": [\"6\\n1 1 1 1 1 3\\n\", \"1\\n3\\n\", \"4\\n4 2 2 3\\n\", \"30\\n4 1 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5\\n\", \"4\\n4 2 4 1\\n\", \"30\\n1 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5\\n\", \"30\\n2 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 ... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Imagine a city with n junctions and m streets. Junctions are numbered from 1 to n.\n\nIn order to increase the traffic flow, mayor of the city has decided to make each street one-way. This means in the street between junctions u and v, the traffic moves only from u to v or only from v to u. \n\nTh... | code | {
"ground_truth": "{\"inputs\": [\"5 4\\n1 2\\n1 3\\n1 4\\n1 5\\n\", \"2 1\\n1 2\\n\", \"4 5\\n1 2\\n2 3\\n3 4\\n4 1\\n1 3\\n\", \"6 7\\n1 2\\n2 3\\n1 3\\n1 4\\n4 5\\n5 6\\n6 4\\n\", \"50 49\\n5 21\\n11 48\\n14 2\\n9 24\\n9 32\\n1 24\\n38 3\\n1 19\\n6 24\\n17 25\\n46 36\\n3 18\\n15 33\\n45 24\\n36 24\\n7 30\\n40 24\\... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Yaroslav is playing a game called \"Time\". The game has a timer showing the lifespan he's got left. As soon as the timer shows 0, Yaroslav's character dies and the game ends. Also, the game has n clock stations, station number i is at point (xi, yi) of the plane. As the player visits station numb... | code | {
"ground_truth": "{\"inputs\": [\"3 1000\\n1000\\n0 0\\n0 1\\n0 3\\n\", \"3 1000\\n1000\\n1 0\\n1 1\\n1 2\\n\", \"11 1199\\n282 735 54 1000 419 939 901 789 128\\n10 -81\\n26 72\\n19 -91\\n-61 85\\n0 -33\\n-62 79\\n-59 65\\n-2 -77\\n-63 100\\n-15 53\\n94 54\\n\", \"8 1931\\n440 627 324 538 539 119\\n-85 -41\\n-91 61\... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "A young boy John is playing with eight triangular panels. These panels are all regular triangles of the same size, each painted in a single color; John is forming various octahedra with them.\n\nWhile he enjoys his playing, his father is wondering how many octahedra can be made of these panels sin... | code | {
"ground_truth": "{\"inputs\": [\"blue blue blue blue blue blue blue blue\\nred blue blue blue blue blue blue blue\\nred red blue blue blue blue blue blue\", \"blue blue blue blue bluf blue blue blue\\nred blue blue blue blue blue blue blue\\nred red blue blue blue blue blue blue\", \"blue blue blue blue bluf clue b... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Suppose we have an n-dimensional supercomputer with an infinite number of processors. Every processor has a vector of $n$ integers as its (n-dimensional) coordinates and can be thought of as a point in the $n$-dimensional space. Furthermore, at every $n$-dimensional lattice point, there is a proce... | code | {
"ground_truth": "{\"inputs\": [\"5\\n2 0\\n2 1\\n2 2\\n3 1\\n1 10\\n\"], \"outputs\": [\"1\\n5\\n13\\n7\\n21\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Everyone knows the famous detective Sherlock. He has been handed over a new case of \"The Abominable Bride\". Each night she kills N people but to irritate \nSherlock she leaves exactly one people. The way she kills the people is somewhat strange. She makes 1 to N people stand in a line and starts... | code | {
"ground_truth": "{\"inputs\": [\"5\\n2\\n4\\n6\\n9\\n12\"], \"outputs\": [\"2\\n4\\n4\\n2\\n8\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Mahmoud and Ehab are on the third stage of their adventures now. As you know, Dr. Evil likes sets. This time he won't show them any set from his large collection, but will ask them to create a new set to replenish his beautiful collection of sets.\n\nDr. Evil has his favorite evil integer x. He as... | code | {
"ground_truth": "{\"inputs\": [\"3 6\\n\", \"5 5\\n\", \"3 3\\n\", \"3 10203\\n\", \"4 2\\n\", \"5 9\\n\", \"1 0\\n\", \"3 0\\n\", \"3 1\\n\", \"3 4\\n\", \"5 5\\n\", \"2 3\\n\", \"10 2\\n\", \"1 1\\n\", \"3 2\\n\", \"4 0\\n\", \"5 2\\n\", \"5 6\\n\", \"4 3\\n\", \"3 6\\n\", \"5 3\\n\", \"32 32\\n\", \"5 1\\n\", \"... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Kana was just an ordinary high school girl before a talent scout discovered her. Then, she became an idol. But different from the stereotype, she is also a gameholic. \n\nOne day Kana gets interested in a new adventure game called Dragon Quest. In this game, her quest is to beat a dragon.\n\n<imag... | code | {
"ground_truth": "{\"inputs\": [\"7\\n100 3 4\\n189 3 4\\n64 2 3\\n63 2 3\\n30 27 7\\n10 9 1\\n69117 21 2\\n\", \"1\\n1 0 0\\n\", \"5\\n1 30 0\\n1 0 0\\n100000 30 30\\n10 1 1\\n8 30 1\\n\", \"1\\n21 1 2\\n\", \"1\\n1 0 1\\n\", \"5\\n1 30 0\\n1 0 0\\n100000 30 20\\n10 1 1\\n8 30 1\\n\", \"7\\n100 3 2\\n189 3 4\\n64 2... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "There are A slimes lining up in a row. Initially, the sizes of the slimes are all 1.\n\nSnuke can repeatedly perform the following operation.\n\n* Choose a positive even number M. Then, select M consecutive slimes and form M / 2 pairs from those slimes as follows: pair the 1-st and 2-nd of them fr... | code | {
"ground_truth": "{\"inputs\": [\"10\\n3 1 4 1 5 9 2 6 5 3\", \"4\\n2 1 2 2\", \"1\\n1\", \"2\\n3 3\", \"4\\n2 1 2 4\", \"1\\n2\", \"2\\n11 3\", \"2\\n3 1\", \"2\\n18 1\", \"10\\n3 1 1 1 5 9 2 6 5 3\", \"2\\n51 1\", \"10\\n3 1 1 1 5 9 2 11 5 3\", \"2\\n1 1\", \"2\\n72 2\", \"10\\n3 1 1 2 6 9 2 10 3 3\", \"10\\n3 1 1... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Every school morning Mirko is woken up by the sound of his alarm clock. Since he is a bit forgetful, quite often he leaves the alarm on on Saturday morning too. That’s not too bad though, since he feels good when he realizes he doesn’t have to get up from his warm and cozy bed.\n\nHe likes that so... | code | {
"ground_truth": "{\"inputs\": [\"10 10\\n\", \"0 30\\n\", \"23 40\\n\"], \"outputs\": [\"9 25\\n\", \"23 45\\n\", \"22 55\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Vasya is reading a e-book. The file of the book consists of $n$ pages, numbered from $1$ to $n$. The screen is currently displaying the contents of page $x$, and Vasya wants to read the page $y$. There are two buttons on the book which allow Vasya to scroll $d$ pages forwards or backwards (but he ... | code | {
"ground_truth": "{\"inputs\": [\"3\\n10 4 5 2\\n5 1 3 4\\n20 4 19 3\\n\", \"1\\n12345 1 1 2\\n\", \"1\\n999999999 3 4 5\\n\", \"1\\n400000001 2 200000001 2\\n\", \"1\\n1000000000 3 1000000000 2\\n\", \"1\\n1000000000 2 89 5\\n\", \"1\\n1000000000 5 999999999 1\\n\", \"5\\n20 10 2 9\\n1000000000 2 89 4\\n1000000000 ... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "Eleven wants to choose a new name for herself. As a bunch of geeks, her friends suggested an algorithm to choose a name for her. Eleven wants her name to have exactly n characters. [Image] \n\nHer friend suggested that her name should only consist of uppercase and lowercase letters 'O'. More prec... | code | {
"ground_truth": "{\"inputs\": [\"8\\n\", \"15\\n\", \"85\\n\", \"381\\n\", \"1\\n\", \"2\\n\", \"3\\n\", \"5\\n\", \"17\\n\", \"49\\n\", \"256\\n\", \"61\\n\"], \"outputs\": [\"OOOoOooO\\n\", \"OOOoOooOooooOoo\\n\", \"OOOoOooOooooOoooooooOooooooooooooOooooooooooooooooooooOoooooooooooooooooooooooooooooo\\n\", \"OOOo... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Your task is to calculate sum of primes present as digits of given number N.\nExample 1:\nInput: 333\nOutput: 9\nExplaination: 3 is a prime number. It \nis present 3 times. So 3+3+3 = 9.\nExample 2:\nInput: 686\nOutput: 0\nExplaination: Neither 6 nor 8 is a \nprime number.\nYour Task:\nYou do not... | code | {
"ground_truth": "{\"fn_name\": \"primeSum\", \"inputs\": [[222], [56], [849], [22282], [578], [1], [2], [0], [11111], [9876543210], [29375029375029375], [99999999999999999]], \"outputs\": [[6], [5], [0], [8], [12], [0], [2], [0], [0], [17], [51], [0]]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "You are given a string s of length n, consisting of first k lowercase English letters.\n\nWe define a c-repeat of some string q as a string, consisting of c copies of the string q. For example, string \"acbacbacbacb\" is a 4-repeat of the string \"acb\".\n\nLet's say that string a contains string ... | code | {
"ground_truth": "{\"inputs\": [\"5 5 3\\ncbcab\\n1 2 4 b\\n2 cab\\n2 bca\\n1 2 3 a\\n1 2 2 c\\n\", \"10 20 5\\nebbbcebbea\\n1 5 9 a\\n1 1 2 b\\n2 abdce\\n2 edacb\\n2 ebdca\\n2 cdbae\\n1 4 9 d\\n1 1 3 b\\n1 4 9 e\\n1 5 9 b\\n2 cbeda\\n1 10 10 c\\n1 6 9 a\\n1 3 4 c\\n1 2 3 b\\n2 aebdc\\n1 3 9 c\\n1 2 4 b\\n1 3 8 b\\n... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You are given n integers a_1, a_2, ..., a_n, where n is odd. You are allowed to flip the sign of some (possibly all or none) of them. You wish to perform these flips in such a way that the following conditions hold:\n\n 1. At least (n - 1)/(2) of the adjacent differences a_{i + 1} - a_i for i = 1... | code | {
"ground_truth": "{\"inputs\": [\"5\\n3\\n-2 4 3\\n5\\n1 1 1 1 1\\n5\\n-2 4 7 -6 4\\n9\\n9 7 -4 -2 1 -3 9 -4 -5\\n9\\n-4 1 9 4 8 9 5 1 -9\\n\", \"5\\n3\\n-2 4 3\\n5\\n1 1 1 1 1\\n5\\n-2 4 7 -6 4\\n9\\n9 7 -4 -2 2 -3 9 -4 -5\\n9\\n-4 1 9 4 8 9 5 1 -9\\n\", \"5\\n3\\n-2 4 3\\n5\\n1 1 1 1 1\\n5\\n-2 4 7 -6 4\\n9\\n9 7 ... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.\n\nThe current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?\n\nConstraints\n\n* -40 \\leq X \\leq 40\n* X is an integer.\n\nInput\n\nInput is giv... | code | {
"ground_truth": "{\"inputs\": [\"25\", \"30\", \"20\", \"44\", \"37\", \"78\", \"47\", \"91\", \"61\", \"26\", \"35\", \"23\", \"48\", \"21\", \"3\", \"1\", \"5\", \"0\", \"6\", \"2\", \"-1\", \"-2\", \"-3\", \"-4\", \"-6\", \"-7\", \"-11\", \"-5\", \"-10\", \"4\", \"-13\", \"-9\", \"-16\", \"-12\", \"-8\", \"8\", ... | {
"index": 0,
"split": "dummy"
} |
codeforces | [
{
"content": "Title: Ratings and Reality Shows\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThere are two main kinds of events in the life of top-model: fashion shows and photo shoots. Participating in any of these events affects the rating of appropriate top-model. After... | code | {
"ground_truth": "{\"inputs\": [\"5 1 1 1 4 0 5\\n1 1\\n2 1\\n3 1\\n4 0\\n5 0\", \"1 1 2 1 2 1 2\\n1 0\", \"10 1 1 1 2 0 10\\n1 1\\n2 1\\n3 0\\n4 0\\n5 1\\n6 1\\n7 1\\n8 1\\n9 1\\n10 1\"], \"outputs\": [\"6\", \"-1\", \"5\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Example\n\nInput\n\n3 1 0 1\n\n\nOutput\n\n18\n\nWrite Python code to solve the problem. Present the code in \n```python\nYour code\n```\nat the end.",
"role": "user"
}
] | code | {
"ground_truth": "{\"inputs\": [\"3 2 0 1\", \"1 2 0 1\", \"2 0 0 1\", \"2 1 0 1\", \"3 1 1 2\", \"3 -1 0 2\", \"3 -1 1 2\", \"5 0 -1 2\", \"4 0 1 3\", \"7 0 -1 2\", \"2 0 0 0\", \"8 0 -1 2\", \"6 2 -1 3\", \"6 2 0 3\", \"4 1 0 2\", \"6 -1 1 2\", \"6 2 1 3\", \"7 -1 1 2\", \"4 1 -1 -2\", \"11 2 1 3\", \"7 -1 2 2\", ... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Panic is rising in the committee for doggo standardization — the puppies of the new brood have been born multi-colored! In total there are 26 possible colors of puppies in the nature and they are denoted by letters from 'a' to 'z' inclusive.\n\nThe committee rules strictly prohibit even the smalle... | code | {
"ground_truth": "{\"inputs\": [\"6\\naabddc\\n\", \"3\\nabc\\n\", \"3\\njjj\\n\", \"4\\nabcc\\n\", \"6\\nabcdee\\n\", \"3\\nzza\\n\", \"3\\ngcw\\n\", \"27\\nabcdefghijklmnopqrstuvwxyza\\n\", \"27\\nmnpsweykjdvaxyiqtgcuzhbfrlo\\n\", \"5\\naabcd\\n\", \"2\\nba\\n\", \"7\\nkssssss\\n\", \"1\\ne\\n\", \"5\\nfnfvn\\n\",... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "A has a string consisting of some number of lowercase English letters 'a'. He gives it to his friend B who appends some number of letters 'b' to the end of this string. Since both A and B like the characters 'a' and 'b', they have made sure that at this point, at least one 'a' and one 'b' exist in... | code | {
"ground_truth": "{\n \"inputs\": [\n \"aaabccc\\n\",\n \"bbacc\\n\",\n \"aabc\\n\",\n \"aabbcc\\n\",\n \"aaacccbb\\n\",\n \"abc\\n\",\n \"acba\\n\",\n \"bbabbc\\n\",\n \"bbbabacca\\n\",\n \"aabcbcaca\\n\",\n \"aaaaabbbbbb\\n\",\n \"c\\n\",\n \"cc\\n\",\n \"bbb\\n\",\n \... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "Max wants to buy a new skateboard. He has calculated the amount of money that is needed to buy a new skateboard. He left a calculator on the floor and went to ask some money from his parents. Meanwhile his little brother Yusuf came and started to press the keys randomly. Unfortunately Max has forg... | code | {
"ground_truth": "{\n \"inputs\": [\n \"124\\n\",\n \"04\\n\",\n \"5810438174\\n\",\n \"1\\n\",\n \"039\\n\",\n \"97247\\n\",\n \"5810438174\\n\",\n \"12883340691714056185860211260984431382156326935244\\n\",\n \"21443152535720202791080929111600723284965686655458368252776163634787219463981... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Problem\n\nN people with IDs from 1 to N are about to sit in N-legged chairs with numbers from 1 to N. The person with ID i wants to sit in the chair pi.\n\nN people are lined up in a row in ascending order of ID, and the first person in the row takes the following actions.\n\n1. If no one is sitt... | code | {
"ground_truth": "{\"inputs\": [\"5\\n3 3 4 4 5\", \"5\\n1 2 3 4 5\", \"5\\n2 2 3 4 5\", \"5\\n2 2 1 4 5\", \"5\\n3 2 1 4 5\", \"5\\n3 4 1 4 5\", \"5\\n1 4 3 4 5\", \"5\\n4 2 1 4 5\", \"5\\n3 4 1 5 5\", \"5\\n1 4 4 4 5\", \"5\\n4 2 1 4 2\", \"5\\n1 4 4 5 5\", \"5\\n5 2 1 4 2\", \"5\\n2 2 5 4 5\", \"5\\n5 4 1 4 5\", ... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "Little X has n distinct integers: p_1, p_2, ..., p_{n}. He wants to divide all of them into two sets A and B. The following two conditions must be satisfied: If number x belongs to set A, then number a - x must also belong to set A. If number x belongs to set B, then number b - x must also belon... | code | {
"ground_truth": "{\n \"inputs\": [\n \"4 5 9\\n2 3 4 5\\n\",\n \"3 3 4\\n1 2 4\\n\",\n \"100 8883 915\\n1599 4666 663 3646 754 2113 2200 3884 4082 1640 3795 2564 2711 2766 1122 4525 1779 2678 2816 2182 1028 2337 4918 1273 4141 217 2682 1756 309 4744 915 1351 3302 1367 3046 4032 4503 711 2860 890 2443 4819... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You are given a tree with n nodes. You have to write non-negative integers on its edges so that the following condition would be satisfied:\n\nFor every two nodes i, j, look at the path between them and count the sum of numbers on the edges of this path. Write all obtained sums on the blackboard. ... | code | {
"ground_truth": "{\"inputs\": [\"4\\n2 4\\n2 3\\n2 1\\n\", \"3\\n2 3\\n2 1\\n\", \"5\\n1 2\\n1 3\\n1 4\\n2 5\\n\", \"43\\n7 29\\n19 18\\n32 4\\n39 40\\n21 11\\n34 28\\n30 23\\n13 19\\n33 39\\n13 35\\n37 21\\n29 8\\n40 1\\n7 9\\n8 38\\n7 31\\n8 12\\n7 42\\n33 20\\n5 36\\n17 32\\n30 43\\n39 34\\n40 3\\n8 24\\n13 37\\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given a non-negative number N in the form of string. The task is to apply at most one swap operation on the number N so that the result is just a previous possible number.\nNote: Leading zeros are not allowed.\n \nExample 1:\nInput :\nS = \"12435\"\nOutput: \n12345\nExplanation:\nAlthough the num... | code | {
"ground_truth": "{\"fn_name\": \"previousNumber\", \"inputs\": [[\"123456\"], [\"9876543210\"], [\"132\"], [\"9871\"], [\"54321\"], [\"10\"], [\"21\"], [\"11\"], [\"111111\"], [\"22\"], [\"1234567890123456789012345678901234567890\"], [\"9876543210987654321098765432109876543210\"]], \"outputs\": [[-1], [\"9876543201... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "The famous global economic crisis is approaching rapidly, so the states of Berman, Berance and Bertaly formed an alliance and allowed the residents of all member states to freely pass through the territory of any of them. In addition, it was decided that a road between the states should be built t... | code | {
"ground_truth": "{\n \"inputs\": [\n \"4 5\\n11..2\\n#..22\\n#.323\\n.#333\\n\",\n \"1 5\\n1#2#3\\n\",\n \"3 4\\n.2..\\n...3\\n.1#.\\n\",\n \"10 10\\n##.#..#.#2\\n...###....\\n#..#....##\\n.....#....\\n.#........\\n.....#####\\n...#..#...\\n....###...\\n###.##...#\\n.#...1#.3.\\n\",\n \"4 3\\n..#\\n... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Petya has recently learned data structure named \"Binary heap\".\n\nThe heap he is now operating with allows the following operations: put the given number into the heap; get the value of the minimum element in the heap; extract the minimum element from the heap; \n\nThus, at any moment of tim... | code | {
"ground_truth": "{\"inputs\": [\"2\\ninsert 3\\ngetMin 4\\n\", \"4\\ninsert 1\\ninsert 1\\nremoveMin\\ngetMin 2\\n\", \"1\\ninsert 1\\n\", \"1\\ngetMin 31\\n\", \"1\\nremoveMin\\n\", \"2\\ninsert 2\\ngetMin 2\\n\", \"2\\ninsert 31\\nremoveMin\\n\", \"2\\ngetMin 31\\nremoveMin\\n\", \"2\\nremoveMin\\ngetMin 31\\n\",... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Naman has two binary strings s and t of length n (a binary string is a string which only consists of the characters \"0\" and \"1\"). He wants to convert s into t using the following operation as few times as possible.\n\nIn one operation, he can choose any subsequence of s and rotate it clockwise... | code | {
"ground_truth": "{\"inputs\": [\"10\\n1111100000\\n1111100001\\n\", \"6\\n010000\\n000001\\n\", \"10\\n1111100000\\n0000011111\\n\", \"8\\n10101010\\n01010101\\n\", \"10\\n1010111110\\n1011101101\\n\", \"12\\n011001010101\\n111001010101\\n\", \"10\\n1100000100\\n0010000011\\n\", \"10\\n0111101111\\n0111111110\\n\",... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "A frog is about to return to the burrow. The burrow is D centimeters ahead of the frog, and the frog goes straight toward the burrow. There are only two actions that a frog can do:\n\n* Large jump (go forward L centimeters)\n* Small jump (go 1 cm forward)\n\n\n\nThe frog aims to just land in the b... | code | {
"ground_truth": "{\"inputs\": [\"10 5\", \"7 4\", \"10 8\", \"7 7\", \"10 7\", \"14 7\", \"19 7\", \"0 4\", \"22 13\", \"11 7\", \"20 7\", \"21 13\", \"34 12\", \"6 7\", \"21 23\", \"14 1\", \"11 1\", \"45 3\", \"68 25\", \"73 4\", \"146 4\", \"212 4\", \"115 65\", \"357 4\", \"357 1\", \"115 172\", \"384 1\", \"11... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You are given an array a consisting of 500000 integers (numbered from 1 to 500000). Initially all elements of a are zero.\n\nYou have to process two types of queries to this array:\n\n * 1 x y — increase a_x by y; \n * 2 x y — compute ∑_{i ∈ R(x, y)} a_i, where R(x, y) is the set of all integers... | code | {
"ground_truth": "{\"inputs\": [\"5\\n1 3 4\\n2 3 0\\n2 4 3\\n1 4 -4\\n2 1 0\\n\", \"2\\n1 1000 2\\n2 1001 1000\\n\", \"5\\n1 3 4\\n2 3 0\\n2 4 3\\n1 500000 1\\n2 800 0\\n\", \"2\\n1 500000 1\\n2 500000 0\\n\", \"2\\n1 499999 1\\n2 500000 499999\\n\", \"2\\n1 500000 228\\n2 250001 249999\\n\", \"2\\n1 500000 1\\n2 4... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "For long time scientists study the behavior of sharks. Sharks, as many other species, alternate short movements in a certain location and long movements between locations.\n\nMax is a young biologist. For n days he watched a specific shark, and now he knows the distance the shark traveled in each ... | code | {
"ground_truth": "{\"inputs\": [\"8\\n1 2 7 3 4 8 5 6\\n\", \"6\\n25 1 2 3 14 36\\n\", \"2\\n2 1\\n\", \"127\\n64 96 63 112 62 95 61 120 60 94 59 111 58 93 57 124 56 92 55 110 54 91 53 119 52 90 51 109 50 89 49 126 48 88 47 108 46 87 45 118 44 86 43 107 42 85 41 123 40 84 39 106 38 83 37 117 36 82 35 105 34 81 33 12... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "You want to build a standard house of cards, but you don't know how many cards you will need. Write a program which will count the minimal number of cards according to the number of floors you want to have. For example, if you want a one floor house, you will need 7 of them (two pairs of two cards... | code | {
"ground_truth": "{\"fn_name\": \"house_of_cards\", \"inputs\": [[1], [2], [3]], \"outputs\": [[7], [15], [26]]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Malek is a rich man. He also is very generous. That's why he decided to split his money between poor people. A charity institute knows n poor people numbered from 1 to n. The institute gave Malek q recommendations. A recommendation is a segment of people like [l, r] which means the institute recom... | code | {
"ground_truth": "{\"inputs\": [\"2 1\\n2 1\\n2 2 0.100\\n\", \"10 3\\n2 2 1 2 1 2 2 5 5 5\\n4 6 0.014\\n4 6 0.012\\n8 10 0.084\\n\", \"1 1\\n1000000000\\n1 1 1.000\\n\", \"10 3\\n2 5 5 4 5 2 5 2 1 4\\n8 10 0.646\\n4 6 0.687\\n4 6 0.504\\n\", \"10 3\\n2 1 2 1 1 3 2 4 1 1\\n5 7 0.979\\n1 3 0.922\\n8 10 0.944\\n\", \"... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Easy and hard versions are actually different problems, so read statements of both problems completely and carefully.\n\nSummer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read exactly $m$ books before all entertainments... | code | {
"ground_truth": "{\"inputs\": [\"6 3 1\\n6 0 0\\n11 1 0\\n9 0 1\\n21 1 1\\n10 1 0\\n8 0 1\", \"6 3 2\\n\\n6 0 0\\n11 1 0\\n9 0 1\\n21 1 1\\n10 1 0\\n8 0 1\", \"3 3 1\\n27 0 0\\n28 0 0\\n11 0 0\\n\", \"1 1 1\\n3 0 1\\n\", \"8 5 1\\n43 0 1\\n5 0 1\\n23 1 1\\n55 0 1\\n19 1 1\\n73 1 1\\n16 1 1\\n42 1 1\\n\", \"27 5 1\\... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "You are given an integer sequence of length n+1, a_1,a_2,...,a_{n+1}, which consists of the n integers 1,...,n.\nIt is known that each of the n integers 1,...,n appears at least once in this sequence.\nFor each integer k=1,...,n+1, find the number of the different subsequences (not necessarily con... | code | {
"ground_truth": "{\"inputs\": [\"3\\n1 2 1 3\\n\", \"1\\n1 1\\n\", \"32\\n29 19 7 10 26 32 27 4 11 20 2 8 16 23 5 14 6 12 17 22 18 30 28 24 15 1 25 3 13 21 19 31 9\\n\"], \"outputs\": [\"3\\n5\\n4\\n1\\n\", \"1\\n1\\n\", \"32\\n525\\n5453\\n40919\\n237336\\n1107568\\n4272048\\n13884156\\n38567100\\n92561040\\n19353... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Kevin has just recevied his disappointing results on the USA Identification of Cows Olympiad (USAICO) in the form of a binary string of length n. Each character of Kevin's string represents Kevin's score on one of the n questions of the olympiad—'1' for a correctly identified cow and '0' otherwise... | code | {
"ground_truth": "{\"inputs\": [\"8\\n10000011\\n\", \"2\\n01\\n\", \"5\\n10101\\n\", \"75\\n010101010101010101010101010101010101010101010101010101010101010101010101010\\n\", \"11\\n00000000000\\n\", \"56\\n10101011010101010101010101010101010101011010101010101010\\n\", \"50\\n0101101011010101010101010101010101010101... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "On the divine friendship day, \"A\" tied \"B\" a friendship band. But alas! Frequent quarrels started between them and \"B\" decided to remove and break off the band! The band isnt a huge one and consists of red, blue and white beads in random positioning. Here are two examples for number of beads... | code | {
"ground_truth": "{\"inputs\": [\"29\\nwwwbbrwrbrbrrbrbrwrwwrbwrwrrb\\n\\nSAMPLE\", \"29\\nwwwbbrwrbrbrrbrbrwrwwrbwrwrrb\", \"77\\nrwrwrwrwrwrwrwrwrwrwrwrwbwrwbwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwr\", \"350\\nrrbbrbbbwbwwbwbbbbwwrrbbwbrwbrwbbbrbrwrwbrwwwrrbbrrwrbbrwbwrwwwrbrwwwwwrwbwwwrrbrrbbbrbrbbbrbbbrb... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "This problem is same as the previous one, but has larger constraints.\n\nShiro's just moved to the new house. She wants to invite all friends of her to the house so they can play monopoly. However, her house is too small, so she can only invite one friend at a time.\n\nFor each of the n days since... | code | {
"ground_truth": "{\"inputs\": [\"5\\n10 100 20 200 1\\n\", \"6\\n1 1 1 2 2 2\\n\", \"1\\n100000\\n\", \"13\\n1 1 1 2 2 2 3 3 3 4 4 4 5\\n\", \"7\\n3 2 1 1 4 5 1\\n\", \"10\\n30518 96518 74071 59971 50121 4862 43967 73607 19138 90754\\n\", \"10\\n4 10 4 4 5 10 10 4 10 10\\n\", \"10\\n63649 14562 779 31060 84730 3390... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given an unsorted linked list of N nodes. The task is to remove duplicate elements from this unsorted Linked List. When a value appears in multiple nodes, the node which appeared first should be kept, all others duplicates are to be removed.\nExample 1:\nInput:\nN = 4\nvalue[] = {5,2,2,4}\nOutput:... | code | {
"ground_truth": "{\"inputs\": [\"N = 4\\nvalue[] = {5,2,2,4}\", \"N = 5\\nvalue[] = {2,2,2,2,2}\"], \"outputs\": [\"5 2 4\", \"2\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given a keypad as shown in the diagram, and an N digit number which is represented by array a[ ], the task is to list all words which are possible by pressing these numbers.\nExample 1:\nInput: N = 3, a[] = {2, 3, 4}\nOutput:\nadg adh adi aeg aeh aei afg afh afi \nbdg bdh bdi beg beh bei bfg bfh b... | code | {
"ground_truth": "{\"inputs\": [\"N = 3, a[] = {2, 3, 4}\", \"N = 3, a[] = {3, 4, 5}\"], \"outputs\": [\"adg adh adi aeg aeh aei afg afh afi \\nbdg bdh bdi beg beh bei bfg bfh bfi \\ncdg cdh cdi ceg ceh cei cfg cfh cfi\", \"dgj dgk dgl dhj dhk dhl dij dik dil \\negj egk egl ehj ehk ehl eij eik eil \\nfgj fgk fgl fhj... | {
"index": 0,
"split": "dummy"
} |
codeforces | [
{
"content": "Title: Substitutes in Number\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nAndrew and Eugene are playing a game. Initially, Andrew has string *s*, consisting of digits. Eugene sends Andrew multiple queries of type \"*d**i*<=→<=*t**i*\", that means \"replace a... | code | {
"ground_truth": "{\"inputs\": [\"123123\\n1\\n2->00\", \"123123\\n1\\n3->\", \"222\\n2\\n2->0\\n0->7\", \"1000000008\\n0\", \"100\\n5\\n1->301\\n0->013\\n1->013\\n0->103\\n0->103\", \"21222\\n10\\n1->\\n2->1\\n1->1\\n1->1\\n1->1\\n1->22\\n2->2\\n2->1\\n1->21\\n1->\", \"21122\\n10\\n1->\\n2->12\\n1->\\n2->21\\n2->\\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "A prime number is an integer greater than $1$ that has no positive divisors other than $1$ and itself.\n\nWe call a number megaprime if it is prime and all of its individual digits are prime. For example, $53$ is megaprime because it is prime and all its digits ($5$ and $3$) are prime; however, $3... | code | {
"ground_truth": "{\"inputs\": [\"10 20\", \"100 200\"], \"outputs\": [\"0\", \"0\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Assume that sk(n) equals the sum of digits of number n in the k-based notation. For example, s2(5) = s2(1012) = 1 + 0 + 1 = 2, s3(14) = s3(1123) = 1 + 1 + 2 = 4.\n\nThe sequence of integers a0, ..., an - 1 is defined as <image>. Your task is to calculate the number of distinct subsequences of sequ... | code | {
"ground_truth": "{\"inputs\": [\"7 7\\n\", \"4 2\\n\", \"948401775311276715 25\\n\", \"3 3\\n\", \"1234567890 12\\n\", \"100 27\\n\", \"999999999999999999 7\\n\", \"1000000000000000000 2\\n\", \"353989972219678213 18\\n\", \"531440999999999999 30\\n\", \"1000000000000000000 6\\n\", \"900099654762154107 16\\n\", \"1... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "As Lord Rama's army is approaching Lanka they have to pass one last hurdle and that is the ocean in between. They have decided to construct a bridge made of stones. But before they start constructing it Lord Rama asked Hanuman to train the monkeys in the army.\n\nHanuman decided to train monkeys w... | code | {
"ground_truth": "{\"inputs\": [\"12 100000000\\n432424 5325 6436 23432 342 4234 3422 2333 233 22 33333 432422\", \"2 4169015\\n80268343 89772825\", \"3 10\\n100 200 300\", \"12 100000000\\t\\n1 10 1000 10000 20000 12 100 10000000 100001 10000002 10000004 10000005\", \"5 5\\n0 1 2 3 4\", \"12 100000000\\n0 1 2 3 4 5... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "Mishka is a little polar bear. As known, little bears loves spending their free time playing dice for chocolates. Once in a wonderful sunny morning, walking around blocks of ice, Mishka met her friend Chris, and they started playing the game.\n\nRules of the game are very simple: at first number o... | code | {
"ground_truth": "{\n \"inputs\": [\n \"3\\n3 5\\n2 1\\n4 2\\n\",\n \"2\\n6 1\\n1 6\\n\",\n \"3\\n1 5\\n3 3\\n2 2\\n\",\n \"6\\n4 1\\n4 2\\n5 3\\n5 1\\n5 3\\n4 1\\n\",\n \"8\\n2 4\\n1 4\\n1 5\\n2 6\\n2 5\\n2 5\\n2 4\\n2 5\\n\",\n \"8\\n4 1\\n2 6\\n4 2\\n2 5\\n5 2\\n3 5\\n5 2\\n1 5\\n\",\n \"9\\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Problem\n\nThere is a grid of $ R \\ times C $ squares with $ (0, 0) $ in the upper left and $ (R-1, C-1) $ in the lower right. When you are in a square ($ e $, $ f $), from there $ (e + 1, f) $, $ (e-1, f) $, $ (e, f + 1) $, $ (e) , f-1) $, $ (e, 0) $, $ (e, C-1) $, $ (0, f) $, $ (R-1, f) $ can b... | code | {
"ground_truth": "{\"inputs\": [\"2 2 0 0 0 1\", \"421 435 196 169 388 5\", \"1 2 0 0 0 0\", \"421 435 196 91 388 9\", \"5 6 0 0 4 4\", \"1 10 0 1 0 9\", \"421 435 196 169 388 12\", \"421 435 196 169 388 10\", \"421 435 196 118 388 0\", \"421 92 17 19 388 10\", \"1 18 0 0 0 9\", \"421 435 196 169 135 9\", \"5 11 0 0... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given a connected undirected graph with $n$ vertices and an integer $k$, you have to either: either find an independent set that has exactly $\\lceil\\frac{k}{2}\\rceil$ vertices. or find a simple cycle of length at most $k$. \n\nAn independent set is a set of vertices such that no two of them ar... | code | {
"ground_truth": "{\"inputs\": [\"4 4 3\\n1 2\\n2 3\\n3 4\\n4 1\\n\", \"4 5 3\\n1 2\\n2 3\\n3 4\\n4 1\\n2 4\\n\", \"4 6 3\\n1 2\\n2 3\\n3 4\\n4 1\\n1 3\\n2 4\\n\", \"5 4 5\\n1 2\\n1 3\\n2 4\\n2 5\\n\", \"3 3 3\\n1 2\\n2 3\\n3 1\\n\", \"6 6 6\\n4 2\\n2 5\\n5 3\\n3 6\\n6 1\\n1 4\\n\", \"6 6 5\\n3 6\\n6 5\\n5 4\\n4 2\\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Valera is a collector. Once he wanted to expand his collection with exactly one antique item.\n\nValera knows n sellers of antiques, the i-th of them auctioned k_{i} items. Currently the auction price of the j-th object of the i-th seller is s_{ij}. Valera gets on well with each of the n sellers. ... | code | {
"ground_truth": "{\"inputs\": [\"3 50000\\n1 40000\\n2 20000 60000\\n3 10000 70000 190000\\n\", \"3 50000\\n1 50000\\n3 100000 120000 110000\\n3 120000 110000 120000\\n\", \"2 100001\\n1 895737\\n1 541571\\n\", \"1 1000000\\n1 1000000\\n\", \"1 1000000\\n1 561774\\n\", \"3 1000000\\n5 1000000 568832 1000000 1000000... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "After finding a suitable residence in the Swiss Alps, Robin thought he finally had what it takes to be happy. But every day he woke up feeling that something was missing. Maybe it was the lack of English food in these parts? Spotting a market opportunity and solving his problem at the same time, h... | code | {
"ground_truth": "{\"inputs\": [\"3 3 2\\n1 2 3\\n\", \"4 11 4\\n10 10 10 10\\n\", \"4 3 3\\n4 1 3 2\\n\"], \"outputs\": [\"3.666666667\\n\", \"20.000000000\\n\", \"5.888888888888\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given a matrix containing lower alphabetical characters only of size n*m. We need to count the number of palindromic paths in the given matrix.\nA path is defined as a sequence of cells starting from top-left cell and ending at bottom-right cell. We are allowed to move to right and down only from ... | code | {
"ground_truth": "{\"fn_name\": \"countOfPalindromicPaths\", \"inputs\": [[[[\"a\", \"a\", \"a\", \"b\"], [\"b\", \"a\", \"a\", \"a\"], [\"a\", \"b\", \"b\", \"a\"]]], [[[\"a\", \"b\"], [\"c\", \"d\"]]], [[[\"a\", \"a\", \"a\", \"a\"], [\"b\", \"b\", \"a\", \"a\"], [\"a\", \"b\", \"a\", \"a\"]]], [[[\"a\", \"b\", \"... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "This problem has unusual memory constraint.\n\nAt evening, Igor and Zhenya the financiers became boring, so they decided to play a game. They prepared n papers with the income of some company for some time periods. Note that the income can be positive, zero or negative.\n\nIgor and Zhenya placed t... | code | {
"ground_truth": "{\"inputs\": [\"4\\n-4 -2 4 5\\n\", \"3\\n1 3 1\\n\", \"5\\n-1 -2 -1 -2 -1\\n\", \"1\\n0\\n\", \"4\\n10 -9 9 -5\\n\", \"7\\n0 -2 -1 -1 -3 3 2\\n\", \"100\\n59 5 -63 -54 -56 -24 58 -19 -32 89 -59 -89 -35 98 51 65 29 -61 65 37 -40 68 -84 62 -50 -89 -18 -79 36 -14 -16 -26 20 89 -23 95 20 -69 -49 80 -9... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "A positive integer is magical if it is divisible by either A or B.\nReturn the N-th magical number. Since the answer may be very large, return it modulo 10^9 + 7.\n \n\n\n\nExample 1:\nInput: N = 1, A = 2, B = 3\nOutput: 2\n\n\nExample 2:\nInput: N = 4, A = 2, B = 3\nOutput: 6\n\n\nExample 3:\nIn... | code | {
"ground_truth": "{\"fn_name\": \"nthMagicalNumber\", \"inputs\": [[1, 2, 3]], \"outputs\": [2]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days off. Your task is to determine the minimum possible and the maximum possible number of days off per year on Mars.\n\nInput\n\nThe first lin... | code | {
"ground_truth": "{\"inputs\": [\"2\\n\", \"14\\n\", \"23\\n\", \"234108\\n\", \"9\\n\", \"99983\\n\", \"987\\n\", \"868523\\n\", \"30\\n\", \"11\\n\", \"234115\\n\", \"99\\n\", \"868512\\n\", \"999985\\n\", \"18\\n\", \"234118\\n\", \"999994\\n\", \"868528\\n\", \"868526\\n\", \"3\\n\", \"1000000\\n\", \"12\\n\", \... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Game of numbers is a game where you are given two integers (X and Y), and you have to print the number of special numbers between X and Y both inclusive. \nThe property of a special numbers is as follows: \nA special number is not divisible by any number of the form ZZ* where (Z\\; >\\; 1). \... | code | {
"ground_truth": "{\"inputs\": [\"1\\n1 10\\n\\nSAMPLE\", \"1\\n1 10\\n\\nELPMAS\", \"1\\n1 9\\n\\nELPMAS\", \"1\\n2 9\\n\\nELPMAS\", \"1\\n2 4\\n\\nSAMPLE\", \"1\\n2 2\\n\\nSANPLE\", \"1\\n1 15\\n\\nELPMAS\", \"1\\n3 9\\n\\nSAMPLE\", \"1\\n1 14\\n\\nELPM@S\", \"1\\n1 29\\n\\nELOMAS\", \"1\\n1 25\\n\\nELOMAS\", \"1\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "A country decides to build a palace.\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\nAmong them, Princess Joisino orders you to select the pla... | code | {
"ground_truth": "{\"inputs\": [\"2\\n12 5\\n1000 2000\\n\", \"3\\n21 -11\\n81234 94124 52141\\n\", \"1000\\n50 12\\n354 76430 27904 50268 73833 44032 2233 54986 38658 75014 43668 35059 40714 88040 8556 52029 40199 9127 9433 16246 11706 88894 29318 55597 10624 87407 59163 67750 74895 37791 16260 82696 57569 51320 42... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "You have just been hired by Amalgamated, Inc. in the country of Acmania to oversee the transportation of raw materials to the company’s factories. Each supplier of raw materials and each factory resides in one of Acmania’s states. No state has both a factory and a supplier (and never more than one... | code | {
"ground_truth": "{\"inputs\": [\"7 3 3 3\\nA B C\\nD E F\\n3 A E G\\n3 A C E\\n3 B D F\\n\", \"7 3 3 4\\nA B C\\nD E F\\n3 A E G\\n3 A C E\\n3 B D F\\n2 G F\\n\"], \"outputs\": [\"2\\n\", \"3\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "The new season of the Bytelandian Premier League (BPL) has started!\nIn the BPL, any two soccer teams play with each other exactly once. In each match, the winner earns 3 points and the loser earns no point. There is no draw (if the match is level after the two halves, two teams will take part in ... | code | {
"ground_truth": "{\"inputs\": [\"3\\n3\\n0 0 0 \\n1 0 1 \\n1 0 0 \\n4\\n0 1 1 0 \\n0 0 2 0 \\n0 2 0 0 \\n1 1 1 0 \\n5\\n0 2 2 1 0 \\n2 0 1 1 0 \\n2 0 0 1 0 \\n0 0 0 0 1 \\n1 1 1 0 0\"], \"outputs\": [\"010\\n0001\\n11001\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Frog Gorf is traveling through Swamp kingdom. Unfortunately, after a poor jump, he fell into a well of $n$ meters depth. Now Gorf is on the bottom of the well and has a long way up.\n\nThe surface of the well's walls vary in quality: somewhere they are slippery, but somewhere have convenient ledge... | code | {
"ground_truth": "{\"inputs\": [\"3\\n0 2 2\\n1 1 0\\n\", \"2\\n1 1\\n1 0\\n\", \"10\\n0 1 2 3 5 5 6 7 8 5\\n9 8 7 1 5 4 3 2 0 0\\n\", \"5\\n0 0 1 4 2\\n0 2 0 1 0\\n\", \"1\\n1\\n0\\n\", \"10\\n1 1 1 0 3 0 6 2 4 5\\n7 6 2 3 5 1 2 0 1 0\\n\", \"10\\n1 0 2 2 5 0 0 0 2 7\\n4 3 1 0 4 3 3 2 1 0\\n\", \"19\\n1 1 3 4 5 3 5... | {
"index": 0,
"split": "dummy"
} |
codeforces | [
{
"content": "Title: Partial Sums\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nYou've got an array *a*, consisting of *n* integers. The array elements are indexed from 1 to *n*. Let's determine a two step operation like that:\n 1. First we build by the array *a* an array... | code | {
"ground_truth": "{\"inputs\": [\"3 1\\n1 2 3\", \"5 0\\n3 14 15 92 6\", \"1 1\\n3\", \"1 0\\n0\", \"1 0\\n123\", \"1 1\\n0\", \"4 1\\n3 20 3 4\", \"5 20\\n11 5 6 8 11\", \"17 239\\n663 360 509 307 311 501 523 370 302 601 541 42 328 200 196 110 573\", \"13 666\\n84 89 29 103 128 233 190 122 117 208 119 97 200\", \"4... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisible by K.\n \n\nExample 1:\nInput: A = [4,5,0,-2,-3,1], K = 5\nOutput: 7\nExplanation: There are 7 subarrays with a sum divisible by K = 5:\n[4, 5, 0, -2, -3, 1], [5], [5, 0], [5, 0, -2, -3],... | code | {
"ground_truth": "{\"fn_name\": \"subarraysDivByK\", \"inputs\": [[[4, 5, 0, -2, -3, 1], 5]], \"outputs\": [7]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Mr. Vincent works in a door mat manufacturing company. One day, he designed a new door mat with the following specifications: \n\nMat size must be $N$X$\\mbox{M}$. ($N$ is an odd natural number, and $\\mbox{M}$ is $3$ times $N$.)\nThe design should have 'WELCOME' written in the center.\nThe design... | code | {
"ground_truth": "{\"inputs\": [\" 5 15\", \" 7 21\", \" 9 27\", \" 13 39\", \" 15 45\", \" 5 15\", \" 97 291\", \" 99 297\", \" 101 303\", \" 51 153\", \" 97 291\", \" 99 297\"], \"outputs\": [\"------.|.------\\n---.|..|..|.---\\n----WELCOME----\\n---.|..|..|.---\\n------.|.------\", \"---------.|.---------\\n----... | {
"index": 0,
"split": "dummy"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.