Dataset Viewer
Auto-converted to Parquet Duplicate
prompt
stringlengths
254
13.2k
text
stringlengths
405
46.7k
timeout
float64
0.5
30
test_cases
dict
solutions
sequencelengths
1
13.8k
Q: Write python code to solve the following coding problem that obeys the constraints and passes the example test cases. The output code needs to read from and write to standard IO. Please wrap your code answer using ```: There are n persons who initially don't know each other. On each morning, two of them, who were no...
Q: Write python code to solve the following coding problem that obeys the constraints and passes the example test cases. The output code needs to read from and write to standard IO. Please wrap your code answer using ```: There are n persons who initially don't know each other. On each morning, two of them, who were no...
2
{ "input": [ "4 4 2\n2 3\n1 2\n1 3\n1 4\n", "5 8 2\n2 1\n4 2\n5 4\n5 2\n4 3\n5 1\n4 1\n3 2\n", "5 7 2\n1 5\n3 2\n2 5\n3 4\n1 2\n5 3\n1 3\n", "16 20 2\n10 3\n5 3\n10 5\n12 7\n7 6\n9 12\n9 6\n1 10\n11 16\n11 1\n16 2\n10 2\n14 4\n15 14\n4 13\n13 15\n1 8\n7 15\n1 7\n8 15\n", "2 1 1\n2 1\n", "16 20...
[ "from collections import deque\n\ndef solve(adj, m, k, uv):\n n = len(adj)\n nn = [len(a) for a in adj]\n q = deque()\n for i in range(n):\n if nn[i] < k:\n q.append(i)\n while q:\n v = q.popleft()\n for u in adj[v]:\n nn[u] -= 1\n if nn[u] == k-1...
Q: Write python code to solve the following coding problem that obeys the constraints and passes the example test cases. The output code needs to read from and write to standard IO. Please wrap your code answer using ```: Let's call a string a phone number if it has length 11 and fits the pattern "8xxxxxxxxxx", where e...
Q: Write python code to solve the following coding problem that obeys the constraints and passes the example test cases. The output code needs to read from and write to standard IO. Please wrap your code answer using ```: Let's call a string a phone number if it has length 11 and fits the pattern "8xxxxxxxxxx", where e...
2
{ "input": [ "22\n0011223344556677889988\n", "11\n00000000008\n", "11\n31415926535\n", "51\n882889888888689888850888388887688788888888888858888\n", "55\n7271714707719515303911625619272900050990324951111943573\n", "72\n888488888888823288848804883838888888887888888888228888218488897809784868\n",...
[ "n = int(input())\ns = input()\nk = s.count(\"8\")\nl = n - k\nif k <= l//10: print(k)\nelse:\n while k > l//10:\n k -= 1\n l += 1\n print(min(k, l//10))\n", "n=int(input())\ns=str(input())\np=s.count(\"8\")\nq=n//11\nf=min(p,q)\nprint(f)\n", "a=int(input())\ny=input()\nx=y.count('8')\n\npri...
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
1
{"input":["5\n2 4 2\n5 10 4\n3 10 1\n1 2 3\n4 6 5\n","20\n1 1000000000 2\n1 1000000000 2\n1 10000000(...TRUNCATED)
["n = int(input())\nA = []\nfor i in range(n):\n A = A+[input().split()]\nfor a in A:\n if int(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
2
{"input":["3\n0 0 0\n","5\n0 1 1 1 10\n","2\n0 1\n","100\n0 0 57 121 57 0 19 251 19 301 19 160 57 57(...TRUNCATED)
["from sys import stdin,stdout\n\nclass Tree(object):\n def __init__(self,n):\n self.tree=(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
3
{"input":["3\n10 20 10\n6\n1 1\n2 1\n2 2\n3 1\n3 2\n3 3\n","7\n1 2 1 3 1 2 1\n9\n2 1\n2 2\n3 1\n3 2\(...TRUNCATED)
["# class SegmentTree(): # adapted from https://www.geeksforgeeks.org/segment-tree-efficient-impleme(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
3
{"input":["3\n1 2 3\n","5\n5 4 3 2 1\n","1\n1\n","100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 (...TRUNCATED)
["n = int(input())\na = [0] + list(map(int, input().split()))\n\npos, pb, ps = [[0] * (n + 1) for x (...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
3
{"input":["5 3\n00011\n3\n1 2 3\n1\n4\n3\n3 4 5\n","8 6\n00110011\n3\n1 3 8\n5\n1 2 5 6 7\n2\n6 8\n2(...TRUNCATED)
["from sys import stdin\ninput = stdin.readline\n\nn , k = [int(i) for i in input().split()]\npairs (...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
2
{"input":["3\n1 3 2\n-100 2 3\n","2\n2 1\n-3 0\n","5\n2 1 4 3 5\n2 2 2 3 4\n","3\n1 3 2\n-100 2 6\n"(...TRUNCATED)
["import bisect\n\ndef getsum(tree , i):\n s = 0\n i += 1\n while i>0:\n s += tree[i(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
2
{"input":["3\n2 1 3\n3 3 6\n99995 9998900031 9998900031\n","1\n2 2 3\n","1\n4 13 13\n","1\n3 1 1\n",(...TRUNCATED)
["# -*- coding:utf-8 -*-\n\n\"\"\"\n\ncreated by shuangquan.huang at 2020/7/1\n\n\"\"\"\n\nimport co(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
"Q: Write python code to solve the following coding problem that obeys the constraints and passes th(...TRUNCATED)
6
{"input":["3\n5 2\n5 3\n7 0\n5 0\n4 0\n10 0\n2 1\n10 100\n50 10\n5 5\n1 5\n2 4\n3 3\n4 2\n5 1\n","3\(...TRUNCATED)
["from sys import stdin, gettrace\nfrom heapq import nlargest\n\nif not gettrace():\n def input()(...TRUNCATED)
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
5