Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
instruction_seed
stringlengths
29
14k
solutions
stringlengths
2
1.9M
starter_code
stringlengths
0
1.47k
input_output
stringlengths
29
79.2M
difficulty
stringclasses
6 values
raw_tags
stringlengths
2
277
name
stringlengths
3
100
source
stringclasses
10 values
tags
stringlengths
2
183
skill_types
stringclasses
113 values
url
stringlengths
34
138
Expected Auxiliary Space
stringclasses
299 values
time_limit
stringclasses
130 values
date
stringlengths
10
10
picture_num
stringclasses
8 values
memory_limit
stringclasses
27 values
Expected Time Complexity
stringclasses
634 values
embedding
sequencelengths
3.07k
3.07k
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 of the cave to the meadow and sat at an arbitrary place one after the other. When a dwarf leaves the cave, he sees the colors of all hats of all dwarves that are seating on the meadow (i.e. left the cave before him). However, he is not able to see the color of his own hat and none of the dwarves can give him this information. * The task for dwarves was to got diverged into two parts — one with dwarves with white hats and one with black hats. After many centuries, dwarves finally managed to select the right place on the meadow without error. Will you be able to repeat their success? You are asked to successively name n different integer points on the plane. After naming each new point you will be given its color — black or white. Your task is to ensure that the named points can be split by a line in such a way that all points of one color lie on the same side from the line and points of different colors lie on different sides. Moreover, no points can belong to the line. Also, you need to report any such line at the end of the process. In this problem, the interactor is adaptive — the colors of the points in the tests are not fixed beforehand and the jury program can select them arbitrarily, in particular, depending on your program output. Interaction The first line of the standard input stream contains an integer n (1 ≤ n ≤ 30) — the number of points your program should name. Then n times your program must print two integer coordinates x and y (0 ≤ x ≤ 109, 0 ≤ y ≤ 109). All points you print must be distinct. In response to each coordinate pair your program will receive the string "black", if the point is black, or "white", if the point is white. When all n points are processed, you need to print four integers x1, y1, x2 and y2 (0 ≤ x1, y1 ≤ 109, 0 ≤ x2, y2 ≤ 109) — coordinates of points (x1, y1) and (x2, y2), which form a line, which separates n points into black and white. Points (x1, y1) and (x2, y2) should not coincide. Hacks To hack solution use the following format. The first line must contain word "hack", the second line should contain the number n and the last line should contain the sequence of 0 and 1 — colors of points, which will be reported to the solution. Unlike the jury tests, colors of points in hacks are always fixed in advance. Of course, the hacked solution wouldn't be able to get the information about the colors in advance. For example, the hack corresponding to sample test will look like this: hack 5 0 0 1 1 0 Example Input 5 <span class="tex-span"></span> black <span class="tex-span"></span> black <span class="tex-span"></span> white <span class="tex-span"></span> white <span class="tex-span"></span> black Output <span class="tex-span"></span> 0 0 <span class="tex-span"></span> 3 1 <span class="tex-span"></span> 2 3 <span class="tex-span"></span> 4 4 <span class="tex-span"></span> 0 2 <span class="tex-span"></span> 1 3 4 1 Note In the sample input and output values are aligned only for simplicity of interpreting them chronologically. In real interaction no "extra" line breaks should appear. The following picture illustrates the first test. <image>
[]
{"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\n28\n2\n", "chess\n10\n", "chess\n11\n", "random\n25\n2\n", "random\n24\n1\n", "random\n13\n1\n", "chess\n19\n", "predefined\n15\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "random\n29\n1\n", "random\n20\n1\n", "random\n26\n1\n", "predefined\n2\n0 1\n", "random\n16\n1\n", "random\n15\n1\n", "random\n8\n1\n", "random\n19\n1\n", "random\n21\n1\n", "random\n27\n1\n", "predefined\n2\n0 0\n", "random\n2\n1\n", "predefined\n15\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "random\n3\n1\n", "predefined\n15\n0 1 0 1 0 1 0 1 0 1 0 1 0 1 0\n", "predefined\n29\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "hack\n30\n0 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\n", "predefined\n29\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 0\n", "predefined\n30\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "random\n23\n2\n", "random\n29\n2\n", "random\n30\n13\n", "random\n9\n1\n", "predefined\n16\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0\n", "predefined\n8\n1 1 1 1 1 1 1 0\n", "random\n30\n2\n", "hack\n5\n0 0 1 1 0\n", "random\n25\n1\n", "random\n14\n1\n", "predefined\n8\n1 1 1 1 1 1 1 1\n", "random\n12\n1\n", "random\n30\n1\n", "random\n17\n1\n", "random\n26\n2\n", "chess\n30\n", "random\n18\n1\n", "predefined\n29\n0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0\n", "chess\n20\n", "predefined\n8\n0 0 0 0 0 0 0 0\n", "random\n27\n2\n", "random\n5\n1\n", "predefined\n29\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\n", "random\n24\n2\n", "random\n11\n1\n", "random\n6\n1\n", "random\n4\n1\n", "predefined\n30\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\n", "predefined\n1\n0\n", "predefined\n5\n0 1 0 1 1\n", "chess\n29\n", "random\n7\n1\n", "random\n1\n1\n", "predefined\n8\n0 1 0 1 0 1 0 1\n", "predefined\n1\n1\n", "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 0 1\n", "random\n7\n2\n", "modnar\n20\n11\n", "random\n10\n2\n", "sandom\n20\n12\n", "random\n30\n25\n", "random\n34\n1\n", "oredefined\n15\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 0\n", "radnom\n21\n2\n", "random\n21\n0\n", "rbndom\n28\n1\n", "random\n13\n2\n", "cgess\n10\n", "ciess\n11\n", "random\n2\n2\n", "random\n35\n1\n", "random\n13\n0\n", "shesc\n19\n", "predefined\n15\n1 1 2 1 1 1 1 1 1 1 1 1 1 1 1\n", "modnar\n29\n2\n", "modnar\n15\n1\n", "random\n26\n0\n", "predefinec\n2\n0 1\n", "random\n8\n2\n", "random\n15\n0\n", "rnadom\n8\n1\n", "rbndom\n19\n1\n", "sandom\n21\n1\n", "r`ndom\n27\n1\n", "denifederp\n2\n0 1\n", "rbndom\n3\n1\n", "predefined\n15\n0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0\n", "random\n3\n0\n", "predefined\n15\n0 1 0 1 0 1 0 1 0 0 0 1 0 1 0\n", "predefined\n3\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "hack\n30\n0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "predefined\n29\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 0\n", "predefined\n30\n0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "random\n15\n2\n", "random\n58\n2\n", "random\n30\n0\n", "raodom\n9\n1\n", "predefined\n16\n1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0\n", "predefined\n8\n0 1 1 1 1 1 1 0\n", "r`ndom\n30\n2\n", "hack\n5\n0 1 1 1 0\n", "modnar\n2\n1\n", "random\n14\n2\n", "precefined\n8\n1 1 1 1 1 1 1 1\n", "r`ndom\n14\n1\n", "random\n30\n4\n", "raneom\n17\n1\n", "randon\n26\n2\n", "ssehc\n30\n", "random\n31\n1\n", "predefined\n29\n0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0\n", "chess\n13\n", "denifederp\n8\n0 0 0 0 0 0 0 0\n", "randpm\n27\n2\n", "random\n5\n2\n", "5\n<span class=\"tex-span\"></span>\nblack\n<span class=\"tex-span\"></span>\nblack\n<span class=\"tex-span\"></span>\nwhite\n<span class=\"tex-span\"></span>\nwhite\n<span class=\"tex-span\"></span>\nblack\n"], "outputs": ["0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n0 0 1000000000 2\n", "0 1\n500000000 1\n250000000 1\n125000000 1\n187500000 1\n125000000 0 187500000 2\n"]}
HARD
['interactive', 'binary search', 'geometry', 'constructive algorithms']
null
codeforces
['Geometry', 'Sorting', 'Constructive algorithms']
['Sorting']
https://codeforces.com/problemset/problem/1063/C
null
2.0 seconds
null
null
256.0 megabytes
null
[ 0.007298862095922232, -0.07029411196708679, -0.0006856563268229365, -0.019779473543167114, 0.03523588553071022, -0.005796155426651239, 0.005788752809166908, 0.06721467524766922, 0.020282842218875885, 0.0046561709605157375, -0.042667992413043976, 0.0006366147426888347, 0.023465916514396667, ...
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 hole i it will immediately jump to hole i + ai, then it will jump out of it and so on. If there is no hole with such number, the ball will just jump out of the row. On each of the M moves the player can perform one of two actions: * Set the power of the hole a to value b. * Throw a ball into the hole a and count the number of jumps of a ball before it jump out of the row and also write down the number of the hole from which it jumped out just before leaving the row. Petya is not good at math, so, as you have already guessed, you are to perform all computations. Input The first line contains two integers N and M (1 ≤ N ≤ 105, 1 ≤ M ≤ 105) — the number of holes in a row and the number of moves. The second line contains N positive integers not exceeding N — initial values of holes power. The following M lines describe moves made by Petya. Each of these line can be one of the two types: * 0 a b * 1 a Type 0 means that it is required to set the power of hole a to b, and type 1 means that it is required to throw a ball into the a-th hole. Numbers a and b are positive integers do not exceeding N. Output For each move of the type 1 output two space-separated numbers on a separate line — the number of the last hole the ball visited before leaving the row and the number of jumps it made. Examples Input 8 5 1 1 1 1 1 2 8 2 1 1 0 1 3 1 1 0 3 4 1 2 Output 8 7 8 5 7 3
[]
{"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 11 2\n1 1\n0 1 5\n1 1\n0 3 4\n1 2\n", "8 5\n1 1 1 1 1 2 11 2\n1 1\n0 1 5\n1 1\n0 1 4\n1 2\n", "8 5\n1 1 1 1 1 2 11 2\n1 1\n0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9 1\n6 2\n", "8 6\n8 3\n7 3\n", "8 1\n6 2\n5 1\n5 2\n5 3\n9 1\n6 2\n", "8 1\n6 2\n5 1\n5 2\n5 3\n9 1\n6 2\n", "8 1\n6 2\n5 1\n5 2\n5 3\n9 1\n10 4\n", "8 1\n6 2\n5 1\n5 2\n5 3\n9 1\n10 4\n", "7 6\n7 4\n7 3\n", "8 6\n8 3\n7 3\n", "8 6\n8 3\n7 3\n", "8 1\n6 2\n5 1\n5 2\n5 3\n9 1\n6 2\n", "8 1\n6 2\n5 1\n5 2\n5 3\n9 1\n6 2\n", "8 1\n6 2\n6 2\n6 3\n6 3\n9 1\n10 4\n", "8 1\n6 2\n5 1\n5 2\n5 3\n9 1\n10 4\n", "8 1\n6 2\n5 1\n5 2\n5 3\n9 1\n6 2\n", "8 1\n6 2\n6 2\n6 3\n6 4\n9 1\n6 2\n", "8 1\n6 2\n5 1\n5 2\n5 3\n9 1\n6 2\n", "8 7\n8 5\n8 5\n", "8 7\n8 5\n8 5\n", "8 7\n8 3\n8 6\n", "8 7\n8 3\n7 2\n", "8 1\n6 2\n5 1\n5 2\n5 3\n9 1\n6 2\n", "8 7\n8 5\n7 3\n"]}
VERY_HARD
['data structures', 'dsu']
null
codeforces
['Spanning trees', 'Data structures']
['Data structures']
https://codeforces.com/problemset/problem/13/E
null
1.0 seconds
null
null
64.0 megabytes
null
[ -0.001230821362696588, -0.033479779958724976, 0.001268637366592884, 0.0006779871764592826, 0.00630987249314785, 0.02377006784081459, 0.02061513066291809, 0.03941509500145912, 0.0032125606667250395, 0.036418624222278595, -0.003846429055556655, 0.035294950008392334, -0.014564569108188152, 0....
"If you visit Aizu Akabeko shrine, you will find a unique paper fortune on which a number with more (...TRUNCATED)
"[\"def sub(maxs, mins):\\n\\tfor i in range(len(maxs)):\\n\\t\\tif maxs[i] != mins[i]:\\n\\t\\t\\ti(...TRUNCATED)
"{\"inputs\": [\"9714431\", \"16612328\", \"23422731\", \"754526\", \"955577\", \"75547\", \"2112\",(...TRUNCATED)
UNKNOWN_DIFFICULTY
[]
null
aizu
[]
[]
null
null
1.0 seconds
null
null
268.435456 megabytes
null
[0.024838225916028023,-0.047773465514183044,0.0020858286879956722,-0.019356491044163704,-0.003626679(...TRUNCATED)
"The number obtained by multiplying 1 by 2, 3, 5 several times (0 or more times) is called the Hammi(...TRUNCATED)
"[\"import sys\\nfrom sys import stdin\\nfrom bisect import bisect_right, bisect_left\\nfrom math im(...TRUNCATED)
"{\"inputs\": [\"3 8\\n2 27\\n1 86\\n0\", \"3 9\\n2 27\\n1 86\\n0\", \"3 8\\n1 35\\n1 86\\n0\", \"5 (...TRUNCATED)
UNKNOWN_DIFFICULTY
[]
null
aizu
[]
[]
null
null
1.0 seconds
null
null
134.217728 megabytes
null
[-0.020179923623800278,-0.014768985100090504,-0.013827952556312084,0.034138575196266174,0.0418236739(...TRUNCATED)
"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)
"#User function Template for python3\n\n\n\nclass Solution:\n\n\tdef minimum_Number(self, s):\n\n\t\(...TRUNCATED)
"{\"inputs\": [\"s = \\\"846903\\\"\", \"s = \\\"55010\\\"\"], \"outputs\": [\"304689\", \"10055\"]}(...TRUNCATED)
EASY
['Algorithms', 'Mathematical']
null
geeksforgeeks
['Mathematics']
[]
https://practice.geeksforgeeks.org/problems/smallest-number-by-rearranging-digits-of-a-given-number0820/1
O(1)
null
null
0
null
O(N * log(N)) where N is the number of digits of the given number
[0.009848089888691902,0.016729768365621567,0.005163755267858505,0.00954845268279314,0.00211494229733(...TRUNCATED)
"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)
"#User function Template for python3\n\nclass Solution:\n def minTime (self, arr, n, k):\n (...TRUNCATED)
"{\"inputs\": [\"n = 5\\nk = 3\\narr[] = {5,10,30,20,15}\", \"n = 4\\nk = 2\\narr[] = {10,20,30,40}\(...TRUNCATED)
MEDIUM_HARD
['Algorithms', 'Searching', 'Binary Search', 'Divide and Conquer', 'Dynamic Programming']
null
geeksforgeeks
['Dynamic programming', 'Sorting', 'Divide and conquer', 'Complete search']
['Dynamic programming', 'Sorting', 'Complete search']
https://practice.geeksforgeeks.org/problems/the-painters-partition-problem1535/1
O(1)
null
null
0
null
O(n log m) , m = sum of all boards' length
[0.019095785915851593,-0.007324746809899807,-0.006029442418366671,-0.017442205920815468,0.0402738600(...TRUNCATED)
"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)
def is_anagram(test, original):
"{\"fn_name\": \"is_anagram\", \"inputs\": [[\"foefet\", \"toffee\"], [\"Buckethead\", \"DeathCubeK\(...TRUNCATED)
EASY
['Strings', 'Fundamentals']
null
codewars
['String algorithms', 'Fundamentals']
[]
https://www.codewars.com/kata/529eef7a9194e0cbc1000255
null
null
null
null
null
null
[-0.03089795634150505,-0.01268829870969057,-0.006035602651536465,-0.009061523713171482,-0.0084119522(...TRUNCATED)
"Arkady decides to observe a river for n consecutive days. The river's water level on each day is eq(...TRUNCATED)
"[\"import sys\\nn = int(input())\\na = [int(x) for x in input().split(' ')]\\nmaxm = 0\\nidx = 0\\n(...TRUNCATED)
"{\"inputs\": [\"3\\n0 1 1\\n\", \"4\\n0 0 1 2\\n\", \"2\\n0 0\\n\", \"4\\n0 1 1 0\\n\", \"3\\n0 1 0(...TRUNCATED)
MEDIUM_HARD
['data structures', 'greedy', 'dp']
null
codeforces
['Dynamic programming', 'Data structures', 'Greedy algorithms']
['Dynamic programming', 'Data structures', 'Greedy algorithms']
https://codeforces.com/problemset/problem/957/D
null
1.0 seconds
null
null
256.0 megabytes
null
[-0.0033331862650811672,-0.035058315843343735,0.002961432095617056,-0.023905687034130096,0.049323596(...TRUNCATED)
"Define a $k$-periodic string as follows:\n\nA string $s$ is $k$-periodic if the length of the strin(...TRUNCATED)
[]
"{\"inputs\": [\"aaaaaaaa\\n\", \"abbaabbaabba\\n\", \"abcdef\\n\", \"abccabbcaabc\\n\"], \"outputs\(...TRUNCATED)
EASY
['strings']
null
kattis
['String algorithms']
[]
https://open.kattis.com/problems/periodicstrings
null
null
null
null
null
null
[0.01552705280482769,0.003003471065312624,0.006951466202735901,0.016033871099352837,0.03943963348865(...TRUNCATED)
"Tom has finally taken over the business empire and now looking for \na new Name of the business to(...TRUNCATED)
"[\"s = input().lower()\\nvow = ['a', 'e', 'i', 'o', 'u', 'y']\\nans = ''\\nfor ch in s:\\n\\tif ch (...TRUNCATED)
{"inputs": [["CodeSprInT"]], "outputs": [[".c.d.s.p.r.n.t"]]}
UNKNOWN_DIFFICULTY
[]
null
codechef
[]
[]
https://www.codechef.com/SPRT2020/problems/EMPRNM
null
null
null
null
null
null
[0.0401652529835701,-0.000341692561050877,-0.0021350730676203966,0.034109409898519516,0.037577286362(...TRUNCATED)
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
7