Dataset Viewer
Auto-converted to Parquet Duplicate
problem_id
stringlengths
32
32
name
stringlengths
2
54
problem
stringlengths
204
5.28k
solutions
sequencelengths
1
5.17k
test_cases
stringlengths
38
86.7k
difficulty
stringclasses
1 value
language
stringclasses
1 value
source
stringclasses
1 value
num_solutions
int64
1
5.17k
starter_code
stringclasses
1 value
000226c6000c597d60e93105ad1571c8
Restoring Password
Igor K. always used to trust his favorite Kashpirovsky Antivirus. That is why he didn't hesitate to download the link one of his groupmates sent him via QIP Infinium. The link was said to contain "some real funny stuff about swine influenza". The antivirus had no objections and Igor K. run the flash application he had ...
[ "s = input()\na = []\nfor i in range(10):\n a.append(input())\n\np = 0\nwhile(p < 80):\n for i in range(10):\n if a[i] == s[p:p+10]:\n print(i, end='')\n p += 10\n break\n\n", "password = input()\r\nnum = []\r\npas = []\r\nfor i in range(10): num.append(input())\r\n\r...
{"inputs": ["01001100100101100000010110001001011001000101100110010110100001011010100101101100\n0100110000\n0100110010\n0101100000\n0101100010\n0101100100\n0101100110\n0101101000\n0101101010\n0101101100\n0101101110", "10101101111001000010100100011010101101110010110111011000100011011110010110001000\n1001000010\n110111100...
UNKNOWN
PYTHON3
CODEFORCES
254
0009291163ba4c4519b618bd57707c1b
Math Show
Polycarp takes part in a math show. He is given *n* tasks, each consists of *k* subtasks, numbered 1 through *k*. It takes him *t**j* minutes to solve the *j*-th subtask of any task. Thus, time required to solve a subtask depends only on its index, but not on the task itself. Polycarp can solve subtasks in any order. ...
[ "n,k,M = [int(i) for i in input().split(' ')]\ntasks = [int(i) for i in input().split(' ')]\ntasks = sorted(tasks)\nans = 0\nfor i in range(n+1):\n remaining_time = M - i*sum(tasks)\n if(remaining_time < 0):\n break\n value = (k+1)*i\n for j in range(k):\n for take in range(n-i):\n ...
{"inputs": ["3 4 11\n1 2 3 4", "5 5 10\n1 2 4 8 16", "1 1 0\n2", "1 1 1\n1", "2 1 0\n2", "2 2 2\n2 3", "4 2 15\n1 4", "24 42 126319796\n318996 157487 174813 189765 259136 406743 138997 377982 244813 16862 95438 346702 454882 274633 67361 387756 61951 448901 427272 288847 316578 416035 56608 211390 187241 191538 299856 ...
UNKNOWN
PYTHON3
CODEFORCES
37
00116124170d507613516798746290b0
A Lot of Games
Andrew, Fedor and Alex are inventive guys. Now they invent the game with strings for two players. Given a group of *n* non-empty strings. During the game two players build the word together, initially the word is empty. The players move in turns. On his step player must add a single letter in the end of the word, the ...
[ "max_alpha = 26\r\n\r\nclass TrieNode:\r\n def __init__(self):\r\n self.children = [0] * max_alpha\r\n\r\ndef add_trie(root, word):\r\n v = root\r\n for char in word:\r\n c = ord(char) - ord('a')\r\n if not v.children[c]:\r\n v.children[c] = TrieNode()\r\n v = v.child...
{"inputs": ["2 3\na\nb", "3 1\na\nb\nc", "1 2\nab", "5 6\nabas\ndsfdf\nabacaba\ndartsidius\nkolobok", "4 2\naaaa\nbbbb\nccccc\ndumbavumba", "3 8\nso\nbad\ntest", "5 2\nwelcome\nto\nthe\nmatrix\nneo", "6 4\ndog\ncat\ncow\nhot\nice\nlol", "4 8\nla\na\nz\nka", "3 2\nop\nhop\ncop", "3 3\nabasdfabab\nabaaasdfdsf\nasdfaba", ...
UNKNOWN
PYTHON3
CODEFORCES
2
0016836ae943bbac4c1846a047051d30
Perfect Number
"We consider a positive integer perfect, if and only if the sum of its digits is exactly $10$. Given(...TRUNCATED)
["k=int(input())\r\na=10\r\nwhile k!=0:\r\n a+=9\r\n s=sum(list(map(int,str(a))))\r\n # pri(...TRUNCATED)
"{\"inputs\": [\"1\", \"2\", \"13\", \"101\", \"1023\", \"9999\", \"10000\", \"2333\", \"9139\", \"9(...TRUNCATED)
UNKNOWN
PYTHON3
CODEFORCES
159
0019608f1af8cd1d0015e58a30bead95
Wrong Floyd
"Valera conducts experiments with algorithms that search for shortest paths. He has recently studied(...TRUNCATED)
["n,m,k=map(int,input().split())\r\nif k==n or m>(n-1)*(n-2)//2+n-k:print(-1)\r\nelse:\r\n\tbn=[int((...TRUNCATED)
"{\"inputs\": [\"3 2 2\\n1 2\", \"3 3 2\\n1 2\", \"300 43056 2\\n5 6\", \"300 44849 2\\n1 300\", \"3(...TRUNCATED)
UNKNOWN
PYTHON3
CODEFORCES
2
003925cb042a4e23c8a1ae7ed2d3c676
Golden System
"Piegirl got bored with binary, decimal and other integer based counting systems. Recently she disco(...TRUNCATED)
["def clean(d):\n ans = ['0']\n for c in list(d):\n ans.append(c)\n i = len(ans)(...TRUNCATED)
"{\"inputs\": [\"1000\\n111\", \"00100\\n11\", \"110\\n101\", \"0\\n0\", \"1\\n10\", \"11\\n10\", \"(...TRUNCATED)
UNKNOWN
PYTHON3
CODEFORCES
4
004052b4221db9fe863f7c0c314178ad
Simple Cycles Edges
"You are given an undirected graph, consisting of $n$ vertices and $m$ edges. The graph does not nec(...TRUNCATED)
["import sys\r\n\r\ndef solve():\r\n\tn, m = map(int, input().split())\r\n\tg = [[] for i in range(n(...TRUNCATED)
"{\"inputs\": [\"3 3\\n1 2\\n2 3\\n3 1\", \"6 7\\n2 3\\n3 4\\n4 2\\n1 2\\n1 5\\n5 6\\n6 1\", \"5 6\\(...TRUNCATED)
UNKNOWN
PYTHON3
CODEFORCES
1
00a6789db72f25421f52cf4aa40e1f80
Vitya and Strange Lesson
"Today at the lesson Vitya learned a very interesting function — mex. Mex of a sequence of number(...TRUNCATED)
["import os\r\nimport sys\r\nfrom io import BytesIO, IOBase\r\n\r\nBUFSIZE = 8192\r\n\r\n\r\nclass F(...TRUNCATED)
"{\"inputs\": [\"2 2\\n1 3\\n1\\n3\", \"4 3\\n0 1 5 6\\n1\\n2\\n4\", \"5 4\\n0 1 5 6 7\\n1\\n1\\n4\\(...TRUNCATED)
UNKNOWN
PYTHON3
CODEFORCES
2
00aa51e739d4197c4766ec0104225460
Laptops
"One day Dima and Alex had an argument about the price and quality of laptops. Dima thinks that the (...TRUNCATED)
["def solve():\r\n x = int(input())\r\n l = []\r\n for i in range(x):\r\n a, b = map(...TRUNCATED)
"{\"inputs\": [\"2\\n1 2\\n2 1\", \"2\\n1 1\\n2 2\", \"3\\n2 2\\n3 3\\n1 1\", \"3\\n3 3\\n1 2\\n2 1\(...TRUNCATED)
UNKNOWN
PYTHON3
CODEFORCES
300
00d009aca003c86e98034a2626d72d5a
Increase and Decrease
"Polycarpus has an array, consisting of *n* integers *a*1,<=*a*2,<=...,<=*a**n*. Polycarpus likes it(...TRUNCATED)
["n = int(input())\r\narr = [int(i) for i in input().split()]\r\nif sum(arr)%n ==0: print(n)\r\nelse(...TRUNCATED)
"{\"inputs\": [\"2\\n2 1\", \"3\\n1 4 1\", \"4\\n2 -7 -2 -6\", \"4\\n2 0 -2 -1\", \"6\\n-1 1 0 0 -1 (...TRUNCATED)
UNKNOWN
PYTHON3
CODEFORCES
196
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
36