diff_sorted_id
stringclasses 105
values | problem_statement
stringlengths 778
1.74k
| problem_type
stringclasses 11
values | problem_category
stringclasses 5
values | relative_diff_score
stringclasses 35
values | opt_solution
stringlengths 24
474
| opt_solution_cost
stringlengths 1
4
| opt_solution_compute_t
stringlengths 14
20
| solution_depth
stringclasses 40
values | max_successor_states
stringclasses 51
values | num_vars_per_state
stringclasses 47
values | is_feasible_args
stringlengths 43
1.24k
| is_correct_args
stringlengths 43
1.26k
| A*_args
stringlengths 46
1.27k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
104 | In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [18, 23, 23, 36, 27, 10, 25, 14, 6, 43, 6, 31, 5, 43, 3, 13, 16, 8, 11, 6, 39, 44, 41, 28, 12, 8, 1, 14, 22, 23, 11, 24, 37, 9, 2, 31, 27, 10, 9, 38, 37, 4, 4, 17, 18, 36, 18, 32, 3, 12, 4, 42, 8, 4, 4, 16, 30, 40, 13, 41], such that the sum of the chosen coins adds up to 441. Each coin in the list is unique and can only be used once. Also coins carry a tax value. The tax values for each coin is {6: 4, 18: 3, 38: 1, 23: 2, 16: 8, 12: 2, 4: 2, 24: 13, 28: 17, 30: 17, 1: 1, 9: 9, 27: 8, 11: 4, 37: 16, 41: 19, 13: 3, 31: 8, 44: 8, 22: 7, 43: 13, 10: 3, 17: 8, 36: 7, 39: 3, 25: 17, 40: 10, 8: 6, 32: 16, 14: 4, 2: 1, 42: 3, 3: 2, 5: 2}, where the tax for coins of the same value is the same. Also, if the coin chosen is smaller than the previous one, it must have an even value, otherwise, if the coin is larger than or equal to the previous coin chosen, it must have an odd value. The objective is to determine which subset of coins should be selected to minimize the total tax paid. The solution should be presented as a list of numbers, representing the value of the coins chosen in order, with the first coins chosen being in index 0, formatted in Python syntax. | coin_exchange | subset_sum | 34 | [42, 38, 12, 23, 23, 39, 36, 18, 12, 23, 18, 10, 13, 13, 43, 36, 18, 14, 10] | 69 | 0.11116838455200195 | 19 | 60 | 60 | [[18, 23, 23, 36, 27, 10, 25, 14, 6, 43, 6, 31, 5, 43, 3, 13, 16, 8, 11, 6, 39, 44, 41, 28, 12, 8, 1, 14, 22, 23, 11, 24, 37, 9, 2, 31, 27, 10, 9, 38, 37, 4, 4, 17, 18, 36, 18, 32, 3, 12, 4, 42, 8, 4, 4, 16, 30, 40, 13, 41]] | [[18, 23, 23, 36, 27, 10, 25, 14, 6, 43, 6, 31, 5, 43, 3, 13, 16, 8, 11, 6, 39, 44, 41, 28, 12, 8, 1, 14, 22, 23, 11, 24, 37, 9, 2, 31, 27, 10, 9, 38, 37, 4, 4, 17, 18, 36, 18, 32, 3, 12, 4, 42, 8, 4, 4, 16, 30, 40, 13, 41], {"6": 4, "18": 3, "38": 1, "23": 2, "16": 8, "12": 2, "4": 2, "24": 13, "28": 17, "30": 17, "1": 1, "9": 9, "27": 8, "11": 4, "37": 16, "41": 19, "13": 3, "31": 8, "44": 8, "22": 7, "43": 13, "10": 3, "17": 8, "36": 7, "39": 3, "25": 17, "40": 10, "8": 6, "32": 16, "14": 4, "2": 1, "42": 3, "3": 2, "5": 2}, 441] | ["[18, 23, 23, 36, 27, 10, 25, 14, 6, 43, 6, 31, 5, 43, 3, 13, 16, 8, 11, 6, 39, 44, 41, 28, 12, 8, 1, 14, 22, 23, 11, 24, 37, 9, 2, 31, 27, 10, 9, 38, 37, 4, 4, 17, 18, 36, 18, 32, 3, 12, 4, 42, 8, 4, 4, 16, 30, 40, 13, 41]", "{6: 4, 18: 3, 38: 1, 23: 2, 16: 8, 12: 2, 4: 2, 24: 13, 28: 17, 30: 17, 1: 1, 9: 9, 27: 8, 11: 4, 37: 16, 41: 19, 13: 3, 31: 8, 44: 8, 22: 7, 43: 13, 10: 3, 17: 8, 36: 7, 39: 3, 25: 17, 40: 10, 8: 6, 32: 16, 14: 4, 2: 1, 42: 3, 3: 2, 5: 2}", "441"] |
104 | In the magic square problem, a 4x4 grid is filled with unique integers ranging from 36 to 92. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 300, 191, None for columns 1 to 2 respectively, and the sums of rows must be None, 214, 240, None for rows 1 to 2 respectively, where None means that we do not have any constraints on the sum of the numbers in the row or column at that index. Also, the sum of the numbers in the diagonal from the top right to the bottom left corner of the grid should equal 249. The goal is to find unique integers (ie each number can be in the final grid only once) in the given range to replace with ‘x’s in the grid below such that the sum of the specified rows, columns, and diagonal equals the given amounts and the sum of all of the numbers in the grid is as low as possible. The solution should be provided as a list of tuples in Python syntax. Each tuple should contain three numbers for each 'x' position: the row index, the column index (both starting from 0), and the value of the unique integer replaced with 'x' at that position.
Grid:
[['x' '69' 'x' 'x']
['x' '62' 'x' 'x']
['x' '82' '40' 'x']
['x' '87' '78' '80']] | magic_square | underdetermined_system | 10 | [[0, 0, 38], [0, 2, 36], [0, 3, 39], [1, 0, 41], [1, 2, 37], [1, 3, 74], [2, 0, 42], [2, 3, 76], [3, 0, 91]] | 972 | 599.0436754226685 | 9 | 36 | 16 | ["[['', '69', '', ''], ['', '62', '', ''], ['', '82', '40', ''], ['', '87', '78', '80']]", 4, 36, 92] | ["[['', '69', '', ''], ['', '62', '', ''], ['', '82', '40', ''], ['', '87', '78', '80']]", 36, 92, [1, 3], [1, 3], [300, 191], [214, 240], 249] | ["[['', '69', '', ''], ['', '62', '', ''], ['', '82', '40', ''], ['', '87', '78', '80']]", "36", "92", "[None, 300, 191, None]", "[None, 214, 240, None]", "249"] |
104 | Using the provided matrix map of a city, where numbers represent travel time in minutes (all numbers are positive integers) and 'x' marks closed workshops, find the quickest route for Ben to travel from his current workshop at index (7, 2) to his destination workshop at index (4, 14), indexing from 0. Ben's car can move north, south, east, or west from a given crossroad, provided there's no x in that direction. Also, there are 3 districts in the city with district 1 covering rows 0 to 4, district 2 covering rows 5 to 8, and district 3 covering rows 9 to 14. Ben has to visit at least 1 workshop in each district on his path to the destination. The roads are bidirectional. The answer should be a list of tuples (in Python syntax) indicating the index of workshops on Ben's path. The start and end workshops must be included in the path.
[x x 7 18 11 4 9 x 15 x x x 1 x x]
[x x 14 x 10 x x x 8 x x 16 1 x x]
[17 17 x x x x x 7 6 12 x x x 7 x]
[x x x x 10 x x 18 1 11 4 x 13 10 16]
[x x x 12 1 x x x 2 7 1 x 2 x 5]
[x x 8 x 12 x x 5 17 x 2 x 4 10 18]
[x x 4 19 1 x 18 7 x 10 3 x 19 16 19]
[6 12 15 16 5 9 16 18 10 15 5 x 5 14 x]
[x 16 8 17 12 11 16 8 9 9 7 4 5 20 3]
[19 17 15 x x 17 x 3 2 2 11 7 8 16 1]
[13 4 17 x x x x 5 x 18 16 15 19 4 x]
[11 x x x x 12 x x x x x x 19 x x]
[18 x x x 9 19 x 16 6 x 9 3 16 15 x]
[x x x 10 x x 4 3 x 3 x 16 18 x 12]
[x 13 x x x x x 10 5 x 17 x x 7 x] | traffic | pathfinding | 7 | [[7, 2], [7, 3], [7, 4], [7, 5], [8, 5], [8, 6], [8, 7], [9, 7], [9, 8], [9, 9], [8, 9], [8, 10], [8, 11], [8, 12], [7, 12], [6, 12], [5, 12], [5, 13], [5, 14], [4, 14]] | 158 | 0.03071141242980957 | 20 | 4 | 4 | [[["x", "x", "7", "18", "11", "4", "9", "x", "15", "x", "x", "x", "1", "x", "x"], ["x", "x", "14", "x", "10", "x", "x", "x", "8", "x", "x", "16", "1", "x", "x"], ["17", "17", "x", "x", "x", "x", "x", "7", "6", "12", "x", "x", "x", "7", "x"], ["x", "x", "x", "x", "10", "x", "x", "18", "1", "11", "4", "x", "13", "10", "16"], ["x", "x", "x", "12", "1", "x", "x", "x", "2", "7", "1", "x", "2", "x", "5"], ["x", "x", "8", "x", "12", "x", "x", "5", "17", "x", "2", "x", "4", "10", "18"], ["x", "x", "4", "19", "1", "x", "18", "7", "x", "10", "3", "x", "19", "16", "19"], ["6", "12", "15", "16", "5", "9", "16", "18", "10", "15", "5", "x", "5", "14", "x"], ["x", "16", "8", "17", "12", "11", "16", "8", "9", "9", "7", "4", "5", "20", "3"], ["19", "17", "15", "x", "x", "17", "x", "3", "2", "2", "11", "7", "8", "16", "1"], ["13", "4", "17", "x", "x", "x", "x", "5", "x", "18", "16", "15", "19", "4", "x"], ["11", "x", "x", "x", "x", "12", "x", "x", "x", "x", "x", "x", "19", "x", "x"], ["18", "x", "x", "x", "9", "19", "x", "16", "6", "x", "9", "3", "16", "15", "x"], ["x", "x", "x", "10", "x", "x", "4", "3", "x", "3", "x", "16", "18", "x", "12"], ["x", "13", "x", "x", "x", "x", "x", "10", "5", "x", "17", "x", "x", "7", "x"]]] | [[["x", "x", "7", "18", "11", "4", "9", "x", "15", "x", "x", "x", "1", "x", "x"], ["x", "x", "14", "x", "10", "x", "x", "x", "8", "x", "x", "16", "1", "x", "x"], ["17", "17", "x", "x", "x", "x", "x", "7", "6", "12", "x", "x", "x", "7", "x"], ["x", "x", "x", "x", "10", "x", "x", "18", "1", "11", "4", "x", "13", "10", "16"], ["x", "x", "x", "12", "1", "x", "x", "x", "2", "7", "1", "x", "2", "x", "5"], ["x", "x", "8", "x", "12", "x", "x", "5", "17", "x", "2", "x", "4", "10", "18"], ["x", "x", "4", "19", "1", "x", "18", "7", "x", "10", "3", "x", "19", "16", "19"], ["6", "12", "15", "16", "5", "9", "16", "18", "10", "15", "5", "x", "5", "14", "x"], ["x", "16", "8", "17", "12", "11", "16", "8", "9", "9", "7", "4", "5", "20", "3"], ["19", "17", "15", "x", "x", "17", "x", "3", "2", "2", "11", "7", "8", "16", "1"], ["13", "4", "17", "x", "x", "x", "x", "5", "x", "18", "16", "15", "19", "4", "x"], ["11", "x", "x", "x", "x", "12", "x", "x", "x", "x", "x", "x", "19", "x", "x"], ["18", "x", "x", "x", "9", "19", "x", "16", "6", "x", "9", "3", "16", "15", "x"], ["x", "x", "x", "10", "x", "x", "4", "3", "x", "3", "x", "16", "18", "x", "12"], ["x", "13", "x", "x", "x", "x", "x", "10", "5", "x", "17", "x", "x", "7", "x"]], [7, 2], [4, 14], 4, 8] | ["[['x', 'x', '7', '18', '11', '4', '9', 'x', '15', 'x', 'x', 'x', '1', 'x', 'x'], ['x', 'x', '14', 'x', '10', 'x', 'x', 'x', '8', 'x', 'x', '16', '1', 'x', 'x'], ['17', '17', 'x', 'x', 'x', 'x', 'x', '7', '6', '12', 'x', 'x', 'x', '7', 'x'], ['x', 'x', 'x', 'x', '10', 'x', 'x', '18', '1', '11', '4', 'x', '13', '10', '16'], ['x', 'x', 'x', '12', '1', 'x', 'x', 'x', '2', '7', '1', 'x', '2', 'x', '5'], ['x', 'x', '8', 'x', '12', 'x', 'x', '5', '17', 'x', '2', 'x', '4', '10', '18'], ['x', 'x', '4', '19', '1', 'x', '18', '7', 'x', '10', '3', 'x', '19', '16', '19'], ['6', '12', '15', '16', '5', '9', '16', '18', '10', '15', '5', 'x', '5', '14', 'x'], ['x', '16', '8', '17', '12', '11', '16', '8', '9', '9', '7', '4', '5', '20', '3'], ['19', '17', '15', 'x', 'x', '17', 'x', '3', '2', '2', '11', '7', '8', '16', '1'], ['13', '4', '17', 'x', 'x', 'x', 'x', '5', 'x', '18', '16', '15', '19', '4', 'x'], ['11', 'x', 'x', 'x', 'x', '12', 'x', 'x', 'x', 'x', 'x', 'x', '19', 'x', 'x'], ['18', 'x', 'x', 'x', '9', '19', 'x', '16', '6', 'x', '9', '3', '16', '15', 'x'], ['x', 'x', 'x', '10', 'x', 'x', '4', '3', 'x', '3', 'x', '16', '18', 'x', '12'], ['x', '13', 'x', 'x', 'x', 'x', 'x', '10', '5', 'x', '17', 'x', 'x', '7', 'x']]", "(7, 2)", "(4, 14)", "4", "8"] |
104 | Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 15x15. Some trampolines are broken and unusable. A map of the park is provided below, with 1 indicating a broken trampoline and 0 indicating a functional one. Alex can jump to any of the eight adjacent trampolines, as long as they are not broken. However, Alex must make excatly 5 diagonal jumps, no more, no less, on his path to his destination. He is currently on the trampoline at position (14, 1) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (2, 10). What is the shortest sequence of trampolines he should jump on to reach his destination (including the first and final trampolines)? The answer should be a list of tuples, in Python syntax, indicating the row and column of each trampoline Alex jumps on.
0 1 1 1 0 0 1 1 0 0 1 0 1 1 1
1 1 1 1 0 1 1 1 1 1 1 1 0 0 0
1 1 0 0 0 0 0 1 0 0 0 0 1 1 0
1 1 1 1 1 1 1 0 0 0 0 1 0 1 1
1 1 1 1 0 1 0 0 0 0 0 0 1 1 1
0 1 0 0 0 0 0 0 0 1 0 1 1 1 1
1 1 0 1 1 1 0 0 0 1 0 1 0 0 1
1 1 1 0 1 0 0 1 1 1 1 0 1 1 1
1 1 1 0 0 0 1 1 0 0 1 1 0 0 1
1 1 0 0 0 1 0 1 1 1 0 1 1 0 1
0 0 0 0 0 1 1 1 0 1 1 1 1 1 1
0 1 0 0 1 1 1 0 1 1 0 1 0 0 0
1 0 1 0 1 1 1 1 0 1 1 0 1 1 1
0 0 0 1 0 0 0 1 1 1 1 1 1 1 1
0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 | trampoline_matrix | pathfinding | 15 | [[14, 1], [13, 1], [12, 1], [11, 2], [10, 2], [9, 2], [9, 3], [8, 3], [8, 4], [7, 5], [6, 6], [5, 6], [5, 7], [4, 7], [4, 8], [3, 9], [2, 10]] | 17 | 0.026737689971923828 | 17 | 8 | 2 | ["[[0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1], [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1], [1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1], [1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1], [1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 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[[0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1], [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1], [1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1], [1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1], [1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1], [0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1], [0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1]]", "(14, 1)", "(2, 10)", "5"] |
105 | In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [26, 8, 34, 12, 20, 21, 35, 13, 28, 5, 16, 11, 24, 42, 16, 12, 34, 21, 27, 27, 20, 47, 9, 12, 38, 23, 43, 33, 26, 22, 38, 42, 20, 41, 47, 41, 24, 46, 35, 42, 9, 35, 13, 45, 24, 29, 45, 2, 41, 39, 24, 38, 39, 18, 5, 8, 36], such that the sum of the chosen coins adds up to 477. Each coin in the list is unique and can only be used once. Also coins carry a tax value. The tax values for each coin is {12: 8, 18: 6, 42: 8, 11: 9, 38: 13, 9: 9, 24: 15, 34: 1, 20: 5, 2: 2, 23: 2, 33: 12, 27: 8, 39: 11, 16: 1, 28: 12, 26: 11, 21: 7, 35: 7, 22: 19, 47: 9, 29: 12, 46: 3, 45: 9, 5: 1, 13: 13, 43: 8, 36: 11, 41: 4, 8: 8}, where the tax for coins of the same value is the same. Also, if the coin chosen is smaller than the previous one, it must have an even value, otherwise, if the coin is larger than or equal to the previous coin chosen, it must have an odd value. The objective is to determine which subset of coins should be selected to minimize the total tax paid. The solution should be presented as a list of numbers, representing the value of the coins chosen in order, with the first coins chosen being in index 0, formatted in Python syntax. | coin_exchange | subset_sum | 35 | [46, 34, 16, 23, 16, 35, 41, 41, 41, 43, 42, 45, 34, 20] | 58 | 0.04893088340759277 | 14 | 57 | 57 | [[26, 8, 34, 12, 20, 21, 35, 13, 28, 5, 16, 11, 24, 42, 16, 12, 34, 21, 27, 27, 20, 47, 9, 12, 38, 23, 43, 33, 26, 22, 38, 42, 20, 41, 47, 41, 24, 46, 35, 42, 9, 35, 13, 45, 24, 29, 45, 2, 41, 39, 24, 38, 39, 18, 5, 8, 36]] | [[26, 8, 34, 12, 20, 21, 35, 13, 28, 5, 16, 11, 24, 42, 16, 12, 34, 21, 27, 27, 20, 47, 9, 12, 38, 23, 43, 33, 26, 22, 38, 42, 20, 41, 47, 41, 24, 46, 35, 42, 9, 35, 13, 45, 24, 29, 45, 2, 41, 39, 24, 38, 39, 18, 5, 8, 36], {"12": 8, "18": 6, "42": 8, "11": 9, "38": 13, "9": 9, "24": 15, "34": 1, "20": 5, "2": 2, "23": 2, "33": 12, "27": 8, "39": 11, "16": 1, "28": 12, "26": 11, "21": 7, "35": 7, "22": 19, "47": 9, "29": 12, "46": 3, "45": 9, "5": 1, "13": 13, "43": 8, "36": 11, "41": 4, "8": 8}, 477] | ["[26, 8, 34, 12, 20, 21, 35, 13, 28, 5, 16, 11, 24, 42, 16, 12, 34, 21, 27, 27, 20, 47, 9, 12, 38, 23, 43, 33, 26, 22, 38, 42, 20, 41, 47, 41, 24, 46, 35, 42, 9, 35, 13, 45, 24, 29, 45, 2, 41, 39, 24, 38, 39, 18, 5, 8, 36]", "{12: 8, 18: 6, 42: 8, 11: 9, 38: 13, 9: 9, 24: 15, 34: 1, 20: 5, 2: 2, 23: 2, 33: 12, 27: 8, 39: 11, 16: 1, 28: 12, 26: 11, 21: 7, 35: 7, 22: 19, 47: 9, 29: 12, 46: 3, 45: 9, 5: 1, 13: 13, 43: 8, 36: 11, 41: 4, 8: 8}", "477"] |
105 | Using the provided matrix map of a city, where numbers represent travel time in minutes (all numbers are positive integers) and 'x' marks closed workshops, find the quickest route for Ben to travel from his current workshop at index (1, 11) to his destination workshop at index (7, 2), indexing from 0. Ben's car can move north, south, east, or west from a given crossroad, provided there's no x in that direction. Also, there are 3 districts in the city with district 1 covering rows 0 to 1, district 2 covering rows 2 to 9, and district 3 covering rows 10 to 14. Ben has to visit at least 1 workshop in each district on his path to the destination. The roads are bidirectional. The answer should be a list of tuples (in Python syntax) indicating the index of workshops on Ben's path. The start and end workshops must be included in the path.
[18 15 x x 1 x x 5 8 18 18 2 x 11 8]
[x 17 x x 2 x 16 9 7 13 16 17 x x x]
[10 x 1 14 1 10 15 4 x x 8 11 10 x x]
[19 x x 9 8 18 5 2 12 x 13 x x 15 11]
[1 x 14 6 6 6 x x x 13 13 x x x x]
[2 3 8 5 7 x x x 19 x 16 x x x x]
[x x 17 18 x 19 x x x 7 8 17 x x x]
[4 x 4 14 17 6 x 2 x x 15 6 x 18 10]
[7 x 3 11 10 x x 12 x x 8 x x 10 x]
[4 16 2 11 x x 14 x 13 x x x x x x]
[14 20 7 14 x x x x x x 5 x 10 16 x]
[1 14 x x x 4 14 19 x 18 x x 17 15 14]
[x x 15 x 4 5 19 18 x 19 11 3 12 x 10]
[1 x 1 x x 13 x 16 4 x x 8 x 9 x]
[x x 12 11 7 x 8 14 3 x 11 x 14 13 x] | traffic | pathfinding | 7 | [[1, 11], [1, 10], [1, 9], [1, 8], [1, 7], [2, 7], [3, 7], [3, 6], [3, 5], [4, 5], [4, 4], [4, 3], [5, 3], [5, 2], [6, 2], [7, 2], [8, 2], [9, 2], [10, 2], [9, 2], [8, 2], [7, 2]] | 147 | 0.028675556182861328 | 22 | 4 | 4 | [[["18", "15", "x", "x", "1", "x", "x", "5", "8", "18", "18", "2", "x", "11", "8"], ["x", "17", "x", "x", "2", "x", "16", "9", "7", "13", "16", "17", "x", "x", "x"], ["10", "x", "1", "14", "1", "10", "15", "4", "x", "x", "8", "11", "10", "x", "x"], ["19", "x", "x", "9", "8", "18", "5", "2", "12", "x", "13", "x", "x", "15", "11"], ["1", "x", "14", "6", "6", "6", "x", "x", "x", "13", "13", "x", "x", "x", "x"], ["2", "3", "8", "5", "7", "x", "x", "x", "19", "x", "16", "x", "x", "x", "x"], ["x", "x", "17", "18", "x", "19", "x", "x", "x", "7", "8", "17", "x", "x", "x"], ["4", "x", "4", "14", "17", "6", "x", "2", "x", "x", "15", "6", "x", "18", "10"], ["7", "x", "3", "11", "10", "x", "x", "12", "x", "x", "8", "x", "x", "10", "x"], ["4", "16", "2", "11", "x", "x", "14", "x", "13", "x", "x", "x", "x", "x", "x"], ["14", "20", "7", "14", "x", "x", "x", "x", "x", "x", "5", "x", "10", "16", "x"], ["1", "14", "x", "x", "x", "4", "14", "19", "x", "18", "x", "x", "17", "15", "14"], ["x", "x", "15", "x", "4", "5", "19", "18", "x", "19", "11", "3", "12", "x", "10"], ["1", "x", "1", "x", "x", "13", "x", "16", "4", "x", "x", "8", "x", "9", "x"], ["x", "x", "12", "11", "7", "x", "8", "14", "3", "x", "11", "x", "14", "13", "x"]]] | [[["18", "15", "x", "x", "1", "x", "x", "5", "8", "18", "18", "2", "x", "11", "8"], ["x", "17", "x", "x", "2", "x", "16", "9", "7", "13", "16", "17", "x", "x", "x"], ["10", "x", "1", "14", "1", "10", "15", "4", "x", "x", "8", "11", "10", "x", "x"], ["19", "x", "x", "9", "8", "18", "5", "2", "12", "x", "13", "x", "x", "15", "11"], ["1", "x", "14", "6", "6", "6", "x", "x", "x", "13", "13", "x", "x", "x", "x"], ["2", "3", "8", "5", "7", "x", "x", "x", "19", "x", "16", "x", "x", "x", "x"], ["x", "x", "17", "18", "x", "19", "x", "x", "x", "7", "8", "17", "x", "x", "x"], ["4", "x", "4", "14", "17", "6", "x", "2", "x", "x", "15", "6", "x", "18", "10"], ["7", "x", "3", "11", "10", "x", "x", "12", "x", "x", "8", "x", "x", "10", "x"], ["4", "16", "2", "11", "x", "x", "14", "x", "13", "x", "x", "x", "x", "x", "x"], ["14", "20", "7", "14", "x", "x", "x", "x", "x", "x", "5", "x", "10", "16", "x"], ["1", "14", "x", "x", "x", "4", "14", "19", "x", "18", "x", "x", "17", "15", "14"], ["x", "x", "15", "x", "4", "5", "19", "18", "x", "19", "11", "3", "12", "x", "10"], ["1", "x", "1", "x", "x", "13", "x", "16", "4", "x", "x", "8", "x", "9", "x"], ["x", "x", "12", "11", "7", "x", "8", "14", "3", "x", "11", "x", "14", "13", "x"]], [1, 11], [7, 2], 1, 9] | ["[['18', '15', 'x', 'x', '1', 'x', 'x', '5', '8', '18', '18', '2', 'x', '11', '8'], ['x', '17', 'x', 'x', '2', 'x', '16', '9', '7', '13', '16', '17', 'x', 'x', 'x'], ['10', 'x', '1', '14', '1', '10', '15', '4', 'x', 'x', '8', '11', '10', 'x', 'x'], ['19', 'x', 'x', '9', '8', '18', '5', '2', '12', 'x', '13', 'x', 'x', '15', '11'], ['1', 'x', '14', '6', '6', '6', 'x', 'x', 'x', '13', '13', 'x', 'x', 'x', 'x'], ['2', '3', '8', '5', '7', 'x', 'x', 'x', '19', 'x', '16', 'x', 'x', 'x', 'x'], ['x', 'x', '17', '18', 'x', '19', 'x', 'x', 'x', '7', '8', '17', 'x', 'x', 'x'], ['4', 'x', '4', '14', '17', '6', 'x', '2', 'x', 'x', '15', '6', 'x', '18', '10'], ['7', 'x', '3', '11', '10', 'x', 'x', '12', 'x', 'x', '8', 'x', 'x', '10', 'x'], ['4', '16', '2', '11', 'x', 'x', '14', 'x', '13', 'x', 'x', 'x', 'x', 'x', 'x'], ['14', '20', '7', '14', 'x', 'x', 'x', 'x', 'x', 'x', '5', 'x', '10', '16', 'x'], ['1', '14', 'x', 'x', 'x', '4', '14', '19', 'x', '18', 'x', 'x', '17', '15', '14'], ['x', 'x', '15', 'x', '4', '5', '19', '18', 'x', '19', '11', '3', '12', 'x', '10'], ['1', 'x', '1', 'x', 'x', '13', 'x', '16', '4', 'x', 'x', '8', 'x', '9', 'x'], ['x', 'x', '12', '11', '7', 'x', '8', '14', '3', 'x', '11', 'x', '14', '13', 'x']]", "(1, 11)", "(7, 2)", "1", "9"] |
105 | Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 15x15. Some trampolines are broken and unusable. A map of the park is provided below, with 1 indicating a broken trampoline and 0 indicating a functional one. Alex can jump to any of the eight adjacent trampolines, as long as they are not broken. However, Alex must make excatly 5 diagonal jumps, no more, no less, on his path to his destination. He is currently on the trampoline at position (12, 2) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (3, 13). What is the shortest sequence of trampolines he should jump on to reach his destination (including the first and final trampolines)? The answer should be a list of tuples, in Python syntax, indicating the row and column of each trampoline Alex jumps on.
1 0 0 1 1 1 1 1 0 0 1 0 0 1 0
1 1 0 0 0 1 1 1 1 1 0 1 0 1 0
0 1 0 1 1 0 1 1 1 1 1 1 1 1 1
0 0 1 0 1 0 1 1 0 0 0 1 0 0 0
1 1 0 0 1 1 0 1 0 0 0 0 0 1 0
1 1 1 0 0 0 0 1 0 1 0 0 1 1 0
0 0 1 0 0 0 0 0 0 0 0 0 0 1 0
0 0 1 0 1 1 0 0 1 1 1 0 0 1 1
0 0 0 0 0 1 0 1 1 1 1 1 0 1 1
0 0 0 0 1 1 0 0 0 1 1 0 1 1 1
0 0 0 0 1 1 1 1 1 0 1 0 1 0 0
1 0 0 0 1 1 1 0 0 0 0 1 1 0 1
1 0 0 1 0 0 1 1 1 0 1 0 0 0 1
1 1 1 1 0 0 0 1 1 0 0 1 0 1 1
1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 | trampoline_matrix | pathfinding | 15 | [[12, 2], [11, 3], [10, 3], [9, 3], [8, 3], [7, 3], [6, 4], [6, 5], [6, 6], [6, 7], [5, 8], [4, 9], [4, 10], [4, 11], [3, 12], [3, 13]] | 16 | 0.03443431854248047 | 16 | 8 | 2 | ["[[1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0], [1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0], [1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0], [1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1], [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1], [0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0], [1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], [1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1], [1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1], [1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1]]", 5] | ["[[1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0], [1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 1, 0, 1, 0, 1, 1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