data_source stringclasses 4
values | prompt listlengths 1 1 | ability stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
taco | [
{
"content": "Problem description.\n\nThis problem is simple and will introduce you to the Dynamic Programming.\n\nYou will be given an array and a key value.\n\nYou will have to find out the occurrences of the key value depending upon the query using Brute Force and Top Down Dynamic Programming.\n\n-----Brute-... | code | {
"ground_truth": "{\"inputs\": [\"1\\n5\\n1 1 1 1 1\\n1\\n2\\n3\\n4\\n5\\n\"], \"outputs\": [\"2 2 3\\n1 1 1\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Bananistan is a beautiful banana republic. Beautiful women in beautiful dresses. Beautiful statues of beautiful warlords. Beautiful stars in beautiful nights.\n\nIn Bananistan people play this crazy game – Bulbo. There’s an array of bulbs and player at the position, which represents one of the bul... | code | {
"ground_truth": "{\"inputs\": [\"5 1\\n1 1\\n1 1\\n1 1\\n1 1\\n1 1\\n\", \"5 5\\n1 5\\n3 7\\n5 9\\n7 11\\n1000000000 1000000000\\n\", \"5 5\\n1 1\\n2 2\\n3 3\\n4 4\\n5 5\\n\", \"5 5\\n1 5\\n3 7\\n5 9\\n7 11\\n1000000000 1000010000\\n\", \"5 4\\n2 7\\n9 16\\n6 10\\n9 17\\n1 6\\n\", \"5 5\\n1 2\\n2 7\\n5 12\\n1 11\\n... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "It's not the rivers that you might be thinking about. The question revolves around the concept of digital rivers.\nA digital river is a sequence of numbers where the number \nfollowing n is n plus the sum of its digits.\nFOR EXAMPLE\n\n12345 is followed by 12360 since 1+2+3+4+5=15 and so\n 12345 ... | code | {
"ground_truth": "{\"inputs\": [\"86\\n 12345\\n 0\", \"86\\n 12444\\n 0\", \"86\\n 5862\\n 0\", \"86\\n 9079\\n 0\", \"86\\n 7745\\n 0\", \"86\\n 9113\\n 0\", \"86\\n 9885\\n 0\", \"86\\n 4733\\n 0\", \"86\\n 18793\\n 0\", \"86\\n 6477\\n 0\", \"86\\n 18588\\n 0\", \"86\\n 4494\\n 0\", \"86\... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "The polar bears are going fishing. They plan to sail from (sx, sy) to (ex, ey). However, the boat can only sail by wind. At each second, the wind blows in one of these directions: east, south, west or north. Assume the boat is currently at (x, y).\n\n * If the wind blows to the east, the boat wil... | code | {
"ground_truth": "{\"inputs\": [\"10 5 3 3 6\\nNENSWESNEE\\n\", \"5 0 0 1 1\\nSESNW\\n\", \"15 1 1 1 2\\nNNNNNNNNNNNNNNN\\n\", \"11 1 1 1 2\\nNNNNNNNNNNN\\n\", \"1 0 0 0 -1\\nS\\n\", \"41 -264908123 -86993764 -264908123 -86993723\\nNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN\\n\", \"19 -172106364 -468680119 -172106365... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Median of K numbers is defined as the (K/2)th smallest number, if K is even; and the ((K+1)/2)th smallest number if K is odd. For example, \n\nmedian of the 4 numbers: 2 1 8 7 is the 2nd smallest number i.e. 2, \n\nand the median of the 5 numbers: 2 1 8 7 6 is the 3rd smallest number i.e. 6.\n\n... | code | {
"ground_truth": "{\"inputs\": [\"5\\n10\\n5\\n1\\n2\\n15\\n\\nSAMPLE\", \"5\\n11\\n5\\n1\\n2\\n15\\n\\nSAMPLE\", \"5\\n11\\n5\\n1\\n4\\n15\\n\\nSAMPLE\", \"5\\n11\\n10\\n1\\n4\\n15\\n\\nSALPLE\", \"5\\n11\\n19\\n1\\n4\\n15\\n\\nSALOLE\", \"5\\n11\\n19\\n1\\n4\\n1\\n\\nSALOLE\", \"5\\n11\\n8\\n1\\n4\\n1\\n\\nSALOLE\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "# Problem\n\nIn China,there is an ancient mathematical book, called \"The Mathematical Classic of Sun Zi\"(《孙子算经》). In the book, there is a classic math problem: “今有物不知其数,三三数之剩二,五五数之剩三,七七数之剩二,问物几何?” \n\nAhh, Sorry. I forgot that you don't know Chinese. Let's translate it to English:\n\nThere is a ... | code | {
"ground_truth": "{\"fn_name\": \"find_unknown_number\", \"inputs\": [[2, 3, 2], [1, 2, 3], [1, 3, 5], [0, 0, 0], [1, 1, 1]], \"outputs\": [[23], [52], [103], [105], [1]]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Consider a sequence $A$ of integers, containing $N$ integers between $1$ and $N$. Each integer appears exactly once in the sequence.\n\nA subsequence of $A$ is a sequence obtained by removing some (possibly none) numbers from the beginning of $A$, and then from the end of $A$.\n\nCalculate how man... | code | {
"ground_truth": "{\"inputs\": [\"5 4\\n1 2 3 4 5\\n\", \"6 3\\n1 2 4 5 6 3\\n\", \"7 4\\n5 7 2 4 3 1 6\\n\"], \"outputs\": [\"2\\n\", \"1\\n\", \"4\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "As Valentines Day was approaching, some couples on the campus are upto some mischief and are sneaking around in the Campus Building. But the building has teachers roaming inside it. The teacher both blocks the way and will catch you if you fall into their line of sight. Also, everytime you take a ... | code | {
"ground_truth": "{\"inputs\": [\"20\\n1 6\\nS...G<\\n40 63\\nv.........##v^.#...#...#............#...........#...v..<.......\\n.^....>........#..#..#...##.............<#..#...........<##..#.\\n...>#....#.<......v#.#..........>.>.......#..........<#.....#..\\nv#........................#.##..#.#.........<.v..#....>#.... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Let's call a string \"s-palindrome\" if it is symmetric about the middle of the string. For example, the string \"oHo\" is \"s-palindrome\", but the string \"aa\" is not. The string \"aa\" is not \"s-palindrome\", because the second half of it is not a mirror reflection of the first half.\n\n<imag... | code | {
"ground_truth": "{\"inputs\": [\"oXoxoXo\\n\", \"bod\\n\", \"ER\\n\", \"oiio\\n\", \"uuuu\\n\", \"iOi\\n\", \"VxrV\\n\", \"A\\n\", \"lxl\\n\", \"o\\n\", \"iii\\n\", \"ipOqi\\n\", \"uu\\n\", \"uuu\\n\", \"O\\n\", \"AAWW\\n\", \"Db\\n\", \"OuO\\n\", \"JL\\n\", \"tt\\n\", \"ii\\n\", \"NNNN\\n\", \"iIcamjTRFH\\n\", \"T... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "A tree is an undirected connected graph without cycles. The distance between two vertices is the number of edges in a simple path between them.\n\nLimak is a little polar bear. He lives in a tree that consists of n vertices, numbered 1 through n.\n\nLimak recently learned how to jump. He can jump ... | code | {
"ground_truth": "{\n \"inputs\": [\n \"6 2\\n1 2\\n1 3\\n2 4\\n2 5\\n4 6\\n\",\n \"13 3\\n1 2\\n3 2\\n4 2\\n5 2\\n3 6\\n10 6\\n6 7\\n6 13\\n5 8\\n5 9\\n9 11\\n11 12\\n\",\n \"3 5\\n2 1\\n3 1\\n\",\n \"2 1\\n1 2\\n\",\n \"2 5\\n2 1\\n\",\n \"15 1\\n12 9\\n13 7\\n1 3\\n10 4\\n9 2\\n2 15\\n11 4\\n2 ... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Okabe needs to renovate the Future Gadget Laboratory after he tried doing some crazy experiments! The lab is represented as an n by n square grid of integers. A good lab is defined as a lab in which every number not equal to 1 can be expressed as the sum of a number in the same row and a number in... | code | {
"ground_truth": "{\"inputs\": [\"3\\n1 1 2\\n2 3 1\\n6 4 1\\n\", \"3\\n1 5 2\\n1 1 1\\n1 2 3\\n\", \"4\\n1 1 1 1\\n1 12 1 2\\n4 4 1 3\\n5 10 6 1\\n\", \"1\\n2\\n\", \"1\\n60000\\n\", \"3\\n1 1 4\\n1 1 2\\n1 1 2\\n\", \"4\\n1 1 1 1\\n1 14 1 6\\n4 5 1 5\\n3 8 2 1\\n\", \"4\\n1 1 1 1\\n1 13 1 2\\n4 5 1 3\\n5 11 6 1\\n... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "Pasha has recently bought a new phone jPager and started adding his friends' phone numbers there. Each phone number consists of exactly n digits.\n\nAlso Pasha has a number k and two sequences of length n / k (n is divisible by k) a_1, a_2, ..., a_{n} / k and b_1, b_2, ..., b_{n} / k. Let's split ... | code | {
"ground_truth": "{\n \"inputs\": [\n \"6 2\\n38 56 49\\n7 3 4\\n\",\n \"8 2\\n1 22 3 44\\n5 4 3 2\\n\",\n \"2 1\\n9 9\\n9 9\\n\",\n \"2 1\\n9 9\\n0 9\\n\",\n \"4 1\\n4 3 2 1\\n1 2 3 4\\n\",\n \"18 9\\n2 3\\n0 4\\n\",\n \"4 4\\n1122\\n2\\n\",\n \"10 5\\n8378 11089\\n7 5\\n\",\n \"10 5\\n5... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "There is a hotel with the following accommodation fee:\n - X yen (the currency of Japan) per night, for the first K nights\n - Y yen per night, for the (K+1)-th and subsequent nights\nTak is staying at this hotel for N consecutive nights.\nFind his total accommodation fee.\n\n-----Constraints-----... | code | {
"ground_truth": "{\"inputs\": [\"5\\n3\\n10000\\n9000\\n\", \"2\\n3\\n10000\\n9000\\n\"], \"outputs\": [\"48000\\n\", \"20000\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "A boy Petya loves chess very much. He even came up with a chess piece of his own, a semiknight. The semiknight can move in any of these four directions: 2 squares forward and 2 squares to the right, 2 squares forward and 2 squares to the left, 2 squares backward and 2 to the right and 2 squares ba... | code | {
"ground_truth": "{\"inputs\": [\"2\\n........\\n........\\n......#.\\nK..##..#\\n.......#\\n...##..#\\n......#.\\nK.......\\n\\n........\\n........\\n..#.....\\n..#..#..\\n..####..\\n...##...\\n........\\n....K#K#\\n\", \"3\\n........\\n........\\n..#.....\\n..#..#..\\n..####..\\n...##...\\n........\\n####K#K#\\n\\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Chef wants to store some important numerical data on his personal computer. He is using a new data type that can store values only from 0 till N both inclusive. If this data type receives a value greater than N then it is cyclically converted to fit into the range 0 to N.\nFor example: \nValue N+1... | code | {
"ground_truth": "{\"inputs\": [\"5\\n25 23\\n30 0\\n15 10\\n20 20\\n35 34\\n\", \"1\\n11 11\\n\", \"4\\n12 12\\n30 15\\n18 17\\n20 21\\n\", \"1\\n1 1\\n\", \"1\\n50 50\\n\", \"1\\n50 51\\n\", \"1\\n2 3\\n\"], \"outputs\": [\"23\\n0\\n10\\n20\\n34\", \"11\", \"12\\n15\\n17\\n0\", \"1\", \"50\", \"0\", \"0\"]}",
"s... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "This morning Tolik has understood that while he was sleeping he had invented an incredible problem which will be a perfect fit for Codeforces! But, as a \"Discuss tasks\" project hasn't been born yet (in English, well), he decides to test a problem and asks his uncle.\n\nAfter a long time thinking... | code | {
"ground_truth": "{\"inputs\": [\"782 19\\n\", \"1 2892\\n\", \"61 389\\n\", \"4830 1\\n\", \"6354 1\\n\", \"8 8\\n\", \"6 8\\n\", \"1249 19\\n\", \"1 3575\\n\", \"61 407\\n\", \"5803 1\\n\", \"6354 2\\n\", \"8 4\\n\", \"3 3\\n\", \"1122 19\\n\", \"1 6589\\n\", \"5803 2\\n\", \"6925 2\\n\", \"8 5\\n\", \"4 3\\n\", \... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Ani and Borna are playing a short game on a two-variable polynomial. It's a special kind of a polynomial: the monomials are fixed, but all of its coefficients are fill-in-the-blanks dashes, e.g. $$$ \\\\_ xy + \\\\_ x^4 y^7 + \\\\_ x^8 y^3 + … $$$\n\nBorna will fill in the blanks with positive int... | code | {
"ground_truth": "{\"inputs\": [\"2\\n2 0\\n0 0\\n\", \"10\\n2 0\\n5 0\\n6 0\\n8 0\\n4 6\\n5 5\\n6 6\\n2 4\\n8 4\\n3 3\\n\", \"2\\n1 0\\n0 0\\n\", \"2\\n1 0\\n2 0\\n\", \"2\\n2 0\\n3 0\\n\", \"5\\n0 0\\n500000000 2\\n999999998 6\\n499999999 2\\n0 1000000000\\n\", \"8\\n8 8\\n7 6\\n10 2\\n10 6\\n9 6\\n4 10\\n8 6\\n10... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Artem has an array of n positive integers. Artem decided to play with it. The game consists of n moves. Each move goes like this. Artem chooses some element of the array and removes it. For that, he gets min(a, b) points, where a and b are numbers that were adjacent with the removed number. If the... | code | {
"ground_truth": "{\"inputs\": [\"5\\n3 1 5 2 6\\n\", \"5\\n1 2 3 4 5\\n\", \"5\\n1 100 101 100 1\\n\", \"10\\n96 66 8 18 30 48 34 11 37 42\\n\", \"1\\n87\\n\", \"2\\n93 51\\n\", \"3\\n31 19 5\\n\", \"4\\n86 21 58 60\\n\", \"5\\n21 6 54 69 32\\n\", \"6\\n46 30 38 9 65 23\\n\", \"7\\n82 60 92 4 2 13 15\\n\", \"8\\n77... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Amr has got a large array of size n. Amr doesn't like large arrays so he intends to make it smaller.\n\nAmr doesn't care about anything in the array except the beauty of it. The beauty of the array is defined to be the maximum number of times that some number occurs in this array. He wants to choo... | code | {
"ground_truth": "{\"inputs\": [\"5\\n1 1 2 2 1\\n\", \"5\\n1 2 2 3 1\\n\", \"6\\n1 2 2 1 1 2\\n\", \"10\\n1 1000000 2 1000000 3 2 1000000 1 2 1\\n\", \"10\\n1 2 3 4 5 5 1 2 3 4\\n\", \"10\\n1 1 2 1 1 2 2 1 2 3\\n\", \"10\\n5 4 3 2 1 1 2 3 4 5\\n\", \"10\\n1 10 100 1000 10000 1 10 100 1000 10000\\n\", \"10\\n9 9 9 9... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given an unsorted array arr[] of size N, the task is to check whether the array consists of consecutive numbers or not.\nExample 1:\nInput: N = 5, arr[] = {5, 4, 2, 1, 3}\nOutput: Yes\nExplanation: All are consecutive elements,\naccording to this order 1,2,3,4 and 5.\nExample 2:\nInput: N = 6, arr... | code | {
"ground_truth": "{\"inputs\": [\"N = 5, arr[] = {5, 4, 2, 1, 3}\", \"N = 6, arr[] = {2, 1, 0, -3, -1, -2}\"], \"outputs\": [\"Yes\", \"Yes\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "\"This problem is rubbish! There is not statement, and there are only 5 test cases. The problemsetter took liberties with this problem!\" — people complained in the comments to one round on Codeforces. And even more... No, wait, the checker for the problem was alright, that's a mercy.\n\nInput\n\n... | code | {
"ground_truth": "{\"inputs\": [\"5\\n\", \"4\\n\", \"2\\n\", \"3\\n\", \"1\\n\"], \"outputs\": [\"1\", \"2\", \"3\", \"1\", \"2\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Chef is the leader of Chef's Earth Defense Organization, and his mission is to counter aliens which are threatening the earth. According to information gathered by the organization, there are $N$ alien spaceships (numbered $1$ through $N$) planning to invade the earth. The $i$-th spaceship will ap... | code | {
"ground_truth": "{\"inputs\": [\"2\\n3 5\\n1 3 5\\n4 8\\n2 4 6 8\\n\", \"1\\n4 6\\n3 6 9 12\\n\", \"2\\n2 1\\n1 3\\n2 5\\n1 3\\n\", \"1\\n5 7\\n6 12 18 24 30\\n\", \"1\\n5 8\\n11 22 33 44 55\\n\", \"1\\n2 1\\n1 1000000000\\n\", \"1\\n5 1\\n1 2 3 4 5\\n\", \"1\\n3 3\\n1 5 9\\n\", \"1\\n3 1\\n1 2 3\\n\", \"1\\n3 1000... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "There is a stack of N cards, each of which has a non-negative integer written on it. The integer written on the i-th card from the top is A_i.\n\nSnuke will repeat the following operation until two cards remain:\n\n* Choose three consecutive cards from the stack.\n* Eat the middle card of the thre... | code | {
"ground_truth": "{\"inputs\": [\"10\\n3 1 4 1 5 9 2 6 5 3\", \"6\\n5 2 4 1 6 9\", \"4\\n3 1 4 2\", \"10\\n3 1 4 1 5 9 2 11 5 3\", \"6\\n5 2 4 1 1 9\", \"4\\n1 1 4 2\", \"10\\n3 1 4 1 5 2 2 11 5 3\", \"6\\n5 2 4 1 1 15\", \"4\\n1 0 4 2\", \"10\\n3 1 4 1 5 2 2 11 5 4\", \"6\\n5 2 4 1 0 15\", \"4\\n1 0 2 2\", \"10\\n3... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Jem is famous for his laziness at school. He always leaves things to last minute. Now Jem has N problems in the assignment of \"Advanced topics in algorithm\" class to solved. The assignment is due tomorrow and as you may guess he hasn't touch any of the problems. Fortunately he got a plan as alwa... | code | {
"ground_truth": "{\"inputs\": [\"5\\n1 1 1\\n2 2 2\\n3 3 3\\n4 4 4\\n5 5 5\\n\", \"1\\n10 1 1\\n\", \"1\\n7 3 2\\n\", \"3\\n8 4 2\\n10 5 3\\n1 5 10\\n\", \"2\\n11 2 3\\n15 3 4\\n\", \"1\\n1 1 100000000\\n\", \"2\\n100000000 100000000 100000000\\n100000000 100000000 100000000\\n\", \"1\\n108 100000000 1\\n\", \"3\\n... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Let us consider a grid of squares with N rows and N columns. Arbok has cut out some part of the grid so that, for each i = 1, 2, \\ldots, N, the bottommost h_i squares are remaining in the i-th column from the left. Now, he wants to place rooks into some of the remaining squares.\n\nA rook is a ch... | code | {
"ground_truth": "{\"inputs\": [\"10\\n4 7 4 8 4 6 8 2 3 6\", \"3\\n2 1 2\", \"2\\n2 2\", \"4\\n1 2 4 1\", \"10\\n4 7 4 9 4 6 8 2 3 6\", \"3\\n3 1 2\", \"4\\n2 2 4 1\", \"4\\n2 2 1 1\", \"10\\n4 7 4 9 4 6 8 2 3 2\", \"4\\n2 3 4 1\", \"4\\n2 2 1 2\", \"10\\n4 7 4 9 4 6 8 1 3 2\", \"4\\n2 2 2 2\", \"10\\n4 7 4 8 4 6 8... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "You are playing a new famous fighting game: Kortal Mombat XII. You have to perform a brutality on your opponent's character.\n\nYou are playing the game on the new generation console so your gamepad have $26$ buttons. Each button has a single lowercase Latin letter from 'a' to 'z' written on it. A... | code | {
"ground_truth": "{\n \"inputs\": [\n \"7 3\\n1 5 16 18 7 2 10\\nbaaaaca\\n\",\n \"5 5\\n2 4 1 3 1000\\naaaaa\\n\",\n \"5 4\\n2 4 1 3 1000\\naaaaa\\n\",\n \"8 1\\n10 15 2 1 4 8 15 16\\nqqwweerr\\n\",\n \"6 3\\n14 18 9 19 2 15\\ncccccc\\n\",\n \"2 1\\n10 10\\nqq\\n\",\n \"1 1\\n10\\nz\\n\",\n ... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "To AmShZ, all arrays are equal, but some arrays are more-equal than others. Specifically, the arrays consisting of n elements from 1 to n that can be turned into permutations of numbers from 1 to n by adding a non-negative integer to each element.\n\nMashtali who wants to appear in every problem s... | code | {
"ground_truth": "{\"inputs\": [\"2 2\\n\", \"10000000 10000\\n\", \"1 1\\n\", \"20 100\\n\", \"5 4\\n\", \"724648 77777\\n\", \"193486257 99999\\n\", \"10000 10000\\n\", \"987654321 54321\\n\", \"100000000 100000\\n\", \"852585258 33333\\n\", \"1000000000 10000\\n\", \"100000 100000\\n\", \"999999999 100000\\n\", \... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "Colonel has n badges. He wants to give one badge to every of his n soldiers. Each badge has a coolness factor, which shows how much it's owner reached. Coolness factor can be increased by one for the cost of one coin. \n\nFor every pair of soldiers one of them should get a badge with strictly high... | code | {
"ground_truth": "{\n \"inputs\": [\n \"4\\n1 3 1 4\\n\",\n \"5\\n1 2 3 2 5\\n\",\n \"5\\n1 5 3 2 4\\n\",\n \"10\\n1 1 2 3 4 5 6 7 8 9\\n\",\n \"11\\n9 2 10 3 1 5 7 1 4 8 6\\n\",\n \"4\\n4 3 2 2\\n\",\n \"1\\n1\\n\",\n \"50\\n49 37 30 2 18 48 14 48 50 27 1 43 46 5 21 28 44 2 24 17 41 38 25 1... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Internet search engines, such as Google, automatically sort and categorize web pages around the world to create a huge database. It also parses the search keywords entered by the user and creates an inquiry statement for database search.\n\nIn each case, complicated processing is performed to real... | code | {
"ground_truth": "{\"inputs\": [\"Win today's preliminary contest and be qualified to visit University of Aizu.\", \"Rain, rain, go to Spain.\", \"Win today's preliminary contest and be qualified to visit University fo Aizu.\", \"Rain, rain, go ot Spain.\", \"Rain, iarn, og ot Spain.\", \"Win todax's premiminary con... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Let's call a number k-good if it contains all digits not exceeding k (0, ..., k). You've got a number k and an array a containing n numbers. Find out how many k-good numbers are in a (count each number every time it occurs in array a).\n\nInput\n\nThe first line contains integers n and k (1 ≤ n ≤ ... | code | {
"ground_truth": "{\"inputs\": [\"2 1\\n1\\n10\\n\", \"10 6\\n1234560\\n1234560\\n1234560\\n1234560\\n1234560\\n1234560\\n1234560\\n1234560\\n1234560\\n1234560\\n\", \"1 0\\n1000000000\\n\", \"1 3\\n1\\n\", \"2 8\\n12345678\\n1230\\n\", \"6 1\\n10\\n102\\n120\\n1032\\n1212103\\n1999999\\n\", \"6 0\\n10\\n102\\n120\\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "In the dangerous wild west, robbers are attacking a long train with many coaches. Chaos erupts, and the robbers realize that the amount of chaos equals the number of passengers in the train, rounded up to the nearest multiple of $10$. In order to quench the chaos, they therefore decide to kill som... | code | {
"ground_truth": "{\"inputs\": [\"5\\n3 5 10 2 5\\n2 4 5 1 3\\n\", \"4\\n32 3 3 3\\n1 3 2 4\\n\"], \"outputs\": [\"90\\n\", \"50\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "This time minions are celebrating Diwali Festival. There are N minions in total. Each of them owns a house. On this Festival, Each of them wants to decorate their house. But none of them have enough money to do that. One of the minion, Kevin, requested Gru for money. Gru agreed for money distribut... | code | {
"ground_truth": "{\"inputs\": [[\"2\", \"4 9\", \"5 2 2 4\", \"4 9\", \"5 2 18 3\"]], \"outputs\": [[\"YES\", \"NO\"]]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Consider sequences \\{A_1,...,A_N\\} of length N consisting of integers between 1 and K (inclusive).\nThere are K^N such sequences. Find the sum of \\gcd(A_1, ..., A_N) over all of them.\nSince this sum can be enormous, print the value modulo (10^9+7).\nHere \\gcd(A_1, ..., A_N) denotes the greate... | code | {
"ground_truth": "{\"inputs\": [\"3 2\\n\", \"3 200\\n\", \"100000 100000\\n\", \"2 1000\\n\", \"2 100000\\n\", \"2 1\\n\", \"100000 1\\n\", \"100000 2\\n\", \"99991 99989\\n\", \"36 99291\\n\", \"37 99737\\n\", \"59 64993\\n\", \"26 92227\\n\", \"8 56588\\n\", \"7775 25\\n\", \"63982 84\\n\", \"68417 56\\n\", \"319... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "For Diwali, Chef arranges all $K$ laddus in a row in his sweet shop. Whenever a customer comes to buy laddus, chef follows a rule that each customer must buy all laddus on odd position. After the selection of the laddu, a new row is formed, and again out of these only laddus on odd position are se... | code | {
"ground_truth": "{\"inputs\": [\"1\\n123456789\\n\", \"1\\n1000000000\\n\", \"4\\n1000000000\\n999999999\\n999999998\\n999999997\\n\"], \"outputs\": [\"67108864\", \"536870912\", \"536870912\\n536870912\\n536870912\\n536870912\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "**DESCRIPTION:**\n\n Your strict math teacher is teaching you about right triangles, and the Pythagorean Theorem --> a^2 + b^2 = c^2 whereas a and b are the legs of the right triangle and c is the hypotenuse of the right triangle. On the test however, the question asks: What are the possible inte... | code | {
"ground_truth": "{\"fn_name\": \"side_len\", \"inputs\": [[1, 1], [3, 4], [4, 6], [5, 12], [8, 10]], \"outputs\": [[[1]], [[2, 3, 4, 6]], [[3, 4, 5, 6, 7, 8, 9]], [[8, 9, 10, 11, 12, 14, 15, 16]], [[3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]]]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Buses run between the cities A and B, the first one is at 05:00 AM and the last one departs not later than at 11:59 PM. A bus from the city A departs every a minutes and arrives to the city B in a ta minutes, and a bus from the city B departs every b minutes and arrives to the city A in a tb minut... | code | {
"ground_truth": "{\"inputs\": [\"10 30\\n10 35\\n05:20\\n\", \"60 120\\n24 100\\n13:00\\n\", \"15 14\\n32 65\\n05:45\\n\", \"1 1\\n3 2\\n08:44\\n\", \"1 3\\n1 2\\n21:43\\n\", \"30 19\\n21 4\\n10:30\\n\", \"65 49\\n24 90\\n07:10\\n\", \"1 1\\n1 1\\n23:59\\n\", \"40 74\\n100 42\\n05:40\\n\", \"1 120\\n1 100\\n23:59\\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Note that the only differences between easy and hard versions are the constraints on n and the time limit. You can make hacks only if all versions are solved.\n\nSlime is interested in sequences. He defined good positive integer sequences p of length n as follows:\n\n * For each k>1 that presents... | code | {
"ground_truth": "{\"inputs\": [\"2664\\n\", \"2868\\n\", \"1725\\n\", \"6726\\n\", \"286\\n\", \"34\\n\", \"2416\\n\", \"1649\\n\", \"32\\n\", \"80\\n\", \"701\\n\", \"2264\\n\", \"5000\\n\", \"5150\\n\", \"78\\n\", \"5\\n\", \"287\\n\", \"2512\\n\", \"463\\n\", \"4240\\n\", \"335\\n\", \"6\\n\", \"4996\\n\", \"777... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given an integer, return its base 7 string representation.\n\nExample 1:\n\nInput: 100\nOutput: \"202\"\n\n\n\nExample 2:\n\nInput: -7\nOutput: \"-10\"\n\n\n\nNote:\nThe input will be in range of [-1e7, 1e7].\n\nWrite Python code to solve the problem. Present the code in \n```python\nYour code\n``... | code | {
"ground_truth": "{\"fn_name\": \"convertToBase7\", \"inputs\": [[50], [10], [0], [-14], [123456], [10000000], [-10000000], [1], [-1], [7], [9876543], [-8742307]], \"outputs\": [[\"101\"], [\"13\"], [\"0\"], [\"-20\"], [\"1022634\"], [\"150666343\"], [\"-150666343\"], [\"1\"], [\"-1\"], [\"10\"], [\"146643405\"], [\... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You are given an array a of 2n distinct integers. You want to arrange the elements of the array in a circle such that no element is equal to the the arithmetic mean of its 2 neighbours.\n\nMore formally, find an array b, such that: \n\n * b is a permutation of a.\n\n * For every i from 1 to 2n, ... | code | {
"ground_truth": "{\"inputs\": [\"3\\n3\\n1 2 3 4 5 6\\n2\\n123 456 789 10\\n1\\n6 9\\n\", \"1\\n1\\n420 69\\n\", \"3\\n3\\n1 2 3 4 5 6\\n2\\n123 456 789 10\\n1\\n6 9\\n\", \"1\\n1\\n692 69\\n\", \"3\\n3\\n1 2 3 4 5 6\\n2\\n123 456 789 6\\n1\\n6 9\\n\", \"3\\n3\\n1 2 3 4 5 6\\n2\\n123 456 962 10\\n1\\n6 9\\n\", \"1\... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "This is an easier version of the problem. In this version, n ≤ 6.\n\nMarek is working hard on creating strong testcases to his new algorithmic problem. You want to know what it is? Nah, we're not telling you. However, we can tell you how he generates the testcases.\n\nMarek chooses an integer n an... | code | {
"ground_truth": "{\"inputs\": [\"3\\n3 1 4\\n1 5 9\\n2 6 5\\n\", \"2\\n50 50\\n50 50\\n\", \"6\\n87 56 53 27 22 24\\n29 66 60 37 61 94\\n79 32 85 64 36 95\\n58 52 42 99 62 21\\n41 83 88 73 6 8\\n33 20 28 25 92 5\\n\", \"6\\n87 48 67 31 76 91\\n56 97 66 54 79 61\\n99 59 85 81 50 92\\n89 72 64 96 14 88\\n90 71 75 78 ... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.\n\nYou are given two strings s and t of the same length n. Their characters are numbered from 1 to n from ... | code | {
"ground_truth": "{\"inputs\": [\"3\\n9\\niredppipe\\npiedpiper\\n4\\nestt\\ntest\\n4\\ntste\\ntest\\n\", \"4\\n1\\na\\nz\\n5\\nadhas\\ndasha\\n5\\naashd\\ndasha\\n5\\naahsd\\ndasha\\n\", \"5\\n2\\nab\\naa\\n2\\naa\\naa\\n2\\nab\\nba\\n2\\nbb\\nba\\n3\\naab\\nabb\\n\", \"6\\n7\\ncontest\\nntecost\\n7\\ncontest\\nnst... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "In Chelyabinsk lives a much respected businessman Nikita with a strange nickname \"Boss\". Once Nikita decided to go with his friend Alex to the Summer Biathlon World Cup. Nikita, as a very important person, received a token which allows to place bets on each section no more than on one competitor... | code | {
"ground_truth": "{\"inputs\": [\"8 4\\n1 5 24 10\\n2 4 6 15\\n4 6 30 50\\n6 7 4 20\\n\", \"4 4\\n1 4 20 5\\n1 3 21 10\\n3 3 4 30\\n3 4 4 20\\n\", \"20 30\\n5 10 38 50\\n17 18 86 42\\n4 13 91 90\\n20 20 45 31\\n3 3 16 11\\n16 16 80 66\\n19 19 96 26\\n15 20 7 84\\n9 18 45 36\\n5 19 89 6\\n9 9 4 58\\n9 14 97 31\\n6 12... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "There is a bus route as shown in Figure 1. There are 10 stops, each numbered 0-9. The bus turns back at stop 0, but the other side is a circulation route, which circulates in the order of 5 → 6 → 7 → 8 → 9 → 5 as shown in the figure.\n\n<image>\n\n\nFor this bus route, create a program that inputs... | code | {
"ground_truth": "{\"inputs\": [\"2\\n2 4\\n4 2\", \"2\\n2 5\\n4 2\", \"2\\n2 1\\n4 2\", \"2\\n2 0\\n4 2\", \"2\\n1 4\\n4 2\", \"2\\n2 0\\n4 0\", \"2\\n2 0\\n4 1\", \"2\\n1 8\\n4 2\", \"2\\n2 0\\n3 0\", \"2\\n2 0\\n1 1\", \"2\\n1 8\\n4 0\", \"2\\n4 0\\n1 1\", \"2\\n1 8\\n8 0\", \"2\\n2 0\\n2 1\", \"2\\n1 2\\n8 0\", ... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "The students in a class in Akabe high-school define the relation “acquaintance” as:\n\n* If A and B are friends, then A is acquainted with B.\n* If A and B are friends and B is acquainted with C, then A is acquainted with C.\n\n\n\nThey define the relation “companion” as:\n\n* Suppose A is acquain... | code | {
"ground_truth": "{\"inputs\": [\"3 2\\n1 1\\n1 2\", \"7 3\\n0 1\\n1 2\\n1 3\\n2 3\\n0 4\\n4 5\\n4 6\\n5 6\", \"4 3\\n0 1\\n1 2\\n1 3\\n2 3\\n0 3\\n4 5\\n4 6\\n5 6\", \"5 2\\n1 1\\n1 2\", \"7 8\\n0 1\\n1 2\\n1 3\\n3 3\\n0 4\\n4 5\\n4 6\\n5 6\", \"7 5\\n0 1\\n1 2\\n1 3\\n2 3\\n0 3\\n4 5\\n2 6\\n5 11\", \"10 0\\n2 2\\... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Due to the frantical usage of the racket to kill flies, Marin has sustained a serious bodily injury known to the medical community as epicondylitis lateralis humeri. His grandma has advised smearing rakija over it, the doctor has prescribed a strong painkiller, but Marin has ignored every single a... | code | {
"ground_truth": "{\"inputs\": [\"4\\n1 3 5 7\\n3\\n2 2\\n2 5\\n1 5\\n\", \"5\\n3 3 4 3 2\\n4\\n1 2\\n1 3\\n5 6\\n7 9\\n\"], \"outputs\": [\"3\\n1\\n0\\n\", \"0\\n4\\n7\\n4\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "A tennis tournament with n participants is running. The participants are playing by an olympic system, so the winners move on and the losers drop out.\n\nThe tournament takes place in the following way (below, m is the number of the participants of the current round): let k be the maximal power o... | code | {
"ground_truth": "{\n \"inputs\": [\n \"5 2 3\\n\",\n \"8 2 4\\n\",\n \"10 1 500\\n\",\n \"20 500 1\\n\",\n \"100 123 99\\n\",\n \"500 1 1\\n\",\n \"500 500 500\\n\",\n \"500 237 474\\n\",\n \"1 2 3\\n\",\n \"1 2 133\\n\",\n \"1 2 100\\n\",\n \"1 3 4\\n\",\n \"1 10 15\\n\",\n ... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Chef discovered that his secret recipe has been stolen. He immediately informs the police of the theft.\n\nIt is known that the policeman and thief move on the number line. You are given that:\nThe initial location of the policeman on the number line is X and his speed is 2 units per second.\nThe ... | code | {
"ground_truth": "{\"inputs\": [\"3\\n7 1\\n2 0\\n9 4\\n\", \"1\\n3 10\\n\", \"2\\n1 2\\n1 -1\\n\", \"1\\n-1 -3\\n\", \"1\\n100000 -100000\\n\", \"1\\n3000 5000\\n\", \"1\\n-50000 50000\\n\", \"1\\n-100000 100000\\n\", \"1\\n100000 -100000\\n\"], \"outputs\": [\"6\\n2\\n5\", \"7\", \"1\\n2\", \"2\", \"200000\", \"20... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Alisha has a string of length n. Each character is either 'a', 'b' or 'c'. She has to select two characters s[i] and s[j] such that s[i] != s[j] and i,j are valid indexes. She has to find the maximum value of the absolute difference between i and j i.e abs(i-j) .\nSince Alisha is busy with her Sem... | code | {
"ground_truth": "{\"inputs\": [\"bbbcbbbb\\n\", \"ccbcccb\\n\", \"abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc\\n\", \"bbbbbabbbbbabbbbabbbaabbbabbbbabbbaabbbabbbbabbbaabbbabbbbabbbaabbbabbbbabbbaabbbabbbbabbbaabbb\\n\"], \"outputs\": [\"4\", \"6\", \"95\", \"91\"... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "There is a grid with R rows and C columns. We call the cell in the r-th row and c-th column (r,c).\n\nMr. Takahashi wrote non-negative integers into N of the cells, that is, he wrote a non-negative integer a_i into (r_i,c_i) for each i (1≤i≤N). After that he fell asleep.\n\nMr. Aoki found the grid... | code | {
"ground_truth": "{\"inputs\": [\"2 4\\n4\\n1 1 0\\n1 2 10\\n2 1 30\\n2 2 20\", \"2 2\\n3\\n1 1 0\\n1 2 10\\n2 1 22\", \"3 3\\n4\\n1 2 0\\n1 3 10\\n3 1 10\\n3 3 20\", \"2 2\\n3\\n2 1 20\\n1 2 10\\n2 1 0\", \"2 4\\n4\\n1 1 0\\n2 2 10\\n2 1 30\\n2 2 20\", \"3 3\\n4\\n1 2 1\\n1 3 10\\n3 1 10\\n3 3 20\", \"3 3\\n4\\n1 2... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Burenka and Tonya are playing an old Buryat game with a chip on a board of $n \\times m$ cells.\n\nAt the beginning of the game, the chip is located in the lower left corner of the board. In one move, the player can move the chip to the right or up by any odd number of cells (but you cannot move t... | code | {
"ground_truth": "{\"inputs\": [\"6\\n1 1\\n1 4\\n5 6\\n2 2\\n6 3\\n999999999 1000000000\\n\"], \"outputs\": [\"Tonya\\nBurenka\\nBurenka\\nTonya\\nBurenka\\nBurenka\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You're given an array of N integer numbers. \nThe maximal sum of the array is the maximal sum of the elements of a nonempty consecutive subarray of this array. For example, the maximal sum of the array [1, -2, 3, -2, 5] is 6 because the sum of the subarray [3, -2, 5] is 6 and it is impossible to ... | code | {
"ground_truth": "{\"inputs\": [\"2\\n5\\n1 -2 3 -2 5\\n2\\n-1 -2\", \"2\\n5\\n2 -2 3 -2 5\\n2\\n-1 -2\", \"2\\n5\\n2 0 3 -2 5\\n2\\n-1 -2\", \"2\\n5\\n1 0 3 -2 5\\n2\\n-1 -2\", \"2\\n5\\n1 0 3 -2 5\\n2\\n0 -2\", \"2\\n5\\n1 -1 3 -4 3\\n2\\n-1 -2\", \"2\\n5\\n1 -1 3 -4 3\\n2\\n-2 -2\", \"2\\n5\\n2 0 3 -2 5\\n2\\n0 -... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "n children are standing in a circle and playing the counting-out game. Children are numbered clockwise from 1 to n. In the beginning, the first child is considered the leader. The game is played in k steps. In the i-th step the leader counts out a_{i} people in clockwise order, starting from the n... | code | {
"ground_truth": "{\"inputs\": [\"7 5\\n10 4 11 4 1\\n\", \"3 2\\n2 5\\n\", \"2 1\\n1\\n\", \"2 1\\n2\\n\", \"2 1\\n3\\n\", \"10 7\\n5 10 4 3 8 10 6\\n\", \"10 8\\n12 6 12 15 20 8 17 12\\n\", \"12 10\\n76 58 82 54 97 46 17 40 36 15\\n\", \"12 6\\n76 61 94 15 66 26\\n\", \"90 10\\n1045 8705 6077 3282 1459 9809 383 62... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You are given a square matrix of size n (it will be an odd integer). Rows are\nindexed 0 to n-1 from top to bottom and columns are indexed 0 to n-1\nform left to right. Matrix consists of only '*' and '.'.\n'*' appears only once in the matrix while all other positions are occupied by '.'\n\nYour t... | code | {
"ground_truth": "{\"inputs\": [\"1\\n7\\n.......\\n.*.....\\n.......\\n.......\\n.......\\n.......\\n.......\\n\\nSAMPLE\", \"1\\n7\\n.......\\n.*.....\\n.......\\n.......\\n.......\\n.......\\n.......\\n\\nSAMQLE\", \"1\\n5\\n.......\\n.*.....\\n.......\\n..-..-.\\n.......\\n.......\\n....../\\n\\nSALPLE\", \"1\\n... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "You are given two integers, $a$ and $b$. You want to transform $a$ to $b$ by performing a sequence of operations. You can only perform the following operations:\n - Divide $a$ by two (only if $a$ is even)\n - Add one to $a$\n\nWhat is the minimum number of these operations you need to transform $a... | code | {
"ground_truth": "{\"inputs\": [\"103 27\\n\", \"3 8\\n\"], \"outputs\": [\"4\\n\", \"5\\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "A student, Kita_masa, is taking an English examination. In this examination, he has to write a sentence of length m.\n\nSince he completely forgot the English grammar, he decided to consider all sentences of length m constructed by concatenating the words he knows and write the K-th sentence among... | code | {
"ground_truth": "{\"inputs\": [\"3 3 4\\na\\naa\\nb\", \"3 3 4\\nb\\naa\\nb\", \"3 3 1\\na\\naa\\nb\", \"2 10 0\\nhello\\nworld\", \"2 67 1000000000000000000\\na\\nb\", \"3 3 4\\nc\\naa\\nb\", \"2 12 0\\nhello\\nworld\", \"2 132 1000000000000000000\\na\\nb\", \"3 5 4\\nc\\naa\\nb\", \"2 12 1\\nhello\\nworld\", \"2 ... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Petya and Vasya are brothers. Today is a special day for them as their parents left them home alone and commissioned them to do n chores. Each chore is characterized by a single parameter — its complexity. The complexity of the i-th chore equals hi.\n\nAs Petya is older, he wants to take the chore... | code | {
"ground_truth": "{\"inputs\": [\"5 2 3\\n6 2 3 100 1\\n\", \"7 3 4\\n1 1 9 1 1 1 1\\n\", \"4 1 3\\n10 402 402 10\\n\", \"102 101 1\\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 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 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 1 1 1 1 1 1 1... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Grapes of Coderpur are very famous. Devu went to the market and saw that there were N people selling grapes. He didn’t like it because things were not very structured. So, he gave a task to Dhinwa to make things better. If Dhinwa successfully completes the task, Devu will be happy.\n\n\nDevu wants... | code | {
"ground_truth": "{\"inputs\": [\"2\\n2 2\\n3 5\\n3 7\\n10 16 18\", \"2\\n2 2\\n3 5\\n3 7\\n8 16 18\", \"2\\n2 2\\n3 8\\n3 7\\n8 16 18\", \"2\\n2 2\\n3 8\\n3 7\\n8 16 7\", \"2\\n2 1\\n5 8\\n3 7\\n8 16 7\", \"2\\n2 2\\n5 8\\n2 7\\n7 16 7\", \"2\\n2 2\\n3 5\\n3 7\\n10 1 18\", \"2\\n2 2\\n5 8\\n3 7\\n8 11 7\", \"2\\n2 ... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom \"Graph Theory\". In total, the season has n episodes, numbered with integers from 1 to n.\n\nPolycarpus watches episodes not one by one but in a random order. He has already watched all the episodes... | code | {
"ground_truth": "{\"inputs\": [\"10\\n3 8 10 1 7 9 6 5 2\\n\", \"5\\n5 2 4 3\\n\", \"2\\n1\\n\", \"5\\n5 4 3 2\\n\", \"3\\n2 3\\n\", \"3\\n2 1\\n\", \"5\\n1 5 3 4\\n\", \"3\\n3 2\\n\", \"3\\n1 3\\n\", \"5\\n4 3 2 1\\n\", \"5\\n1 4 5 2\\n\", \"3\\n3 1\\n\", \"2\\n2\\n\", \"3\\n1 2\\n\", \"5\\n1 2 3 4\\n\", \"5\\n2 3... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "At art shows, it is very common to have booths where children can create their very own sand art. This art is typically made by taking a jar or bottle and filling it with layers of different colors of sand. Instead of a bottle, this year a new container is being used for decorating! The container ... | code | {
"ground_truth": "{\"inputs\": [\"2 2 5 5\\n2.0 2.0\\n4.0\\n1.0 0.0\\n0.0 1.0\\n1.0 0.0\\n0.0 2.0\\n\", \"2 2 5 5\\n2.0 2.0\\n4.0\\n1.0 0.0\\n0.0 1.0\\n1.5 0.0\\n0.0 2.0\\n\", \"2 5 11 10\\n3.0 4.0 4.0 9.0 2.0\\n4.0\\n2.0 2.0 1.0 0.5 0.25\\n0.0 2.0 0.0 4.0 1.0\\n2.0 2.0 3.0 4.0 0.75\\n0.0 2.1 0.0 5.1 1.1\\n\"], \"ou... | {
"index": 0,
"split": "dummy"
} |
codeforces | [
{
"content": "Title: LRU\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nWhile creating high loaded systems one should pay a special attention to caching. This problem will be about one of the most popular caching algorithms called LRU (Least Recently Used).\n\nSuppose the c... | code | {
"ground_truth": "{\"inputs\": [\"3 1\\n0.3 0.2 0.5\", \"2 1\\n0.0 1.0\", \"3 2\\n0.3 0.2 0.5\", \"3 3\\n0.2 0.3 0.5\", \"1 1\\n1.0\", \"10 1\\n0.12 0.14 0.13 0.08 0.15 0.10 0.15 0.04 0.02 0.07\", \"10 5\\n0.02 0.17 0.04 0.07 0.21 0.06 0.09 0.11 0.17 0.06\", \"10 10\\n0.02 0.03 0.12 0.21 0.07 0.15 0.21 0.14 0.01 0.0... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Given are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n* 1 \\leq K \\leq N \\leq 2\\times... | code | {
"ground_truth": "{\"inputs\": [\"4 2\\n1 2 -3 -4\", \"10 10\\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\", \"4 3\\n-1 -2 -3 -4\", \"2 1\\n-1 1000000000\", \"4 2\\n1 2 -3 0\", \"10 2\\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\", \"4 3\\n-1 -3 -3 -4\", \"3 1\\n-1 1000000... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given an array arr[] of size N,the task is to arrange the array such that odd elements occupy the odd positions and even elements occupy the even positions. The order of elements must remain the same. Consider zero-based indexing. After printing according to conditions, if remaining, print the rem... | code | {
"ground_truth": "{\"inputs\": [\"N = 6\\r\\narr[] = {1, 2, 3, 4, 5, 6}\", \"N = 4, arr[] = {3, 2, 4, 1}\"], \"outputs\": [\"2 1 4 3 6 5\", \" 2 3 4 1\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Dreamoon likes sequences very much. So he created a problem about the sequence that you can't find in OEIS: \n\nYou are given two integers $d, m$, find the number of arrays $a$, satisfying the following constraints: The length of $a$ is $n$, $n \\ge 1$ $1 \\le a_1 < a_2 < \\dots < a_n \\le d$ D... | code | {
"ground_truth": "{\"inputs\": [\"10\\n1 1000000000\\n2 999999999\\n3 99999998\\n4 9999997\\n5 999996\\n6 99995\\n7 9994\\n8 993\\n9 92\\n10 1\\n\", \"10\\n1 1000000000\\n2 999999999\\n3 170267273\\n4 9999997\\n5 999996\\n6 99995\\n7 9994\\n8 993\\n9 92\\n10 1\\n\", \"10\\n1 1000000000\\n2 999999999\\n3 170267273\\n... | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "Takahashi is meeting up with Aoki.\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\nWill he arrive in time?\n\n-----Constraints-----\n - 1 \... | code | {
"ground_truth": "{\"inputs\": [\"1000 15 80\\n\", \"2000 20 100\\n\", \"10000 1 1\\n\", \"1050 10 100\\n\", \"1001 10 100\\n\", \"1000 10 100\\n\", \"999 10 100\\n\", \"950 10 100\\n\", \"1 1 1\\n\", \"1 10000 10000\\n\", \"522 4575 6426\\n\", \"9445 8772 81\\n\", \"3447 629 3497\\n\", \"7202 7775 4325\\n\", \"3982... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "A simple recommendation system would recommend a user things liked by a certain number of their friends. In this problem you will implement part of such a system.\n\nYou are given user's friends' opinions about a list of items. You are also given a threshold T — the minimal number of \"likes\" nec... | code | {
"ground_truth": "{\"inputs\": [\"4 4 1\\nNNNY\\nNNYN\\nNYNN\\nYNNN\\n\", \"3 3 2\\nYYY\\nNNN\\nYNY\\n\", \"1 10 1\\nYYYNYNNYNN\\n\", \"8 4 1\\nYYYN\\nNNNN\\nNYNY\\nYNNY\\nYNYY\\nYNYN\\nYNNY\\nNNYN\\n\", \"9 8 7\\nNYYNNNYY\\nYYYNYNNN\\nYNYNYNNY\\nNYYYNNNY\\nNYYYYNYN\\nNNNNYYNN\\nYNYYYYYY\\nNNYNYNYY\\nNYYNNYYY\\n\", ... | {
"index": 0,
"split": "dummy"
} |
codeforces | [
{
"content": "Title: Tower of Hanoi\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThe Tower of Hanoi is a well-known mathematical puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a... | code | {
"ground_truth": "{\"inputs\": [\"0 1 1\\n1 0 1\\n1 1 0\\n3\", \"0 2 2\\n1 0 100\\n1 2 0\\n3\", \"0 2 1\\n1 0 100\\n1 2 0\\n5\", \"0 5835 1487\\n6637 0 9543\\n6961 6820 0\\n7\", \"0 3287 5433\\n6796 0 5787\\n1445 6158 0\\n26\", \"0 4449 3122\\n6816 0 8986\\n1048 1468 0\\n4\", \"0 913 8129\\n8352 0 4408\\n9073 7625 0... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You are given an array a_1, a_2, …, a_n.\n\nIn one operation you can choose two elements a_i and a_j (i ≠ j) and decrease each of them by one.\n\nYou need to check whether it is possible to make all the elements equal to zero or not.\n\nInput\n\nThe first line contains a single integer n (2 ≤ n ≤ ... | code | {
"ground_truth": "{\"inputs\": [\"6\\n1 2 3 4 5 6\\n\", \"4\\n1 1 2 2\\n\", \"3\\n10407 5987 4237\\n\", \"8\\n3343 33870 9537 1563 709 8515 5451 4713\\n\", \"3\\n319728747 773363571 580543238\\n\", \"3\\n772674020 797853944 81685387\\n\", \"3\\n10225 4237 5987\\n\", \"2\\n1 2\\n\", \"2\\n999999954 999999992\\n\", \"... | {
"index": 0,
"split": "dummy"
} |
codeforces | [
{
"content": "Title: Physical Education Lessons\n\nTime Limit: None seconds\n\nMemory Limit: None megabytes\n\nProblem Description:\nThis year Alex has finished school, and now he is a first-year student of Berland State University. For him it was a total surprise that even though he studies programming, he sti... | code | {
"ground_truth": "{\"inputs\": [\"4\\n6\\n1 2 1\\n3 4 1\\n2 3 2\\n1 3 2\\n2 4 1\\n1 4 2\", \"3\\n8\\n2 2 1\\n3 3 2\\n1 1 1\\n1 3 2\\n2 3 2\\n3 3 1\\n1 2 1\\n2 2 2\", \"7\\n10\\n5 7 1\\n5 6 2\\n7 7 2\\n6 7 2\\n5 5 1\\n3 6 2\\n1 3 2\\n5 6 1\\n1 3 1\\n6 7 1\"], \"outputs\": [\"2\\n0\\n2\\n3\\n1\\n4\", \"2\\n2\\n1\\n3\\... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "In the speed skating badge test, grades are awarded when the time specified for two distances is exceeded. For example, to reach Class A, 500 M requires less than 40.0 seconds and 1000 M requires less than 1 minute and 23 seconds.\n\nCreate a program that takes the time recorded in the speed skati... | code | {
"ground_truth": "{\"inputs\": [\"40.0 70.0\\n72.5 140.51\", \"40.0 70.15273874709118\\n72.5 140.51\", \"43.236780306897465 72.47791800727414\\n76.48007184592961 143.3245253779178\", \"50.825010742906116 75.69989732783311\\n82.26479437960049 146.33206365267094\", \"55.48794721361476 79.14473639758064\\n86.5307454979... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "When they are bored, Federico and Giada often play the following card game with a deck containing 6n cards.\n\nEach card contains one number between 1 and 6n and each number appears on exactly one card. Initially the deck is sorted, so the first card contains the number 1, the second card contains... | code | {
"ground_truth": "{\"inputs\": [\"5\\n1 3 4 5 6 7 8 11 12 13 17 24 26 27 28\\n\", \"10\\n1 2 6 7 8 9 13 14 15 16 17 18 19 21 22 23 29 30 31 34 35 36 42 43 47 50 51 52 53 54\\n\", \"10\\n2 3 4 7 32 33 34 35 37 38 39 40 41 42 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60\\n\", \"10\\n1 3 4 5 6 7 8 9 10 11 12 13 14 1... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "You're at the last mission in one very old and very popular strategy game Dune II: Battle For Arrakis. The map of the mission can be represented as a rectangular matrix of size n × m. Initially, there are a_{i, j} units of your army in the cell (i, j).\n\nYou want to prepare for the final battle, ... | code | {
"ground_truth": "{\"inputs\": [\"3 3 1\\n1 2 3\\n2 1 2\\n1 1 2\\n2 3 100\\n\", \"4 4 3\\n2 5 6 3\\n4 8 10 5\\n2 6 7 1\\n8 4 2 1\\n1 1 8\\n2 3 4\\n4 4 5\\n\"], \"outputs\": [\"\\n21 22 \\n\", \"\\n123 135 129 145 \\n\"]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "On Unix system type files can be identified with the ls -l command which displays the type of the file in the first alphabetic letter of the file system permissions field. You can find more information about file type on Unix system on the [wikipedia page](https://en.wikipedia.org/wiki/Unix_file_t... | code | {
"ground_truth": "{\"fn_name\": \"linux_type\", \"inputs\": [[\"-rwxrwxrwx\"], [\"Drwxr-xr-x\"], [\"lrwxrw-rw-\"], [\"srwxrwxrwx\"]], \"outputs\": [[\"file\"], [\"door\"], [\"symlink\"], [\"socket\"]]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
apps | [
{
"content": "You are the gym teacher in the school.\n\nThere are $n$ students in the row. And there are two rivalling students among them. The first one is in position $a$, the second in position $b$. Positions are numbered from $1$ to $n$ from left to right.\n\nSince they are rivals, you want to maximize the ... | code | {
"ground_truth": "{\n \"inputs\": [\n \"3\\n5 1 3 2\\n100 33 100 1\\n6 0 2 3\\n\",\n \"22\\n100 100 100 1\\n100 100 1 100\\n100 0 100 1\\n100 0 1 100\\n2 0 1 2\\n2 100 1 2\\n2 0 2 1\\n2 100 2 1\\n100 0 1 2\\n100 98 1 2\\n100 97 1 2\\n100 0 2 1\\n100 98 2 1\\n100 97 2 1\\n100 0 99 100\\n100 98 99 100\\n100 97 ... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Chefina is always interested to play with string. But due to exam pressure she has no time to solve a string problem. She wants your help. Can you help her to solve that problem?\nYou are given a string. You have to find out the $Wonder$ $Sum$ of the string. $Wonder$ $Sum$ of a string is defined... | code | {
"ground_truth": "{\"inputs\": [\"5\\nabc\\nbcd\\nxyz\\nyzx\\nabcde\\n\", \"1\\nsmile\\n\", \"1\\ndaisy\\n\", \"1\\ndream\\n\", \"5\\na\\nz\\nd\\ne\\nf\\n\", \"1\\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz... | {
"index": 0,
"split": "dummy"
} |
codecontests | [
{
"content": "Petr is a detective in Braginsk. Somebody stole a huge amount of money from a bank and Petr is to catch him. Somebody told Petr that some luxurious car moves along the roads without stopping.\n\nPetr knows that it is the robbers who drive the car. The roads in Braginsk are one-directional and each... | code | {
"ground_truth": "{\"inputs\": [\"5 6\\n1 2\\n2 3\\n3 1\\n3 4\\n4 5\\n5 3\\n\", \"3 3\\n1 2\\n2 3\\n3 1\\n\", \"4 6\\n3 4\\n4 3\\n3 1\\n1 2\\n2 1\\n4 2\\n\", \"5 7\\n1 2\\n2 3\\n3 1\\n1 4\\n4 3\\n1 5\\n5 4\\n\", \"7 9\\n1 2\\n2 3\\n3 4\\n4 5\\n5 1\\n1 6\\n6 4\\n4 7\\n7 1\\n\", \"2 2\\n1 2\\n2 1\\n\", \"5 8\\n1 2\\n2... | {
"index": 0,
"split": "dummy"
} |
taco | [
{
"content": "Given a number N. Check whether it is a magic number or not.\nNote:- A number is said to be a magic number, if the sum of its digits are calculated till a single digit recursively by adding the sum of the digits after every addition and the single digit comes out to be 1.\nExample 1:\nInput: N = 1... | code | {
"ground_truth": "{\"fn_name\": \"isMagic\", \"inputs\": [[1237], [12], [16], [19], [999], [1], [7], [99], [11], [10], [1000000000], [999999999]], \"outputs\": [[0], [0], [0], [1], [0], [1], [0], [0], [0], [1], [1], [0]]}",
"style": "rule"
} | {
"index": 0,
"split": "dummy"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.