Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
problem_id
stringlengths
32
32
name
stringlengths
3
105
problem
stringlengths
200
14k
solutions
stringlengths
2
1.9M
test_cases
stringlengths
33
79.2M
difficulty
stringclasses
6 values
language
stringclasses
1 value
source
stringclasses
11 values
num_solutions
int64
2
1.9M
starter_code
stringlengths
0
1.47k
eb422b41811612b9fe4a2b11eec17665
UNKNOWN
This is an interactive problem. In good old times dwarves tried to develop extrasensory abilities: * Exactly n dwarves entered completely dark cave. * Each dwarf received a hat — white or black. While in cave, none of the dwarves was able to see either his own hat or hats of other Dwarves. * Dwarves went out ...
[]
{"inputs": ["hack\n30\n1 0 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\n", "random\n22\n2\n", "random\n20\n11\n", "random\n10\n1\n", "random\n20\n12\n", "random\n30\n14\n", "random\n23\n1\n", "predefined\n15\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 0\n", "random\n21\n2\n", "random\n22\n1\n", "random\n28\n1\n", "random\...
HARD
PYTHON3
CODEFORCES
2
c82b99dc987eaef4c73d6c165b66145a
UNKNOWN
There are $n$ candy boxes in front of Tania. The boxes are arranged in a row from left to right, numbered from $1$ to $n$. The $i$-th box contains $r_i$ candies, candies have the color $c_i$ (the color can take one of three values ​​— red, green, or blue). All candies inside a single box have the same color (and it is ...
["INF = 10000000000.0\nmax_n = 50\nmax_k = 2000\n\ndef main():\n\t(n, s, k) = map(int, input().split())\n\ts -= 1\n\tbuf = [''] * (max_n + 1)\n\tdp = [[0 for i in range(max_n + 1)] for j in range(max_k + 1)]\n\tr = list(map(int, input().split()))\n\tc = input()\n\tanswer = INF\n\tfor i in range(len(c)):\n\t\tbuf[i] = c...
{"inputs": ["5 3 10\n1 2 3 4 5\nRGBRR\n", "2 1 15\n5 6\nRG\n", "6 1 21\n4 2 3 5 1 6\nRGBGRB\n", "6 1 21\n6 5 4 3 2 1\nRGBRGB\n", "1 1 10\n10\nR\n", "2 1 10\n5 5\nRG\n", "2 1 10\n5 6\nRR\n", "5 3 10\n1 2 3 4 5\nRGBRG\n", "9 1 6\n1 1 1 3 3 3 2 2 2\nRGGBRRGBB\n", "50 39 2000\n48 43 26 24 46 37 15 30 39 34 4 14 29 34 8 18 ...
HARD
PYTHON3
CODEFORCES
7,703
4e178f196c8c3a9c4b7ebff6121ef1b8
UNKNOWN
Little Petya likes to play a lot. Most of all he likes to play a game «Holes». This is a game for one person with following rules: There are N holes located in a single row and numbered from left to right with numbers from 1 to N. Each hole has it's own power (hole number i has the power ai). If you throw a ball into ...
[]
{"inputs": ["10 10\n5 1 2 4 1 7 3 8 10 8\n0 5 6\n1 8\n1 1\n0 10 3\n1 5\n1 3\n1 2\n0 6 1\n1 9\n1 1\n", "10 10\n5 1 2 8 1 7 3 8 10 8\n0 5 6\n1 8\n1 1\n0 10 3\n1 5\n1 3\n1 2\n0 6 1\n1 9\n1 1\n", "8 5\n1 1 1 1 1 1 8 2\n1 1\n0 1 3\n1 1\n0 3 4\n1 2\n", "8 5\n1 1 1 1 1 2 11 2\n1 1\n0 1 3\n1 1\n0 3 4\n1 2\n", "8 5\n1 1 1 1 1 2...
VERY_HARD
PYTHON3
CODEFORCES
2
3b03aa823c1e29df793da1262a08f550
UNKNOWN
If you visit Aizu Akabeko shrine, you will find a unique paper fortune on which a number with more than one digit is written. Each digit ranges from 1 to 9 (zero is avoided because it is considered a bad omen in this shrine). Using this string of numeric values, you can predict how many years it will take before your ...
["def sub(maxs, mins):\n\tfor i in range(len(maxs)):\n\t\tif maxs[i] != mins[i]:\n\t\t\tif i == len(maxs) - 1:\n\t\t\t\treturn int(maxs[i]) - int(mins[i])\n\t\t\tif i == len(maxs) - 2:\n\t\t\t\treturn int(maxs[i:i + 2]) - int(mins[i:i + 2])\n\t\t\treturn 10\n\treturn 0\n\ndef checkEqual(S):\n\tans = 8\n\tfor k in range...
{"inputs": ["9714431", "16612328", "23422731", "754526", "955577", "75547", "2112", "799", "88", "32523857", "4787", "1859551", "135661", "3675", "156692", "167918384", "83994", "4837847", "14513597", "15282598", "12659326", "1468417", "6280", "115464", "52376853", "2315", "3641224", "97187", "836", "195884", "36250", ...
UNKNOWN_DIFFICULTY
PYTHON3
UNKNOWN_SOURCE
1,414
1284e0d3a65facca53ac85c34f8e1e2d
UNKNOWN
You have a deck of $n$ cards, and you'd like to reorder it to a new one. Each card has a value between $1$ and $n$ equal to $p_i$. All $p_i$ are pairwise distinct. Cards in a deck are numbered from bottom to top, i. e. $p_1$ stands for the bottom card, $p_n$ is the top card. In each step you pick some integer $k > 0$...
["import heapq\nfrom math import sqrt\nimport operator\nimport sys\ninf_var = 0\nif inf_var == 1:\n\tinf = open('input.txt', 'r')\nelse:\n\tinf = sys.stdin\ninput = inf.readline\n\ndef read_one_int():\n\treturn int(input().rstrip('\\n'))\n\ndef read_list_of_ints():\n\tres = [int(val) for val in input().rstrip('\\n').sp...
{"inputs": ["4\n4\n1 2 3 4\n5\n1 5 2 4 3\n6\n4 2 5 3 6 1\n1\n1\n", "4\n4\n2 1 3 4\n5\n1 5 2 4 3\n6\n4 2 5 3 6 1\n1\n1\n", "4\n4\n2 1 3 4\n5\n1 5 2 4 3\n6\n2 4 5 3 6 1\n1\n1\n", "4\n4\n1 2 3 4\n5\n1 5 2 4 3\n6\n4 2 5 3 6 1\n1\n1\n"], "outputs": ["4 3 2 1\n5 2 4 3 1\n6 1 5 3 4 2\n1\n", "4 3 2 1\n5 2 4 3 1\n6 1 5 3 4 2\n1...
EASY
PYTHON3
CODEFORCES
111,989
9c4b7463e2300a9f1799fa130c36d325
UNKNOWN
The number obtained by multiplying 1 by 2, 3, 5 several times (0 or more times) is called the Hamming numbers. For example * 1 * 1 x 2 x 2 = 4 * 1 x 2 x 2 x 3 x 5 x 5 = 300 Etc. are humming numbers, but 11, 13, 14 etc. are not humming numbers. All humming numbers are divisible by a power of 60 (for example, 54 is ...
["import sys\nfrom sys import stdin\nfrom bisect import bisect_right, bisect_left\nfrom math import ceil, log\ninput = stdin.readline\n\ndef main(args):\n\thammings = []\n\ttemp = set()\n\tfor i in range(ceil(log(1000000.0, 2)) + 1):\n\t\tfor j in range(ceil(log(1000000.0, 3)) + 1):\n\t\t\tfor k in range(ceil(log(10000...
{"inputs": ["3 8\n2 27\n1 86\n0", "3 9\n2 27\n1 86\n0", "3 8\n1 35\n1 86\n0", "5 8\n2 27\n1 86\n0", "3 9\n4 27\n1 86\n0", "3 9\n6 27\n1 86\n0", "3 9\n6 31\n1 86\n0", "3 6\n6 31\n1 86\n0", "3 6\n6 9\n1 86\n0", "3 6\n8 9\n1 86\n0", "3 8\n1 19\n1 86\n0", "3 8\n2 27\n1 140\n0", "5 8\n2 27\n2 86\n0", "3 9\n4 15\n1 86\n0", "...
UNKNOWN_DIFFICULTY
PYTHON3
UNKNOWN_SOURCE
6,394
03f9be7e9c709de6b470e92833c3713f
UNKNOWN
"Given a number s(in string form). Find the Smallest number (Not leading Zeros) which can be obtaine(...TRUNCATED)
"[\"class Solution:\\n\\n\\tdef minimum_Number(self, s):\\n\\t\\tl = list(s)\\n\\t\\tl.sort()\\n\\t\(...TRUNCATED)
"{\"inputs\": [\"s = \\\"846903\\\"\", \"s = \\\"55010\\\"\"], \"outputs\": [\"304689\", \"10055\"]}(...TRUNCATED)
EASY
PYTHON3
PRACTICE.GEEKSFORGEEKS.ORG
9,467
"#User function Template for python3\n\n\n\nclass Solution:\n\n\tdef minimum_Number(self, s):\n\n\t\(...TRUNCATED)
158f232b5556964128f808fc7b4b3fd6
UNKNOWN
"Dilpreet wants to paint his dog's home that has n boards with different lengths. The length of i^{t(...TRUNCATED)
"[\"class Solution:\\n\\n\\tdef minTime(self, arr, n, k):\\n\\n\\t\\tdef numofPainter(maxLen):\\n\\t(...TRUNCATED)
"{\"inputs\": [\"n = 5\\nk = 3\\narr[] = {5,10,30,20,15}\", \"n = 4\\nk = 2\\narr[] = {10,20,30,40}\(...TRUNCATED)
MEDIUM_HARD
PYTHON3
PRACTICE.GEEKSFORGEEKS.ORG
5,355
"#User function Template for python3\n\nclass Solution:\n def minTime (self, arr, n, k):\n (...TRUNCATED)
c3b7fd6f2121cd70c517caf6bea03e57
UNKNOWN
"An **anagram** is the result of rearranging the letters of a word to produce a new word.\n\n**Note:(...TRUNCATED)
"[\"def is_anagram(test, original):\\n\\treturn sorted(original.lower()) == sorted(test.lower())\\n\(...TRUNCATED)
"{\"fn_name\": \"is_anagram\", \"inputs\": [[\"foefet\", \"toffee\"], [\"Buckethead\", \"DeathCubeK\(...TRUNCATED)
EASY
PYTHON3
CODEWARS
21,041
def is_anagram(test, original):
598ab0550cc4d8aaa648fa03f09a5d98
UNKNOWN
"There are n cities in Berland. Some pairs of them are connected with m directed roads. One can use (...TRUNCATED)
[]
"{\"inputs\": [\"4 0 1\\n3 1 1\\n\", \"20 20 40\\n4 5\\n6 7\\n13 14\\n10 11\\n9 10\\n19 20\\n2 3\\n1(...TRUNCATED)
VERY_HARD
PYTHON3
CODEFORCES
2
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
5