data_source
string
question
string
prompt
list
raw_prompt
list
ability
string
reward_model
dict
extra_info
dict
lower_pass_rate
float64
lower_scores
list
upper_pass_rate
float64
upper_scores
list
goldilocks
bool
taco
DZY loves collecting special strings which only contain lowercase letters. For each lowercase letter c DZY knows its value w_{c}. For each special string s = s_1s_2... s_{|}s| (|s| is the length of the string) he represents its value with a function f(s), where $f(s) = \sum_{i = 1}^{|s|}(w_{s_{i}} \cdot i)$ Now DZY ha...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "DZY loves collecting special strings which only contain lowercase letters. For each lowercase letter c DZY knows its value w_{c}. For each special string s = s_1s_2... s_{|}s| (|s| is the length of the string) he represents its value with a function f(s), where $f(s) = \\sum_{i...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"abc\\n3\\n1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\\n\", \"mmzhr\\n3\\n443 497 867 471 195 670 453 413 579 466 553 881 847 642 269 996 666 702 487 209 257 741 974 133 519 453\\n\", \"ajeeseerqnpaujubmajpibxrccazaawetywxmifzehojf\\n23\\n359 813 772 413 7...
{ "split": "train", "index": 6030, "id": "TACO_9e61bd10-5471-4b7f-af5e-374400d2d007" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Nothing is eternal in the world, Kostya understood it on the 7-th of January when he saw partially dead four-color garland. Now he has a goal to replace dead light bulbs, however he doesn't know how many light bulbs for each color are required....
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Nothing is eternal in the world, Kostya understood it on the 7-th of January when he saw partially dead four-color garland.\n\nNow he has a goal to replace dead light bulbs, however he doesn't know how many light bulbs for each color are required. It is guaranteed that for each...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"RYBGRYBGR\\n\", \"output\": \"0 0 0 0\"}, {\"type\": \"stdin_stdout\", \"input\": \"!RGYB\\n\", \"output\": \"0 1 0 0\"}, {\"type\": \"stdin_stdout\", \"input\": \"!!!!YGRB\\n\", \"output\": \"1 1 1 1\"}, {\"type\": \"stdin_stdout\", \"i...
{ "split": "train", "index": 421, "id": "PRIMEINTELLECT_27caff35-0e93-4779-96c7-6112eebe11f8" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0.22549019607843138 ]
false
taco
Kuriyama Mirai has killed many monsters and got many (namely n) stones. She numbers the stones from 1 to n. The cost of the i-th stone is v_{i}. Kuriyama Mirai wants to know something about these stones so she will ask you two kinds of questions: She will tell you two numbers, l and r (1 ≤ l ≤ r ≤ n), and you should t...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Kuriyama Mirai has killed many monsters and got many (namely n) stones. She numbers the stones from 1 to n. The cost of the i-th stone is v_{i}. Kuriyama Mirai wants to know something about these stones so she will ask you two kinds of questions: She will tell you two numbers,...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"6\\n6 4 2 7 2 7\\n3\\n2 3 6\\n1 3 4\\n1 1 6\\n\", \"4\\n5 5 2 3\\n10\\n1 2 4\\n2 1 4\\n1 1 1\\n2 1 4\\n2 1 2\\n1 1 1\\n1 3 3\\n1 1 3\\n1 4 4\\n1 2 2\\n\", \"4\\n2 2 3 6\\n9\\n2 2 3\\n1 1 3\\n2 2 3\\n2 2 3\\n2 2 2\\n1 1 3\\n1 1 3\\n2 1 4\\n1 1 2\\n\", \"18\\n26 46 ...
{ "split": "train", "index": 2339, "id": "TACO_b6f07cfc-cabe-4b80-9589-357a95953dc0" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: You are given n blocks, each of them is of the form [color_1|value|color_2], where the block can also be flipped to get [color_2|value|color_1]. A sequence of blocks is called valid if the touching endpoints of neighboring blocks have the same...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "You are given n blocks, each of them is of the form [color_1|value|color_2], where the block can also be flipped to get [color_2|value|color_1]. \n\nA sequence of blocks is called valid if the touching endpoints of neighboring blocks have the same color. For example, the sequen...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n1 1000 1\\n2 500 2\\n3 250 3\\n4 125 4\\n\", \"output\": \"1000\"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n1 100000 1\\n1 100000 2\\n1 100000 2\\n4 50000 3\\n3 50000 4\\n4 50000 4\\n3 50000 3\\n\", \"output\": \"300000\"}, {\"...
{ "split": "train", "index": 9536, "id": "PRIMEINTELLECT_0165e034-82d2-439f-a6b4-36687c3cee14" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Alice is a beginner composer and now she is ready to create another masterpiece. And not even the single one but two at the same time! Alice has a sheet with n notes written on it. She wants to take two such non-empty non-intersecting subseque...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Alice is a beginner composer and now she is ready to create another masterpiece. And not even the single one but two at the same time! \n\nAlice has a sheet with n notes written on it. She wants to take two such non-empty non-intersecting subsequences that both of them form a m...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6\\n62 22 60 61 48 49\\n\", \"output\": \"5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n1 2 4 5\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n7776 32915 1030 71664 7542 72359 65387 75222 95899 40333...
{ "split": "train", "index": 4016, "id": "PRIMEINTELLECT_80783729-d894-4770-b6a7-b2235cd6faff" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0.013888888888888888, 0, 0.013888888888888888, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: After a team finished their training session on Euro football championship, Valeric was commissioned to gather the balls and sort them into baskets. Overall the stadium has n balls and m baskets. The baskets are positioned in a row from left to ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "After a team finished their training session on Euro football championship, Valeric was commissioned to gather the balls and sort them into baskets. Overall the stadium has n balls and m baskets. The baskets are positioned in a row from left to right and they are numbered with ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3 1\\n\", \"output\": \"1\\n1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 3\\n\", \"output\": \"2\\n1\\n3\\n2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 1\\n\", \"output\": \"1\\n1\\n\"}, {\"type\": \"stdin_stdout\", \...
{ "split": "train", "index": 6126, "id": "PRIMEINTELLECT_739a699e-a25e-4ce0-92e0-85e91ef01a28" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0.9951923076923077, 0, 0, 0, 0.9951923076923077, 0, 0, 0 ]
false
taco
There are three cells on an infinite 2-dimensional grid, labeled $A$, $B$, and $F$. Find the length of the shortest path from $A$ to $B$ if: in one move you can go to any of the four adjacent cells sharing a side; visiting the cell $F$ is forbidden (it is an obstacle). -----Input----- The first line contains an in...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "There are three cells on an infinite 2-dimensional grid, labeled $A$, $B$, and $F$. Find the length of the shortest path from $A$ to $B$ if:\n\nin one move you can go to any of the four adjacent cells sharing a side;\n\nvisiting the cell $F$ is forbidden (it is an obstacle).\n\...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"7\\n\\n1 1\\n3 3\\n2 2\\n\\n2 5\\n2 1\\n2 3\\n\\n1000 42\\n1000 1\\n1000 1000\\n\\n1 10\\n3 10\\n2 10\\n\\n3 8\\n7 8\\n3 7\\n\\n2 1\\n4 1\\n1 1\\n\\n1 344\\n1 10\\n1 1\\n\", \"7\\n\\n1 1\\n3 3\\n2 2\\n\\n2 5\\n2 1\\n2 3\\n\\n1000 42\\n1000 1\\n1000 1000\\n\\n1 10\...
{ "split": "train", "index": 5892, "id": "TACO_7acf251c-05f4-4148-a24e-c702e9115cec" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
One day in the IT lesson Anna and Maria learned about the lexicographic order. String x is lexicographically less than string y, if either x is a prefix of y (and x ≠ y), or there exists such i (1 ≤ i ≤ min(|x|, |y|)), that xi < yi, and for any j (1 ≤ j < i) xj = yj. Here |a| denotes the length of the string a. The le...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "One day in the IT lesson Anna and Maria learned about the lexicographic order.\n\nString x is lexicographically less than string y, if either x is a prefix of y (and x ≠ y), or there exists such i (1 ≤ i ≤ min(|x|, |y|)), that xi < yi, and for any j (1 ≤ j < i) xj = yj. Here |a...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...
{ "split": "train", "index": 68, "id": "TACO_c1305a4a-16f4-4fd1-ae8d-aad0525e3c58" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a cle...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a clean square, it will become dirty, ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n0101\\n1000\\n1111\\n0101\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n111\\n111\\n111\\n\", \"output\": \"3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n0100000000\\n0000000000\\n0000000000\\n0...
{ "split": "train", "index": 1423, "id": "PRIMEINTELLECT_d8841f66-b019-4398-b93f-34a869a19f8c" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0.29411764705882354 ]
false
taco
Vova again tries to play some computer card game. The rules of deck creation in this game are simple. Vova is given an existing deck of n cards and a magic number k. The order of the cards in the deck is fixed. Each card has a number written on it; number a_{i} is written on the i-th card in the deck. After receiving...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Vova again tries to play some computer card game.\n\nThe rules of deck creation in this game are simple. Vova is given an existing deck of n cards and a magic number k. The order of the cards in the deck is fixed. Each card has a number written on it; number a_{i} is written on...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"3 4\\n6 2 8\\n\", \"3 6\\n9 1 14\\n\", \"5 1\\n1 3 1 3 1\\n\", \"5 1\\n5 5 5 5 5\\n\", \"5 1\\n5 4 4 4 4\\n\", \"100 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...
{ "split": "train", "index": 851, "id": "TACO_ef4fc808-8584-49e2-9ebd-ae124d4cac60" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Takahashi and Aoki will take N exams numbered 1 to N. They have decided to compete in these exams. The winner will be determined as follows: * For each exam i, Takahashi decides its importance c_i, which must be an integer between l_i and u_i (inclusive). * Let A be \sum_{i=1}^{N} c_i \times (Takahashi's score on Exa...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Takahashi and Aoki will take N exams numbered 1 to N. They have decided to compete in these exams. The winner will be determined as follows:\n\n* For each exam i, Takahashi decides its importance c_i, which must be an integer between l_i and u_i (inclusive).\n\n* Let A be \\sum...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"2 100\\n85 2 6\\n60 1 1\", \"10 1000\\n451 4593 6263\\n324 310 9662\\n378 1431 7068\\n71 1757 9218\\n204 3676 4328\\n840 6221 9080\\n684 1545 8511\\n709 5467 8674\\n862 6504 9835\\n283 4965 9980\", \"1 100000\\n31415 2718 1443\", \"2 100\\n85 2 11\\n60 1 1\", \"10...
{ "split": "train", "index": 2009, "id": "TACO_79e42b13-dd44-481a-a3a0-2f5957c3c23e" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: [Æsir - CHAOS](https://soundcloud.com/kivawu/aesir-chaos) [Æsir - V.](https://soundcloud.com/kivawu/aesir-v) "Everything has been planned out. No more hidden concerns. The condition of Cytus is also perfect. The time right now...... 00:01:12....
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "[Æsir - CHAOS](https://soundcloud.com/kivawu/aesir-chaos)\n\n[Æsir - V.](https://soundcloud.com/kivawu/aesir-v)\n\n\"Everything has been planned out. No more hidden concerns. The condition of Cytus is also perfect.\n\nThe time right now...... 00:01:12......\n\nIt's time.\"\n\nT...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n3 1 4 1\\n\", \"output\": \"6\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n3 1 4 4\\n\", \"output\": \"6\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n3 1 4 1 5\\n\", \"output\": \"11\"}, {\"type\": \"stdin_stdout\", \"input...
{ "split": "train", "index": 5317, "id": "PRIMEINTELLECT_facc9523-7efc-4b23-9e4f-bf1857e998c5" }
0
[ 0, 0, 0, 0.008403361344537815, 0, 0, 0, 0 ]
0.25
[ 0.008403361344537815, 0, 0, 1, 1, 0, 0, 0 ]
true
primeintellect
Solve the following coding problem using the programming language python: Convert integers to binary as simple as that. You would be given an integer as a argument and you have to return its binary form. To get an idea about how to convert a decimal number into a binary number, visit here. **Notes**: negative numbers...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Convert integers to binary as simple as that. You would be given an integer as a argument and you have to return its binary form.\nTo get an idea about how to convert a decimal number into a binary number, visit here.\n\n**Notes**: negative numbers should be handled as two's co...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"to_binary\", \"input\": [2], \"output\": [\"10\"]}, {\"type\": \"function_call\", \"fn_name\": \"to_binary\", \"input\": [3], \"output\": [\"11\"]}, {\"type\": \"function_call\", \"fn_name\": \"to_binary\", \"input\": [4], \"output\":...
{ "split": "train", "index": 11646, "id": "PRIMEINTELLECT_cfc3ef0f-e251-4474-90b1-a627117d8e9f" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Bimokh is Mashmokh's boss. For the following n days he decided to pay to his workers in a new way. At the beginning of each day he will give each worker a certain amount of tokens. Then at the end of each day each worker can give some of his tok...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Bimokh is Mashmokh's boss. For the following n days he decided to pay to his workers in a new way. At the beginning of each day he will give each worker a certain amount of tokens. Then at the end of each day each worker can give some of his tokens back to get a certain amount ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 1 4\\n12 6 11 9 1\\n\", \"output\": \"0 2 3 1 1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"3 1 2\\n1 2 3\\n\", \"output\": \"1 0 1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1 1\\n1\\n\", \"output\": \"0 \"}, {\"type\": \"std...
{ "split": "train", "index": 14978, "id": "PRIMEINTELLECT_8035d4b6-f551-460d-996a-a5eed942ff48" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, organ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Berland annual chess tournament is coming!\n\nOrganizers have gathered 2·n chess players who should be divided into two teams with n people each. The first team is sponsored by BerOil and the second team is sponsored by BerMobile. Obviously, organizers should guarantee the win ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2\\n1 3 2 4\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n3 3\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n1 1 1 1 2 2 3 3 3 3\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin...
{ "split": "train", "index": 11975, "id": "PRIMEINTELLECT_5e6a7525-1ba9-43cc-b717-469c305cc304" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Takahashi wants to grill N pieces of meat on a grilling net, which can be seen as a two-dimensional plane. The coordinates of the i-th piece of meat are \left(x_i, y_i\right), and its hardness is c_i. Takahashi can use one heat source to grill t...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Takahashi wants to grill N pieces of meat on a grilling net, which can be seen as a two-dimensional plane. The coordinates of the i-th piece of meat are \\left(x_i, y_i\\right), and its hardness is c_i.\nTakahashi can use one heat source to grill the meat. If he puts the heat s...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 3\\n-1 0 3\\n0 0 3\\n1 0 2\\n1 1 40\\n\", \"output\": \"2.4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 5\\n-879 981 26\\n890 -406 81\\n512 859 97\\n362 -955 25\\n128 553 17\\n-885 763 2\\n449 310 57\\n-656 -204 11\\n-270 76 40...
{ "split": "train", "index": 413, "id": "PRIMEINTELLECT_33e3a605-3602-4fb8-98c5-22005a1cca3c" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0.9663461538461539, 0, 0.9903846153846154, 0, 0, 0, 0.9711538461538461, 0.9903846153846154 ]
false
primeintellect
Solve the following coding problem using the programming language python: It's a beautiful April day and Wallace is playing football with his friends. But his friends do not know that Wallace actually stayed home with Gromit and sent them his robotic self instead. Robo-Wallace has several advantages over the other guy...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "It's a beautiful April day and Wallace is playing football with his friends. But his friends do not know that Wallace actually stayed home with Gromit and sent them his robotic self instead. Robo-Wallace has several advantages over the other guys. For example, he can hit the ba...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 4 6 2 2 1\\n\", \"output\": \"-1\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 10 13 10 3 1\\n\", \"output\": \"4.375000000000\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 10 15 17 9 2\\n\", \"output\": \"11.333333333333\"}, {\"ty...
{ "split": "train", "index": 7644, "id": "PRIMEINTELLECT_a4a8beda-7923-4cb8-8b66-294b4198f5ce" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: To confuse the opponents, the Galactic Empire represents fractions in an unusual format. The fractions are represented as two sets of integers. The product of numbers from the first set gives the fraction numerator, the product of numbers from t...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "To confuse the opponents, the Galactic Empire represents fractions in an unusual format. The fractions are represented as two sets of integers. The product of numbers from the first set gives the fraction numerator, the product of numbers from the second set gives the fraction ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 3\\n2 5 10 20\\n100 1 3\\n\", \"output\": \"4 3\\n1 1 1 20 \\n1 1 3 \"}, {\"type\": \"stdin_stdout\", \"input\": \"3 2\\n100 5 2\\n50 10\\n\", \"output\": \"3 2\\n1 1 2 \\n1 1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"2 3\\n50 10\...
{ "split": "train", "index": 8524, "id": "PRIMEINTELLECT_48b1a4ab-6720-4f92-9ebf-e1bf56364b8a" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
You are given two integers $l$ and $r$, $l\le r$. Find the largest possible value of $a mod b$ over all pairs $(a, b)$ of integers for which $r\ge a \ge b \ge l$. As a reminder, $a mod b$ is a remainder we get when dividing $a$ by $b$. For example, $26 mod 8 = 2$. -----Input----- Each test contains multiple test ca...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "You are given two integers $l$ and $r$, $l\\le r$. Find the largest possible value of $a mod b$ over all pairs $(a, b)$ of integers for which $r\\ge a \\ge b \\ge l$.\n\nAs a reminder, $a mod b$ is a remainder we get when dividing $a$ by $b$. For example, $26 mod 8 = 2$.\n\n\n-...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"4\\n1 1\\n999999999 1000000000\\n8 26\\n1 999999999\\n\", \"4\\n1 1\\n999999999 1000000000\\n9 26\\n1 999999999\\n\", \"4\\n1 1\\n817823218 1000000000\\n9 26\\n1 999999999\\n\", \"4\\n1 1\\n817823218 1000001000\\n9 26\\n1 999999999\\n\", \"4\\n1 1\\n817823218 1000...
{ "split": "train", "index": 1613, "id": "TACO_64807842-b216-4dfd-a5fc-eb76086d11ff" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Tokitsukaze is playing a game derivated from Japanese mahjong. In this game, she has three tiles in her hand. Each tile she owns is a suited tile, which means it has a suit (manzu, pinzu or souzu) and a number (a digit ranged from $1$ to $9$). I...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Tokitsukaze is playing a game derivated from Japanese mahjong. In this game, she has three tiles in her hand. Each tile she owns is a suited tile, which means it has a suit (manzu, pinzu or souzu) and a number (a digit ranged from $1$ to $9$). In this problem, we use one digit ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1s 2s 3s\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9m 9m 9m\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3p 9m 2p\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", \"input\":...
{ "split": "train", "index": 11779, "id": "PRIMEINTELLECT_84f25542-5721-49c2-a5fb-e5afc273933b" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
You are given an array $a[0 \ldots n - 1] = [a_0, a_1, \ldots, a_{n - 1}]$ of zeroes and ones only. Note that in this problem, unlike the others, the array indexes are numbered from zero, not from one. In one step, the array $a$ is replaced by another array of length $n$ according to the following rules: First, a new...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "You are given an array $a[0 \\ldots n - 1] = [a_0, a_1, \\ldots, a_{n - 1}]$ of zeroes and ones only. Note that in this problem, unlike the others, the array indexes are numbered from zero, not from one.\n\nIn one step, the array $a$ is replaced by another array of length $n$ a...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"5\\n2 1\\n0 1\\n3 2\\n0 1 0\\n5 2\\n1 1 0 1 0\\n4 2\\n0 1 0 1\\n1 1\\n0\\n\", \"5\\n2 1\\n0 1\\n3 2\\n0 1 0\\n5 2\\n1 1 1 1 0\\n4 2\\n0 1 0 1\\n1 1\\n0\\n\", \"5\\n2 1\\n0 1\\n3 2\\n0 1 0\\n5 2\\n1 0 1 1 0\\n4 2\\n0 1 0 1\\n1 1\\n0\\n\", \"5\\n2 1\\n0 1\\n3 2\\n0 ...
{ "split": "train", "index": 992, "id": "TACO_0e0cfc97-4149-4b4f-8ea9-44f63b1f3f94" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: n students are taking an exam. The highest possible score at this exam is m. Let a_{i} be the score of the i-th student. You have access to the school database which stores the results of all students. You can change each student's score as lon...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "n students are taking an exam. The highest possible score at this exam is m. Let a_{i} be the score of the i-th student. You have access to the school database which stores the results of all students.\n\nYou can change each student's score as long as the following conditions a...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2\\n4 10\\n1 2 3 4\\n4 5\\n1 2 3 4\\n\", \"output\": \"10\\n5\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"27\\n1 1\\n0\\n1 2\\n0\\n1 5\\n0\\n1 10\\n0\\n1 50\\n0\\n1 100\\n0\\n1 500\\n0\\n1 1000\\n0\\n1 5000\\n0\\n1 10000\\n0\\n1 500...
{ "split": "train", "index": 5899, "id": "PRIMEINTELLECT_c3e7528d-7ff9-4e6f-9c09-ab0a8c61dc23" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0.375
[ 0.0594059405940594, 0.0297029702970297, 1, 0.04950495049504951, 1, 1, 0.039603960396039604, 0 ]
true
primeintellect
Solve the following coding problem using the programming language python: Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distance between the two farthest of them doesn't exceed d...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distance between the two farthest of them doesn't exceed d.\n\nNote that the order of the p...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 2\\n-3 -2 -1 0\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 3\\n1 2 3 4\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 19\\n1 10 20 30 50\\n\", \"output\": \"1\\n\"}, {\"type\": \"s...
{ "split": "train", "index": 4770, "id": "PRIMEINTELLECT_0390b808-c6e2-47c4-9e22-f8d7800eba36" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0.052884615384615384, 0, 0, 0, 0, 0 ]
false
taco
Takahashi throws N dice, each having K sides with all integers from 1 to K. The dice are NOT pairwise distinguishable. For each i=2,3,...,2K, find the following value modulo 998244353: - The number of combinations of N sides shown by the dice such that the sum of no two different sides is i. Note that the dice are NOT...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Takahashi throws N dice, each having K sides with all integers from 1 to K. The dice are NOT pairwise distinguishable.\nFor each i=2,3,...,2K, find the following value modulo 998244353:\n - The number of combinations of N sides shown by the dice such that the sum of no two diff...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"3 3\\n\", \"4 5\\n\", \"6 1000\\n\", \"2000 2000\\n\", \"1798 1987\\n\", \"2000 1166\\n\", \"1 2000\\n\", \"2000 3\\n\", \"1789 1568\\n\", \"1998 1999\\n\", \"732 1756\\n\", \"5 1234\\n\", \"1452 9\\n\", \"1889 2\\n\", \"2 1675\\n\", \"667 288\\n\", \"1879 1290\\n...
{ "split": "train", "index": 5422, "id": "TACO_cc94d30e-e479-4bab-b0f3-384a5851cf22" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Chouti is working on a strange math problem. There was a sequence of $n$ positive integers $x_1, x_2, \ldots, x_n$, where $n$ is even. The sequence was very special, namely for every integer $t$ from $1$ to $n$, $x_1+x_2+...+x_t$ is a square of...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Chouti is working on a strange math problem.\n\nThere was a sequence of $n$ positive integers $x_1, x_2, \\ldots, x_n$, where $n$ is even. The sequence was very special, namely for every integer $t$ from $1$ to $n$, $x_1+x_2+...+x_t$ is a square of some integer number (that is,...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6\\n5 11 44\\n\", \"output\": \"Yes\\n4 5 16 11 64 44\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n9900\\n\", \"output\": \"Yes\\n100 9900\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\\n314 1592 6535\\n\", \"output\": \"No\...
{ "split": "train", "index": 1190, "id": "PRIMEINTELLECT_b9d5c7d6-8800-4aa7-9bbe-3cc7250997c6" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0.041666666666666664, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: The Berland road network consists of n cities and of m bidirectional roads. The cities are numbered from 1 to n, where the main capital city has number n, and the culture capital — number 1. The road network is set up so that it is possible to r...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "The Berland road network consists of n cities and of m bidirectional roads. The cities are numbered from 1 to n, where the main capital city has number n, and the culture capital — number 1. The road network is set up so that it is possible to reach any city from any other one ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"11 14\\n1 2\\n1 3\\n2 4\\n3 4\\n4 5\\n4 6\\n5 11\\n6 11\\n1 8\\n8 9\\n9 7\\n11 7\\n1 10\\n10 4\\n\", \"output\": \"1.714285714\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 4\\n1 2\\n2 4\\n1 3\\n3 4\\n\", \"output\": \"1.000000000\\...
{ "split": "train", "index": 6561, "id": "PRIMEINTELLECT_1a9f43ca-00ad-4ea5-b3ea-617dfdaf71d4" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: You are given a integer $n$ ($n > 0$). Find any integer $s$ which satisfies these conditions, or report that there are no such numbers: In the decimal representation of $s$: $s > 0$, $s$ consists of $n$ digits, no digit in $s$ equals $0$, ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "You are given a integer $n$ ($n > 0$). Find any integer $s$ which satisfies these conditions, or report that there are no such numbers:\n\nIn the decimal representation of $s$: $s > 0$, $s$ consists of $n$ digits, no digit in $s$ equals $0$, $s$ is not divisible by any of ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n1\\n2\\n3\\n4\\n\", \"output\": \"-1\\n23\\n233\\n2333\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n19999\\n19998\\n20001\\n20000\\n20002\\n\", \"output\": \"2333333333333333333333333333333333333333333333333333333333333333333...
{ "split": "train", "index": 10911, "id": "PRIMEINTELLECT_f52284fe-ec6f-4d13-95a1-46d4cff766dc" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: The king of a country loves prime numbers and gambling. The unit of currency in this country is called prime. As of November 1, 2007, Prime's cross-yen rate was just prime at 9973, so the King is overjoyed. Subsidiary coins with 1/101 prime as o...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "The king of a country loves prime numbers and gambling. The unit of currency in this country is called prime. As of November 1, 2007, Prime's cross-yen rate was just prime at 9973, so the King is overjoyed. Subsidiary coins with 1/101 prime as one subprime are used in this coun...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\n5 0\\n9 1\\n3 10\\n11 3\\n1\\n999983 20\\n0\", \"output\": \"5\\n1\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n5 -1\\n9 1\\n3 10\\n11 3\\n1\\n999983 20\\n0\", \"output\": \"3\\n1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \...
{ "split": "train", "index": 5310, "id": "PRIMEINTELLECT_8663bb64-bf43-43f2-8f2d-edc20ac52195" }
0
[ 0, 0.005, 0, 0, 0.005, 0, 0.005, 0 ]
1
[ 1, 1, 1, 1, 1, 1, 1, 1 ]
true
primeintellect
Solve the following coding problem using the programming language python: In mathematics, the Pythagorean theorem — is a relation in Euclidean geometry among the three sides of a right-angled triangle. In terms of areas, it states: In any right-angled triangle, the area of the square whose side is the hypotenuse (th...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "In mathematics, the Pythagorean theorem — is a relation in Euclidean geometry among the three sides of a right-angled triangle. In terms of areas, it states:\n\nIn any right-angled triangle, the area of the square whose side is the hypotenuse (the side opposite the right angle...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n\", \"output\": \"1\"}, {\"type\": \"stdin_stdout\", \"input\": \"74\\n\", \"output\": \"35\"}, {\"type\": \"stdin_stdout\", \"input\": \"625\\n\", \"output\": \"507\"}, {\"type\": \"stdin_stdout\", \"input\": \"177\\n\", \"output\":...
{ "split": "train", "index": 6896, "id": "PRIMEINTELLECT_da5b7dab-c4e5-4c3b-bb9d-0efd89270134" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Given is a sequence of integers A_1, A_2, ..., A_N. If its elements are pairwise distinct, print YES; otherwise, print NO. -----Constraints----- - 2 ≤ N ≤ 200000 - 1 ≤ A_i ≤ 10^9 - All values in input are integers. -----Input----- Input is given from Standard Input in the following format: N A_1 ... A_N -----Outp...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Given is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\n-----Constraints-----\n - 2 ≤ N ≤ 200000\n - 1 ≤ A_i ≤ 10^9\n - All values in input are integers.\n\n-----Input-----\nInput is given from Standard Inpu...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"5\\n2 6 1 4 5\\n\", \"6\\n4 1 3 1 6 2\\n\", \"2\\n10000000 10000000\\n\", \"6\\n4 1 3 1 6 1\", \"2\\n10000100 10000000\", \"5\\n2 9 1 4 5\", \"6\\n4 1 3 1 2 1\", \"2\\n10000100 10001000\", \"5\\n2 9 1 3 5\", \"6\\n4 1 3 1 2 0\", \"2\\n10000100 10101000\", \"5\\n2 ...
{ "split": "train", "index": 978, "id": "TACO_41923584-c4d5-4a6e-bd55-136a9fcb20cd" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
To quickly hire highly skilled specialists one of the new IT City companies made an unprecedented move. Every employee was granted a car, and an employee can choose one of four different car makes. The parking lot before the office consists of one line of (2n - 2) parking spaces. Unfortunately the total number of cars...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "To quickly hire highly skilled specialists one of the new IT City companies made an unprecedented move. Every employee was granted a car, and an employee can choose one of four different car makes.\n\nThe parking lot before the office consists of one line of (2n - 2) parking sp...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"3\\n\", \"4\\n\", \"5\\n\", \"6\\n\", \"7\\n\", \"12\\n\", \"15\\n\", \"28\\n\", \"29\\n\", \"30\\n\", \"6\\n\", \"5\\n\", \"30\\n\", \"28\\n\", \"12\\n\", \"29\\n\", \"15\\n\", \"7\\n\", \"4\\n\", \"11\\n\", \"9\\n\", \"26\\n\", \"14\\n\", \"16\\n\", \"19\\n\", \...
{ "split": "train", "index": 5985, "id": "TACO_220ea970-d23a-4eed-be7b-9ef5b50d4a54" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Boboniu has a directed graph with n vertices and m edges. The out-degree of each vertex is at most k. Each edge has an integer weight between 1 and m. No two edges have equal weights. Boboniu likes to walk on the graph with some specific rules, which is represented by a tuple (c_1,c_2,…,c_k). If he now stands on a v...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Boboniu has a directed graph with n vertices and m edges.\n\nThe out-degree of each vertex is at most k.\n\nEach edge has an integer weight between 1 and m. No two edges have equal weights.\n\nBoboniu likes to walk on the graph with some specific rules, which is represented by ...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"9 60 9\\n8 4 1\\n2 6 2\\n4 3 3\\n2 9 4\\n6 7 5\\n7 6 6\\n7 8 7\\n9 5 8\\n2 8 9\\n1 8 10\\n2 7 11\\n2 4 12\\n6 1 13\\n9 2 14\\n4 9 15\\n3 7 16\\n4 7 17\\n7 4 18\\n8 7 19\\n5 1 20\\n8 3 21\\n4 5 22\\n5 9 23\\n9 6 24\\n7 5 25\\n9 4 26\\n6 9 27\\n2 5 28\\n8 6 29\\n1 7...
{ "split": "train", "index": 6060, "id": "TACO_80e72d16-e15a-42b0-aba9-195b2a3472fe" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>.\n\nHelp Vladik with that, i.e for a given n find three distinct p...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"7\\n\", \"output\": \"7 8 56 \"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n\", \"output\": \"3 4 12 \"}, {\"type\": \"stdin_stdout\", \"input\": \"82\\n\", \"output\": \"82 83 6806 \"}, {\"type\": \"stdin_stdout\", \"input\": \"720\...
{ "split": "train", "index": 6959, "id": "PRIMEINTELLECT_10780ed5-180a-4a53-ad5b-b363ae01e7e9" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Bertown has n junctions and m bidirectional roads. We know that one can get from any junction to any other one by the existing roads. As there were more and more cars in the city, traffic jams started to pose real problems. To deal with them t...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Bertown has n junctions and m bidirectional roads. We know that one can get from any junction to any other one by the existing roads. \n\nAs there were more and more cars in the city, traffic jams started to pose real problems. To deal with them the government decided to make t...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6 7\\n1 2\\n2 3\\n1 3\\n4 5\\n4 6\\n5 6\\n2 4\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"6 8\\n1 2\\n2 3\\n1 3\\n4 5\\n4 6\\n5 6\\n2 4\\n3 5\\n\", \"output\": \"3 1\\n6 5\\n4 6\\n4 2\\n5 4\\n3 5\\n2 3\\n1 2\\n...
{ "split": "train", "index": 9541, "id": "PRIMEINTELLECT_08e5e933-7bfc-4c45-bbaa-a23fd5670195" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Основой любой социальной сети является отношение дружбы между двумя пользователями в том или ином смысле. В одной известной социальной сети дружба симметрична, то есть если a является другом b, то b также является другом a. В этой же сети есть...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Основой любой социальной сети является отношение дружбы между двумя пользователями в том или ином смысле. В одной известной социальной сети дружба симметрична, то есть если a является другом b, то b также является другом a. \n\nВ этой же сети есть функция, которая демонстрирует...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 51\\n10 23\\n23 42\\n39 42\\n10 39\\n39 58\\n\", \"output\": \"10: 1 42\\n23: 1 39\\n39: 1 23\\n42: 1 10\\n58: 2 10 42\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 100\\n1 2\\n1 3\\n1 4\\n2 3\\n2 4\\n\", \"output\": \"1: 0\\n2: 0...
{ "split": "train", "index": 984, "id": "PRIMEINTELLECT_e0eac948-e55a-46c7-9195-59ffdb061a10" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: n! = n × (n − 1) × (n − 2) × ... × 3 × 2 × 1 Is called the factorial of n. For example, the factorial of 12 12! = 12 x 11 x 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 479001600 And there are two consecutive 0s at the end. Write a program that ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "n! = n × (n − 1) × (n − 2) × ... × 3 × 2 × 1\n\nIs called the factorial of n. For example, the factorial of 12\n\n12! = 12 x 11 x 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 479001600\n\nAnd there are two consecutive 0s at the end.\n\nWrite a program that inputs the integer n and ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2\\n12\\n10000\\n0\", \"output\": \"0\\n2\\n2499\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n21\\n10000\\n0\", \"output\": \"0\\n4\\n2499\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\n21\\n11000\\n0\", \"output\": \"0\\n4\\n...
{ "split": "train", "index": 3396, "id": "PRIMEINTELLECT_fa73ea9b-2ed6-4441-9879-03f4e72b70f4" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0.75
[ 1, 1, 1, 0.04950495049504951, 1, 1, 1, 0.1485148514851485 ]
true
taco
Everybody seems to think that the Martians are green, but it turns out they are metallic pink and fat. Ajs has two bags of distinct nonnegative integers. The bags are disjoint, and the union of the sets of numbers in the bags is \{0,1,…,M-1\}, for some positive integer M. Ajs draws a number from the first bag and a num...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Everybody seems to think that the Martians are green, but it turns out they are metallic pink and fat. Ajs has two bags of distinct nonnegative integers. The bags are disjoint, and the union of the sets of numbers in the bags is \\{0,1,…,M-1\\}, for some positive integer M. Ajs...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"14 34\\n1 2 4 7 10 12 13 18 19 21 24 27 29 30\\n\", \"36 81\\n4 5 7 8 13 14 16 17 22 23 25 26 31 32 34 35 40 41 43 44 49 50 52 53 58 59 61 62 67 68 70 71 76 77 79 80\\n\", \"9 10\\n1 2 3 4 5 6 7 8 9\\n\", \"1 2\\n1\\n\", \"3 100000011\\n678 500678 1000678\\n\", \"...
{ "split": "train", "index": 4402, "id": "TACO_2e712fce-c4da-44b9-b461-736f8ec27ba5" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Petya wonders eagerly wha...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\n\nPetya wonders eagerly what minimum lucky number has the ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"11\\n\", \"output\": \"47\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"999980\\n\", \"output\": \"444477777777777777777777777777777777777777777777777777777777...
{ "split": "train", "index": 4211, "id": "PRIMEINTELLECT_974de128-0071-4f7b-9dcf-b73f671268d6" }
0
[ 0, 0.006622516556291391, 0, 0.013245033112582781, 0.006622516556291391, 0, 0, 0 ]
0
[ 0, 0.006622516556291391, 0, 0.006622516556291391, 0.006622516556291391, 0, 0, 0 ]
false
taco
Tenten runs a weapon shop for ninjas. Today she is willing to sell $n$ shurikens which cost $1$, $2$, ..., $n$ ryo (local currency). During a day, Tenten will place the shurikens onto the showcase, which is empty at the beginning of the day. Her job is fairly simple: sometimes Tenten places another shuriken (from the a...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Tenten runs a weapon shop for ninjas. Today she is willing to sell $n$ shurikens which cost $1$, $2$, ..., $n$ ryo (local currency). During a day, Tenten will place the shurikens onto the showcase, which is empty at the beginning of the day. Her job is fairly simple: sometimes ...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"4\\n+\\n+\\n- 2\\n+\\n- 3\\n+\\n- 1\\n- 4\\n\", \"1\\n- 1\\n+\\n\", \"3\\n+\\n+\\n+\\n- 2\\n- 1\\n- 3\\n\", \"1\\n+\\n- 1\\n\", \"10\\n+\\n- 3\\n+\\n+\\n+\\n+\\n- 1\\n- 7\\n- 9\\n- 10\\n+\\n+\\n+\\n- 4\\n- 5\\n- 8\\n+\\n- 6\\n+\\n- 2\\n\", \"10\\n+\\n- 3\\n+\\n+\\...
{ "split": "train", "index": 3223, "id": "TACO_f1fa0d77-67e7-415c-a88d-66f6141a7908" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
You are given n segments on the Ox-axis. You can drive a nail in any integer point on the Ox-axis line nail so, that all segments containing this point, are considered nailed down. If the nail passes through endpoint of some segment, this segment is considered to be nailed too. What is the smallest number of nails need...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "You are given n segments on the Ox-axis. You can drive a nail in any integer point on the Ox-axis line nail so, that all segments containing this point, are considered nailed down. If the nail passes through endpoint of some segment, this segment is considered to be nailed too....
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"3\\n55 55\\n55 55\\n55 55\\n\", \"1\\n-2244 5023\\n\", \"10\\n47 -85\\n71 40\\n-87 64\\n76 73\\n52 -51\\n-20 -57\\n-14 -77\\n-45 -11\\n-56 -48\\n81 20\\n\", \"4\\n1 1\\n0 0\\n10000 10000\\n-10000 -10000\\n\", \"3\\n40 -83\\n52 -80\\n-21 -4\\n\", \"5\\n0 3\\n4 2\\n...
{ "split": "train", "index": 5723, "id": "TACO_d08deafb-1292-49c1-afc6-5e04daf4dcd7" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: As you could know there are no male planes nor female planes. However, each plane on Earth likes some other plane. There are n planes on Earth, numbered from 1 to n, and the plane with number i likes the plane with number fi, where 1 ≤ fi ≤ n an...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "As you could know there are no male planes nor female planes. However, each plane on Earth likes some other plane. There are n planes on Earth, numbered from 1 to n, and the plane with number i likes the plane with number fi, where 1 ≤ fi ≤ n and fi ≠ i.\n\nWe call a love trian...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n2 4 5 1 3\\n\", \"output\": \"YES\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n5 5 5 5 1\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n50 40 60 87 39 58 44 84 46 68 16 57 77 87 92 95 42 31 74 1...
{ "split": "train", "index": 9224, "id": "PRIMEINTELLECT_20be98e6-76ab-4962-bb7a-f61f7bed2fec" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
<image> One morning the Cereal Guy found out that all his cereal flakes were gone. He found a note instead of them. It turned out that his smart roommate hid the flakes in one of n boxes. The boxes stand in one row, they are numbered from 1 to n from the left to the right. The roommate left hints like "Hidden to the l...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "<image>\n\nOne morning the Cereal Guy found out that all his cereal flakes were gone. He found a note instead of them. It turned out that his smart roommate hid the flakes in one of n boxes. The boxes stand in one row, they are numbered from 1 to n from the left to the right. T...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"3 0\\n\", \"1 1\\nTo the right of 1\\n\", \"1000 1\\nTo the right of 117\\n\", \"2 1\\nTo the right of 2\\n\", \"1 0\\n\", \"2 0\\n\", \"6 2\\nTo the right of 2\\nTo the left of 4\\n\", \"2 2\\nTo the left of 2\\nTo the left of 2\\n\", \"459 16\\nTo the right of 9...
{ "split": "train", "index": 4217, "id": "TACO_5349264e-7358-41b4-bede-1ddc466f159b" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
In this problem, a date is written as Y-M-D. For example, 2019-11-30 means November 30, 2019. Integers M_1, D_1, M_2, and D_2 will be given as input. It is known that the date 2019-M_2-D_2 follows 2019-M_1-D_1. Determine whether the date 2019-M_1-D_1 is the last day of a month. Constraints * Both 2019-M_1-D_1 and 20...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "In this problem, a date is written as Y-M-D. For example, 2019-11-30 means November 30, 2019.\n\nIntegers M_1, D_1, M_2, and D_2 will be given as input.\nIt is known that the date 2019-M_2-D_2 follows 2019-M_1-D_1.\nDetermine whether the date 2019-M_1-D_1 is the last day of a m...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"11 30\\n6 1\", \"11 17\\n11 17\", \"6 30\\n12 1\", \"11 16\\n11 28\", \"11 24\\n11 28\", \"11 30\\n18 1\", \"11 8\\n11 28\", \"11 8\\n11 17\", \"11 16\\n11 31\", \"11 30\\n35 1\", \"11 8\\n11 32\", \"11 30\\n2 1\", \"11 3\\n11 8\", \"11 30\\n26 1\", \"11 16\\n11 4...
{ "split": "train", "index": 5483, "id": "TACO_955f2c20-e367-4444-8b20-b5cd951a6003" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Pasha loves his phone and also putting his hair up... But the hair is now irrelevant. Pasha has installed a new game to his phone. The goal of the game is following. There is a rectangular field consisting of n row with m pixels in each row. Initially, all the pixels are colored white. In one move, Pasha can choose an...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Pasha loves his phone and also putting his hair up... But the hair is now irrelevant.\n\nPasha has installed a new game to his phone. The goal of the game is following. There is a rectangular field consisting of n row with m pixels in each row. Initially, all the pixels are col...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"2 2 4\\n1 1\\n1 2\\n2 1\\n2 2\\n\", \"2 3 6\\n2 3\\n2 2\\n1 3\\n2 2\\n1 2\\n1 1\\n\", \"5 3 7\\n2 3\\n1 2\\n1 1\\n4 1\\n3 1\\n5 3\\n3 2\\n\", \"3 3 11\\n2 1\\n3 1\\n1 1\\n1 3\\n1 2\\n2 3\\n3 3\\n3 2\\n2 2\\n1 3\\n3 3\\n\", \"2 2 5\\n1 1\\n2 1\\n2 1\\n1 2\\n2 2\\n\...
{ "split": "train", "index": 2390, "id": "TACO_5c3e7d09-efb2-43ba-b58c-ebdf704b40b9" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Gennady is one of the best child dentists in Berland. Today n children got an appointment with him, they lined up in front of his office. All children love to cry loudly at the reception at the dentist. We enumerate the children with integers from 1 to n in the order they go in the line. Every child is associated with...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Gennady is one of the best child dentists in Berland. Today n children got an appointment with him, they lined up in front of his office.\n\nAll children love to cry loudly at the reception at the dentist. We enumerate the children with integers from 1 to n in the order they go...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"10\\n10 3 3\\n8 6 17\\n9 5 26\\n10 7 17\\n3 10 29\\n3 1 27\\n3 3 7\\n8 10 28\\n1 3 23\\n3 4 6\\n\", \"1\\n1 1 1\\n\", \"10\\n9 8 8\\n2 9 8\\n10 7 16\\n7 2 9\\n3 5 23\\n9 9 25\\n3 2 35\\n3 5 36\\n5 3 40\\n4 4 42\\n\", \"10\\n10 7 10\\n3 6 11\\n8 4 10\\n10 1 11\\n7 ...
{ "split": "train", "index": 945, "id": "TACO_f388c833-8ca3-48dc-b707-b5b2ae645a43" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Alica and Bob are playing a game. Initially they have a binary string $s$ consisting of only characters 0 and 1. Alice and Bob make alternating moves: Alice makes the first move, Bob makes the second move, Alice makes the third one, and so on....
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Alica and Bob are playing a game.\n\nInitially they have a binary string $s$ consisting of only characters 0 and 1.\n\nAlice and Bob make alternating moves: Alice makes the first move, Bob makes the second move, Alice makes the third one, and so on. During each move, the curren...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\\n01\\n1111\\n0011\\n\", \"output\": \"DA\\nNET\\nNET\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n1111111111\\n\", \"output\": \"NET\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n11111111111\\n\", \"output\": \"NET\\n\"...
{ "split": "train", "index": 1864, "id": "PRIMEINTELLECT_86ca1dd7-7214-4ede-8db4-2678d79221cc" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Of course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains ai animals in it. Also there are m roads in the zoo, and each road connects two distinct areas. Naturally the zoo is connected...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Of course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains ai animals in it. Also there are m roads in the zoo, and each road connects two distinct areas. Naturally the zoo is connected, so you can reach any area of th...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"10 19\\n13637 26970 19043 3616 12880 19387 12539 25190 2452 1261\\n1 2\\n1 3\\n1 4\\n2 5\\n3 6\\n6 7\\n3 8\\n5 9\\n3 10\\n4 10\\n9 3\\n2 8\\n4 3\\n2 3\\n7 10\\n7 8\\n5 10\\n5 6\\n7 4\\n\", \"output\": \"8241.4222222222\\n\"}, {\"type\": ...
{ "split": "train", "index": 10434, "id": "PRIMEINTELLECT_aa8f2451-2128-4f95-93cf-a932cb83226b" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: You are given a sorted array $a_1, a_2, \dots, a_n$ (for each index $i > 1$ condition $a_i \ge a_{i-1}$ holds) and an integer $k$. You are asked to divide this array into $k$ non-empty consecutive subarrays. Every element in the array should be...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "You are given a sorted array $a_1, a_2, \\dots, a_n$ (for each index $i > 1$ condition $a_i \\ge a_{i-1}$ holds) and an integer $k$.\n\nYou are asked to divide this array into $k$ non-empty consecutive subarrays. Every element in the array should be included in exactly one suba...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6 3\\n4 8 15 16 23 42\\n\", \"output\": \"12\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4 4\\n1 3 3 7\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 1\\n1 1 2 3 5 8 13 21\\n\", \"output\": \"20\\n\"}, {\"t...
{ "split": "train", "index": 14523, "id": "PRIMEINTELLECT_200bbd83-316b-40f2-937a-8160607affcd" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Memory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with score a and Lexa starts with score b. In a single turn, both Memory and Lexa get some integer in the range [ - k;k] (i.e. one integer a...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Memory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with score a and Lexa starts with score b. In a single turn, both Memory and Lexa get some integer in the range [ - k;k] (i.e. one integer among - k, - k + 1, - k + 2, .....
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 2 2 1\\n\", \"output\": \"6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1 1 2\\n\", \"output\": \"31\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2 12 3 1\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": ...
{ "split": "train", "index": 405, "id": "PRIMEINTELLECT_9e9a7da5-0cdf-4b7d-b416-cdc63df4d49b" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0.25
[ 0, 0, 1, 0, 1, 0, 0, 0 ]
true
primeintellect
Solve the following coding problem using the programming language python: There are N people numbered 1 to N. Each person wears a red hat or a blue hat. You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`. Determine if there are more pe...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "There are N people numbered 1 to N. Each person wears a red hat or a blue hat.\n\nYou are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.\n\nDetermine if there are more people wearing a red hat than p...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\nRRBR\", \"output\": \"Yes\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\nBRBR\", \"output\": \"No\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\nRBRR\", \"output\": \"Yes\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\nBBR...
{ "split": "train", "index": 2993, "id": "PRIMEINTELLECT_2ecb078e-bb59-4264-a1c0-7e5743220ef9" }
0
[ 0, 0, 0, 0.3142857142857143, 0, 0, 0, 0 ]
1
[ 1, 1, 1, 1, 1, 1, 1, 1 ]
true
primeintellect
Solve the following coding problem using the programming language python: Kicker (table football) is a board game based on football, in which players control the footballers' figures mounted on rods by using bars to get the ball into the opponent's goal. When playing two on two, one player of each team controls the go...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Kicker (table football) is a board game based on football, in which players control the footballers' figures mounted on rods by using bars to get the ball into the opponent's goal. When playing two on two, one player of each team controls the goalkeeper and the full-backs (play...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 1\\n2 2\\n3 3\\n2 2\\n\", \"output\": \"Team 2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 3\\n2 2\\n1 1\\n2 2\\n\", \"output\": \"Draw\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 100\\n100 1\\n99 99\\n99 99\\n\", \"outpu...
{ "split": "train", "index": 4112, "id": "PRIMEINTELLECT_0efc906a-2971-4a38-a5c6-e5ce2f096c78" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0.034482758620689655, 0.034482758620689655, 0.02586206896551724, 0.02586206896551724, 0, 0.04310344827586207, 0.02586206896551724, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: # A History Lesson The Pony Express was a mail service operating in the US in 1859-60. It reduced the time for messages to travel between the Atlantic and Pacific coasts to about 10 days, before it was made obsolete by the [transcontinental...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "# A History Lesson\n\nThe Pony Express was a mail service operating in the US in 1859-60.\n\n\n\n\nIt reduced the time for messages to travel between the Atlantic and Pacific coasts to about 10 days, before it was made obsolete by the [transcontinental telegraph](https://en.wik...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"riders\", \"input\": [[18, 15]], \"output\": [1]}, {\"type\": \"function_call\", \"fn_name\": \"riders\", \"input\": [[43, 23, 40, 13]], \"output\": [2]}, {\"type\": \"function_call\", \"fn_name\": \"riders\", \"input\": [[33, 8, 16, ...
{ "split": "train", "index": 13038, "id": "PRIMEINTELLECT_940264c7-9d94-445b-8755-d3d67380685d" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: There are n walruses standing in a queue in an airport. They are numbered starting from the queue's tail: the 1-st walrus stands at the end of the queue and the n-th walrus stands at the beginning of the queue. The i-th walrus has the age equal ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "There are n walruses standing in a queue in an airport. They are numbered starting from the queue's tail: the 1-st walrus stands at the end of the queue and the n-th walrus stands at the beginning of the queue. The i-th walrus has the age equal to ai.\n\nThe i-th walrus becomes...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"6\\n10 8 5 3 50 45\\n\", \"output\": \"2 1 0 -1 0 -1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"7\\n10 4 6 3 2 8 15\\n\", \"output\": \"4 2 1 0 -1 -1 -1 \"}, {\"type\": \"stdin_stdout\", \"input\": \"5\\n10 3 1 10 11\\n\", \"output\"...
{ "split": "train", "index": 8156, "id": "PRIMEINTELLECT_f35f54f7-4b06-4ff0-b9d0-3f02e54260a2" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Ilya is working for the company that constructs robots. Ilya writes programs for entertainment robots, and his current project is "Bob", a new-generation game robot. Ilya's boss wants to know his progress so far. Especially he is interested if B...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Ilya is working for the company that constructs robots. Ilya writes programs for entertainment robots, and his current project is \"Bob\", a new-generation game robot. Ilya's boss wants to know his progress so far. Especially he is interested if Bob is better at playing differe...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"10 2 1\\n1 1 1\\n1 1 1\\n1 1 1\\n2 2 2\\n2 2 2\\n2 2 2\\n\", \"output\": \"1 9\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8 1 1\\n2 2 1\\n3 3 1\\n3 1 3\\n1 1 1\\n2 1 1\\n1 2 3\\n\", \"output\": \"5 2\\n\"}, {\"type\": \"stdin_stdou...
{ "split": "train", "index": 14899, "id": "PRIMEINTELLECT_53bc5a2f-a9d6-4c6c-be33-47e6a545b411" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: In this problem, your task is to use ASCII graphics to paint a cardiogram. A cardiogram is a polyline with the following corners: <image> That is, a cardiogram is fully defined by a sequence of positive integers a1, a2, ..., an. Your task i...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "In this problem, your task is to use ASCII graphics to paint a cardiogram. \n\nA cardiogram is a polyline with the following corners:\n\n<image>\n\nThat is, a cardiogram is fully defined by a sequence of positive integers a1, a2, ..., an.\n\nYour task is to paint a cardiogram b...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n3 1 2 5 1\\n\", \"output\": \" /\\\\ \\n /\\\\/ \\\\ \\n / \\\\ \\n/ \\\\ \\n \\\\/\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n1 5 1\\n\", \"output\": \"/\\\\ \\n \\\\ \\n \\\\ ...
{ "split": "train", "index": 6684, "id": "PRIMEINTELLECT_093302e1-7447-4abb-ab97-165db4c0cacc" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: An `non decreasing` number is one containing no two consecutive digits (left to right), whose the first is higer than the second. For example, 1235 is an non decreasing number, 1229 is too, but 123429 isn't. Write a function that finds the numb...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "An `non decreasing` number is one containing no two consecutive digits (left to right), whose the first is higer than the second. For example, 1235 is an non decreasing number, 1229 is too, but 123429 isn't.\n\nWrite a function that finds the number of non decreasing numbers up...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"increasing_numbers\", \"input\": [0], \"output\": [1]}, {\"type\": \"function_call\", \"fn_name\": \"increasing_numbers\", \"input\": [1], \"output\": [10]}, {\"type\": \"function_call\", \"fn_name\": \"increasing_numbers\", \"input\"...
{ "split": "train", "index": 15872, "id": "PRIMEINTELLECT_2b71e548-b024-4650-9a5a-da1f1a67d163" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: The on-board computer on Polycarp's car measured that the car speed at the beginning of some section of the path equals v_1 meters per second, and in the end it is v_2 meters per second. We know that this section of the route took exactly t seco...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "The on-board computer on Polycarp's car measured that the car speed at the beginning of some section of the path equals v_1 meters per second, and in the end it is v_2 meters per second. We know that this section of the route took exactly t seconds to pass.\n\nAssuming that at ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 6\\n4 2\\n\", \"output\": \"26\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 10\\n10 0\\n\", \"output\": \"100\"}, {\"type\": \"stdin_stdout\", \"input\": \"87 87\\n2 10\\n\", \"output\": \"174\"}, {\"type\": \"stdin_stdout\", \"inp...
{ "split": "train", "index": 9888, "id": "PRIMEINTELLECT_ee197e4d-7f23-4557-aca4-96a33b5d0d99" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Write a program which finds the greatest common divisor of two natural numbers a and b Hint You can use the following observation: For integers x and y, if x ≥ y, then gcd(x, y) = gcd(y, x%y) Constrants 1 ≤ a, b ≤ 109 Input a and b are given in a line sparated by a single space. Output Output the greatest comm...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Write a program which finds the greatest common divisor of two natural numbers a and b\n\nHint\n\nYou can use the following observation:\n\nFor integers x and y, if x ≥ y, then gcd(x, y) = gcd(y, x%y)\n\nConstrants\n\n1 ≤ a, b ≤ 109\n\nInput\n\na and b are given in a line spara...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"86 20\", \"147 6\", \"9 20\", \"9 9\", \"268 8\", \"14 7\", \"8 24\", \"12 12\", \"624 18\", \"48 64\", \"124 31\", \"25 35\", \"35 35\", \"252 63\", \"32 192\", \"110 11\", \"110 90\", \"-1 -1\", \"18 18\", \"-2 -2\", \"28 28\", \"506 22\", \"13 130\", \"147 8\",...
{ "split": "train", "index": 4281, "id": "TACO_ddaa9545-c2fd-44ba-95a6-49d837f2ae1a" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Let's define a function $f(x)$ ($x$ is a positive integer) as follows: write all digits of the decimal representation of $x$ backwards, then get rid of the leading zeroes. For example, $f(321) = 123$, $f(120) = 21$, $f(1000000) = 1$, $f(111) = 1...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Let's define a function $f(x)$ ($x$ is a positive integer) as follows: write all digits of the decimal representation of $x$ backwards, then get rid of the leading zeroes. For example, $f(321) = 123$, $f(120) = 21$, $f(1000000) = 1$, $f(111) = 111$.\n\nLet's define another func...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n4\\n37\\n998244353\\n1000000007\\n12345678901337426966631415\\n\", \"output\": \"1\\n2\\n9\\n10\\n26\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n10\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n9...
{ "split": "train", "index": 15422, "id": "PRIMEINTELLECT_609bac52-28e2-4449-b4ce-c842a1f84f4e" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
There are two bus stops denoted A and B, and there n buses that go from A to B every day. The shortest path from A to B takes t units of time but some buses might take longer paths. Moreover, buses are allowed to overtake each other during the route. At each station one can find a sorted list of moments of time when a...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "There are two bus stops denoted A and B, and there n buses that go from A to B every day. The shortest path from A to B takes t units of time but some buses might take longer paths. Moreover, buses are allowed to overtake each other during the route.\n\nAt each station one can ...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"2 1000000000\\n999999999 1000000000\\n1 2\\n\", \"2 1000000000\\n99999999 1000000000\\n1 1\\n\", \"2 1000000000\\n1 1000000000\\n2 2\\n\", \"2 10\\n4 5\\n2 2\\n\", \"2 2\\n4 5\\n1 2\\n\", \"2 1000000000\\n130296385 1000000000\\n1 1\\n\", \"3 19\\n4 6 8\\n2 2 3\\n\...
{ "split": "train", "index": 4480, "id": "TACO_d4e11e58-abd4-4c9f-8dd1-53fa5b9158f4" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Everybody knows the classic ["half your age plus seven"](https://en.wikipedia.org/wiki/Age_disparity_in_sexual_relationships#The_.22half-your-age-plus-seven.22_rule) dating rule that a lot of people follow (including myself). It's the 'recommend...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Everybody knows the classic [\"half your age plus seven\"](https://en.wikipedia.org/wiki/Age_disparity_in_sexual_relationships#The_.22half-your-age-plus-seven.22_rule) dating rule that a lot of people follow (including myself). It's the 'recommended' age range in which to date ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"dating_range\", \"input\": [17], \"output\": [\"15-20\"]}, {\"type\": \"function_call\", \"fn_name\": \"dating_range\", \"input\": [40], \"output\": [\"27-66\"]}, {\"type\": \"function_call\", \"fn_name\": \"dating_range\", \"input\":...
{ "split": "train", "index": 14062, "id": "PRIMEINTELLECT_0a79af33-a451-4208-a008-143fb5239bb2" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Sereja has a bracket sequence s_1, s_2, ..., s_{n}, or, in other words, a string s of length n, consisting of characters "(" and ")". Sereja needs to answer m queries, each of them is described by two integers l_{i}, r_{i} (1 ≤ l_{i} ≤ r_{i} ≤ ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Sereja has a bracket sequence s_1, s_2, ..., s_{n}, or, in other words, a string s of length n, consisting of characters \"(\" and \")\".\n\nSereja needs to answer m queries, each of them is described by two integers l_{i}, r_{i} (1 ≤ l_{i} ≤ r_{i} ≤ n). The answer to the i-th ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"())(())(())(\\n7\\n1 1\\n2 3\\n1 2\\n1 12\\n8 12\\n5 11\\n2 10\\n\", \"output\": \"0\\n0\\n2\\n10\\n4\\n6\\n6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"(((((()((((((((((()((()(((((\\n1\\n8 15\\n\", \"output\": \"0\\n\"}, {\"type\"...
{ "split": "train", "index": 10299, "id": "PRIMEINTELLECT_dafe6a17-8c79-4d8f-83a0-c49cdf21e770" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
We have N colored balls arranged in a row from left to right; the color of the i-th ball from the left is c_i. You are given Q queries. The i-th query is as follows: how many different colors do the l_i-th through r_i-th balls from the left have? -----Constraints----- - 1\leq N,Q \leq 5 \times 10^5 - 1\leq c_i \leq ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "We have N colored balls arranged in a row from left to right; the color of the i-th ball from the left is c_i.\nYou are given Q queries. The i-th query is as follows: how many different colors do the l_i-th through r_i-th balls from the left have?\n\n-----Constraints-----\n - 1...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"4 3\\n1 2 1 3\\n1 3\\n2 4\\n3 3\\n\", \"10 10\\n2 5 6 5 2 1 7 9 7 2\\n5 5\\n2 4\\n6 7\\n2 2\\n7 8\\n7 9\\n1 8\\n6 9\\n8 10\\n6 8\\n\", \"10 10\\n4 5 6 5 2 1 7 9 7 2\\n5 5\\n2 4\\n6 7\\n2 2\\n7 8\\n7 9\\n1 8\\n6 9\\n8 10\\n6 8\", \"4 1\\n1 2 1 3\\n1 3\\n2 4\\n3 3\"...
{ "split": "train", "index": 4685, "id": "TACO_319e92dc-bb2f-4e7b-949b-fd0efecdc568" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Example Input 3 y 7 y 6 n 5 Output 1
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Example\n\nInput\n\n3\ny 7\ny 6\nn 5\n\n\nOutput\n\n1" } ]
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"3\\ny 7\\ny 2\\nn 5\", \"3\\ny 7\\ny 3\\nn 5\", \"3\\ny 7\\ny 3\\nn 10\", \"3\\ny 2\\ny 3\\nn 10\", \"3\\ny 2\\ny 6\\nn 10\", \"3\\nx 2\\ny 6\\nn 10\", \"3\\ny 7\\ny 11\\nn 5\", \"3\\ny 8\\ny 2\\nn 5\", \"3\\ny 7\\ny 6\\nn 2\", \"3\\ny 0\\ny 3\\nn 10\", \"3\\ny 4\...
{ "split": "train", "index": 1160, "id": "TACO_f9bd1e8e-a2e9-474a-b7b9-860a945bab7b" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: For given integer n, count the totatives of n, that is, the positive integers less than or equal to n that are relatively prime to n. Input n An integer n (1 ≤ n ≤ 1000000000). Output The number of totatives in a line. Examples Input ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "For given integer n, count the totatives of n, that is, the positive integers less than or equal to n that are relatively prime to n.\n\n\n\nInput\n\n\nn\n\n\nAn integer n (1 ≤ n ≤ 1000000000).\n\nOutput\n\nThe number of totatives in a line.\n\nExamples\n\nInput\n\n6\n\n\nOutpu...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1000000\", \"output\": \"400000\"}, {\"type\": \"stdin_stdout\", \"input\": \"6\", \"output\": \"2\"}, {\"type\": \"stdin_stdout\", \"input\": \"1000100\", \"output\": \"391680\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5\", \"outp...
{ "split": "train", "index": 4694, "id": "PRIMEINTELLECT_b107f7fe-468d-40b8-b58e-bb15fff21612" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0.0380952380952381, 0, 0, 0, 0, 0, 0.009523809523809525, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Recently, Duff has been practicing weight lifting. As a hard practice, Malek gave her a task. He gave her a sequence of weights. Weight of i-th of them is 2^{w}_{i} pounds. In each step, Duff can lift some of the remaining weights and throw them...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Recently, Duff has been practicing weight lifting. As a hard practice, Malek gave her a task. He gave her a sequence of weights. Weight of i-th of them is 2^{w}_{i} pounds. In each step, Duff can lift some of the remaining weights and throw them away. She does this until there'...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n1 1 2 3 3\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n0 1 2 3\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1\\n120287\\n\", \"output\": \"1\\n\"}, {\"type\": \"stdin_stdout\", ...
{ "split": "train", "index": 90, "id": "PRIMEINTELLECT_6c15d8da-4761-4c85-83a8-4562cb28ec92" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: There is an infinite board of square tiles. Initially all tiles are white. Vova has a red marker and a blue marker. Red marker can color $a$ tiles. Blue marker can color $b$ tiles. If some tile isn't white then you can't use marker of any color...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "There is an infinite board of square tiles. Initially all tiles are white.\n\nVova has a red marker and a blue marker. Red marker can color $a$ tiles. Blue marker can color $b$ tiles. If some tile isn't white then you can't use marker of any color on it. Each marker must be dra...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 4\\n\", \"output\": \"12\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 9\\n\", \"output\": \"14\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"9 3\\n\", \"output\": \"14\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 6\\n\",...
{ "split": "train", "index": 2389, "id": "PRIMEINTELLECT_ff8cf5d9-2f8b-4b14-af80-babbd4f1b194" }
0.75
[ 1, 1, 0, 1, 1, 0, 1, 1 ]
1
[ 1, 1, 1, 1, 1, 1, 1, 1 ]
true
primeintellect
Solve the following coding problem using the programming language python: There are $n$ persons who initially don't know each other. On each morning, two of them, who were not friends before, become friends. We want to plan a trip for every evening of $m$ days. On each trip, you have to select a group of people that ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "There are $n$ persons who initially don't know each other. On each morning, two of them, who were not friends before, become friends.\n\nWe want to plan a trip for every evening of $m$ days. On each trip, you have to select a group of people that will go on the trip. For every ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4 4 2\\n2 3\\n1 2\\n1 3\\n1 4\\n\", \"output\": \"0\\n0\\n3\\n3\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 8 2\\n2 1\\n4 2\\n5 4\\n5 2\\n4 3\\n5 1\\n4 1\\n3 2\\n\", \"output\": \"0\\n0\\n0\\n3\\n3\\n4\\n4\\n5\\n\"}, {\"type\": \"...
{ "split": "train", "index": 185, "id": "PRIMEINTELLECT_bb6627b9-6dd6-44b1-a927-5edfd6039e84" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Once upon a time there were several little pigs and several wolves on a two-dimensional grid of size n × m. Each cell in this grid was either empty, containing one little pig, or containing one wolf. A little pig and a wolf are adjacent if the ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Once upon a time there were several little pigs and several wolves on a two-dimensional grid of size n × m. Each cell in this grid was either empty, containing one little pig, or containing one wolf.\n\nA little pig and a wolf are adjacent if the cells that they are located at ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 3\\nPPW\\nW.P\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 3\\nP.W\\n.P.\\nW.P\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 10\\nPPPPPPPPPP\\nPPPPPPPWPP\\nPPPPPPPPPP\\nPPPPPPPPPP...
{ "split": "train", "index": 4592, "id": "PRIMEINTELLECT_aa01dc74-c023-4785-b314-3f9db37e07ad" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Problem Given the integer n, output the smallest m such that nCm (the number of combinations that choose m out of n different ones) is even. Constraints The input satisfies the following conditions. * 1 ≤ n ≤ 1018 Input The input is given ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Problem\n\nGiven the integer n, output the smallest m such that nCm (the number of combinations that choose m out of n different ones) is even.\n\nConstraints\n\nThe input satisfies the following conditions.\n\n* 1 ≤ n ≤ 1018\n\nInput\n\nThe input is given in the following form...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"3\", \"output\": \"4\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\", \"output\": \"1\"}, {\"type\": \"stdin_stdout\", \"input\": \"111\", \"output\": \"16\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\", \"output\": \"1\\n\"}, {\"ty...
{ "split": "train", "index": 3617, "id": "PRIMEINTELLECT_2eb37e17-34bc-46e8-bc1a-7a30f8f0d90d" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
A Martian boy is named s — he has got this name quite recently from his parents for his coming of age birthday. Now he enjoys looking for his name everywhere. If he sees that he can obtain his name from some string by removing zero or more letters (at that, the remaining letters remain in the same order), he gets happy...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "A Martian boy is named s — he has got this name quite recently from his parents for his coming of age birthday. Now he enjoys looking for his name everywhere. If he sees that he can obtain his name from some string by removing zero or more letters (at that, the remaining letter...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"aba\\nbaobababbah\\n\", \"mars\\nsunvenusearthmarsjupitersaturnuranusneptune\\n\", \"rry\\nsorrymercuryismissedabove\\n\", \"a\\naaaaaaaaaaaaaa\\n\", \"abcaba\\nabcabaabcabaabcabaabcaba\\n\", \"lol\\nlol\\n\", \"aaaaaaaaaaaa\\naaaaaa\\n\", \"a\\na\\n\", \"a\\na\\n...
{ "split": "train", "index": 455, "id": "TACO_b0d0cc24-18c3-41b7-8629-f037fa4d4b7b" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: You just got done with your set at the gym, and you are wondering how much weight you could lift if you did a single repetition. Thankfully, a few scholars have devised formulas for this purpose (from [Wikipedia](https://en.wikipedia.org/wiki/On...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "You just got done with your set at the gym, and you are wondering how much weight you could lift if you did a single repetition. Thankfully, a few scholars have devised formulas for this purpose (from [Wikipedia](https://en.wikipedia.org/wiki/One-repetition_maximum)) :\n\n\n###...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"calculate_1RM\", \"input\": [135, 20], \"output\": [282]}, {\"type\": \"function_call\", \"fn_name\": \"calculate_1RM\", \"input\": [200, 8], \"output\": [253]}, {\"type\": \"function_call\", \"fn_name\": \"calculate_1RM\", \"input\":...
{ "split": "train", "index": 9786, "id": "PRIMEINTELLECT_1219d823-4367-47ba-901f-2cae5030f2f0" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Everybody knows that the capital of Berland is connected to Bercouver (the Olympic capital) by a direct road. To improve the road's traffic capacity, there was placed just one traffic sign, limiting the maximum speed. Traffic signs in Berland ar...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Everybody knows that the capital of Berland is connected to Bercouver (the Olympic capital) by a direct road. To improve the road's traffic capacity, there was placed just one traffic sign, limiting the maximum speed. Traffic signs in Berland are a bit peculiar, because they li...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 70\\n200 170 40\\n\", \"output\": \"8.965874696353\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"1 1\\n2 1 3\\n\", \"output\": \"2.500000000000\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"20 40\\n9958 9799 30\\n\", \"output\": ...
{ "split": "train", "index": 7066, "id": "PRIMEINTELLECT_8f14517d-f6cb-4cea-af0b-d4708fcb1f05" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Rick and Morty are playing their own version of Berzerk (which has nothing in common with the famous Berzerk game). This game needs a huge space, so they play it with a computer. In this game there are n objects numbered from 1 to n arranged in...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Rick and Morty are playing their own version of Berzerk (which has nothing in common with the famous Berzerk game). This game needs a huge space, so they play it with a computer.\n\nIn this game there are n objects numbered from 1 to n arranged in a circle (in clockwise order)....
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n2 3 2\\n3 1 2 3\\n\", \"output\": \"Lose Win Win Loop\\nLoop Win Win Win\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"8\\n4 6 2 3 4\\n2 3 6\\n\", \"output\": \"Win Win Win Win Win Win Win\\nLose Win Lose Lose Win Lose Lose\\n\"},...
{ "split": "train", "index": 136, "id": "PRIMEINTELLECT_aa7ad31c-694d-4ac5-85d0-13a53d68001c" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0.0078125, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Alice and Bob are going to drive from their home to a theater for a date. They are very challenging - they have no maps with them even though they don’t know the route at all (since they have just moved to their new home). Yes, they will be goin...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Alice and Bob are going to drive from their home to a theater for a date. They are very challenging - they have no maps with them even though they don’t know the route at all (since they have just moved to their new home). Yes, they will be going just by their feeling.\n\nThe t...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 1 5\\n1 0 1 0 0\\n0 2 1 0 0\\n2 0 0 1 0\\n1 0 0 1 0\\n0 1 1 0 1\\n0 0 0 1 0\\n0 0 0\", \"output\": \"8.50000000\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 1 5\\n0 0 1 0 0\\n0 2 1 0 0\\n2 0 0 1 0\\n1 0 0 1 0\\n0 1 1 0 1\\n0 0 0 1 0...
{ "split": "train", "index": 3003, "id": "PRIMEINTELLECT_d2b21738-930f-484b-9ee0-c79c20ea5db2" }
0
[ 0, 0, 0, 0, 0.012658227848101266, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Innokenty is a president of a new football league in Byteland. The first task he should do is to assign short names to all clubs to be shown on TV next to the score. Of course, the short names should be distinct, and Innokenty wants that all sho...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Innokenty is a president of a new football league in Byteland. The first task he should do is to assign short names to all clubs to be shown on TV next to the score. Of course, the short names should be distinct, and Innokenty wants that all short names consist of three letters...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2\\nDINAMO BYTECITY\\nFOOTBALL MOSCOW\\n\", \"output\": \"YES\\nDIN\\nFOO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"2\\nDINAMO BYTECITY\\nDINAMO BITECITY\\n\", \"output\": \"NO\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n...
{ "split": "train", "index": 1534, "id": "PRIMEINTELLECT_5d1aa234-c1e3-4480-8849-9da88a9b3009" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0.75
[ 1, 1, 0, 1, 1, 0, 1, 1 ]
true
primeintellect
Solve the following coding problem using the programming language python: The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.) We will close the window so as to min...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)\nWe will close the window so as to minimize the total horizontal lengt...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"12 4\\n\", \"output\": \"4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"20 15\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"20 30\\n\", \"output\": \"0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100 100...
{ "split": "train", "index": 2529, "id": "PRIMEINTELLECT_858bf8ed-6a73-46bb-9ca1-8c80a4814ff4" }
0
[ 0.003289473684210526, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0.003289473684210526, 0.993421052631579, 0.9901315789473685, 0, 0 ]
false
taco
You are given an integer $n$ and an array $a_1, a_2, \ldots, a_n$. You should reorder the elements of the array $a$ in such way that the sum of $\textbf{MEX}$ on prefixes ($i$-th prefix is $a_1, a_2, \ldots, a_i$) is maximized. Formally, you should find an array $b_1, b_2, \ldots, b_n$, such that the sets of elements ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "You are given an integer $n$ and an array $a_1, a_2, \\ldots, a_n$. You should reorder the elements of the array $a$ in such way that the sum of $\\textbf{MEX}$ on prefixes ($i$-th prefix is $a_1, a_2, \\ldots, a_i$) is maximized.\n\nFormally, you should find an array $b_1, b_2...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"3\\n7\\n4 2 0 1 3 3 7\\n5\\n2 2 8 6 9\\n1\\n0\\n\", \"1\\n1\\n2\\n\", \"1\\n100\\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 ...
{ "split": "train", "index": 2478, "id": "TACO_b73cbbc7-dc7d-4e74-b29c-00e40c684696" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Recently Luba bought a monitor. Monitor is a rectangular matrix of size n × m. But then she started to notice that some pixels cease to work properly. Luba thinks that the monitor will become broken the first moment when it contains a square k ×...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Recently Luba bought a monitor. Monitor is a rectangular matrix of size n × m. But then she started to notice that some pixels cease to work properly. Luba thinks that the monitor will become broken the first moment when it contains a square k × k consisting entirely of broken ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"2 3 2 5\\n2 1 8\\n2 2 8\\n1 2 1\\n1 3 4\\n2 3 2\\n\", \"output\": \"8\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3 3 2 5\\n1 2 2\\n2 2 1\\n2 3 5\\n3 2 10\\n2 1 100\\n\", \"output\": \"-1\\n\"}, {\"type\": \"stdin_stdout\", \"input\...
{ "split": "train", "index": 1828, "id": "PRIMEINTELLECT_81b30cef-844c-4796-a64b-ad4e2c32c0a5" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
1
[ 1, 1, 1, 1, 1, 1, 1, 1 ]
true
primeintellect
Solve the following coding problem using the programming language python: Make a wish to a shooting star The mysterious organization JAG (Japanese Alumni Group) holds regular meetings. One day, the agenda was "How to enable participating teams to demonstrate their strength in the upcoming ICPC (International Collegia...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Make a wish to a shooting star\n\nThe mysterious organization JAG (Japanese Alumni Group) holds regular meetings. One day, the agenda was \"How to enable participating teams to demonstrate their strength in the upcoming ICPC (International Collegiate Programming Contest) domest...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1\\n0.0000 0.0000 0.0000 2.0000 0.0000 0.0000 4.0000 1.0000\\n2\\n0.0000 0.0000 0.0000 2.0000 0.0000 0.0000 4.0000 1.0000\\n10.0000 0.0000 0.0000 -2.0000 0.0000 0.0000 4.0000 1.0000\\n5\\n-10.0000 0.0000 0.0000 10.0000 0.0000 0.0000 2.00...
{ "split": "train", "index": 10630, "id": "PRIMEINTELLECT_a7bbcd27-8846-4a6f-b995-a768e5158875" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: During the last Sereja's Codesecrof round the server crashed many times, so the round was decided to be made unrated for some participants. Let's assume that n people took part in the contest. Let's assume that the participant who got the firs...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "During the last Sereja's Codesecrof round the server crashed many times, so the round was decided to be made unrated for some participants. \n\nLet's assume that n people took part in the contest. Let's assume that the participant who got the first place has rating a1, the seco...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 0\\n5 5 4 1 2\\n\", \"output\": \"2\\n3\\n4\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 -10\\n5 5 1 7 4 1 2 4 9 2\\n\", \"output\": \"2\\n4\\n5\\n7\\n8\\n9\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"10 0\\n5 5 1 7 4 1 2 4...
{ "split": "train", "index": 13983, "id": "PRIMEINTELLECT_729a63a5-2d47-4445-951f-74af58dca262" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: A schoolboy named Vasya loves reading books on programming and mathematics. He has recently read an encyclopedia article that described the method of median smoothing (or median filter) and its many applications in science and engineering. Vasya...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "A schoolboy named Vasya loves reading books on programming and mathematics. He has recently read an encyclopedia article that described the method of median smoothing (or median filter) and its many applications in science and engineering. Vasya liked the idea of the method ver...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5\\n0 1 0 1 0\\n\", \"output\": \"2\\n0 0 0 0 0\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"4\\n0 0 1 1\\n\", \"output\": \"0\\n0 0 1 1\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"3\\n0 1 0\\n\", \"output\": \"1\\n0 0 0\\n\"}, ...
{ "split": "train", "index": 4496, "id": "PRIMEINTELLECT_10ec348d-24ae-442a-adf9-8f410003a00e" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: You have a collection of lovely poems. Unfortuantely they aren't formatted very well. They're all on one line, like this: ``` Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "You have a collection of lovely poems. Unfortuantely they aren't formatted very well. They're all on one line, like this:\n\n```\nBeautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated.\n```\nWhat you w...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"format_poem\", \"input\": [\"Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated.\"], \"output\": [\"Beautiful is better than ugly.\\nExplicit is better th...
{ "split": "train", "index": 11318, "id": "PRIMEINTELLECT_aa6561d3-ceb1-44d3-8b27-e21d7ed1292f" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Take an integer `n (n >= 0)` and a digit `d (0 <= d <= 9)` as an integer. Square all numbers `k (0 <= k <= n)` between 0 and n. Count the numbers of digits `d` used in the writing of all the `k**2`. Call `nb_dig` (or nbDig or ...) the function ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Take an integer `n (n >= 0)` and a digit `d (0 <= d <= 9)` as an integer. Square all numbers `k (0 <= k <= n)` between 0 and n. Count the numbers of \ndigits `d` used in the writing of all the `k**2`. Call `nb_dig` (or nbDig or ...) the function taking `n` and `d` as parameters...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"function_call\", \"fn_name\": \"nb_dig\", \"input\": [5750, 0], \"output\": [4700]}, {\"type\": \"function_call\", \"fn_name\": \"nb_dig\", \"input\": [11011, 2], \"output\": [9481]}, {\"type\": \"function_call\", \"fn_name\": \"nb_dig\", \"input\": [12224, 8], \"ou...
{ "split": "train", "index": 15284, "id": "PRIMEINTELLECT_054e579e-0fb7-45f4-8990-1705d32e2ce2" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Each item in the game has a level. The higher the level is, the higher basic parameters the item has. We shall consider only the following basic parameters: attack (atk), defense (def) and resistance to different types of impact (res). Each ite...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Each item in the game has a level. The higher the level is, the higher basic parameters the item has. We shall consider only the following basic parameters: attack (atk), defense (def) and resistance to different types of impact (res).\n\nEach item belongs to one class. In this...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"4\\nsword weapon 10 2 3 2\\npagstarmor armor 0 15 3 1\\niceorb orb 3 2 13 2\\nlongbow weapon 9 1 2 1\\n6\\nmike gladiator 5 longbow\\nbobby sentry 6 pagstarmor\\npetr gladiator 7 iceorb\\nteddy physician 6 sword\\nblackjack sentry 8 swor...
{ "split": "train", "index": 2853, "id": "PRIMEINTELLECT_808b8942-fb3b-4e7a-af80-7f3de713a512" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0.00909090909090909, 0.004545454545454545, 0, 0.004545454545454545 ]
false
taco
Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a_1, a_2, ..., a_{n}. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exercise a_{i} times. Greg now only does three types of exercises: "chest" ex...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n integers a_1, a_2, ..., a_{n}. These numbers mean that Greg needs to do exactly n exercises today. Besides, Greg should repeat the i-th in order exercise a_{i} times.\n\nGreg now on...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"2\\n2 8\\n\", \"3\\n5 1 10\\n\", \"7\\n3 3 2 7 9 6 8\\n\", \"4\\n5 6 6 2\\n\", \"5\\n8 2 2 6 3\\n\", \"6\\n8 7 2 5 3 4\\n\", \"8\\n7 2 9 10 3 8 10 6\\n\", \"9\\n5 4 2 3 4 4 5 2 2\\n\", \"10\\n4 9 8 5 3 8 8 10 4 2\\n\", \"11\\n10 9 7 6 1 3 9 7 1 3 5\\n\", \"12\\n24...
{ "split": "train", "index": 5430, "id": "TACO_03c15c88-8a94-4de4-905f-5e113e69cfd0" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: Takahashi and Aoki love calculating things, so they will play with numbers now. First, they came up with one positive integer each. Takahashi came up with X, and Aoki came up with Y. Then, they will enjoy themselves by repeating the following o...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Takahashi and Aoki love calculating things, so they will play with numbers now.\n\nFirst, they came up with one positive integer each. Takahashi came up with X, and Aoki came up with Y. Then, they will enjoy themselves by repeating the following operation K times:\n\n* Compute ...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 8 3\\n00101\\n10101001\", \"output\": \"10000\\n10110100\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 8 3\\n00101\\n10100001\", \"output\": \"1000\\n10100100\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"5 8 5\\n00101\\n101100...
{ "split": "train", "index": 15440, "id": "PRIMEINTELLECT_6f2ea2f9-8626-430b-b7c8-bb15cc26c438" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers). The key in football is to divide into teams fairly before the ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).\n\nThe key in footbal...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"100\\n85 50 17 89 65 89 5 20 86 26 16 21 85 14 44 31 87 31 6 2 48 67 8 80 79 1 48 36 97 1 5 30 79 50 78 12 2 55 76 100 54 40 26 81 97 96 68 56 87 14 51 17 54 37 52 33 69 62 38 63 74 15 62 78 9 19 67 2 60 58 93 60 18 96 55 48 34 7 79 82 32 58 90 67 20 50 27 15 7 89...
{ "split": "train", "index": 232, "id": "TACO_5ee0f8a3-e3e8-4ba6-a449-4513ecfaa3d2" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Let $f(i)$ denote the minimum positive integer $x$ such that $x$ is not a divisor of $i$. Compute $\sum_{i=1}^n f(i)$ modulo $10^9+7$. In other words, compute $f(1)+f(2)+\dots+f(n)$ modulo $10^9+7$. -----Input----- The first line contains a single integer $t$ ($1\leq t\leq 10^4$), the number of test cases. Then $t$...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Let $f(i)$ denote the minimum positive integer $x$ such that $x$ is not a divisor of $i$.\n\nCompute $\\sum_{i=1}^n f(i)$ modulo $10^9+7$. In other words, compute $f(1)+f(2)+\\dots+f(n)$ modulo $10^9+7$.\n\n\n-----Input-----\n\nThe first line contains a single integer $t$ ($1\\...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"6\\n1\\n2\\n3\\n4\\n10\\n10000000000000000\\n\", \"1\\n4642392862013167\\n\", \"1\\n4642392862013167\\n\", \"1\\n5897090464090076\\n\", \"6\\n1\\n4\\n3\\n4\\n10\\n10000000000000000\\n\", \"1\\n3141480811161321\\n\", \"1\\n3202097780689747\\n\", \"1\\n5061211645916...
{ "split": "train", "index": 2849, "id": "TACO_7adf5d6a-85e2-4ecf-af3a-eba0fdfae2c8" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: When a boy was cleaning up after his grand father passing, he found an old paper: <image> In addition, other side of the paper says that "go ahead a number of steps equivalent to the first integer, and turn clockwise by degrees equivalent to...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "When a boy was cleaning up after his grand father passing, he found an old paper:\n\n<image>\n\n\n\nIn addition, other side of the paper says that \"go ahead a number of steps equivalent to the first integer, and turn clockwise by degrees equivalent to the second integer\".\n\n...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"56,65\\n97,54\\n64,-4\\n55,76\\n42,-27\\n43,80\\n87,-86\\n55,-6\\n89,34\\n95,5\\n0,0\", \"output\": \"171\\n-302\"}, {\"type\": \"stdin_stdout\", \"input\": \"56,65\\n97,54\\n64,-4\\n55,76\\n42,-27\\n43,80\\n87,-86\\n55,-6\\n89,34\\n5,59...
{ "split": "train", "index": 3704, "id": "PRIMEINTELLECT_ca2c52a5-a46c-40e0-9d24-fc55414d8aa0" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0.9714285714285714, 0.9904761904761905, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: The surveyor starship Hakodate-maru is famous for her two fuel containers with unbounded capacities. They hold the same type of atomic fuel balls. There, however, is an inconvenience. The shapes of the fuel containers #1 and #2 are always cubic...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "The surveyor starship Hakodate-maru is famous for her two fuel containers with unbounded capacities. They hold the same type of atomic fuel balls.\n\nThere, however, is an inconvenience. The shapes of the fuel containers #1 and #2 are always cubic and regular tetrahedral respec...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"100\\n84\\n50\\n20\\n151200\\n0\", \"output\": \"99\\n84\\n47\\n20\\n151200\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"100\\n84\\n50\\n20\\n150323\\n0\", \"output\": \"99\\n84\\n47\\n20\\n150303\\n\"}, {\"type\": \"stdin_stdout\", ...
{ "split": "train", "index": 15181, "id": "PRIMEINTELLECT_8472fa3a-4561-4858-bb9b-b16a1b51b6b1" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: At an arcade, Takahashi is playing a game called RPS Battle, which is played as follows: * The player plays N rounds of Rock Paper Scissors against the machine. (See Notes for the description of Rock Paper Scissors. A draw also counts as a roun...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "At an arcade, Takahashi is playing a game called RPS Battle, which is played as follows:\n\n* The player plays N rounds of Rock Paper Scissors against the machine. (See Notes for the description of Rock Paper Scissors. A draw also counts as a round.)\n* Each time the player win...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 2\\n8 7 6\\nrsrpr\", \"output\": \"27\"}, {\"type\": \"stdin_stdout\", \"input\": \"7 1\\n100 10 1\\nssssppr\", \"output\": \"211\"}, {\"type\": \"stdin_stdout\", \"input\": \"30 5\\n325 234 123\\nrspsspspsrpspsppprpsprpssprpsr\", \"ou...
{ "split": "train", "index": 5511, "id": "PRIMEINTELLECT_00198d00-c9d6-4d62-a272-3badfc298a02" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Nukes has an integer that can be represented as the bitwise OR of one or more integers between A and B (inclusive). How many possible candidates of the value of Nukes's integer there are? Constraints * 1 ≤ A ≤ B < 2^{60} * A and B are integers. Input The input is given from Standard Input in the following format: ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Nukes has an integer that can be represented as the bitwise OR of one or more integers between A and B (inclusive). How many possible candidates of the value of Nukes's integer there are?\n\nConstraints\n\n* 1 ≤ A ≤ B < 2^{60}\n* A and B are integers.\n\nInput\n\nThe input is g...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"65\\n110\", \"271828182845904523\\n328419650112448238\", \"271828182845904523\\n491516385100905315\", \"65\\n158\", \"7\\n8\", \"65\\n181\", \"271828182845904523\\n636593337042278053\", \"271828182845904523\\n1128816364578546661\", \"7\\n15\", \"271828182845904523...
{ "split": "train", "index": 4540, "id": "TACO_fb3147ff-f563-4a49-8559-b4110de5a78f" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
primeintellect
Solve the following coding problem using the programming language python: A lot of people associate Logo programming language with turtle graphics. In this case the turtle moves along the straight line and accepts commands "T" ("turn around") and "F" ("move 1 unit forward"). You are given a list of commands that will...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "A lot of people associate Logo programming language with turtle graphics. In this case the turtle moves along the straight line and accepts commands \"T\" (\"turn around\") and \"F\" (\"move 1 unit forward\").\n\nYou are given a list of commands that will be given to the turtle...
code
{ "style": "rule", "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"FFFTFFF\\n2\\n\", \"output\": \"6\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"FT\\n1\\n\", \"output\": \"2\\n\"}, {\"type\": \"stdin_stdout\", \"input\": \"TFFFTTTFFFFTFFTTFTTFTTFFTFFFTTTTTTFTTTTTTFFFFFFFTFFFFTTTFTFFTTTTTTFFFFFTTFTF...
{ "split": "train", "index": 9094, "id": "PRIMEINTELLECT_0bbbdffb-47c8-4967-b1b6-77a8fe3ca870" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
You might have heard about the next game in Lara Croft series coming out this year. You also might have watched its trailer. Though you definitely missed the main idea about its plot, so let me lift the veil of secrecy. Lara is going to explore yet another dangerous dungeon. Game designers decided to use good old 2D e...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "You might have heard about the next game in Lara Croft series coming out this year. You also might have watched its trailer. Though you definitely missed the main idea about its plot, so let me lift the veil of secrecy.\n\nLara is going to explore yet another dangerous dungeon....
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"4 3 0\\n\", \"4 3 11\\n\", \"4 3 7\\n\", \"1000000000 2 1999999999\\n\", \"1000000000 1000000000 999999999999999999\\n\", \"1000000000 1000000000 999999999\\n\", \"1000000000 1000000000 2000000500\\n\", \"2 2 2\\n\", \"28 3 1\\n\", \"2 3 3\\n\", \"4 6 8\\n\", \"6 ...
{ "split": "train", "index": 1628, "id": "TACO_0fa90fcb-fa8c-4762-b5bc-5bd5739ea5b1" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Vasya's house is situated in a forest, and there is a mushroom glade near it. The glade consists of two rows, each of which can be divided into n consecutive cells. For each cell Vasya knows how fast the mushrooms grow in this cell (more formally, how many grams of mushrooms grow in this cell each minute). Vasya spends...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Vasya's house is situated in a forest, and there is a mushroom glade near it. The glade consists of two rows, each of which can be divided into n consecutive cells. For each cell Vasya knows how fast the mushrooms grow in this cell (more formally, how many grams of mushrooms gr...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"3\\n1 2 3\\n6 5 4\\n\", \"3\\n1 1000 10000\\n10 100 100000\\n\", \"6\\n12 8 12 17 20 5\\n17 4 8 8 8 4\\n\", \"6\\n16 20 18 7 14 2\\n17 12 4 10 7 4\\n\", \"6\\n4 1 12 9 3 11\\n12 20 19 12 19 11\\n\", \"1\\n7\\n5\\n\", \"2\\n1 2\\n1 1\\n\", \"1\\n1\\n1\\n\", \"6\\n1...
{ "split": "train", "index": 1879, "id": "TACO_28b4d6a6-9a1a-4f93-8220-d72b5d290d08" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
The full exploration sister is a very talented woman. Your sister can easily count the number of routes in a grid pattern if it is in the thousands. You and your exploration sister are now in a room lined with hexagonal tiles. The older sister seems to be very excited about the hexagon she sees for the first time. The ...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "The full exploration sister is a very talented woman. Your sister can easily count the number of routes in a grid pattern if it is in the thousands. You and your exploration sister are now in a room lined with hexagonal tiles. The older sister seems to be very excited about the...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"0 0 1 2\\n1\\n0 1\\n2 2\", \"0 -1 0 2\\n0\\n2 2\", \"1 0 0 2\\n0\\n2 2\", \"0 0 0 2\\n6\\n0 1\\n1 -1\\n1 0\\n0 -1\\n-1 -1\\n-1 0\\n2 2\", \"1 2 0 0\\n1\\n-1 0\\n4 2\", \"-11 -1 1 0\\n1\\n-1 -2\\n21 33\", \"-11 -1 1 -1\\n1\\n-1 -2\\n21 33\", \"-6 -1 1 -1\\n1\\n-1 -...
{ "split": "train", "index": 5057, "id": "TACO_ba530682-44b1-4616-b303-d9151ebf0ed2" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Noora is a student of one famous high school. It's her final year in school — she is going to study in university next year. However, she has to get an «A» graduation certificate in order to apply to a prestigious one. In school, where Noora is studying, teachers are putting down marks to the online class register, wh...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Noora is a student of one famous high school. It's her final year in school — she is going to study in university next year. However, she has to get an «A» graduation certificate in order to apply to a prestigious one.\n\nIn school, where Noora is studying, teachers are putting...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"2 10\\n8 9\\n\", \"3 5\\n4 4 4\\n\", \"3 10\\n10 8 9\\n\", \"2 23\\n21 23\\n\", \"5 10\\n5 10 10 9 10\\n\", \"12 50\\n18 10 26 22 22 23 14 21 27 18 25 12\\n\", \"38 12\\n2 7 10 8 5 3 5 6 3 6 5 1 9 7 7 8 3 4 4 4 5 2 3 6 6 1 6 7 4 4 8 7 4 5 3 6 6 6\\n\", \"63 86\\n3...
{ "split": "train", "index": 2198, "id": "TACO_a4493cf1-f88c-4c09-8f6c-33e7e9aaf19a" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Problem KND is a student programmer at the University of Aizu. His neighbor is known to be very annoying. Neighbors find out that he is a sweet tooth and plan to add more sweetness than necessary to make him fat. To that end, your neighbor, you, was introduced to a sweets shop by a friend. However, the way products a...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Problem\n\nKND is a student programmer at the University of Aizu. His neighbor is known to be very annoying. Neighbors find out that he is a sweet tooth and plan to add more sweetness than necessary to make him fat. To that end, your neighbor, you, was introduced to a sweets sh...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"3 3 100\\n2\\n5 20 3 10\\n2\\n10 50 16 60\\n2\\n8 30 22 100\\n0 1 2\\n\\n1 1 30\\n1\\n13 8\\n0\", \"3 3 100\\n2\\n5 20 3 10\\n2\\n13 50 16 60\\n2\\n0 30 22 100\\n0 1 2\\n\\n1 1 30\\n1\\n13 8\\n0\", \"3 3 100\\n2\\n5 20 3 10\\n2\\n13 50 16 60\\n2\\n0 30 22 100\\n0 ...
{ "split": "train", "index": 1666, "id": "TACO_09f36b71-deac-4375-8664-f0b1065f6256" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false
taco
Mr. Morishita was in trouble ... I had Mr. Anehara write a program, but the program crashed. Mr. Anehara wrote a program that reads the formula in Reverse Polish Notation and outputs the calculation result. According to the crash log, it seems that the cause was that it was divided by 0. This may be because Mr. Morish...
[ { "role": "system", "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\n### Format: Read the inputs from stdin solve the problem and write the answer to stdout...
[ { "role": "user", "content": "Mr. Morishita was in trouble ... I had Mr. Anehara write a program, but the program crashed.\n\nMr. Anehara wrote a program that reads the formula in Reverse Polish Notation and outputs the calculation result. According to the crash log, it seems that the cause was that it was ...
code
{ "style": "rule", "ground_truth": "{\"inputs\": [\"1\\na 1 10\\n3\\n15 a /\", \"2\\na 1 10\\nb 1 10\\n5\\n1 b b - /\", \"2\\nb 1 10\\nb 1 10\\n5\\n1 b b - /\", \"1\\na 0 255\\n7\\n1 a 2 * 1 * /\", \"1\\na 1 11\\n3\\n10 a /\", \"1\\na 0 255\\n7\\n1 a 2 * 1 * 0\", \"1\\na 1 11\\n3\\n9 a /\", \"1\\na 0 206\\n7\\n1 a ...
{ "split": "train", "index": 5000, "id": "TACO_2a3d6f5f-934a-4a49-bbd7-954cda5487bb" }
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
0
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
false