Dataset Viewer (First 5GB)
Auto-converted to Parquet Duplicate
problem
string
solutions
list
tests
string
starter_code
string
metadata
string
question
string
data_source
string
uid
string
index
int64
ICL
list
prompt
list
ability
string
reward_model
dict
extra_info
dict
Solve the following coding problem using the programming language python: There are some websites that are accessible through several different addresses. For example, for a long time Codeforces was accessible with two hostnames codeforces.com and codeforces.ru. You are given a list of page addresses being queried. F...
[ "```python\n# Bartek Kostka\n# You are not prepared!\n\n#include \"bits/stdc++.h\"\n\nn = int(input())\nW = {}\nfor i in range(n):\n adr = input()\n adr = adr.split(\"/\")\n if adr[-1] == '':\n adr[-1] = '?'\n domena = \"/\".join(adr[:3])\n adres = \"/\".join(adr[3:])\n #print(domena, adre...
[{"type": "stdin_stdout", "input": "10\nhttp://abacaba.ru/test\nhttp://abacaba.ru/\nhttp://abacaba.com\nhttp://abacaba.com/test\nhttp://abacaba.de/\nhttp://abacaba.ru/test\nhttp://abacaba.de/test\nhttp://abacaba.com/\nhttp://abacaba.com/t\nhttp://abacaba.com/test\n", "output": "1\nhttp://abacaba.de http://abacaba.ru \n...
null
null
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. Solve the following coding problem using the programming language python: There are some websites that are accessible through severa...
livecodebench
deepcoder_0
0
[ { "answer": "```python\nimport math\nimport re\nfrom fractions import Fraction\nfrom collections import Counter\n\nclass Task:\n ips = []\n k = 0\n answer = ''\n \n def __init__(self):\n n, self.k = [int(x) for x in input().split()]\n self.ips = ['' for _ in range(n)]\n for i...
[ { "content": "\nRelated Problem Solutions:\nQuestion: Solve the following coding problem using the programming language python:\n\nThe problem uses a simplified TCP/IP address model, please make sure you've read the statement attentively.\n\nPolycarpus has found a job, he is a system administrator. One day he c...
code
{ "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"10\\nhttp://abacaba.ru/test\\nhttp://abacaba.ru/\\nhttp://abacaba.com\\nhttp://abacaba.com/test\\nhttp://abacaba.de/\\nhttp://abacaba.ru/test\\nhttp://abacaba.de/test\\nhttp://abacaba.com/\\nhttp://abacaba.com/t\\nhttp://abacaba.com/test\\n\", \"output\": ...
{ "index": 0, "question": "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\nSolve the following coding problem using the programming language python:\n\nThere are some websites...
Solve the following coding problem using the programming language python: Dreamoon loves summing up something for no reason. One day he obtains two integers a and b occasionally. He wants to calculate the sum of all nice integers. Positive integer x is called nice if $\operatorname{mod}(x, b) \neq 0$ and $\frac{\opera...
[ "```python\na,b=map(int,input().split())\nprint(((b-1)*a*b//2+(a+1)*a*b*b*(b-1)//4)%1000000007)\n```" ]
[{"type": "stdin_stdout", "input": "1 1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "2 2\n", "output": "8\n"}, {"type": "stdin_stdout", "input": "4 1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "4 2\n", "output": "24\n"}, {"type": "stdin_stdout", "input": "4 3\n", "output": "102\n"}, {"type": "s...
null
null
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. Solve the following coding problem using the programming language python: Dreamoon loves summing up something for no reason. One day...
livecodebench
deepcoder_1
1
[ { "answer": "```python\nimport sys\nimport math\nMAXNUM = math.inf\nMINNUM = -1 * math.inf\nASCIILOWER = 97\nASCIIUPPER = 65\nMODMAX = 1000000007\n\ndef getInt():\n\treturn int(sys.stdin.readline().rstrip())\n\ndef getInts():\n\treturn map(int, sys.stdin.readline().rstrip().split(' '))\n\ndef getString():\n\tre...
[ { "content": "\nRelated Problem Solutions:\nQuestion: Solve the following coding problem using the programming language python:\n\nDreamoon loves summing up something for no reason. One day he obtains two integers a and b occasionally. He wants to calculate the sum of all nice integers. Positive integer x is ca...
code
{ "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"1 1\\n\", \"output\": \"0\\n\", \"metadata\": {\"func_name\": null}}, {\"type\": \"stdin_stdout\", \"input\": \"2 2\\n\", \"output\": \"8\\n\", \"metadata\": {\"func_name\": null}}, {\"type\": \"stdin_stdout\", \"input\": \"4 1\\n\", \"output\": \"0\\n\", ...
{ "index": 1, "question": "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\nSolve the following coding problem using the programming language python:\n\nDreamoon loves summing ...
Solve the following coding problem using the programming language python: Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path. You are given l and r. For all integers from l to r, inclusive, we wrote down all of their integer divisors except...
[ "```python\nl,r = map(int, input().split(\" \"))\nif l == r:\n print (l)\nelse:\n print (2)\n```" ]
[{"type": "stdin_stdout", "input": "19 29\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "3 6\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "39 91\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "76 134\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "93 95\n", "output": "2\n"}, {"typ...
null
null
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. Solve the following coding problem using the programming language python: Tavak and Seyyed are good friends. Seyyed is very funny an...
livecodebench
deepcoder_2
2
[ { "answer": "(a, b) = map(int, input().split())\nprint(2 if a != b else a)\n", "question": "Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path.\n\nYou are given l and r. For all integers from l to r, inclusive, we wrote down all o...
[ { "content": "\nRelated Problem Solutions:\nQuestion: Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path.\n\nYou are given l and r. For all integers from l to r, inclusive, we wrote down all of their integer divisors except 1. Find th...
code
{ "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"19 29\\n\", \"output\": \"2\\n\", \"metadata\": {\"func_name\": null}}, {\"type\": \"stdin_stdout\", \"input\": \"3 6\\n\", \"output\": \"2\\n\", \"metadata\": {\"func_name\": null}}, {\"type\": \"stdin_stdout\", \"input\": \"39 91\\n\", \"output\": \"2\\n...
{ "index": 2, "question": "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\nSolve the following coding problem using the programming language python:\n\nTavak and Seyyed are go...
Solve the following coding problem using the programming language python: "QAQ" is a word to denote an expression of crying. Imagine "Q" as eyes with tears and "A" as a mouth. Now Diamond has given Bort a string consisting of only uppercase English letters of length n. There is a great number of "QAQ" in the string (...
[ "```python\ns=input()\nans = 0\nfor i in range(len(s)):\n if s[i] == 'A':\n ans += s[:i].count('Q') * s[i:].count('Q')\nprint(ans)\n```" ]
[{"type": "stdin_stdout", "input": "QAQAQYSYIOIWIN\n", "output": "4\n"}, {"type": "stdin_stdout", "input": "QAQQQZZYNOIWIN\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "QA\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "IAQVAQZLQBQVQFTQQQADAQJA\n", "output": "24\n"}, {"type": "stdin_stdout", "input"...
null
null
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. Solve the following coding problem using the programming language python: "QAQ" is a word to denote an expression of crying. Imagine...
livecodebench
deepcoder_3
3
[ { "answer": "```python\n# QAQ\ndef crying(s):\n ans = 0\n for i in range(len(s)):\n if (s[i] != \"Q\"):\n continue\n for j in range(i + 1, len(s)):\n if s[j] != 'A':\n continue\n for k in range(j + 1, len(s)):\n if s[k] == 'Q':\n...
[ { "content": "\nRelated Problem Solutions:\nQuestion: Solve the following coding problem using the programming language python:\n\n\"QAQ\" is a word to denote an expression of crying. Imagine \"Q\" as eyes with tears and \"A\" as a mouth.\n\nNow Diamond has given Bort a string consisting of only uppercase Engli...
code
{ "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"QAQAQYSYIOIWIN\\n\", \"output\": \"4\\n\", \"metadata\": {\"func_name\": null}}, {\"type\": \"stdin_stdout\", \"input\": \"QAQQQZZYNOIWIN\\n\", \"output\": \"3\\n\", \"metadata\": {\"func_name\": null}}, {\"type\": \"stdin_stdout\", \"input\": \"QA\\n\", \...
{ "index": 3, "question": "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\nSolve the following coding problem using the programming language python:\n\n\"QAQ\" is a word to de...
Solve the following coding problem using the programming language python: Codefortia is a small island country located somewhere in the West Pacific. It consists of $n$ settlements connected by $m$ bidirectional gravel roads. Curiously enough, the beliefs of the inhabitants require the time needed to pass each road to...
[ "```python\nimport heapq\nn,m,a,b=map(int,input().split())\ngraph={i:[] for i in range(n)}\nfor i in range(m):\n u,v,w=map(int,input().split())\n graph[u-1].append((v-1,w))\n graph[v-1].append((u-1,w))\ncomponents=[-1]*n\ncomp=-1\nfor i in range(n):\n if components[i]==-1:\n comp+=1\n comp...
[{"type": "stdin_stdout", "input": "5 5 20 25\n1 2 25\n2 3 25\n3 4 20\n4 5 20\n5 1 20\n", "output": "0 25 60 40 20\n"}, {"type": "stdin_stdout", "input": "6 7 13 22\n1 2 13\n2 3 13\n1 4 22\n3 4 13\n4 5 13\n5 6 13\n6 1 13\n", "output": "0 13 26 39 26 13\n"}, {"type": "stdin_stdout", "input": "2 1 1 2\n2 1 1\n", "output"...
null
null
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. Solve the following coding problem using the programming language python: Codefortia is a small island country located somewhere in ...
livecodebench
deepcoder_4
4
[ { "answer": "```python\nimport heapq\nn,m,a,b=map(int,input().split())\ngraph={i:[] for i in range(n)}\nfor i in range(m):\n u,v,w=map(int,input().split())\n graph[u-1].append((v-1,w))\n graph[v-1].append((u-1,w))\ncomponents=[-1]*n\ncomp=-1\nfor i in range(n):\n if components[i]==-1:\n comp+...
[ { "content": "\nRelated Problem Solutions:\nQuestion: Solve the following coding problem using the programming language python:\n\nCodefortia is a small island country located somewhere in the West Pacific. It consists of n settlements connected by m bidirectional gravel roads. Curiously enough, the beliefs of ...
code
{ "ground_truth": "[{\"type\": \"stdin_stdout\", \"input\": \"5 5 20 25\\n1 2 25\\n2 3 25\\n3 4 20\\n4 5 20\\n5 1 20\\n\", \"output\": \"0 25 60 40 20\\n\", \"metadata\": {\"func_name\": null}}, {\"type\": \"stdin_stdout\", \"input\": \"6 7 13 22\\n1 2 13\\n2 3 13\\n1 4 22\\n3 4 13\\n4 5 13\\n5 6 13\\n6 1 13\\n\", \"...
{ "index": 4, "question": "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\nSolve the following coding problem using the programming language python:\n\nCodefortia is a small i...
"Solve the following coding problem using the programming language python:\n\nPikachu had an array w(...TRUNCATED)
["```python\nX, D = list(map(int, input().split()))\ncn = 1\nadd0 = 1 if (X&1) else 0\nans = []\nfor(...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"10 5\\n\", \"output\": \"6\\n1 1 1 7 13 19 \"}, {\"type\(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
livecodebench
deepcoder_5
5
[{"answer":"```python\nX, d = map(int, input().split())\n\nx = X\nans = list()\nln = 0\nlast = 1\nwh(...TRUNCATED)
[{"content":"\nRelated Problem Solutions:\nQuestion: Solve the following coding problem using the pr(...TRUNCATED)
code
{"ground_truth":"[{\"type\": \"stdin_stdout\", \"input\": \"10 5\\n\", \"output\": \"6\\n1 1 1 7 13 (...TRUNCATED)
{"index":5,"question":"You are an expert Python programmer. You will be given a question (problem sp(...TRUNCATED)
"Solve the following coding problem using the programming language python:\n\nVasya and Kolya play a(...TRUNCATED)
["```python\nstr = input()\nl = len(str)\na = [0] * (2 * l)\npos = [[] for i in range(26)]\nfor i, c(...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"technocup\\n\", \"output\": \"1.000000000000000\\n\"}, {(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
livecodebench
deepcoder_6
6
[{"answer":"```python\ns = input()\nn = len(s)\nd = {}\nfor i in range(n):\n\tif s[i] not in d:\n\t\(...TRUNCATED)
[{"content":"\nRelated Problem Solutions:\nQuestion: Solve the following coding problem using the pr(...TRUNCATED)
code
{"ground_truth":"[{\"type\": \"stdin_stdout\", \"input\": \"technocup\\n\", \"output\": \"1.00000000(...TRUNCATED)
{"index":6,"question":"You are an expert Python programmer. You will be given a question (problem sp(...TRUNCATED)
"Solve the following coding problem using the programming language python:\n\nIn the evenings Donkey(...TRUNCATED)
["```python\nfrom bisect import *\nfrom math import *\n\nn = int(input())\na, b, c, d = list(map(int(...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"15\\n1/3 2/1\\n3 1\\n6 2\\n4 2\\n2 5\\n4 5\\n6 6\\n3 4\\(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
livecodebench
deepcoder_7
7
[{"answer":"```python\nimport bisect\n\ndef INPUT():\n\tglobal n, a, b, c, d\n\tn = int(input())\n\t(...TRUNCATED)
[{"content":"\nRelated Problem Solutions:\nQuestion: Solve the following coding problem using the pr(...TRUNCATED)
code
{"ground_truth":"[{\"type\": \"stdin_stdout\", \"input\": \"15\\n1/3 2/1\\n3 1\\n6 2\\n4 2\\n2 5\\n4(...TRUNCATED)
{"index":7,"question":"You are an expert Python programmer. You will be given a question (problem sp(...TRUNCATED)
"Solve the following coding problem using the programming language python:\n\nThe Little Elephant ha(...TRUNCATED)
["```python\nx = input ()\n\nflag = 0\ns = 0\n\nfor each_item in x:\n if each_item == '0':\n (...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"101\\n\", \"output\": \"11\\n\"}, {\"type\": \"stdin_std(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
livecodebench
deepcoder_8
8
[{"answer":"```python\ns = list(input())\nfor i in range(len(s)):\n\tif s[i] == '0':\n\t\tbreak\ndel(...TRUNCATED)
[{"content":"\nRelated Problem Solutions:\nQuestion: Solve the following coding problem using the pr(...TRUNCATED)
code
{"ground_truth":"[{\"type\": \"stdin_stdout\", \"input\": \"101\\n\", \"output\": \"11\\n\", \"metad(...TRUNCATED)
{"index":8,"question":"You are an expert Python programmer. You will be given a question (problem sp(...TRUNCATED)
"Solve the following coding problem using the programming language python:\n\nIt is so boring in the(...TRUNCATED)
["```python\ndef gcd(a, b):\n while b > 0:\n a, b = b, a % b\n return a\n\nn = int(inpu(...TRUNCATED)
"[{\"type\": \"stdin_stdout\", \"input\": \"2\\n2 3\\n\", \"output\": \"Alice\\n\"}, {\"type\": \"st(...TRUNCATED)
null
null
"You are an expert Python programmer. You will be given a question (problem specification) and will (...TRUNCATED)
livecodebench
deepcoder_9
9
[{"answer":"```python\nfrom sys import *\nfrom math import *\nfrom string import *\nfrom operator im(...TRUNCATED)
[{"content":"\nRelated Problem Solutions:\nQuestion: Solve the following coding problem using the pr(...TRUNCATED)
code
{"ground_truth":"[{\"type\": \"stdin_stdout\", \"input\": \"2\\n2 3\\n\", \"output\": \"Alice\\n\", (...TRUNCATED)
{"index":9,"question":"You are an expert Python programmer. You will be given a question (problem sp(...TRUNCATED)
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
4