data_source
stringclasses
3 values
prompt
listlengths
1
1
ability
stringclasses
1 value
reward_model
dict
extra_info
dict
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nJohn Doe has an n × m table. John Doe can paint points in some table cells, not more than one point in one table cell. John Doe wants to use such operations to make each square subtable of size n × n have exactly k points...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"8 703528038 1\\\\n\\\", \\\"output\\\": \\\"322849207\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"94 1634867304 3200\\\\n\\\", \\\"output\\\": \\\"583832610\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdou...
{ "split": "train", "index": 5700, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nproblem\n\nGiven a sequence of n integers a1, a2, ..., an and a positive integer k (1 ≤ k ≤ n), then the sum of k consecutive integers Si = ai + ai + Create a program that outputs the maximum value of 1 + ... + ai + k-1 (...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 3\\\\n2\\\\n5\\\\n-4\\\\n8\\\\n3\\\\n0 0\\\", \\\"output\\\": \\\"9\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 3\\\\n2\\\\n5\\\\n-4\\\\n12\\\\n3\\\\n0 0\\\", \\\"output\\\": \\\"13\\\\n\\\"}, {...
{ "split": "train", "index": 5701, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nPetya loves computer games. Finally a game that he's been waiting for so long came out!\n\nThe main character of this game has n different skills, each of which is characterized by an integer a_{i} from 0 to 100. The high...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2 4\\\\n7 9\\\\n\\\", \\\"output\\\": \\\"2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 8\\\\n17 15 19\\\\n\\\", \\\"output\\\": \\\"5\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\"...
{ "split": "train", "index": 5702, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nEnter a positive integer n of 4,000 or less, with a pair of integers a, b, c, d in the range 0-1000.\n\n\na + b + c + d = n\n\n\nCreate a program that outputs the number of combinations that satisfy the conditions.\n\n\n\...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n0\\\\n35\\\", \\\"output\\\": \\\"10\\\\n1\\\\n8436\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n-1\\\\n35\\\", \\\"output\\\": \\\"10\\\\n0\\\\n8436\\\\n\\\"}, {\\\"type\\\": \\\"stdin_s...
{ "split": "train", "index": 5703, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet $f_{x} = c^{2x-6} \\cdot f_{x-1} \\cdot f_{x-2} \\cdot f_{x-3}$ for $x \\ge 4$.\n\nYou have given integers $n$, $f_{1}$, $f_{2}$, $f_{3}$, and $c$. Find $f_{n} \\bmod (10^{9}+7)$.\n\n\n-----Input-----\n\nThe only line...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 1 2 5 3\\\\n\\\", \\\"output\\\": \\\"72900\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"17 97 41 37 11\\\\n\\\", \\\"output\\\": \\\"317451037\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"i...
{ "split": "train", "index": 5704, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY was offered a job of a screenwriter for the ongoing TV series. In particular, he needs to automate the hard decision: which main characters will get married by the end of the series.\n\nThere a...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4 16 105\\\\n2 4 15\\\\n1 1 16\\\\n2 2 57\\\\n3 4 31\\\\n1 2 47\\\\n2 3 28\\\\n1 3 70\\\\n4 2 50\\\\n3 1 10\\\\n4 1 11\\\\n4 4 27\\\\n1 4 56\\\\n3 3 28\\\\n3 2 28\\\\n2 1 33\\\\n4 3 63\\\\n\\\", \\\"output\\\": \\\"94\\\\...
{ "split": "train", "index": 5705, "reference": null, "knowledge_emb": [ 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe 9-th grade student Gabriel noticed a caterpillar on a tree when walking around in a forest after the classes. The caterpillar was on the height h_1 cm from the ground. On the height h_2 cm (h_2 > h_1) on the same tree...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10 30\\\\n2 1\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10 13\\\\n1 1\\\\n\\\", \\\"output\\\": \\\"0\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\":...
{ "split": "train", "index": 5706, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThis problem uses a simplified network topology model, please read the problem statement carefully and use it as a formal document as you develop the solution.\n\nPolycarpus continues working as a system administrator in ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4 3\\\\n1 2\\\\n2 3\\\\n3 4\\\\n\\\", \\\"output\\\": \\\"bus topology\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4 4\\\\n1 2\\\\n2 3\\\\n3 4\\\\n4 1\\\\n\\\", \\\"output\\\": \\\"ring topology\\\\...
{ "split": "train", "index": 5707, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nSome natural number was written on the board. Its sum of digits was not less than k. But you were distracted a bit, and someone changed this number to n, replacing some digits with others. It's known that the length of th...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n11\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n99\\\\n\\\", \\\"output\\\": \\\"0\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10\\\...
{ "split": "train", "index": 5708, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are playing a new computer game in which you have to fight monsters. In a dungeon you are trying to clear, you met three monsters; the first of them has $a$ health points, the second has $b$ health points, and the thi...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n3 2 4\\\\n1 1 1\\\\n10 1 7\\\\n\\\", \\\"output\\\": \\\"YES\\\\nNO\\\\nNO\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n1111111 2222222 6666666\\\\n\\\", \\\"output\\\": \\\"YES\\\\n\\\"}...
{ "split": "train", "index": 5709, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given two integers $x$ and $y$ (it is guaranteed that $x > y$). You may choose any prime integer $p$ and subtract it any number of times from $x$. Is it possible to make $x$ equal to $y$?\n\nRecall that a prime nu...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n100 98\\\\n42 32\\\\n1000000000000000000 1\\\\n41 40\\\\n\\\", \\\"output\\\": \\\"YES\\\\nYES\\\\nYES\\\\nNO\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n1383 1382\\\\n\\\", \\\"output\\...
{ "split": "train", "index": 5710, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S consisting of lowercase English letters.\nDetermine whether we can turn S into a palindrome by repeating the operation of swapping two adjacent characters. If it is possible, find the minimum requ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"eel\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"ataatmma\\\\n\\\", \\\"output\\\": \\\"4\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"snuke\\\\n...
{ "split": "train", "index": 5711, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nProblem A Secret of Chocolate Poles\n\nWendy, the master of a chocolate shop, is thinking of displaying poles of chocolate disks in the showcase. She can use three kinds of chocolate disks: white thin disks, dark thin dis...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 4\\\", \\\"output\\\": \\\"4\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2 4\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4 4\\\", \\\"output\\\": ...
{ "split": "train", "index": 5712, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nIahub is so happy about inventing bubble sort graphs that he's staying all day long at the office and writing permutations. Iahubina is angry that she is no more important for Iahub. When Iahub goes away, Iahubina comes t...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"6\\\\n-1 -1 -1 -1 -1 -1\\\\n\\\", \\\"output\\\": \\\"265\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10\\\\n4 10 -1 1 6 8 9 2 -1 -1\\\\n\\\", \\\"output\\\": \\\"4\\\\n\\\"}, {\\\"type\\\": \\\"std...
{ "split": "train", "index": 5713, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\nAt least how many sheets of paper does he need?\n\n-----Constraints-----\n - N is an integer.\n...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n\\\", \\\"output\\\": \\\"3\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"100\\\\n\\\", \\\"o...
{ "split": "train", "index": 5714, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer number $n$. The following algorithm is applied to it:\n\n if $n = 0$, then end algorithm; find the smallest prime divisor $d$ of $n$; subtract $d$ from $n$ and go to step $1$. \n\nDetermine the...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n\\\", \\\"output\\\": \\\"2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n\\\", \\\"out...
{ "split": "train", "index": 5715, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nVictor tries to write his own text editor, with word correction included. However, the rules of word correction are really strange.\n\nVictor thinks that if a word contains two consecutive vowels, then it's kinda weird an...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\nweird\\\\n\\\", \\\"output\\\": \\\"werd\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\nword\\\\n\\\", \\\"output\\\": \\\"word\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\"...
{ "split": "train", "index": 5716, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe make a tower by stacking up blocks. The tower consists of several stages and each stage is constructed by connecting blocks horizontally. Each block is of the same weight and is tough enough to withstand the weight equ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 4\\\", \\\"output\\\": \\\"5\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4 8\\\", \\\"output\\\": \\\"4\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"6 8\\\", \\\"output\\\": ...
{ "split": "train", "index": 5717, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nDecades have passed since the beginning of AtCoder Beginner Contest.\nThe contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds shou...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"999\\\\n\\\", \\\"output\\\": \\\"ABC\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1000\\\\n\\\", \\\"output\\\": \\\"ABD\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1481\\\\n\...
{ "split": "train", "index": 5718, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nBerland National Library has recently been built in the capital of Berland. In addition, in the library you can take any of the collected works of Berland leaders, the library has a reading room.\n\nToday was the pilot la...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"6\\\\n+ 12001\\\\n- 12001\\\\n- 1\\\\n- 1200\\\\n+ 1\\\\n+ 7\\\\n\\\", \\\"output\\\": \\\"3\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n- 1\\\\n- 2\\\\n\\\", \\\"output\\\": \\\"2\\\"}, {\\\"type\...
{ "split": "train", "index": 5719, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn order to make the \"Sea Battle\" game more interesting, Boris decided to add a new ship type to it. The ship consists of two rectangles. The first rectangle has a width of $w_1$ and a height of $h_1$, while the second ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2 1 2 1\\\\n\\\", \\\"output\\\": \\\"12\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2 2 1 2\\\\n\\\", \\\"output\\\": \\\"16\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 1 1...
{ "split": "train", "index": 5720, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence $a_1, a_2, \\dots, a_n$ consisting of $n$ non-zero integers (i.e. $a_i \\ne 0$). \n\nYou have to calculate two following values: the number of pairs of indices $(l, r)$ $(l \\le r)$ such that $a_...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n5 -3 3 -1 1\\\\n\\\", \\\"output\\\": \\\"8 7\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10\\\\n4 2 -4 3 1 2 -4 3 2 3\\\\n\\\", \\\"output\\\": \\\"28 27\\\\n\\\"}, {\\\"type\\\": \\\"stdin_s...
{ "split": "train", "index": 5721, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a program which reads relations in a SNS (Social Network Service), and judges that given pairs of users are reachable each other through the network.\n\nConstraints\n\n* $2 \\leq n \\leq 100,000$\n* $0 \\leq m \\leq...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10 9\\\\n0 1\\\\n0 2\\\\n3 4\\\\n5 7\\\\n5 6\\\\n3 7\\\\n6 8\\\\n7 8\\\\n8 9\\\\n3\\\\n0 1\\\\n5 9\\\\n1 3\\\", \\\"output\\\": \\\"yes\\\\nyes\\\\nno\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"16 ...
{ "split": "train", "index": 5722, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an integer N. Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally \"Seven-Five-Three numbers\") are there?\nHere, a Shichi-Go-San number is a positive integer that satis...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"575\\\\n\\\", \\\"output\\\": \\\"4\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3600\\\\n\\\", \\\"output\\\": \\\"13\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"999999999\\\\...
{ "split": "train", "index": 5723, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\n-----Constraints-----\n - 1 \\leq N \\leq 10^5\n\n-----Input---...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"11\\\\n\\\", \\\"output\\\": \\\"9\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"136\\\\n\\\", \\\"output\\\": \\\"46\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"100000\\\\n\\\"...
{ "split": "train", "index": 5724, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nTernary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"-.....----.\\\\n\\\", \\\"output\\\": \\\"10000220\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"-.-..-.--.---..---.-..---.-...-.-.----..-.---.-.---..-.--.---.-.-------.---.--....----.-.---.---.---.--...
{ "split": "train", "index": 5725, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an array $a$ of length $n$ and array $b$ of length $m$ both consisting of only integers $0$ and $1$. Consider a matrix $c$ of size $n \\times m$ formed by following rule: $c_{i, j} = a_i \\cdot b_j$ (i.e. $a...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 3 2\\\\n1 0 1\\\\n1 1 1\\\\n\\\", \\\"output\\\": \\\"4\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 5 4\\\\n1 1 1\\\\n1 1 1 1 1\\\\n\\\", \\\"output\\\": \\\"14\\\\n\\\"}, {\\\"type\\\": \\\"std...
{ "split": "train", "index": 5726, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou have a given integer $n$. Find the number of ways to fill all $3 \\times n$ tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. $\\square$ This pictur...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n\\\", \\\"output\\\": \\\"4\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n\\\", \\\"output\\\": \\\"0\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"17\\\\n\\\", \\\"output\\\": ...
{ "split": "train", "index": 5727, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYoung boy Artem tries to paint a picture, and he asks his mother Medina to help him. Medina is very busy, that's why she asked for your help.\n\nArtem wants to paint an $n \\times m$ board. Each cell of the board should b...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n3 2\\\\n3 3\\\\n\\\", \\\"output\\\": \\\"WB\\\\nBB\\\\nBB\\\\nWBB\\\\nBBB\\\\nBBB\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"16\\\\n2 2\\\\n2 3\\\\n4 2\\\\n2 5\\\\n2 3\\\\n3 3\\\\n3 4\\\\n3 ...
{ "split": "train", "index": 5728, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a progra...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n\\\", \\\"output\\\": \\\"Hello World\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n3\\\\n5\\\\n\\\", \\\"output\\\": \\\"8\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \...
{ "split": "train", "index": 5729, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Little Elephant has an integer a, written in the binary notation. He wants to write this number on a piece of paper.\n\nTo make sure that the number a fits on the piece of paper, the Little Elephant ought to delete ex...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"101\\\\n\\\", \\\"output\\\": \\\"11\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"110010\\\\n\\\", \\\"output\\\": \\\"11010\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10000\\...
{ "split": "train", "index": 5730, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nA direced graph is strongly connected if every two nodes are reachable from each other. In a strongly connected component of a directed graph, every two nodes of the component are mutually reachable.\n\nConstraints\n\n* 1...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 6\\\\n0 1\\\\n1 0\\\\n0 2\\\\n2 4\\\\n4 3\\\\n3 2\\\\n4\\\\n0 1\\\\n0 3\\\\n2 3\\\\n3 4\\\", \\\"output\\\": \\\"1\\\\n0\\\\n1\\\\n1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 6\\\\n0 1\\\\n1 0...
{ "split": "train", "index": 5731, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nINTERCAL is the oldest of esoteric programming languages. One of its many weird features is the method of character-based output, known as Turing Tape method. It converts an array of unsigned 8-bit integers into a sequenc...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"|wB6qdp/]MLcsaTcq*k`ORMsjdW{\\\\\\\"i5gD_@ap*L0.QbDx:pW3-=-;G~#5EeY\\\\n\\\", \\\"output\\\": \\\"194\\\\n80\\\\n172\\\\n214\\\\n222\\\\n104\\\\n24\\\\n26\\\\n58\\\\n8\\\\n128\\\\n108\\\\n248\\\\n72\\\\n92\\\\n100\\\\n56\...
{ "split": "train", "index": 5732, "reference": null, "knowledge_emb": [ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given $n$ integers $w_i (i = 0, 1, ..., n-1)$ to be sorted in ascending order. You can swap two integers $w_i$ and $w_j$. Each swap operation has a cost, which is the sum of the two integers $w_i + w_j$. You can p...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n8 3 2 1\\\", \\\"output\\\": \\\"14\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n0 5 3 4 2\\\", \\\"output\\\": \\\"7\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\...
{ "split": "train", "index": 5733, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp is preparing the first programming contest for robots. There are $n$ problems in it, and a lot of robots are going to participate in it. Each robot solving the problem $i$ gets $p_i$ points, and the score of each...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n1 1 1 0 0\\\\n0 1 1 1 1\\\\n\\\", \\\"output\\\": \\\"3\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n0 0 0\\\\n0 0 0\\\\n\\\", \\\"output\\\": \\\"-1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_s...
{ "split": "train", "index": 5734, "reference": null, "knowledge_emb": [ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nMobile phones are equipped with a function that displays input candidates in order to efficiently input texts such as emails. This records frequently used words and presents words that have the entered letters as initial ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\nben likes bananas the best among many fruits because bananas are sweet and cheap\\\\nb\\\\n1\\\\nwinners get to visit aizu and the university of aizu and make many friends as well\\\\na\\\\n3\\\\nask alex about\\\\n...
{ "split": "train", "index": 5735, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nVova's house is an array consisting of $n$ elements (yeah, this is the first problem, I think, where someone lives in the array). There are heaters in some positions of the array. The $i$-th element of the array is $1$ if...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"6 2\\\\n0 1 1 0 0 1\\\\n\\\", \\\"output\\\": \\\"3\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 3\\\\n1 0 0 0 1\\\\n\\\", \\\"output\\\": \\\"2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"...
{ "split": "train", "index": 5736, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are playing one RPG from the 2010s. You are planning to raise your smithing skill, so you need as many resources as possible. So how to get resources? By stealing, of course.\n\nYou decided to rob a town's blacksmith ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n33 27\\\\n6 10\\\\n5 6\\\\n100 200\\\\n10 10\\\\n5 5\\\\n1 19\\\\n1 3\\\\n19 5\\\\n\\\", \\\"output\\\": \\\"11\\\\n20\\\\n3\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n1 1\\\\n1 1\\\\n1...
{ "split": "train", "index": 5737, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nVanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of the pyramid must consist of 1 cube, the second level must consist of 1 + 2 = 3 cubes, the third lev...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"25\\\\n\\\", \\\"output\\\": \\\"4\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n\\\", \\\"ou...
{ "split": "train", "index": 5738, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are N bags of biscuits. The i-th bag contains A_i biscuits.\n\nTakaki will select some of these bags and eat all of the biscuits inside. Here, it is also possible to select all or none of the bags.\n\nHe would like ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 1\\\\n67\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"45 1\\\\n17 55 85 55 74 20 90 67 40 70 39 89 91 50 16 24 14 43 24 68 25 9 89 71 41 16 53 13 61 15 85 72 62 67 42 26 ...
{ "split": "train", "index": 5739, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nSome days ago, I learned the concept of LCM (least common multiple). I've played with it for several times and I want to make a big number with it.\n\nBut I also don't want to use many numbers, so I'll choose three positi...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"862795\\\\n\\\", \\\"output\\\": \\\"642275489615199390\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"116\\\\n\\\", \\\"output\\\": \\\"1507420\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"inpu...
{ "split": "train", "index": 5740, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different.\n\n-----Constraints-----\n - 2 ≤ |S| ≤ 26, where |S| denotes the length of S.\n - S consists of lo...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"uncopyrightable\\\\n\\\", \\\"output\\\": \\\"yes\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"different\\\\n\\\", \\\"output\\\": \\\"no\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\"...
{ "split": "train", "index": 5741, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nLittle Artem got n stones on his birthday and now wants to give some of them to Masha. He knows that Masha cares more about the fact of receiving the present, rather than the value of that present, so he wants to give her...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n\\\", \\\"out...
{ "split": "train", "index": 5742, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nFind the minimum number with the given sum of digits $s$ such that all digits in it are distinct (i.e. all digits are unique).\n\nFor example, if $s=20$, then the answer is $389$. This is the minimum number in which all d...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n20\\\\n8\\\\n45\\\\n10\\\\n\\\", \\\"output\\\": \\\"389\\\\n8\\\\n123456789\\\\n19\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"45\\\\n1\\\\n2\\\\n3\\\\n4\\\\n5\\\\n6\\\\n7\\\\n8\\\\n9\\\\n10\...
{ "split": "train", "index": 5743, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn Summer Informatics School, if a student doesn't behave well, teachers make a hole in his badge. And today one of the teachers caught a group of $n$ students doing yet another trick. \n\nLet's assume that all these stud...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n2 3 2\\\\n\\\", \\\"output\\\": \\\"2 2 3 \\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n1 2 3\\\\n\\\", \\\"output\\\": \\\"1 2 3 \\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"inpu...
{ "split": "train", "index": 5744, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe only difference between easy and hard versions is constraints.\n\nA session has begun at Beland State University. Many students are taking exams.\n\nPolygraph Poligrafovich is going to examine a group of $n$ students....
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"7 15\\\\n1 2 3 4 5 6 7\\\\n\\\", \\\"output\\\": \\\"0 0 0 0 0 2 3 \\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 100\\\\n80 40 40 40 60\\\\n\\\", \\\"output\\\": \\\"0 1 1 2 3 \\\"}, {\\\"type\\\": \\\"...
{ "split": "train", "index": 5745, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp is writing the prototype of a graphic editor. He has already made up his mind that the basic image transformations in his editor will be: rotate the image 90 degrees clockwise, flip the image horizontally (symmet...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 2\\\\n.*.\\\\n.*.\\\\n\\\", \\\"output\\\": \\\"....\\\\n....\\\\n****\\\\n****\\\\n....\\\\n....\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 100\\\\n.\\\\n.\\\\n.\\\\n.\\\\n.\\\\n.\\\\n.\\\\n.\...
{ "split": "train", "index": 5746, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nBeing tired of participating in too many Codeforces rounds, Gildong decided to take some rest in a park. He sat down on a bench, and soon he found two rabbits hopping around. One of the rabbits was taller than the other.\...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n0 10 2 3\\\\n0 10 3 3\\\\n900000000 1000000000 1 9999999\\\\n1 2 1 1\\\\n1 3 1 1\\\\n\\\", \\\"output\\\": \\\"2\\\\n-1\\\\n10\\\\n-1\\\\n1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n0 ...
{ "split": "train", "index": 5747, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nConsider all binary strings of length $m$ ($1 \\le m \\le 60$). A binary string is a string that consists of the characters 0 and 1 only. For example, 0110 is a binary string, and 012aba is not. Obviously, there are exact...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n3 3\\\\n010\\\\n001\\\\n111\\\\n4 3\\\\n000\\\\n111\\\\n100\\\\n011\\\\n1 1\\\\n1\\\\n1 1\\\\n0\\\\n3 2\\\\n00\\\\n01\\\\n10\\\\n\\\", \\\"output\\\": \\\"100\\\\n010\\\\n0\\\\n1\\\\n11\\\\n\\\"}, {\\\"type\\\": \\\...
{ "split": "train", "index": 5748, "reference": null, "knowledge_emb": [ 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nIn the official contest this problem has a different statement, for which jury's solution was working incorrectly, and for this reason it was excluded from the contest. This mistake have been fixed and the current given p...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"8\\\\n729541013 135019377 88372488 319157478 682081360 558614617 258129110 790518782\\\\n\\\", \\\"output\\\": \\\"470242129\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"18\\\\n515925896 832652240 2799756...
{ "split": "train", "index": 5749, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a prime number $p$, $n$ integers $a_1, a_2, \\ldots, a_n$, and an integer $k$. \n\nFind the number of pairs of indexes $(i, j)$ ($1 \\le i < j \\le n$) for which $(a_i + a_j)(a_i^2 + a_j^2) \\equiv k \\bmod ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 3 0\\\\n0 1 2\\\\n\\\", \\\"output\\\": \\\"1\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"6 7 2\\\\n1 2 3 4 5 6\\\\n\\\", \\\"output\\\": \\\"3\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\":...
{ "split": "train", "index": 5750, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 4 240\\\\n60 90 120\\\\n80 150 80 150\\\\n\\\", \\\"output\\\": \\\"3\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 4 730\\\\n60 90 120\\\\n80 150 80 150\\\\n\\\", \\\"output\\\": \\\"7\\\\n\\\"},...
{ "split": "train", "index": 5751, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nA soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so on (in other words, he has to pay i·k dollars for the i-th banana). \n\nHe has n dollars. Ho...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 17 4\\\\n\\\", \\\"output\\\": \\\"13\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 2 1\\\\n\\\", \\\"output\\\": \\\"0\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 1 1\\\\n\\\", \\\...
{ "split": "train", "index": 5752, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a building consisting of $10~000$ apartments numbered from $1$ to $10~000$, inclusive.\n\nCall an apartment boring, if its number consists of the same digit. Examples of boring apartments are $11, 2, 777, 9999$ a...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n22\\\\n9999\\\\n1\\\\n777\\\\n\\\", \\\"output\\\": \\\"13\\\\n90\\\\n1\\\\n66\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"36\\\\n1\\\\n2\\\\n3\\\\n4\\\\n5\\\\n6\\\\n7\\\\n8\\\\n9\\\\n11\\\\n2...
{ "split": "train", "index": 5753, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nMahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz who likes strings. He wrote it on a magical paper but he was surprised because some characters disappeared while writing ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\naab\\\\n2 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\\\n\\\", \\\"output\\\": \\\"3\\\\n2\\\\n2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10\\\\nabcdeabcde\\\\n5 5 5 5 4 1 1 1 1 1 1 ...
{ "split": "train", "index": 5754, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nBertown is a city with $n$ buildings in a straight line.\n\nThe city's security service discovered that some buildings were mined. A map was compiled, which is a string of length $n$, where the $i$-th character is \"1\" i...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n1 1\\\\n01000010\\\\n5 1\\\\n01101110\\\\n\\\", \\\"output\\\": \\\"2\\\\n6\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n1 1\\\\n01000110\\\\n5 1\\\\n01101110\\\\n\\\", \\\"output\\\": \\...
{ "split": "train", "index": 5755, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nPolycarp is playing a new computer game. This game has $n$ stones in a row. The stone on the position $i$ has integer power $a_i$. The powers of all stones are distinct.\n\nEach turn Polycarp can destroy either stone on t...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n5\\\\n1 5 4 3 2\\\\n8\\\\n2 1 3 4 5 6 8 7\\\\n8\\\\n4 2 3 1 8 6 7 5\\\\n4\\\\n3 4 2 1\\\\n4\\\\n2 3 1 4\\\\n\\\", \\\"output\\\": \\\"2\\\\n4\\\\n5\\\\n3\\\\n2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"inp...
{ "split": "train", "index": 5756, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nAnton likes to listen to fairy tales, especially when Danik, Anton's best friend, tells them. Right now Danik tells Anton a fairy tale:\n\n\"Once upon a time, there lived an emperor. He was very rich and had much grain. O...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 2\\\\n\\\", \\\"output\\\": \\\"4\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"8 1\\\\n\\\", \\\"output\\\": \\\"5\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"32 5\\\\n\\\", ...
{ "split": "train", "index": 5757, "reference": null, "knowledge_emb": [ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are N people living on a number line.\nThe i-th person lives at coordinate X_i.\nYou are going to hold a meeting that all N people have to attend.\nThe meeting can be held at any integer coordinate. If you choose to...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n1 4\\\\n\\\", \\\"output\\\": \\\"5\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"7\\\\n14 14 2 13 56 2 37\\\\n\\\", \\\"output\\\": \\\"2354\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"...
{ "split": "train", "index": 5758, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given four integers $n$, $c_0$, $c_1$ and $h$ and a binary string $s$ of length $n$.\n\nA binary string is a string consisting of characters $0$ and $1$.\n\nYou can change any character of the string $s$ (the stri...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"6\\\\n3 1 1 1\\\\n100\\\\n5 10 100 1\\\\n01010\\\\n5 10 1 1\\\\n11111\\\\n5 1 10 1\\\\n11111\\\\n12 2 1 10\\\\n101110110101\\\\n2 100 1 10\\\\n00\\\\n\\\", \\\"output\\\": \\\"3\\\\n52\\\\n5\\\\n10\\\\n16\\\\n22\\\\n\\\"}...
{ "split": "train", "index": 5759, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given an array a of length n.\n\nLet's define the eversion operation. Let x = a_n. Then array a is partitioned into two parts: left and right. The left part contains the elements of a that are not greater than x (...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n1\\\\n998244353\\\\n4\\\\n1 1 2 3\\\\n\\\", \\\"output\\\": \\\"0\\\\n0\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n1\\\\n925217660\\\\n4\\\\n1 1 2 3\\\\n\\\", \\\"output\\\": \\\"0\\\\n...
{ "split": "train", "index": 5760, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nVasya owns three big integers — $a, l, r$. Let's define a partition of $x$ such a sequence of strings $s_1, s_2, \\dots, s_k$ that $s_1 + s_2 + \\dots + s_k = x$, where $+$ is a concatanation of strings. $s_i$ is the $i$-...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"135\\\\n1\\\\n15\\\\n\\\", \\\"output\\\": \\\"2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10000\\\\n0\\\\n9\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"inp...
{ "split": "train", "index": 5761, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nAmr doesn't like Maths as he finds it really boring, so he usually sleeps in Maths lectures. But one day the teacher suspected that Amr is sleeping and asked him a question to make sure he wasn't.\n\nFirst he gave Amr two...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 2 1000\\\\n\\\", \\\"output\\\": \\\"4\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2 2 1000\\\\n\\\", \\\"output\\\": \\\"45\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 3 1103\\\\n\...
{ "split": "train", "index": 5762, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nNathan O. Davis has been running an electronic bulletin board system named JAG-channel. He is now having hard time to add a new feature there --- threaded view.\n\nLike many other bulletin board systems, JAG-channel is th...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n0\\\\nccpi\\\", \\\"output\\\": \\\"ccpi\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n0\\\\nipcc\\\", \\\"output\\\": \\\"ipcc\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\...
{ "split": "train", "index": 5763, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nAlice and Borys are playing tennis.\n\nA tennis match consists of games. In each game, one of the players is serving and the other one is receiving.\n\nPlayers serve in turns: after a game where Alice is serving follows a...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n2 1\\\\n1 1\\\\n0 5\\\\n\\\", \\\"output\\\": \\\"4\\\\n0 1 2 3\\\\n2\\\\n0 2\\\\n2\\\\n2 3\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n0 100000\\\\n100000 0\\\\n\\\", \\\"output\\\": \\...
{ "split": "train", "index": 5764, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a chess board with $n$ rows and $n$ columns. Initially all cells of the board are empty, and you have to put a white or a black knight into each cell of the board.\n\nA knight is a chess piece that can attac...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n\\\", \\\"output\\\": \\\"WBW\\\\nBWB\\\\nWBW\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n\\\", \\\"output\\\": \\\"WBWB\\\\nBWBW\\\\nWBWB\\\\nBWBW\\\\n\\\"}, {\\\"type\\\": \\\"stdin_st...
{ "split": "train", "index": 5765, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThis is a simplified version of the problem B2. Perhaps you should read the problem B2 before you start solving B1.\n\nPaul and Mary have a favorite string $s$ which consists of lowercase letters of the Latin alphabet. Th...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\nkzaaa\\\\ncodeforces\\\\narchive\\\\ny\\\\nxxxxxx\\\\n\\\", \\\"output\\\": \\\"2\\\\n5\\\\n3\\\\n0\\\\n1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\naa\\\\n\\\", \\\"output\\\": \\\"1\\...
{ "split": "train", "index": 5766, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nLet us consider sets of positive integers less than or equal to n. Note that all elements of a set are different. Also note that the order of elements doesn't matter, that is, both {3, 5, 9} and {5, 9, 3} mean the same se...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"9 3 23\\\\n9 3 22\\\\n10 3 28\\\\n16 10 107\\\\n20 8 102\\\\n20 10 105\\\\n20 10 155\\\\n3 5 3\\\\n4 2 11\\\\n0 0 0\\\", \\\"output\\\": \\\"1\\\\n2\\\\n0\\\\n20\\\\n1542\\\\n5448\\\\n1\\\\n0\\\\n0\\\\n\\\"}, {\\\"type\\\...
{ "split": "train", "index": 5767, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nHaruna is a high school student. She must remember the seating arrangements in her class because she is a class president. It is too difficult task to remember if there are so many students.\n\nThat is the reason why seat...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2 1\\\\n2 2\\\\n0 0\\\", \\\"output\\\": \\\"yes\\\\nyes\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 1\\\\n2 0\\\\n0 0\\\", \\\"output\\\": \\\"no\\\\nyes\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdou...
{ "split": "train", "index": 5768, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nNot long ago Billy came across such a problem, where there were given three natural numbers A, B and C from the range [1, N], and it was asked to check whether the equation AB = C is correct. Recently Billy studied the co...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"127\\\\n\\\", \\\"output\\\": \\\"226374\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"987572\\\\n\\\", \\\"output\\\": \\\"107019643962508968\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input...
{ "split": "train", "index": 5769, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nA monster is attacking the Cyberland!\n\nMaster Yang, a braver, is going to beat the monster. Yang and the monster each have 3 attributes: hitpoints (HP), offensive power (ATK) and defensive power (DEF).\n\nDuring the bat...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 2 1\\\\n1 100 1\\\\n1 100 100\\\\n\\\", \\\"output\\\": \\\"99\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"100 100 100\\\\n1 1 1\\\\n1 1 1\\\\n\\\", \\\"output\\\": \\\"0\\\\n\\\"}, {\\\"type\\\":...
{ "split": "train", "index": 5770, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nAn array of integers $p_1, p_2, \\dots, p_n$ is called a permutation if it contains each number from $1$ to $n$ exactly once. For example, the following arrays are permutations: $[3, 1, 2]$, $[1]$, $[1, 2, 3, 4, 5]$ and $...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n-2 1\\\\n\\\", \\\"output\\\": \\\"3 1 2 \\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n1 1 1 1\\\\n\\\", \\\"output\\\": \\\"1 2 3 4 5 \\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\"...
{ "split": "train", "index": 5771, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nUser ainta has a permutation p_1, p_2, ..., p_{n}. As the New Year is coming, he wants to make his permutation as pretty as possible.\n\nPermutation a_1, a_2, ..., a_{n} is prettier than permutation b_1, b_2, ..., b_{n}, ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"7\\\\n5 2 4 3 6 7 1\\\\n0001001\\\\n0000000\\\\n0000010\\\\n1000001\\\\n0000000\\\\n0010000\\\\n1001000\\\\n\\\", \\\"output\\\": \\\"1 2 4 3 6 7 5\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n...
{ "split": "train", "index": 5772, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a string $s$ consisting of $n$ lowercase Latin letters. $n$ is even.\n\nFor each position $i$ ($1 \\le i \\le n$) in string $s$ you are required to change the letter on this position either to the previous l...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n6\\\\nabccba\\\\n2\\\\ncf\\\\n4\\\\nadfa\\\\n8\\\\nabaazaba\\\\n2\\\\nml\\\\n\\\", \\\"output\\\": \\\"YES\\\\nNO\\\\nYES\\\\nNO\\\\nNO\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n2\\\\n...
{ "split": "train", "index": 5773, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nFor the multiset of positive integers s=\\\\{s_1,s_2,...,s_k\\}, define the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of s as follow:\n\n * \\gcd(s) is the maximum positive integer x, such that all in...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n199999 200000\\\\n\\\", \\\"output\\\": \\\"39999800000\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n10007 20014\\\\n\\\", \\\"output\\\": \\\"20014\\\\n\\\"}, {\\\"type\\\": \\\"stdin_st...
{ "split": "train", "index": 5774, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nNatasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lowercase Latin letter. This way, the rocket can be described by the string ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5 3\\\\nxyabd\\\\n\\\", \\\"output\\\": \\\"29\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"7 4\\\\nproblem\\\\n\\\", \\\"output\\\": \\\"34\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2...
{ "split": "train", "index": 5775, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nWe have a tree with N vertices and N-1 edges, respectively numbered 1, 2,\\cdots, N and 1, 2, \\cdots, N-1. Edge i connects Vertex u_i and v_i.\nFor integers L, R (1 \\leq L \\leq R \\leq N), let us define a function f(L,...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n1 3\\\\n2 3\\\\n\\\", \\\"output\\\": \\\"7\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n1 2\\\\n\\\", \\\"output\\\": \\\"3\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\":...
{ "split": "train", "index": 5776, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nTakahashi has N sticks that are distinguishable from each other. The length of the i-th stick is L_i.\nHe is going to form a triangle using three of these sticks. Let a, b, and c be the lengths of the three sticks used. H...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n3 4 2 1\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n1 1000 1\\\\n\\\", \\\"output\\\": \\\"0\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\"...
{ "split": "train", "index": 5777, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nA 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 Plac...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n12 5\\\\n1000 2000\\\\n\\\", \\\"output\\\": \\\"1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n21 -11\\\\n81234 94124 52141\\\\n\\\", \\\"output\\\": \\\"3\\\\n\\\"}, {\\\"type\\\": \\\"...
{ "split": "train", "index": 5778, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nOne day n friends met at a party, they hadn't seen each other for a long time and so they decided to make a group photo together. \n\nSimply speaking, the process of taking photos can be described as follows. On the photo...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n1 10\\\\n5 5\\\\n10 1\\\\n\\\", \\\"output\\\": \\\"75 110 60 \\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n2 1\\\\n1 2\\\\n2 1\\\\n\\\", \\\"output\\\": \\\"6 4 6 \\\"}, {\\\"type\\\": \\\"st...
{ "split": "train", "index": 5779, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nKattapa, as you all know was one of the greatest warriors of his time. The kingdom of Maahishmati had never lost a battle under him (as army-chief), and the reason for that was their really powerful army, also called as M...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n1\\\\n\\\", \\\"output\\\": \\\"NOT READY\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n2\\\", \\\"output\\\": \\\"READY FOR BATTLE\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\"...
{ "split": "train", "index": 5780, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nLike any unknown mathematician, Yuri has favourite numbers: $A$, $B$, $C$, and $D$, where $A \\leq B \\leq C \\leq D$. Yuri also likes triangles and once he thought: how many non-degenerate triangles with integer sides $x...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 2 3 4\\\\n\\\", \\\"output\\\": \\\"4\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 2 2 5\\\\n\\\", \\\"output\\\": \\\"3\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"500000 ...
{ "split": "train", "index": 5781, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are playing a variation of game 2048. Initially you have a multiset $s$ of $n$ integers. Every integer in this multiset is a power of two. \n\nYou may perform any number (possibly, zero) operations with this multiset....
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"6\\\\n4\\\\n1024 512 64 512\\\\n1\\\\n2048\\\\n3\\\\n64 512 2\\\\n2\\\\n4096 4\\\\n7\\\\n2048 2 2048 2048 2048 2048 2048\\\\n2\\\\n2048 4096\\\\n\\\", \\\"output\\\": \\\"YES\\\\nYES\\\\nNO\\\\nNO\\\\nYES\\\\nYES\\\\n\\\"...
{ "split": "train", "index": 5782, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nConstraints\n\n* 1 ≤ a, b ≤ 100\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\n...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"0 5\\\", \\\"output\\\": \\\"0 10\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 5\\\", \\\"output\\\": \\\"5 12\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1 3\\\", \\\"output...
{ "split": "train", "index": 5783, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given two positive integers $a$ and $b$.\n\nIn one move, you can change $a$ in the following way:\n\n Choose any positive odd integer $x$ ($x > 0$) and replace $a$ with $a+x$; choose any positive even integer $y...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"5\\\\n2 3\\\\n10 10\\\\n2 4\\\\n7 4\\\\n9 3\\\\n\\\", \\\"output\\\": \\\"1\\\\n0\\\\n2\\\\n2\\\\n1\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n19260817 114514\\\\n\\\", \\\"output\\\": \\\"2\...
{ "split": "train", "index": 5784, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nVlad went into his appartment house entrance, now he is on the $1$-th floor. He was going to call the elevator to go up to his apartment.\n\nThere are only two elevators in his house. Vlad knows for sure that:\n\nthe firs...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n1 2 3\\\\n3 1 2\\\\n3 2 1\\\\n\\\", \\\"output\\\": \\\"1\\\\n3\\\\n2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n1902 3 5\\\\n\\\", \\\"output\\\": \\\"2\\\\n\\\"}, {\\\"type\\\": \\\"s...
{ "split": "train", "index": 5785, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYou are given a rectangle grid. That grid's size is n × m. Let's denote the coordinate system on the grid. So, each point on the grid will have coordinates — a pair of integers (x, y) (0 ≤ x ≤ n, 0 ≤ y ≤ m).\n\nYour task ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"9 9 5 5 2 1\\\\n\\\", \\\"output\\\": \\\"1 3 9 7\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"100 100 52 50 46 56\\\\n\\\", \\\"output\\\": \\\"17 8 86 92\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\...
{ "split": "train", "index": 5786, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you c...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"11\\\\n\\\", \\\"output\\\": \\\"Yes\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"40\\\\n\\\", \\\"output\\\": \\\"Yes\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n\\\", \...
{ "split": "train", "index": 5787, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nInnovation technologies are on a victorious march around the planet. They integrate into all spheres of human activity!\n\nA restaurant called \"Dijkstra's Place\" has started thinking about optimizing the booking system....
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n10 50\\\\n2 100\\\\n5 30\\\\n3\\\\n4 6 9\\\\n\\\", \\\"output\\\": \\\"2 130\\\\n2 1\\\\n3 2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1\\\\n1 1\\\\n1\\\\n1\\\\n\\\", \\\"output\\\": \\\"1 1...
{ "split": "train", "index": 5788, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nUnary is a minimalistic Brainfuck dialect in which programs are written using only one token. \n\nBrainfuck programs use 8 commands: \"+\", \"-\", \"[\", \"]\", \"<\", \">\", \".\" and \",\" (their meaning is not importan...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"-[..[]+>>.>,]>.+]>.]>[.>+,>+\\\\n\\\", \\\"output\\\": \\\"860720\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\".<>.+]>],>><\\\\n\\\", \\\"output\\\": \\\"228058\\\\n\\\"}, {\\\"type\\\": \\\"stdin_st...
{ "split": "train", "index": 5789, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThe Chef likes to stay in touch with his staff. So, the Chef, the head server, and the sous-chef all carry two-way transceivers so they can stay in constant contact. Of course, these transceivers have a limited range so i...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n1\\\\n0 1\\\\n0 0\\\\n1 0\\\\n2\\\\n0 1\\\\n0 0\\\\n1 0\\\\n2\\\\n0 0\\\\n0 2\\\\n2 1\\\", \\\"output\\\": \\\"yes\\\\nyes\\\\nno\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n1\\\\n0 1\\\\n0 -...
{ "split": "train", "index": 5790, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nTwo bears are playing tic-tac-toe via mail. It's boring for them to play usual tic-tac-toe game, so they are a playing modified version of this game. Here are its rules.\n\nThe game is played on the following field.\n\n<i...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"xxo xoo xxo\\\\nooo ooo xxx\\\\noox oxo oxx\\\\n\\\\noxo oxo xxx\\\\nxoo oxx oxo\\\\nxxx oxx ooo\\\\n\\\\noxx xoo xxo\\\\nxxx oox xox\\\\nxxo o.o oxo\\\\n9 6\\\\n\\\", \\\"output\\\": \\\"xxo xoo xxo \\\\nooo ooo xxx \\\\...
{ "split": "train", "index": 5791, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nStudent Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n5 2\\\\n3 1\\\\n4 2\\\\n\\\", \\\"output\\\": \\\"2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n6 1\\\\n5 2\\\\n4 3\\\\n\\\", \\\"output\\\": \\\"6\\\\n\\\"}, {\\\"type\\\": \\\"stdin_st...
{ "split": "train", "index": 5792, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere is a frequency operation in the conversion operation of a finite number sequence. The conversion result of the sequence $ S = \\\\ {s_1, s_2, ... s_n \\\\} $ is a sequence of the same length. If the result is $ C = ...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10\\\\n4 5 1 1 4 5 12 3 6 4\\\\n0\\\", \\\"output\\\": \\\"3\\\\n6 4 4 4 6 4 6 6 6 6\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"10\\\\n4 5 1 1 4 5 12 3 0 5\\\\n0\\\", \\\"output\\\": \\\"3\\\\n4 6 ...
{ "split": "train", "index": 5793, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nArseniy is already grown-up and independent. His mother decided to leave him alone for m days and left on a vacation. She have prepared a lot of food, left some money and washed all Arseniy's clothes. \n\nTen minutes befo...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 2 3\\\\n1 2 3\\\\n1 2\\\\n2 3\\\\n\\\", \\\"output\\\": \\\"2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 2 2\\\\n1 1 2\\\\n1 2\\\\n2 1\\\\n\\\", \\\"output\\\": \\\"0\\\\n\\\"}, {\\\"type\\\": ...
{ "split": "train", "index": 5794, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nThere are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively. Print `Yes` if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, a...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"8 2 4\\\", \\\"output\\\": \\\"Yes\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3 3 1\\\", \\\"output\\\": \\\"No\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"31 61 59\\\", \\\"...
{ "split": "train", "index": 5795, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nA bracket sequence is a string containing only characters \"(\" and \")\".\n\nA regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters \"1\" and...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n)\\\\n()\\\\n(\\\\n\\\", \\\"output\\\": \\\"2\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2\\\\n()\\\\n()\\\\n\\\", \\\"output\\\": \\\"4\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"i...
{ "split": "train", "index": 5796, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nYour company was appointed to lay new asphalt on the highway of length $n$. You know that every day you can either repair one unit of the highway (lay new asphalt over one unit of the highway) or skip repairing.\n\nSkippi...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n5 1 1\\\\n8 10 10\\\\n1000000 1 1000000\\\\n\\\", \\\"output\\\": \\\"5\\\\n8\\\\n499999500000\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"3\\\\n5 1 1\\\\n8 6 10\\\\n1000000 1 1000000\\\\n\\\"...
{ "split": "train", "index": 5797, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nMonocarp wants to draw four line segments on a sheet of paper. He wants the $i$-th segment to have its length equal to $a_i$ ($1 \\le i \\le 4$). These segments can intersect with each other, and each segment should be ei...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n1 2 3 4\\\\n5 5 5 5\\\\n3 1 4 1\\\\n100 20 20 100\\\\n\\\", \\\"output\\\": \\\"3\\\\n25\\\\n3\\\\n2000\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"4\\\\n1 0 3 4\\\\n5 5 5 5\\\\n3 1 4 1\\\\n10...
{ "split": "train", "index": 5798, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
primeintellect
[ { "content": "Solve the following coding problem using the programming language python:\n\nTakahashi 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...
code
{ "style": "rule", "ground_truth": "\"[{\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"1000 15 80\\\\n\\\", \\\"output\\\": \\\"Yes\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": \\\"2000 20 100\\\\n\\\", \\\"output\\\": \\\"Yes\\\\n\\\"}, {\\\"type\\\": \\\"stdin_stdout\\\", \\\"input\\\": ...
{ "split": "train", "index": 5799, "reference": null, "knowledge_emb": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...