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
92
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [[92, 79, 74, 46, 64, 44], [39, 59, 75, 26, 47, 73], [29, 53, 56, '_', 16, 17]]
8_puzzle
puzzle
5
[26, 47, 73, 44, 64, 73, 16, 17, 44, 64, 73, 46, 74, 75, 56, 53, 29, 39, 59, 56, 53, 26, 17, 16, 46, 73, 64, 44]
28
0.7006855010986328
28
4
18
[[[92, 79, 74, 46, 64, 44], [39, 59, 75, 26, 47, 73], [29, 53, 56, "_", 16, 17]]]
[[[92, 79, 74, 46, 64, 44], [39, 59, 75, 26, 47, 73], [29, 53, 56, "_", 16, 17]]]
["[[92, 79, 74, 46, 64, 44], [39, 59, 75, 26, 47, 73], [29, 53, 56, '_', 16, 17]]"]
92
In the game 'Sort the Chars', we are given a table of n by m dimensions. This table contains n words, each with m characters, except for the first word which has m - 1 characters. Each character is written on a separate tile. The objective of the game is to rearrange the characters such that row i spells the i-th word in the list, with the blank tile ('_') placed in the top left corner of the board in the end. We can rearrange the tiles by swapping the blank space with any of its 4 diagonal neighboring tiles. Given the list of words and initial state of the board below, where the black space is represented as '_', what is the shortest list of swap actions (reported in python syntax) that can sort the board into the given list of target words? The list must only include the 4 diagonal swap directions: up-right, down-right, up-left, or down-left, representing the direction in ehich the blank space was swpped in. Target words: shrew, bedark, curcas, bender, hocker The initial board: [['e', 's', '_', 'r', 'k', 'w'], ['b', 'c', 'd', 'd', 'r', 'a'], ['c', 'u', 'e', 'c', 'e', 's'], ['b', 'r', 'n', 'h', 'e', 'a'], ['h', 'o', 'e', 'k', 'r', 'r']]
8_puzzle_words
puzzle
4
["down-right", "down-left", "down-right", "up-right", "up-right", "up-left", "down-left", "down-left", "up-left", "down-left", "down-right", "up-right", "up-left", "up-right", "down-right", "down-right", "down-right", "down-left", "up-left", "up-left", "up-left", "down-left", "down-right", "down-right", "up-right", "up-left", "up-left", "up-left"]
28
23.219958066940308
28
4
30
[[["e", "s", "_", "r", "k", "w"], ["b", "c", "d", "d", "r", "a"], ["c", "u", "e", "c", "e", "s"], ["b", "r", "n", "h", "e", "a"], ["h", "o", "e", "k", "r", "r"]]]
[[["e", "s", "_", "r", "k", "w"], ["b", "c", "d", "d", "r", "a"], ["c", "u", "e", "c", "e", "s"], ["b", "r", "n", "h", "e", "a"], ["h", "o", "e", "k", "r", "r"]], ["shrew", "bedark", "curcas", "bender", "hocker"]]
["[['e', 's', '_', 'r', 'k', 'w'], ['b', 'c', 'd', 'd', 'r', 'a'], ['c', 'u', 'e', 'c', 'e', 's'], ['b', 'r', 'n', 'h', 'e', 'a'], ['h', 'o', 'e', 'k', 'r', 'r']]", "['shrew', 'bedark', 'curcas', 'bender', 'hocker']"]
92
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'F'. Our task is to visit city R and city S excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from S and R, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. I H R E G S W Q C A B F J V L I 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 H 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 R 0 1 0 1 1 0 1 0 0 0 1 0 0 1 1 E 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 G 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 S 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 W 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 Q 1 0 0 0 0 1 0 0 1 1 1 0 1 0 0 C 1 1 1 0 1 0 1 0 0 1 0 1 1 1 0 A 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 B 0 0 0 1 0 1 1 0 0 1 0 0 0 0 1 F 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 J 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 V 0 0 0 1 1 0 0 1 0 1 1 0 0 0 0 L 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0
city_directed_graph
pathfinding
15
["F", "H", "S", "J", "S", "Q", "C", "R", "W", "R"]
10
0.05547213554382324
10
15
18
[[[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1], [1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0], [1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 0,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", "J", "V", "L"], "F", "R", "S"]
["[[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1], [1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1], [0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0], [1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0], [1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]]", "['I', 'H', 'R', 'E', 'G', 'S', 'W', 'Q', 'C', 'A', 'B', 'F', 'J', 'V', 'L']", "['F']", "['R', 'S']"]
92
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [19, 11, 35, 3, 12, 23, 42, 45, 8, 12, 32, 82, 39, 12, 45, 12, 40, 38, 28, 6, 32, 37, 39, 9, 43, 12, 38, 4, 42, 44, 41, 37, 83, 5, 38], such that the sum of the chosen coins adds up to 466. 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 {37: 6, 43: 18, 32: 16, 4: 4, 83: 4, 8: 5, 23: 18, 12: 6, 82: 16, 44: 20, 39: 1, 19: 8, 35: 7, 38: 11, 11: 3, 42: 5, 45: 12, 3: 1, 6: 2, 41: 3, 28: 18, 40: 2, 9: 6, 5: 4}, 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
22
[3, 39, 83, 42, 40, 6, 37, 37, 39, 41, 45, 42, 12]
54
0.05336928367614746
13
35
35
[[19, 11, 35, 3, 12, 23, 42, 45, 8, 12, 32, 82, 39, 12, 45, 12, 40, 38, 28, 6, 32, 37, 39, 9, 43, 12, 38, 4, 42, 44, 41, 37, 83, 5, 38]]
[[19, 11, 35, 3, 12, 23, 42, 45, 8, 12, 32, 82, 39, 12, 45, 12, 40, 38, 28, 6, 32, 37, 39, 9, 43, 12, 38, 4, 42, 44, 41, 37, 83, 5, 38], {"37": 6, "43": 18, "32": 16, "4": 4, "83": 4, "8": 5, "23": 18, "12": 6, "82": 16, "44": 20, "39": 1, "19": 8, "35": 7, "38": 11, "11": 3, "42": 5, "45": 12, "3": 1, "6": 2, "41": 3, "28": 18, "40": 2, "9": 6, "5": 4}, 466]
["[19, 11, 35, 3, 12, 23, 42, 45, 8, 12, 32, 82, 39, 12, 45, 12, 40, 38, 28, 6, 32, 37, 39, 9, 43, 12, 38, 4, 42, 44, 41, 37, 83, 5, 38]", "{37: 6, 43: 18, 32: 16, 4: 4, 83: 4, 8: 5, 23: 18, 12: 6, 82: 16, 44: 20, 39: 1, 19: 8, 35: 7, 38: 11, 11: 3, 42: 5, 45: 12, 3: 1, 6: 2, 41: 3, 28: 18, 40: 2, 9: 6, 5: 4}", "466"]
92
The game of 'Sort It' begins with 3 tubes, each filled with 6 balls of different colors. The goal is to sort the balls by color, with each tube containing balls of only one color. Only one ball can be moved at a time, taken from the top of one tube and placed on top of another. The capacity of each tube (maximum number of balls we can fit in each tube) is 9 balls. It is not allowed to place a ball in a tube that already has 9 balls. The solution should be a list of tuples, each containing, first, the index of the tube from which a ball is taken and, second, the index of the tube to which it is moved, indexing from 0. Given the initial state of the tubes, represented by the lists below (with the leftmost item being the color of the topmost ball in each tube), what is the shortest list of move tuples that will result in all the balls being correctly sorted? [['Red', 'Green', 'Blue', 'Red', 'Red', 'Blue'], ['Green', 'Red', 'Green', 'Green', 'Blue', 'Red'], ['Green', 'Blue', 'Green', 'Blue', 'Blue', 'Red']]
color_sorting
sorting
10
[[1, 2], [1, 0], [1, 2], [1, 2], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [0, 2], [0, 1], [0, 2], [0, 2], [0, 2], [0, 2], [0, 2], [0, 2], [1, 0], [1, 0], [1, 0], [1, 2], [1, 0], [2, 1], [2, 1], [2, 1], [2, 0], [2, 0], [1, 2], [1, 2], [0, 1]]
35
174.02124547958374
35
6
18
[[["Red", "Green", "Blue", "Red", "Red", "Blue"], ["Green", "Red", "Green", "Green", "Blue", "Red"], ["Green", "Blue", "Green", "Blue", "Blue", "Red"]], 9]
[[["Red", "Green", "Blue", "Red", "Red", "Blue"], ["Green", "Red", "Green", "Green", "Blue", "Red"], ["Green", "Blue", "Green", "Blue", "Blue", "Red"]], 9]
["[['Red', 'Green', 'Blue', 'Red', 'Red', 'Blue'], ['Green', 'Red', 'Green', 'Green', 'Blue', 'Red'], ['Green', 'Blue', 'Green', 'Blue', 'Blue', 'Red']]", "9"]
92
We have a 4x4 numerical grid, with numbers ranging from 31 to 86 (31 included in the range but 86 is not included). The numbers in each row and column must be strictly increasing or decreasing. This means that either first > second > third > fourth or first < second < third < fourth in each row and column. If a grid cell is marked with an 'x', the number in that position is hidden. The objective is to replace the 'x's with unique integers from the given range, ensuring that each number only appears once in the grid. The replacements must maintain the consecutive order in each row and column. Additionally, the sum of the numbers in the topmost row plus the numbers in the rightmost column plus the numbers in the diagonal connecting the top-left corner of the grid to its bottom-right corner should be minimized. The solution should be given as a list of tuples in Python syntax. Each tuple should represent the replacement of a number with an 'x' number and contain three elements: the row index of the 'x', the column index of the 'x' (both starting from 0), and the value of the number that replaces the 'x'. The initial state of the grid is as follows: Grid: [['85' '73' '59' 'x'] ['x' 'x' '66' '70'] ['x' '59' 'x' 'x'] ['40' '41' '79' '82']]
consecutive_grid
underdetermined_system
11
[[0, 0, 30], [0, 3, 6], [1, 0, 29], [1, 2, 12], [1, 3, 7], [2, 1, 16], [2, 2, 17], [3, 0, 8], [3, 1, 9], [3, 2, 18]]
308
15.29494833946228
10
55
16
["[['', '28', '11', ''], ['', '27', '', ''], ['15', '', '', '46'], ['', '', '', '50']]", 6, 61]
["[['', '28', '11', ''], ['', '27', '', ''], ['15', '', '', '46'], ['', '', '', '50']]", 6, 61]
["[['', '28', '11', ''], ['', '27', '', ''], ['15', '', '', '46'], ['', '', '', '50']]", "6", "61"]
92
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 41 to 92. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 240, 266, None for columns 1 to 2 respectively, and the sums of rows must be None, 298, 222, 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 299. 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' '41' '67' 'x'] ['x' '73' 'x' '91'] ['x' '43' 'x' '76'] ['80' 'x' 'x' '86']]
magic_square
underdetermined_system
7
[[0, 0, 42], [0, 3, 87], [1, 0, 45], [1, 2, 89], [2, 0, 44], [2, 2, 59], [3, 1, 83], [3, 2, 51]]
1057
14.704439878463745
8
36
16
["[['', '41', '67', ''], ['', '73', '', '91'], ['', '43', '', '76'], ['80', '', '', '86']]", 4, 41, 92]
["[['', '41', '67', ''], ['', '73', '', '91'], ['', '43', '', '76'], ['80', '', '', '86']]", 41, 92, [1, 3], [1, 3], [240, 266], [298, 222], 299]
["[['', '41', '67', ''], ['', '73', '', '91'], ['', '43', '', '76'], ['80', '', '', '86']]", "41", "92", "[None, 240, 266, None]", "[None, 298, 222, None]", "299"]
92
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, 14) to his destination workshop at index (2, 4), 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 2, district 2 covering rows 3 to 6, and district 3 covering rows 7 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. [15 1 x 3 x 9 15 8 17 x x 6 x 12 3] [x x x 14 x 7 18 6 14 2 19 15 x x x] [4 3 x 10 8 4 16 13 6 x 18 10 14 x x] [x x x 10 x 14 10 7 x x x 4 2 19 3] [5 x 10 x 18 12 20 15 x x 11 11 1 10 19] [8 x 13 x x x 16 7 3 x x 2 18 11 x] [12 x 15 x x 6 x x x x 18 3 14 3 6] [x 6 13 19 19 x 7 12 18 5 x 1 4 18 11] [5 x 18 x 12 4 3 7 x 16 1 x 16 2 x] [x x x x 18 x x 14 15 1 x x 9 x x] [x 13 x 7 7 x x 16 10 x x x x 8 x] [x x 19 18 8 18 x x 12 x 13 x 17 12 7] [x x x x 7 7 13 17 x x x x x 9 5] [9 x 14 x 9 x 8 x x x 17 4 12 12 12] [8 1 11 x x x x x 15 x x 2 16 x 15]
traffic
pathfinding
7
[[7, 14], [6, 14], [6, 13], [5, 13], [4, 13], [4, 12], [3, 12], [3, 11], [2, 11], [1, 11], [1, 10], [1, 9], [1, 8], [1, 7], [1, 6], [1, 5], [2, 5], [2, 4]]
140
0.030504465103149414
18
4
4
[[["15", "1", "x", "3", "x", "9", "15", "8", "17", "x", "x", "6", "x", "12", "3"], ["x", "x", "x", "14", "x", "7", "18", "6", "14", "2", "19", "15", "x", "x", "x"], ["4", "3", "x", "10", "8", "4", "16", "13", "6", "x", "18", "10", "14", "x", "x"], ["x", "x", "x", "10", "x", "14", "10", "7", "x", "x", "x", "4", "2", "19", "3"], ["5", "x", "10", "x", "18", "12", "20", "15", "x", "x", "11", "11", "1", "10", "19"], ["8", "x", "13", "x", "x", "x", "16", "7", "3", "x", "x", "2", "18", "11", "x"], ["12", "x", "15", "x", "x", "6", "x", "x", "x", "x", "18", "3", "14", "3", "6"], ["x", "6", "13", "19", "19", "x", "7", "12", "18", "5", "x", "1", "4", "18", "11"], ["5", "x", "18", "x", "12", "4", "3", "7", "x", "16", "1", "x", "16", "2", "x"], ["x", "x", "x", "x", "18", "x", "x", "14", "15", "1", "x", "x", "9", "x", "x"], ["x", "13", "x", "7", "7", "x", "x", "16", "10", "x", "x", "x", "x", "8", "x"], ["x", "x", "19", "18", "8", "18", "x", "x", "12", "x", "13", "x", "17", "12", "7"], ["x", "x", "x", "x", "7", "7", "13", "17", "x", "x", "x", "x", "x", "9", "5"], ["9", "x", "14", "x", "9", "x", "8", "x", "x", "x", "17", "4", "12", "12", "12"], ["8", "1", "11", "x", "x", "x", "x", "x", "15", "x", "x", "2", "16", "x", "15"]]]
[[["15", "1", "x", "3", "x", "9", "15", "8", "17", "x", "x", "6", "x", "12", "3"], ["x", "x", "x", "14", "x", "7", "18", "6", "14", "2", "19", "15", "x", "x", "x"], ["4", "3", "x", "10", "8", "4", "16", "13", "6", "x", "18", "10", "14", "x", "x"], ["x", "x", "x", "10", "x", "14", "10", "7", "x", "x", "x", "4", "2", "19", "3"], ["5", "x", "10", "x", "18", "12", "20", "15", "x", "x", "11", "11", "1", "10", "19"], ["8", "x", "13", "x", "x", "x", "16", "7", "3", "x", "x", "2", "18", "11", "x"], ["12", "x", "15", "x", "x", "6", "x", "x", "x", "x", "18", "3", "14", "3", "6"], ["x", "6", "13", "19", "19", "x", "7", "12", "18", "5", "x", "1", "4", "18", "11"], ["5", "x", "18", "x", "12", "4", "3", "7", "x", "16", "1", "x", "16", "2", "x"], ["x", "x", "x", "x", "18", "x", "x", "14", "15", "1", "x", "x", "9", "x", "x"], ["x", "13", "x", "7", "7", "x", "x", "16", "10", "x", "x", "x", "x", "8", "x"], ["x", "x", "19", "18", "8", "18", "x", "x", "12", "x", "13", "x", "17", "12", "7"], ["x", "x", "x", "x", "7", "7", "13", "17", "x", "x", "x", "x", "x", "9", "5"], ["9", "x", "14", "x", "9", "x", "8", "x", "x", "x", "17", "4", "12", "12", "12"], ["8", "1", "11", "x", "x", "x", "x", "x", "15", "x", "x", "2", "16", "x", "15"]], [7, 14], [2, 4], 2, 6]
["[['15', '1', 'x', '3', 'x', '9', '15', '8', '17', 'x', 'x', '6', 'x', '12', '3'], ['x', 'x', 'x', '14', 'x', '7', '18', '6', '14', '2', '19', '15', 'x', 'x', 'x'], ['4', '3', 'x', '10', '8', '4', '16', '13', '6', 'x', '18', '10', '14', 'x', 'x'], ['x', 'x', 'x', '10', 'x', '14', '10', '7', 'x', 'x', 'x', '4', '2', '19', '3'], ['5', 'x', '10', 'x', '18', '12', '20', '15', 'x', 'x', '11', '11', '1', '10', '19'], ['8', 'x', '13', 'x', 'x', 'x', '16', '7', '3', 'x', 'x', '2', '18', '11', 'x'], ['12', 'x', '15', 'x', 'x', '6', 'x', 'x', 'x', 'x', '18', '3', '14', '3', '6'], ['x', '6', '13', '19', '19', 'x', '7', '12', '18', '5', 'x', '1', '4', '18', '11'], ['5', 'x', '18', 'x', '12', '4', '3', '7', 'x', '16', '1', 'x', '16', '2', 'x'], ['x', 'x', 'x', 'x', '18', 'x', 'x', '14', '15', '1', 'x', 'x', '9', 'x', 'x'], ['x', '13', 'x', '7', '7', 'x', 'x', '16', '10', 'x', 'x', 'x', 'x', '8', 'x'], ['x', 'x', '19', '18', '8', '18', 'x', 'x', '12', 'x', '13', 'x', '17', '12', '7'], ['x', 'x', 'x', 'x', '7', '7', '13', '17', 'x', 'x', 'x', 'x', 'x', '9', '5'], ['9', 'x', '14', 'x', '9', 'x', '8', 'x', 'x', 'x', '17', '4', '12', '12', '12'], ['8', '1', '11', 'x', 'x', 'x', 'x', 'x', '15', 'x', 'x', '2', '16', 'x', '15']]", "(7, 14)", "(2, 4)", "2", "6"]
92
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 (10, 0) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (1, 12). 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 1 1 1 0 1 1 1 1 1 0 0 0 0 1 1 0 0 1 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 0 0 0 1 1 0 1 0 0 1 1 1 1 0 1 0 1 0 0 0 0 1 1 1 0 1 1 0 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 0 1 1 0 1 1
trampoline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, 1, 1], [1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1], [0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1]]", "(10, 0)", "(1, 12)", "5"]
92
Given 9 labeled water jugs with capacities 143, 34, 117, 130, 50, 142, 144, 150, 29, 78 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 307, 316, 325, 622 liters of water respectively. The amount of water in each unlabeled bucket can not at any point in time exceed the amount of water in the bucket placed after it. Jugs can only be filled to the top and emptied completely, and the unlabeled buckets cannot be overfilled. An action, represented as a tuple ('+', X, Y) or ('-', X, Y), involves adding to or removing water from the unlabeled bucket numbered Y, using the jug with capacity X. Determine the shortest sequence of actions needed to fill the buckets as specified, and present the solution as a list of action tuples in Python syntax.
water_jug
subset_sum
7
[["+", 143, 4], ["+", 150, 4], ["+", 150, 4], ["+", 150, 4], ["+", 29, 4], ["+", 78, 3], ["+", 117, 3], ["+", 130, 3], ["+", 143, 2], ["+", 144, 2], ["+", 29, 2], ["+", 130, 1], ["+", 143, 1], ["+", 34, 1]]
14
0.04768729209899902
14
80
3
[[143, 34, 117, 130, 50, 142, 144, 150, 29, 78], [307, 316, 325, 622]]
[[143, 34, 117, 130, 50, 142, 144, 150, 29, 78], [307, 316, 325, 622]]
["[143, 34, 117, 130, 50, 142, 144, 150, 29, 78]", "[307, 316, 325, 622]"]
93
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [[94, 87, 69, 81, 4, 79], ['_', 35, 86, 61, 57, 75], [41, 18, 65, 9, 53, 55]]
8_puzzle
puzzle
5
[94, 87, 69, 86, 65, 18, 35, 69, 87, 94, 69, 65, 61, 57, 4, 79, 75, 55, 53, 4, 55, 53]
22
0.032526254653930664
22
4
18
[[[94, 87, 69, 81, 4, 79], ["_", 35, 86, 61, 57, 75], [41, 18, 65, 9, 53, 55]]]
[[[94, 87, 69, 81, 4, 79], ["_", 35, 86, 61, 57, 75], [41, 18, 65, 9, 53, 55]]]
["[[94, 87, 69, 81, 4, 79], ['_', 35, 86, 61, 57, 75], [41, 18, 65, 9, 53, 55]]"]
93
In the game 'Sort the Chars', we are given a table of n by m dimensions. This table contains n words, each with m characters, except for the first word which has m - 1 characters. Each character is written on a separate tile. The objective of the game is to rearrange the characters such that row i spells the i-th word in the list, with the blank tile ('_') placed in the top left corner of the board in the end. We can rearrange the tiles by swapping the blank space with any of its 4 diagonal neighboring tiles. Given the list of words and initial state of the board below, where the black space is represented as '_', what is the shortest list of swap actions (reported in python syntax) that can sort the board into the given list of target words? The list must only include the 4 diagonal swap directions: up-right, down-right, up-left, or down-left, representing the direction in ehich the blank space was swpped in. Target words: helen, adelea, bumble, iodism, trullo The initial board: [['d', 'h', '_', 'l', 'e', 'n'], ['a', 'a', 'e', 'b', 'e', 'u'], ['m', 'u', 'i', 'b', 'e', 'e'], ['i', 'o', 'd', 'm', 's', 'l'], ['t', 'r', 'l', 'l', 'l', 'o']]
8_puzzle_words
puzzle
4
["down-left", "down-left", "down-right", "up-right", "up-right", "up-left", "down-left", "down-right", "down-right", "up-right", "up-right", "up-left", "down-left", "down-left", "down-right", "up-right", "up-left", "down-left", "down-left", "down-right", "up-right", "down-right", "up-right", "up-left", "up-right", "up-left", "down-left", "down-right", "down-left", "up-left", "down-left", "up-left", "up-right", "up-right", "down-right", "down-left", "up-left", "up-left"]
38
502.2531027793884
38
4
30
[[["d", "h", "_", "l", "e", "n"], ["a", "a", "e", "b", "e", "u"], ["m", "u", "i", "b", "e", "e"], ["i", "o", "d", "m", "s", "l"], ["t", "r", "l", "l", "l", "o"]]]
[[["d", "h", "_", "l", "e", "n"], ["a", "a", "e", "b", "e", "u"], ["m", "u", "i", "b", "e", "e"], ["i", "o", "d", "m", "s", "l"], ["t", "r", "l", "l", "l", "o"]], ["helen", "adelea", "bumble", "iodism", "trullo"]]
["[['d', 'h', '_', 'l', 'e', 'n'], ['a', 'a', 'e', 'b', 'e', 'u'], ['m', 'u', 'i', 'b', 'e', 'e'], ['i', 'o', 'd', 'm', 's', 'l'], ['t', 'r', 'l', 'l', 'l', 'o']]", "['helen', 'adelea', 'bumble', 'iodism', 'trullo']"]
93
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'M'. Our task is to visit city Y and city K excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from K and Y, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. C Q T K M B R D J A Y V O N P C 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 Q 1 0 0 1 0 1 1 1 0 0 1 1 0 1 0 T 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 K 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 M 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 B 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 R 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 D 0 0 0 1 0 1 0 0 1 1 0 0 1 1 0 J 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 A 1 0 1 0 0 0 0 1 1 0 1 1 0 0 0 Y 1 0 1 0 0 1 1 0 1 0 0 0 1 0 0 V 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 O 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 N 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 P 1 0 0 0 1 0 0 0 1 1 1 1 1 1 0
city_directed_graph
pathfinding
15
["M", "A", "Y", "B", "D", "K", "P", "Y", "O", "K"]
10
0.10736274719238281
10
15
18
[[[0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0], [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0], [0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0], [1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0], [1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0]], ["C", "Q", "T", "K", "M", "B", "R", "D", "J", "A", "Y", "V", "O", "N", "P"], "Y", "K"]
[[[0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0], [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0,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 1, 0, 1, 1, 0, 0, 0], [1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0], [1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0]]", "['C', 'Q', 'T', 'K', 'M', 'B', 'R', 'D', 'J', 'A', 'Y', 'V', 'O', 'N', 'P']", "['M']", "['Y', 'K']"]
93
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [43, 41, 23, 24, 40, 11, 12, 9, 32, 32, 6, 15, 16, 20, 6, 39, 9, 12, 4, 251, 43, 24, 27, 20, 39, 37, 7, 43, 9, 13, 45, 27, 9, 15, 41, 25], such that the sum of the chosen coins adds up to 471. 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 {9: 7, 32: 17, 24: 17, 15: 11, 4: 3, 39: 18, 41: 9, 25: 14, 27: 5, 40: 5, 43: 8, 11: 9, 20: 1, 45: 2, 16: 15, 251: 12, 37: 10, 13: 1, 23: 1, 7: 1, 12: 1, 6: 5}, 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
23
[7, 45, 20, 12, 23, 12, 251, 40, 20, 41]
34
0.04783797264099121
10
36
36
[[43, 41, 23, 24, 40, 11, 12, 9, 32, 32, 6, 15, 16, 20, 6, 39, 9, 12, 4, 251, 43, 24, 27, 20, 39, 37, 7, 43, 9, 13, 45, 27, 9, 15, 41, 25]]
[[43, 41, 23, 24, 40, 11, 12, 9, 32, 32, 6, 15, 16, 20, 6, 39, 9, 12, 4, 251, 43, 24, 27, 20, 39, 37, 7, 43, 9, 13, 45, 27, 9, 15, 41, 25], {"9": 7, "32": 17, "24": 17, "15": 11, "4": 3, "39": 18, "41": 9, "25": 14, "27": 5, "40": 5, "43": 8, "11": 9, "20": 1, "45": 2, "16": 15, "251": 12, "37": 10, "13": 1, "23": 1, "7": 1, "12": 1, "6": 5}, 471]
["[43, 41, 23, 24, 40, 11, 12, 9, 32, 32, 6, 15, 16, 20, 6, 39, 9, 12, 4, 251, 43, 24, 27, 20, 39, 37, 7, 43, 9, 13, 45, 27, 9, 15, 41, 25]", "{9: 7, 32: 17, 24: 17, 15: 11, 4: 3, 39: 18, 41: 9, 25: 14, 27: 5, 40: 5, 43: 8, 11: 9, 20: 1, 45: 2, 16: 15, 251: 12, 37: 10, 13: 1, 23: 1, 7: 1, 12: 1, 6: 5}", "471"]
93
The game of 'Sort It' begins with 3 tubes, each filled with 6 balls of different colors. The goal is to sort the balls by color, with each tube containing balls of only one color. Only one ball can be moved at a time, taken from the top of one tube and placed on top of another. The capacity of each tube (maximum number of balls we can fit in each tube) is 9 balls. It is not allowed to place a ball in a tube that already has 9 balls. The solution should be a list of tuples, each containing, first, the index of the tube from which a ball is taken and, second, the index of the tube to which it is moved, indexing from 0. Given the initial state of the tubes, represented by the lists below (with the leftmost item being the color of the topmost ball in each tube), what is the shortest list of move tuples that will result in all the balls being correctly sorted? [['Red', 'Green', 'Red', 'Green', 'Blue', 'Red'], ['Red', 'Blue', 'Green', 'Green', 'Blue', 'Blue'], ['Red', 'Blue', 'Blue', 'Green', 'Red', 'Green']]
color_sorting
sorting
10
[[2, 1], [0, 1], [0, 2], [0, 1], [0, 2], [0, 2], [1, 0], [1, 0], [1, 0], [1, 0], [1, 2], [1, 0], [1, 0], [2, 1], [2, 1], [2, 0], [2, 0], [2, 1], [2, 1], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [1, 0], [1, 2]]
27
151.82125544548035
27
6
18
[[["Red", "Green", "Red", "Green", "Blue", "Red"], ["Red", "Blue", "Green", "Green", "Blue", "Blue"], ["Red", "Blue", "Blue", "Green", "Red", "Green"]], 9]
[[["Red", "Green", "Red", "Green", "Blue", "Red"], ["Red", "Blue", "Green", "Green", "Blue", "Blue"], ["Red", "Blue", "Blue", "Green", "Red", "Green"]], 9]
["[['Red', 'Green', 'Red', 'Green', 'Blue', 'Red'], ['Red', 'Blue', 'Green', 'Green', 'Blue', 'Blue'], ['Red', 'Blue', 'Blue', 'Green', 'Red', 'Green']]", "9"]
93
We have a 4x4 numerical grid, with numbers ranging from 36 to 91 (36 included in the range but 91 is not included). The numbers in each row and column must be strictly increasing or decreasing. This means that either first > second > third > fourth or first < second < third < fourth in each row and column. If a grid cell is marked with an 'x', the number in that position is hidden. The objective is to replace the 'x's with unique integers from the given range, ensuring that each number only appears once in the grid. The replacements must maintain the consecutive order in each row and column. Additionally, the sum of the numbers in the topmost row plus the numbers in the rightmost column plus the numbers in the diagonal connecting the top-left corner of the grid to its bottom-right corner should be minimized. The solution should be given as a list of tuples in Python syntax. Each tuple should represent the replacement of a number with an 'x' number and contain three elements: the row index of the 'x', the column index of the 'x' (both starting from 0), and the value of the number that replaces the 'x'. The initial state of the grid is as follows: Grid: [['38' 'x' '50' 'x'] ['x' 'x' '64' '67'] ['54' 'x' '71' '79'] ['x' '59' '89' '90']]
consecutive_grid
underdetermined_system
11
[[0, 0, 62], [0, 1, 63], [0, 3, 76], [1, 1, 64], [2, 0, 52], [2, 1, 65]]
916
0.2937626838684082
6
55
16
["[['', '', '74', ''], ['61', '', '80', '88'], ['', '', '82', '89'], ['51', '75', '83', '90']]", 50, 110]
["[['', '', '74', ''], ['61', '', '80', '88'], ['', '', '82', '89'], ['51', '75', '83', '90']]", 50, 110]
["[['', '', '74', ''], ['61', '', '80', '88'], ['', '', '82', '89'], ['51', '75', '83', '90']]", "50", "110"]
93
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 41 to 92. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 244, 295, None for columns 1 to 2 respectively, and the sums of rows must be None, 266, 261, 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 265. 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: [['53' '57' 'x' 'x'] ['77' '78' 'x' '56'] ['51' '62' '88' 'x'] ['x' 'x' 'x' 'x']]
magic_square
underdetermined_system
8
[[0, 2, 61], [0, 3, 58], [1, 2, 55], [2, 3, 60], [3, 0, 90], [3, 1, 47], [3, 2, 91], [3, 3, 41]]
1025
1.733626127243042
8
36
16
["[['53', '57', '', ''], ['77', '78', '', '56'], ['51', '62', '88', ''], ['', '', '', '']]", 4, 41, 92]
["[['53', '57', '', ''], ['77', '78', '', '56'], ['51', '62', '88', ''], ['', '', '', '']]", 41, 92, [1, 3], [1, 3], [244, 295], [266, 261], 265]
["[['53', '57', '', ''], ['77', '78', '', '56'], ['51', '62', '88', ''], ['', '', '', '']]", "41", "92", "[None, 244, 295, None]", "[None, 266, 261, None]", "265"]
93
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 (4, 14) to his destination workshop at index (7, 1), 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 6, and district 3 covering rows 7 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 x x 2 19 x x 15 x x 2 17 18 18] [x x 2 18 3 17 1 x x x 6 x x 7 9] [x x 2 10 3 x 6 11 5 7 8 17 x 12 6] [x 14 13 9 3 x 18 x 17 16 14 8 9 x 13] [x x x 17 x 16 9 3 1 x 5 20 2 2 6] [8 x 8 x 5 19 12 19 7 1 5 4 11 13 16] [x 6 19 17 20 x x 14 14 x x 3 20 13 3] [12 14 7 1 15 x 8 8 x x x 15 x x x] [x 9 x x 4 7 7 x x 13 7 7 x 6 x] [x x x 11 10 x x x 5 x 7 14 x 19 x] [x 11 18 x 19 x 1 18 1 8 x x x 12 15] [19 x 7 x 9 3 x 7 12 13 19 13 x 9 x] [x 17 9 x 6 x 6 x x 11 x 19 x x x] [4 17 5 x 7 5 17 12 x 16 8 x x 17 x] [15 2 13 x 14 x x 17 x x 1 x 19 1 17]
traffic
pathfinding
7
[[4, 14], [4, 13], [4, 12], [5, 12], [5, 11], [5, 10], [5, 9], [5, 8], [6, 8], [6, 7], [7, 7], [7, 6], [8, 6], [8, 5], [8, 4], [7, 4], [7, 3], [7, 2], [7, 1]]
131
0.028059959411621094
19
4
4
[[["x", "x", "x", "x", "2", "19", "x", "x", "15", "x", "x", "2", "17", "18", "18"], ["x", "x", "2", "18", "3", "17", "1", "x", "x", "x", "6", "x", "x", "7", "9"], ["x", "x", "2", "10", "3", "x", "6", "11", "5", "7", "8", "17", "x", "12", "6"], ["x", "14", "13", "9", "3", "x", "18", "x", "17", "16", "14", "8", "9", "x", "13"], ["x", "x", "x", "17", "x", "16", "9", "3", "1", "x", "5", "20", "2", "2", "6"], ["8", "x", "8", "x", "5", "19", "12", "19", "7", "1", "5", "4", "11", "13", "16"], ["x", "6", "19", "17", "20", "x", "x", "14", "14", "x", "x", "3", "20", "13", "3"], ["12", "14", "7", "1", "15", "x", "8", "8", "x", "x", "x", "15", "x", "x", "x"], ["x", "9", "x", "x", "4", "7", "7", "x", "x", "13", "7", "7", "x", "6", "x"], ["x", "x", "x", "11", "10", "x", "x", "x", "5", "x", "7", "14", "x", "19", "x"], ["x", "11", "18", "x", "19", "x", "1", "18", "1", "8", "x", "x", "x", "12", "15"], ["19", "x", "7", "x", "9", "3", "x", "7", "12", "13", "19", "13", "x", "9", "x"], ["x", "17", "9", "x", "6", "x", "6", "x", "x", "11", "x", "19", "x", "x", "x"], ["4", "17", "5", "x", "7", "5", "17", "12", "x", "16", "8", "x", "x", "17", "x"], ["15", "2", "13", "x", "14", "x", "x", "17", "x", "x", "1", "x", "19", "1", "17"]]]
[[["x", "x", "x", "x", "2", "19", "x", "x", "15", "x", "x", "2", "17", "18", "18"], ["x", "x", "2", "18", "3", "17", "1", "x", "x", "x", "6", "x", "x", "7", "9"], ["x", "x", "2", "10", "3", "x", "6", "11", "5", "7", "8", "17", "x", "12", "6"], ["x", "14", "13", "9", "3", "x", "18", "x", "17", "16", "14", "8", "9", "x", "13"], ["x", "x", "x", "17", "x", "16", "9", "3", "1", "x", "5", "20", "2", "2", "6"], ["8", "x", "8", "x", "5", "19", "12", "19", "7", "1", "5", "4", "11", "13", "16"], ["x", "6", "19", "17", "20", "x", "x", "14", "14", "x", "x", "3", "20", "13", "3"], ["12", "14", "7", "1", "15", "x", "8", "8", "x", "x", "x", "15", "x", "x", "x"], ["x", "9", "x", "x", "4", "7", "7", "x", "x", "13", "7", "7", "x", "6", "x"], ["x", "x", "x", "11", "10", "x", "x", "x", "5", "x", "7", "14", "x", "19", "x"], ["x", "11", "18", "x", "19", "x", "1", "18", "1", "8", "x", "x", "x", "12", "15"], ["19", "x", "7", "x", "9", "3", "x", "7", "12", "13", "19", "13", "x", "9", "x"], ["x", "17", "9", "x", "6", "x", "6", "x", "x", "11", "x", "19", "x", "x", "x"], ["4", "17", "5", "x", "7", "5", "17", "12", "x", "16", "8", "x", "x", "17", "x"], ["15", "2", "13", "x", "14", "x", "x", "17", "x", "x", "1", "x", "19", "1", "17"]], [4, 14], [7, 1], 4, 6]
["[['x', 'x', 'x', 'x', '2', '19', 'x', 'x', '15', 'x', 'x', '2', '17', '18', '18'], ['x', 'x', '2', '18', '3', '17', '1', 'x', 'x', 'x', '6', 'x', 'x', '7', '9'], ['x', 'x', '2', '10', '3', 'x', '6', '11', '5', '7', '8', '17', 'x', '12', '6'], ['x', '14', '13', '9', '3', 'x', '18', 'x', '17', '16', '14', '8', '9', 'x', '13'], ['x', 'x', 'x', '17', 'x', '16', '9', '3', '1', 'x', '5', '20', '2', '2', '6'], ['8', 'x', '8', 'x', '5', '19', '12', '19', '7', '1', '5', '4', '11', '13', '16'], ['x', '6', '19', '17', '20', 'x', 'x', '14', '14', 'x', 'x', '3', '20', '13', '3'], ['12', '14', '7', '1', '15', 'x', '8', '8', 'x', 'x', 'x', '15', 'x', 'x', 'x'], ['x', '9', 'x', 'x', '4', '7', '7', 'x', 'x', '13', '7', '7', 'x', '6', 'x'], ['x', 'x', 'x', '11', '10', 'x', 'x', 'x', '5', 'x', '7', '14', 'x', '19', 'x'], ['x', '11', '18', 'x', '19', 'x', '1', '18', '1', '8', 'x', 'x', 'x', '12', '15'], ['19', 'x', '7', 'x', '9', '3', 'x', '7', '12', '13', '19', '13', 'x', '9', 'x'], ['x', '17', '9', 'x', '6', 'x', '6', 'x', 'x', '11', 'x', '19', 'x', 'x', 'x'], ['4', '17', '5', 'x', '7', '5', '17', '12', 'x', '16', '8', 'x', 'x', '17', 'x'], ['15', '2', '13', 'x', '14', 'x', 'x', '17', 'x', 'x', '1', 'x', '19', '1', '17']]", "(4, 14)", "(7, 1)", "4", "6"]
93
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, 10) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (2, 1). 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 1 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 0 0 1 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 1 1 1 1 0 1 1 0 0 0 0 1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 0 1 0 0 1 1 0 1 0 1 0 1 1 0 0 0 1 1 1 1 0 1 1 0 1 0 1 1 1 0 0 0 1 0 0 1 1 1 1 0 1 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 0 0 1 0 1 0
trampoline_matrix
pathfinding
15
[[14, 10], [14, 9], [14, 8], [13, 7], [13, 6], [12, 5], [11, 4], [11, 3], [10, 2], [9, 1], [8, 1], [7, 1], [6, 1], [6, 0], [5, 0], [4, 0], [3, 0], [2, 0], [2, 1]]
19
0.024536848068237305
19
8
2
["[[1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1], [0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1], [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1], [0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0], [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 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0], [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1], [0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1], [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1], [0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0], [0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1], [0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0], [1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0], [1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1], [0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1], [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0]]", "(14, 10)", "(2, 1)", "5"]
93
Given 9 labeled water jugs with capacities 39, 110, 41, 54, 47, 33, 136, 40, 100 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 192, 459, 473, 493 liters of water respectively. The amount of water in each unlabeled bucket can not at any point in time exceed the amount of water in the bucket placed after it. Jugs can only be filled to the top and emptied completely, and the unlabeled buckets cannot be overfilled. An action, represented as a tuple ('+', X, Y) or ('-', X, Y), involves adding to or removing water from the unlabeled bucket numbered Y, using the jug with capacity X. Determine the shortest sequence of actions needed to fill the buckets as specified, and present the solution as a list of action tuples in Python syntax.
water_jug
subset_sum
7
[["+", 100, 4], ["+", 100, 4], ["+", 47, 4], ["+", 110, 4], ["+", 136, 4], ["+", 47, 3], ["+", 136, 3], ["+", 136, 3], ["+", 54, 3], ["+", 100, 3], ["+", 33, 2], ["+", 136, 2], ["+", 136, 2], ["+", 54, 2], ["+", 100, 2], ["+", 41, 1], ["+", 41, 1], ["+", 110, 1]]
18
0.06568336486816406
18
72
3
[[39, 110, 41, 54, 47, 33, 136, 40, 100], [192, 459, 473, 493]]
[[39, 110, 41, 54, 47, 33, 136, 40, 100], [192, 459, 473, 493]]
["[39, 110, 41, 54, 47, 33, 136, 40, 100]", "[192, 459, 473, 493]"]
94
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [[98, 30, 85, 44, 59, 40], [56, 68, 50, 61, 47, 15], [37, 48, 24, 81, 22, '_']]
8_puzzle
puzzle
5
[15, 40, 59, 44, 61, 50, 68, 30, 85, 68, 50, 81, 24, 48, 30, 50, 81, 47, 44, 61, 68, 81, 48, 24, 22, 15]
26
0.07562923431396484
26
4
18
[[[98, 30, 85, 44, 59, 40], [56, 68, 50, 61, 47, 15], [37, 48, 24, 81, 22, "_"]]]
[[[98, 30, 85, 44, 59, 40], [56, 68, 50, 61, 47, 15], [37, 48, 24, 81, 22, "_"]]]
["[[98, 30, 85, 44, 59, 40], [56, 68, 50, 61, 47, 15], [37, 48, 24, 81, 22, '_']]"]
94
In the game 'Sort the Chars', we are given a table of n by m dimensions. This table contains n words, each with m characters, except for the first word which has m - 1 characters. Each character is written on a separate tile. The objective of the game is to rearrange the characters such that row i spells the i-th word in the list, with the blank tile ('_') placed in the top left corner of the board in the end. We can rearrange the tiles by swapping the blank space with any of its 4 diagonal neighboring tiles. Given the list of words and initial state of the board below, where the black space is represented as '_', what is the shortest list of swap actions (reported in python syntax) that can sort the board into the given list of target words? The list must only include the 4 diagonal swap directions: up-right, down-right, up-left, or down-left, representing the direction in ehich the blank space was swpped in. Target words: drunk, armure, diglot, caudal, mirach The initial board: [['_', 'd', 'a', 'u', 'n', 'k'], ['a', 'r', 'm', 'r', 'r', 'e'], ['d', 'i', 'u', 'l', 'l', 't'], ['c', 'd', 'u', 'r', 'a', 'c'], ['m', 'i', 'g', 'a', 'o', 'h']]
8_puzzle_words
puzzle
4
["down-right", "up-right", "down-right", "down-left", "down-left", "up-left", "up-right", "down-right", "down-left", "down-right", "up-right", "down-right", "up-right", "up-left", "down-left", "up-left", "down-left", "up-left", "up-right", "up-left"]
20
0.9841225147247314
20
4
30
[[["_", "d", "a", "u", "n", "k"], ["a", "r", "m", "r", "r", "e"], ["d", "i", "u", "l", "l", "t"], ["c", "d", "u", "r", "a", "c"], ["m", "i", "g", "a", "o", "h"]]]
[[["_", "d", "a", "u", "n", "k"], ["a", "r", "m", "r", "r", "e"], ["d", "i", "u", "l", "l", "t"], ["c", "d", "u", "r", "a", "c"], ["m", "i", "g", "a", "o", "h"]], ["drunk", "armure", "diglot", "caudal", "mirach"]]
["[['_', 'd', 'a', 'u', 'n', 'k'], ['a', 'r', 'm', 'r', 'r', 'e'], ['d', 'i', 'u', 'l', 'l', 't'], ['c', 'd', 'u', 'r', 'a', 'c'], ['m', 'i', 'g', 'a', 'o', 'h']]", "['drunk', 'armure', 'diglot', 'caudal', 'mirach']"]
94
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'I'. Our task is to visit city H and city R excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from R and H, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. X T R O M U I P Z F V H Q J B X 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 T 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 R 0 0 0 1 0 0 1 0 1 0 1 0 0 0 0 O 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 M 0 1 0 1 0 1 0 0 0 0 0 1 0 0 0 U 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 I 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 P 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 Z 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 F 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 V 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 H 1 0 0 0 1 0 0 0 1 1 1 0 1 0 0 Q 0 1 1 0 0 1 0 1 0 0 0 1 0 0 0 J 1 0 1 1 1 0 0 1 1 1 0 0 1 0 0 B 1 1 0 0 0 1 0 1 1 1 1 1 0 0 0
city_directed_graph
pathfinding
15
["I", "B", "H", "F", "R", "O", "M", "H", "Q", "R"]
10
0.04136967658996582
10
15
18
[[[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0], [1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0]], ["X", "T", "R", "O", "M", "U", "I", "P", "Z", "F", "V", "H", "Q", "J", "B"], "H", "R"]
[[[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0], [1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0]], ["X", "T", "R", "O", "M", "U", "I", "P", "Z", "F", "V", "H", "Q", "J", "B"], "I", "H", "R"]
["[[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0], [1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0]]", "['X', 'T', 'R', 'O', 'M', 'U', 'I', 'P', 'Z', 'F', 'V', 'H', 'Q', 'J', 'B']", "['I']", "['H', 'R']"]
94
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [21, 13, 10, 18, 21, 43, 42, 29, 14, 19, 9, 2, 15, 19, 32, 45, 24, 31, 25, 7, 21, 24, 29, 29, 4, 36, 29, 19, 29, 12, 3, 44, 40, 46, 33, 3, 28, 44, 25, 6, 36, 3, 4, 19, 31], such that the sum of the chosen coins adds up to 474. 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: 3, 9: 7, 13: 11, 19: 11, 36: 17, 32: 11, 46: 1, 4: 3, 21: 14, 3: 1, 18: 5, 29: 18, 12: 9, 2: 2, 15: 14, 43: 11, 24: 5, 25: 15, 14: 10, 42: 11, 44: 7, 31: 11, 40: 2, 33: 10, 45: 20, 7: 6, 10: 3, 28: 5}, 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
24
[46, 44, 40, 28, 24, 2, 3, 3, 3, 33, 24, 18, 43, 42, 45, 44, 32]
105
0.08423256874084473
17
45
45
[[21, 13, 10, 18, 21, 43, 42, 29, 14, 19, 9, 2, 15, 19, 32, 45, 24, 31, 25, 7, 21, 24, 29, 29, 4, 36, 29, 19, 29, 12, 3, 44, 40, 46, 33, 3, 28, 44, 25, 6, 36, 3, 4, 19, 31]]
[[21, 13, 10, 18, 21, 43, 42, 29, 14, 19, 9, 2, 15, 19, 32, 45, 24, 31, 25, 7, 21, 24, 29, 29, 4, 36, 29, 19, 29, 12, 3, 44, 40, 46, 33, 3, 28, 44, 25, 6, 36, 3, 4, 19, 31], {"6": 3, "9": 7, "13": 11, "19": 11, "36": 17, "32": 11, "46": 1, "4": 3, "21": 14, "3": 1, "18": 5, "29": 18, "12": 9, "2": 2, "15": 14, "43": 11, "24": 5, "25": 15, "14": 10, "42": 11, "44": 7, "31": 11, "40": 2, "33": 10, "45": 20, "7": 6, "10": 3, "28": 5}, 474]
["[21, 13, 10, 18, 21, 43, 42, 29, 14, 19, 9, 2, 15, 19, 32, 45, 24, 31, 25, 7, 21, 24, 29, 29, 4, 36, 29, 19, 29, 12, 3, 44, 40, 46, 33, 3, 28, 44, 25, 6, 36, 3, 4, 19, 31]", "{6: 3, 9: 7, 13: 11, 19: 11, 36: 17, 32: 11, 46: 1, 4: 3, 21: 14, 3: 1, 18: 5, 29: 18, 12: 9, 2: 2, 15: 14, 43: 11, 24: 5, 25: 15, 14: 10, 42: 11, 44: 7, 31: 11, 40: 2, 33: 10, 45: 20, 7: 6, 10: 3, 28: 5}", "474"]
94
The game of 'Sort It' begins with 3 tubes, each filled with 6 balls of different colors. The goal is to sort the balls by color, with each tube containing balls of only one color. Only one ball can be moved at a time, taken from the top of one tube and placed on top of another. The capacity of each tube (maximum number of balls we can fit in each tube) is 9 balls. It is not allowed to place a ball in a tube that already has 9 balls. The solution should be a list of tuples, each containing, first, the index of the tube from which a ball is taken and, second, the index of the tube to which it is moved, indexing from 0. Given the initial state of the tubes, represented by the lists below (with the leftmost item being the color of the topmost ball in each tube), what is the shortest list of move tuples that will result in all the balls being correctly sorted? [['Red', 'Green', 'Blue', 'Blue', 'Green', 'Blue'], ['Red', 'Green', 'Green', 'Blue', 'Green', 'Blue'], ['Red', 'Red', 'Blue', 'Red', 'Green', 'Red']]
color_sorting
sorting
10
[[1, 0], [2, 0], [2, 0], [2, 1], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [1, 0], [1, 2], [1, 2], [1, 0], [1, 0], [1, 2], [1, 0], [1, 2], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [2, 0], [1, 2], [1, 0], [1, 0], [2, 1], [2, 0], [2, 0]]
33
79.31269884109497
33
6
18
[[["Red", "Green", "Blue", "Blue", "Green", "Blue"], ["Red", "Green", "Green", "Blue", "Green", "Blue"], ["Red", "Red", "Blue", "Red", "Green", "Red"]], 9]
[[["Red", "Green", "Blue", "Blue", "Green", "Blue"], ["Red", "Green", "Green", "Blue", "Green", "Blue"], ["Red", "Red", "Blue", "Red", "Green", "Red"]], 9]
["[['Red', 'Green', 'Blue', 'Blue', 'Green', 'Blue'], ['Red', 'Green', 'Green', 'Blue', 'Green', 'Blue'], ['Red', 'Red', 'Blue', 'Red', 'Green', 'Red']]", "9"]
94
We have a 4x4 numerical grid, with numbers ranging from 39 to 94 (39 included in the range but 94 is not included). The numbers in each row and column must be strictly increasing or decreasing. This means that either first > second > third > fourth or first < second < third < fourth in each row and column. If a grid cell is marked with an 'x', the number in that position is hidden. The objective is to replace the 'x's with unique integers from the given range, ensuring that each number only appears once in the grid. The replacements must maintain the consecutive order in each row and column. Additionally, the sum of the numbers in the topmost row plus the numbers in the rightmost column plus the numbers in the diagonal connecting the top-left corner of the grid to its bottom-right corner should be minimized. The solution should be given as a list of tuples in Python syntax. Each tuple should represent the replacement of a number with an 'x' number and contain three elements: the row index of the 'x', the column index of the 'x' (both starting from 0), and the value of the number that replaces the 'x'. The initial state of the grid is as follows: Grid: [['91' '57' 'x' '45'] ['41' '49' 'x' 'x'] ['x' 'x' '49' 'x'] ['x' '46' '47' '73']]
consecutive_grid
underdetermined_system
12
[[0, 0, 24], [1, 0, 23], [1, 1, 37], [1, 3, 72], [2, 0, 22], [3, 2, 54]]
679
0.5468931198120117
6
55
16
["[['', '36', '71', '79'], ['', '', '69', ''], ['', '50', '63', '70'], ['21', '53', '', '62']]", 20, 80]
["[['', '36', '71', '79'], ['', '', '69', ''], ['', '50', '63', '70'], ['21', '53', '', '62']]", 20, 80]
["[['', '36', '71', '79'], ['', '', '69', ''], ['', '50', '63', '70'], ['21', '53', '', '62']]", "20", "80"]
94
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 41 to 92. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 267, 236, None for columns 1 to 2 respectively, and the sums of rows must be None, 270, 234, 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 301. 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: [['48' 'x' 'x' 'x'] ['54' 'x' 'x' 'x'] ['x' '64' '44' '83'] ['82' '68' '51' 'x']]
magic_square
underdetermined_system
8
[[0, 1, 49], [0, 2, 52], [0, 3, 66], [1, 1, 86], [1, 2, 89], [1, 3, 41], [2, 0, 43], [3, 3, 42]]
962
2.9558627605438232
8
36
16
["[['48', '', '', ''], ['54', '', '', ''], ['', '64', '44', '83'], ['82', '68', '51', '']]", 4, 41, 92]
["[['48', '', '', ''], ['54', '', '', ''], ['', '64', '44', '83'], ['82', '68', '51', '']]", 41, 92, [1, 3], [1, 3], [267, 236], [270, 234], 301]
["[['48', '', '', ''], ['54', '', '', ''], ['', '64', '44', '83'], ['82', '68', '51', '']]", "41", "92", "[None, 267, 236, None]", "[None, 270, 234, None]", "301"]
94
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 (3, 2) to his destination workshop at index (7, 13), 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 2, district 2 covering rows 3 to 6, and district 3 covering rows 7 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 2 x 12 3 8 x 1 5 x x 14 x 5 x] [5 x x 9 19 10 10 x x 14 16 x x 17 x] [7 4 7 18 2 7 16 x 7 x 9 x x 6 x] [9 x 14 x x 14 7 9 18 11 14 8 13 14 15] [8 4 x 17 x 7 15 x x 19 x 10 x 12 13] [7 11 5 6 x 13 x x 15 4 9 17 19 6 8] [13 x x x x x x x 4 10 x 7 7 17 9] [x x 6 x x 17 12 11 x x x 10 15 14 x] [16 x 5 19 x 19 x 4 11 16 x x 12 x x] [x x 14 x x 19 x x 4 13 7 x x x 8] [x 4 x 13 7 14 x x 2 15 9 11 x x x] [x x x x x 19 x 6 2 x x x 4 7 x] [17 12 10 3 5 18 x x x 11 x 19 13 x x] [1 x 5 x 17 x 17 x 7 18 x x 8 x x] [x x x x x x 2 9 x 10 3 x x 15 2]
traffic
pathfinding
7
[[3, 2], [2, 2], [2, 3], [2, 4], [2, 5], [3, 5], [3, 6], [3, 7], [3, 8], [3, 9], [3, 10], [3, 11], [4, 11], [5, 11], [6, 11], [6, 12], [7, 12], [7, 13]]
185
0.026812314987182617
18
4
4
[[["x", "2", "x", "12", "3", "8", "x", "1", "5", "x", "x", "14", "x", "5", "x"], ["5", "x", "x", "9", "19", "10", "10", "x", "x", "14", "16", "x", "x", "17", "x"], ["7", "4", "7", "18", "2", "7", "16", "x", "7", "x", "9", "x", "x", "6", "x"], ["9", "x", "14", "x", "x", "14", "7", "9", "18", "11", "14", "8", "13", "14", "15"], ["8", "4", "x", "17", "x", "7", "15", "x", "x", "19", "x", "10", "x", "12", "13"], ["7", "11", "5", "6", "x", "13", "x", "x", "15", "4", "9", "17", "19", "6", "8"], ["13", "x", "x", "x", "x", "x", "x", "x", "4", "10", "x", "7", "7", "17", "9"], ["x", "x", "6", "x", "x", "17", "12", "11", "x", "x", "x", "10", "15", "14", "x"], ["16", "x", "5", "19", "x", "19", "x", "4", "11", "16", "x", "x", "12", "x", "x"], ["x", "x", "14", "x", "x", "19", "x", "x", "4", "13", "7", "x", "x", "x", "8"], ["x", "4", "x", "13", "7", "14", "x", "x", "2", "15", "9", "11", "x", "x", "x"], ["x", "x", "x", "x", "x", "19", "x", "6", "2", "x", "x", "x", "4", "7", "x"], ["17", "12", "10", "3", "5", "18", "x", "x", "x", "11", "x", "19", "13", "x", "x"], ["1", "x", "5", "x", "17", "x", "17", "x", "7", "18", "x", "x", "8", "x", "x"], ["x", "x", "x", "x", "x", "x", "2", "9", "x", "10", "3", "x", "x", "15", "2"]]]
[[["x", "2", "x", "12", "3", "8", "x", "1", "5", "x", "x", "14", "x", "5", "x"], ["5", "x", "x", "9", "19", "10", "10", "x", "x", "14", "16", "x", "x", "17", "x"], ["7", "4", "7", "18", "2", "7", "16", "x", "7", "x", "9", "x", "x", "6", "x"], ["9", "x", "14", "x", "x", "14", "7", "9", "18", "11", "14", "8", "13", "14", "15"], ["8", "4", "x", "17", "x", "7", "15", "x", "x", "19", "x", "10", "x", "12", "13"], ["7", "11", "5", "6", "x", "13", "x", "x", "15", "4", "9", "17", "19", "6", "8"], ["13", "x", "x", "x", "x", "x", "x", "x", "4", "10", "x", "7", "7", "17", "9"], ["x", "x", "6", "x", "x", "17", "12", "11", "x", "x", "x", "10", "15", "14", "x"], ["16", "x", "5", "19", "x", "19", "x", "4", "11", "16", "x", "x", "12", "x", "x"], ["x", "x", "14", "x", "x", "19", "x", "x", "4", "13", "7", "x", "x", "x", "8"], ["x", "4", "x", "13", "7", "14", "x", "x", "2", "15", "9", "11", "x", "x", "x"], ["x", "x", "x", "x", "x", "19", "x", "6", "2", "x", "x", "x", "4", "7", "x"], ["17", "12", "10", "3", "5", "18", "x", "x", "x", "11", "x", "19", "13", "x", "x"], ["1", "x", "5", "x", "17", "x", "17", "x", "7", "18", "x", "x", "8", "x", "x"], ["x", "x", "x", "x", "x", "x", "2", "9", "x", "10", "3", "x", "x", "15", "2"]], [3, 2], [7, 13], 2, 6]
["[['x', '2', 'x', '12', '3', '8', 'x', '1', '5', 'x', 'x', '14', 'x', '5', 'x'], ['5', 'x', 'x', '9', '19', '10', '10', 'x', 'x', '14', '16', 'x', 'x', '17', 'x'], ['7', '4', '7', '18', '2', '7', '16', 'x', '7', 'x', '9', 'x', 'x', '6', 'x'], ['9', 'x', '14', 'x', 'x', '14', '7', '9', '18', '11', '14', '8', '13', '14', '15'], ['8', '4', 'x', '17', 'x', '7', '15', 'x', 'x', '19', 'x', '10', 'x', '12', '13'], ['7', '11', '5', '6', 'x', '13', 'x', 'x', '15', '4', '9', '17', '19', '6', '8'], ['13', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '4', '10', 'x', '7', '7', '17', '9'], ['x', 'x', '6', 'x', 'x', '17', '12', '11', 'x', 'x', 'x', '10', '15', '14', 'x'], ['16', 'x', '5', '19', 'x', '19', 'x', '4', '11', '16', 'x', 'x', '12', 'x', 'x'], ['x', 'x', '14', 'x', 'x', '19', 'x', 'x', '4', '13', '7', 'x', 'x', 'x', '8'], ['x', '4', 'x', '13', '7', '14', 'x', 'x', '2', '15', '9', '11', 'x', 'x', 'x'], ['x', 'x', 'x', 'x', 'x', '19', 'x', '6', '2', 'x', 'x', 'x', '4', '7', 'x'], ['17', '12', '10', '3', '5', '18', 'x', 'x', 'x', '11', 'x', '19', '13', 'x', 'x'], ['1', 'x', '5', 'x', '17', 'x', '17', 'x', '7', '18', 'x', 'x', '8', 'x', 'x'], ['x', 'x', 'x', 'x', 'x', 'x', '2', '9', 'x', '10', '3', 'x', 'x', '15', '2']]", "(3, 2)", "(7, 13)", "2", "6"]
94
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 (13, 1) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (4, 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 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 0 0 1 0 1 1 1 1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 1 0 0 1 1 1 0 0 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 1 0 1 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 1 0
trampoline_matrix
pathfinding
15
[[13, 1], [12, 2], [11, 3], [10, 4], [10, 5], [10, 6], [10, 7], [9, 8], [8, 8], [8, 9], [8, 10], [7, 11], [6, 11], [6, 12], [6, 13], [5, 13], [4, 13]]
17
0.023047924041748047
17
8
2
["[[1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0], [1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1], [1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1], [0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0], [1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0], [0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1], [0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0], [0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0], [0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1], [1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0]]", 5]
["[[1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1,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, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1], [0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0], [0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0], [0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1], [1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0]]", "(13, 1)", "(4, 13)", "5"]
94
Given 9 labeled water jugs with capacities 81, 56, 41, 88, 137, 14, 149, 120, 87, 104 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 377, 456, 512, 541 liters of water respectively. The amount of water in each unlabeled bucket can not at any point in time exceed the amount of water in the bucket placed after it. Jugs can only be filled to the top and emptied completely, and the unlabeled buckets cannot be overfilled. An action, represented as a tuple ('+', X, Y) or ('-', X, Y), involves adding to or removing water from the unlabeled bucket numbered Y, using the jug with capacity X. Determine the shortest sequence of actions needed to fill the buckets as specified, and present the solution as a list of action tuples in Python syntax.
water_jug
subset_sum
7
[["+", 81, 4], ["+", 149, 4], ["+", 149, 4], ["+", 81, 4], ["+", 81, 4], ["+", 81, 3], ["+", 120, 3], ["+", 149, 3], ["+", 81, 3], ["+", 81, 3], ["+", 41, 2], ["+", 137, 2], ["+", 149, 2], ["+", 88, 2], ["+", 41, 2], ["+", 120, 1], ["+", 120, 1], ["+", 137, 1]]
18
0.09543561935424805
18
80
3
[[81, 56, 41, 88, 137, 14, 149, 120, 87, 104], [377, 456, 512, 541]]
[[81, 56, 41, 88, 137, 14, 149, 120, 87, 104], [377, 456, 512, 541]]
["[81, 56, 41, 88, 137, 14, 149, 120, 87, 104]", "[377, 456, 512, 541]"]
95
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [[92, 72, 91, 79, 62, 24], [93, 67, 65, 63, 83, 74], [41, 34, 29, 27, 58, '_']]
8_puzzle
puzzle
5
[58, 27, 63, 65, 67, 72, 92, 93, 72, 67, 65, 83, 62, 24, 74, 62, 24, 79, 83, 63, 27, 24, 62, 58]
24
0.20434069633483887
24
4
18
[[[92, 72, 91, 79, 62, 24], [93, 67, 65, 63, 83, 74], [41, 34, 29, 27, 58, "_"]]]
[[[92, 72, 91, 79, 62, 24], [93, 67, 65, 63, 83, 74], [41, 34, 29, 27, 58, "_"]]]
["[[92, 72, 91, 79, 62, 24], [93, 67, 65, 63, 83, 74], [41, 34, 29, 27, 58, '_']]"]
95
In the game 'Sort the Chars', we are given a table of n by m dimensions. This table contains n words, each with m characters, except for the first word which has m - 1 characters. Each character is written on a separate tile. The objective of the game is to rearrange the characters such that row i spells the i-th word in the list, with the blank tile ('_') placed in the top left corner of the board in the end. We can rearrange the tiles by swapping the blank space with any of its 4 diagonal neighboring tiles. Given the list of words and initial state of the board below, where the black space is represented as '_', what is the shortest list of swap actions (reported in python syntax) that can sort the board into the given list of target words? The list must only include the 4 diagonal swap directions: up-right, down-right, up-left, or down-left, representing the direction in ehich the blank space was swpped in. Target words: tuner, myrtol, soldan, elvira, herman The initial board: [['y', 't', 's', 'n', 'a', 'r'], ['m', 'r', 'r', 't', 'o', 'e'], ['l', 'o', '_', 'd', 'l', 'n'], ['e', 'u', 'v', 'i', 'r', 'a'], ['h', 'e', 'l', 'm', 'a', 'n']]
8_puzzle_words
puzzle
4
["up-left", "up-right", "down-right", "up-right", "down-right", "down-left", "down-left", "up-left", "down-left", "up-left", "up-right", "down-right", "down-left", "down-right", "up-right", "up-right", "up-left", "up-left", "down-left", "up-left"]
20
0.4562370777130127
20
4
30
[[["y", "t", "s", "n", "a", "r"], ["m", "r", "r", "t", "o", "e"], ["l", "o", "_", "d", "l", "n"], ["e", "u", "v", "i", "r", "a"], ["h", "e", "l", "m", "a", "n"]]]
[[["y", "t", "s", "n", "a", "r"], ["m", "r", "r", "t", "o", "e"], ["l", "o", "_", "d", "l", "n"], ["e", "u", "v", "i", "r", "a"], ["h", "e", "l", "m", "a", "n"]], ["tuner", "myrtol", "soldan", "elvira", "herman"]]
["[['y', 't', 's', 'n', 'a', 'r'], ['m', 'r', 'r', 't', 'o', 'e'], ['l', 'o', '_', 'd', 'l', 'n'], ['e', 'u', 'v', 'i', 'r', 'a'], ['h', 'e', 'l', 'm', 'a', 'n']]", "['tuner', 'myrtol', 'soldan', 'elvira', 'herman']"]
95
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'C'. Our task is to visit city E and city Q excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from Q and E, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. E K G C U A J O N R W M B H Q E 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 K 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 G 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 C 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 U 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 A 0 0 0 1 1 0 0 1 1 0 1 0 0 0 0 J 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 O 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 N 0 1 1 0 1 0 1 0 0 0 0 0 0 0 1 R 0 0 1 0 0 0 1 1 0 0 0 1 1 0 1 W 1 0 1 1 0 1 1 0 0 0 0 1 0 1 0 M 0 0 0 1 1 1 0 1 0 0 0 0 0 0 0 B 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 H 1 1 0 0 0 1 0 0 0 0 0 1 1 0 0 Q 1 0 1 1 1 0 0 0 0 0 0 1 1 1 0
city_directed_graph
pathfinding
15
["C", "O", "N", "Q", "E", "R", "Q", "E"]
8
0.034786224365234375
8
15
18
[[[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0], [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0], [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0], [0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0], [1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0]], ["E", "K", "G", "C", "U", "A", "J", "O", "N", "R", "W", "M", "B", "H", "Q"], "E", "Q"]
[[[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 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, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0], [0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0], [1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0]]", "['E', 'K', 'G', 'C', 'U', 'A', 'J', 'O', 'N', 'R', 'W', 'M', 'B', 'H', 'Q']", "['C']", "['E', 'Q']"]
95
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [26, 8, 19, 9, 36, 23, 42, 40, 13, 34, 40, 25, 11, 38, 10, 41, 19, 34, 91, 18, 14, 27, 14, 43, 42, 13, 2, 27, 90, 13, 3, 4, 44, 7, 48, 40, 35, 40, 10, 12, 25], such that the sum of the chosen coins adds up to 488. 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 {44: 20, 11: 4, 19: 3, 4: 4, 10: 3, 14: 9, 90: 18, 48: 12, 91: 5, 8: 4, 7: 5, 9: 5, 12: 2, 42: 18, 36: 6, 35: 10, 34: 12, 25: 7, 27: 1, 3: 2, 26: 15, 40: 8, 43: 1, 18: 8, 23: 1, 13: 3, 41: 8, 38: 13, 2: 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
25
[23, 27, 27, 12, 19, 91, 90, 36, 41, 40, 43, 10, 19, 10]
63
0.06218409538269043
14
41
41
[[26, 8, 19, 9, 36, 23, 42, 40, 13, 34, 40, 25, 11, 38, 10, 41, 19, 34, 91, 18, 14, 27, 14, 43, 42, 13, 2, 27, 90, 13, 3, 4, 44, 7, 48, 40, 35, 40, 10, 12, 25]]
[[26, 8, 19, 9, 36, 23, 42, 40, 13, 34, 40, 25, 11, 38, 10, 41, 19, 34, 91, 18, 14, 27, 14, 43, 42, 13, 2, 27, 90, 13, 3, 4, 44, 7, 48, 40, 35, 40, 10, 12, 25], {"44": 20, "11": 4, "19": 3, "4": 4, "10": 3, "14": 9, "90": 18, "48": 12, "91": 5, "8": 4, "7": 5, "9": 5, "12": 2, "42": 18, "36": 6, "35": 10, "34": 12, "25": 7, "27": 1, "3": 2, "26": 15, "40": 8, "43": 1, "18": 8, "23": 1, "13": 3, "41": 8, "38": 13, "2": 2}, 488]
["[26, 8, 19, 9, 36, 23, 42, 40, 13, 34, 40, 25, 11, 38, 10, 41, 19, 34, 91, 18, 14, 27, 14, 43, 42, 13, 2, 27, 90, 13, 3, 4, 44, 7, 48, 40, 35, 40, 10, 12, 25]", "{44: 20, 11: 4, 19: 3, 4: 4, 10: 3, 14: 9, 90: 18, 48: 12, 91: 5, 8: 4, 7: 5, 9: 5, 12: 2, 42: 18, 36: 6, 35: 10, 34: 12, 25: 7, 27: 1, 3: 2, 26: 15, 40: 8, 43: 1, 18: 8, 23: 1, 13: 3, 41: 8, 38: 13, 2: 2}", "488"]
95
The game of 'Sort It' begins with 3 tubes, each filled with 6 balls of different colors. The goal is to sort the balls by color, with each tube containing balls of only one color. Only one ball can be moved at a time, taken from the top of one tube and placed on top of another. The capacity of each tube (maximum number of balls we can fit in each tube) is 9 balls. It is not allowed to place a ball in a tube that already has 9 balls. The solution should be a list of tuples, each containing, first, the index of the tube from which a ball is taken and, second, the index of the tube to which it is moved, indexing from 0. Given the initial state of the tubes, represented by the lists below (with the leftmost item being the color of the topmost ball in each tube), what is the shortest list of move tuples that will result in all the balls being correctly sorted? [['Green', 'Green', 'Green', 'Red', 'Blue', 'Blue'], ['Blue', 'Red', 'Red', 'Red', 'Green', 'Green'], ['Blue', 'Green', 'Blue', 'Red', 'Red', 'Blue']]
color_sorting
sorting
10
[[2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [2, 0], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [2, 0], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [0, 2], [1, 0], [1, 2], [1, 0]]
27
145.94300484657288
27
6
18
[[["Green", "Green", "Green", "Red", "Blue", "Blue"], ["Blue", "Red", "Red", "Red", "Green", "Green"], ["Blue", "Green", "Blue", "Red", "Red", "Blue"]], 9]
[[["Green", "Green", "Green", "Red", "Blue", "Blue"], ["Blue", "Red", "Red", "Red", "Green", "Green"], ["Blue", "Green", "Blue", "Red", "Red", "Blue"]], 9]
["[['Green', 'Green', 'Green', 'Red', 'Blue', 'Blue'], ['Blue', 'Red', 'Red', 'Red', 'Green', 'Green'], ['Blue', 'Green', 'Blue', 'Red', 'Red', 'Blue']]", "9"]
95
We have a 4x4 numerical grid, with numbers ranging from 39 to 94 (39 included in the range but 94 is not included). The numbers in each row and column must be strictly increasing or decreasing. This means that either first > second > third > fourth or first < second < third < fourth in each row and column. If a grid cell is marked with an 'x', the number in that position is hidden. The objective is to replace the 'x's with unique integers from the given range, ensuring that each number only appears once in the grid. The replacements must maintain the consecutive order in each row and column. Additionally, the sum of the numbers in the topmost row plus the numbers in the rightmost column plus the numbers in the diagonal connecting the top-left corner of the grid to its bottom-right corner should be minimized. The solution should be given as a list of tuples in Python syntax. Each tuple should represent the replacement of a number with an 'x' number and contain three elements: the row index of the 'x', the column index of the 'x' (both starting from 0), and the value of the number that replaces the 'x'. The initial state of the grid is as follows: Grid: [['71' 'x' '57' 'x'] ['67' '68' 'x' '73'] ['51' 'x' '72' 'x'] ['50' 'x' '75' 'x']]
consecutive_grid
underdetermined_system
12
[[0, 0, 13], [0, 1, 14], [0, 2, 43], [0, 3, 47], [2, 1, 33], [3, 0, 28]]
418
1.5906620025634766
6
55
16
["[['', '', '', ''], ['25', '32', '40', '46'], ['27', '', '39', '42'], ['', '34', '38', '41']]", 13, 73]
["[['', '', '', ''], ['25', '32', '40', '46'], ['27', '', '39', '42'], ['', '34', '38', '41']]", 13, 73]
["[['', '', '', ''], ['25', '32', '40', '46'], ['27', '', '39', '42'], ['', '34', '38', '41']]", "13", "73"]
95
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 41 to 92. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 262, 272, None for columns 1 to 2 respectively, and the sums of rows must be None, 291, 301, 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 256. 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: [['68' '50' '47' '65'] ['x' '91' 'x' '71'] ['x' 'x' 'x' '60'] ['x' 'x' 'x' '84']]
magic_square
underdetermined_system
8
[[1, 0, 42], [1, 2, 87], [2, 0, 88], [2, 1, 63], [2, 2, 90], [3, 0, 41], [3, 1, 58], [3, 2, 48]]
1053
13.726203918457031
8
36
16
["[['68', '50', '47', '65'], ['', '91', '', '71'], ['', '', '', '60'], ['', '', '', '84']]", 4, 41, 92]
["[['68', '50', '47', '65'], ['', '91', '', '71'], ['', '', '', '60'], ['', '', '', '84']]", 41, 92, [1, 3], [1, 3], [262, 272], [291, 301], 256]
["[['68', '50', '47', '65'], ['', '91', '', '71'], ['', '', '', '60'], ['', '', '', '84']]", "41", "92", "[None, 262, 272, None]", "[None, 291, 301, None]", "256"]
95
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 (5, 2) to his destination workshop at index (9, 13), 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 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. [x x x x 9 x 14 17 x 13 3 x 13 10 18] [1 x 11 12 14 13 8 x 5 7 x x x x x] [3 x x 18 11 16 x x x x 1 x 15 12 10] [x 10 x 3 2 15 14 x x x 17 x 6 1 x] [8 10 x x x x 1 19 6 x 17 2 x x x] [x 6 15 2 17 2 11 5 9 x 12 15 x x 16] [x x 8 x 14 x 13 20 17 12 19 9 x x x] [13 10 1 4 11 3 15 x x 3 14 20 x 6 x] [x 11 16 9 19 18 12 2 x x 1 10 x x x] [x 13 18 18 7 x x x x 18 5 6 x 7 3] [x x x 18 6 16 10 18 9 19 x 3 5 3 4] [14 18 4 1 17 x 7 x 3 16 11 x 17 11 1] [x x 12 16 x 14 9 x x x 13 1 x x 19] [19 x 3 x 8 x x x 3 x x x 17 9 8] [15 x 2 8 9 13 x 14 x 6 x 19 x x 5]
traffic
pathfinding
7
[[5, 2], [5, 3], [5, 4], [5, 5], [5, 6], [4, 6], [5, 6], [5, 7], [5, 8], [6, 8], [6, 9], [7, 9], [7, 10], [8, 10], [9, 10], [9, 11], [10, 11], [10, 12], [10, 13], [9, 13]]
134
0.029214859008789062
20
4
4
[[["x", "x", "x", "x", "9", "x", "14", "17", "x", "13", "3", "x", "13", "10", "18"], ["1", "x", "11", "12", "14", "13", "8", "x", "5", "7", "x", "x", "x", "x", "x"], ["3", "x", "x", "18", "11", "16", "x", "x", "x", "x", "1", "x", "15", "12", "10"], ["x", "10", "x", "3", "2", "15", "14", "x", "x", "x", "17", "x", "6", "1", "x"], ["8", "10", "x", "x", "x", "x", "1", "19", "6", "x", "17", "2", "x", "x", "x"], ["x", "6", "15", "2", "17", "2", "11", "5", "9", "x", "12", "15", "x", "x", "16"], ["x", "x", "8", "x", "14", "x", "13", "20", "17", "12", "19", "9", "x", "x", "x"], ["13", "10", "1", "4", "11", "3", "15", "x", "x", "3", "14", "20", "x", "6", "x"], ["x", "11", "16", "9", "19", "18", "12", "2", "x", "x", "1", "10", "x", "x", "x"], ["x", "13", "18", "18", "7", "x", "x", "x", "x", "18", "5", "6", "x", "7", "3"], ["x", "x", "x", "18", "6", "16", "10", "18", "9", "19", "x", "3", "5", "3", "4"], ["14", "18", "4", "1", "17", "x", "7", "x", "3", "16", "11", "x", "17", "11", "1"], ["x", "x", "12", "16", "x", "14", "9", "x", "x", "x", "13", "1", "x", "x", "19"], ["19", "x", "3", "x", "8", "x", "x", "x", "3", "x", "x", "x", "17", "9", "8"], ["15", "x", "2", "8", "9", "13", "x", "14", "x", "6", "x", "19", "x", "x", "5"]]]
[[["x", "x", "x", "x", "9", "x", "14", "17", "x", "13", "3", "x", "13", "10", "18"], ["1", "x", "11", "12", "14", "13", "8", "x", "5", "7", "x", "x", "x", "x", "x"], ["3", "x", "x", "18", "11", "16", "x", "x", "x", "x", "1", "x", "15", "12", "10"], ["x", "10", "x", "3", "2", "15", "14", "x", "x", "x", "17", "x", "6", "1", "x"], ["8", "10", "x", "x", "x", "x", "1", "19", "6", "x", "17", "2", "x", "x", "x"], ["x", "6", "15", "2", "17", "2", "11", "5", "9", "x", "12", "15", "x", "x", "16"], ["x", "x", "8", "x", "14", "x", "13", "20", "17", "12", "19", "9", "x", "x", "x"], ["13", "10", "1", "4", "11", "3", "15", "x", "x", "3", "14", "20", "x", "6", "x"], ["x", "11", "16", "9", "19", "18", "12", "2", "x", "x", "1", "10", "x", "x", "x"], ["x", "13", "18", "18", "7", "x", "x", "x", "x", "18", "5", "6", "x", "7", "3"], ["x", "x", "x", "18", "6", "16", "10", "18", "9", "19", "x", "3", "5", "3", "4"], ["14", "18", "4", "1", "17", "x", "7", "x", "3", "16", "11", "x", "17", "11", "1"], ["x", "x", "12", "16", "x", "14", "9", "x", "x", "x", "13", "1", "x", "x", "19"], ["19", "x", "3", "x", "8", "x", "x", "x", "3", "x", "x", "x", "17", "9", "8"], ["15", "x", "2", "8", "9", "13", "x", "14", "x", "6", "x", "19", "x", "x", "5"]], [5, 2], [9, 13], 4, 9]
["[['x', 'x', 'x', 'x', '9', 'x', '14', '17', 'x', '13', '3', 'x', '13', '10', '18'], ['1', 'x', '11', '12', '14', '13', '8', 'x', '5', '7', 'x', 'x', 'x', 'x', 'x'], ['3', 'x', 'x', '18', '11', '16', 'x', 'x', 'x', 'x', '1', 'x', '15', '12', '10'], ['x', '10', 'x', '3', '2', '15', '14', 'x', 'x', 'x', '17', 'x', '6', '1', 'x'], ['8', '10', 'x', 'x', 'x', 'x', '1', '19', '6', 'x', '17', '2', 'x', 'x', 'x'], ['x', '6', '15', '2', '17', '2', '11', '5', '9', 'x', '12', '15', 'x', 'x', '16'], ['x', 'x', '8', 'x', '14', 'x', '13', '20', '17', '12', '19', '9', 'x', 'x', 'x'], ['13', '10', '1', '4', '11', '3', '15', 'x', 'x', '3', '14', '20', 'x', '6', 'x'], ['x', '11', '16', '9', '19', '18', '12', '2', 'x', 'x', '1', '10', 'x', 'x', 'x'], ['x', '13', '18', '18', '7', 'x', 'x', 'x', 'x', '18', '5', '6', 'x', '7', '3'], ['x', 'x', 'x', '18', '6', '16', '10', '18', '9', '19', 'x', '3', '5', '3', '4'], ['14', '18', '4', '1', '17', 'x', '7', 'x', '3', '16', '11', 'x', '17', '11', '1'], ['x', 'x', '12', '16', 'x', '14', '9', 'x', 'x', 'x', '13', '1', 'x', 'x', '19'], ['19', 'x', '3', 'x', '8', 'x', 'x', 'x', '3', 'x', 'x', 'x', '17', '9', '8'], ['15', 'x', '2', '8', '9', '13', 'x', '14', 'x', '6', 'x', '19', 'x', 'x', '5']]", "(5, 2)", "(9, 13)", "4", "9"]
95
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 (0, 13) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (13, 5). 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 0 1 1 0 0 1 1 0 1 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 0 1 1 1 0 1 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 0 1 0 0 0 1 1 1 0 1 0 0 1 1 0 1 1 0 0 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 1 0 0 1 0 0 1 1 0 1 0 1 1 0 1 0 0 0 0 0 1 0 1 0 0 1 1 1 1 1
trampoline_matrix
pathfinding
15
[[0, 13], [0, 12], [1, 11], [2, 10], [2, 9], [2, 8], [3, 7], [3, 6], [4, 6], [4, 5], [5, 5], [6, 5], [7, 5], [8, 6], [9, 6], [10, 6], [11, 6], [12, 6], [13, 5]]
19
0.029097557067871094
19
8
2
["[[1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0],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, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1]]", [0, 13], [13, 5], 5]
["[[1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1], [0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1], [0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0], [1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0], [1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1], [1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1]]", "(0, 13)", "(13, 5)", "5"]
95
Given 9 labeled water jugs with capacities 146, 45, 136, 13, 148, 17, 42, 137, 141, 31 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 307, 384, 555, 575 liters of water respectively. The amount of water in each unlabeled bucket can not at any point in time exceed the amount of water in the bucket placed after it. Jugs can only be filled to the top and emptied completely, and the unlabeled buckets cannot be overfilled. An action, represented as a tuple ('+', X, Y) or ('-', X, Y), involves adding to or removing water from the unlabeled bucket numbered Y, using the jug with capacity X. Determine the shortest sequence of actions needed to fill the buckets as specified, and present the solution as a list of action tuples in Python syntax.
water_jug
subset_sum
7
[["+", 136, 4], ["+", 137, 4], ["+", 141, 4], ["+", 148, 4], ["+", 13, 4], ["+", 136, 3], ["+", 136, 3], ["+", 137, 3], ["+", 146, 3], ["+", 45, 2], ["+", 45, 2], ["+", 146, 2], ["+", 148, 2], ["+", 146, 1], ["+", 148, 1], ["+", 13, 1]]
16
0.049184560775756836
16
80
3
[[146, 45, 136, 13, 148, 17, 42, 137, 141, 31], [307, 384, 555, 575]]
[[146, 45, 136, 13, 148, 17, 42, 137, 141, 31], [307, 384, 555, 575]]
["[146, 45, 136, 13, 148, 17, 42, 137, 141, 31]", "[307, 384, 555, 575]"]
96
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [[99, 98, 87, 84, 72, 64], [60, 59, 19, 57, '_', 53], [33, 22, 18, 48, 16, 37]]
8_puzzle
puzzle
5
[53, 37, 16, 48, 18, 19, 57, 53, 48, 16]
10
0.02994561195373535
10
4
18
[[[99, 98, 87, 84, 72, 64], [60, 59, 19, 57, "_", 53], [33, 22, 18, 48, 16, 37]]]
[[[99, 98, 87, 84, 72, 64], [60, 59, 19, 57, "_", 53], [33, 22, 18, 48, 16, 37]]]
["[[99, 98, 87, 84, 72, 64], [60, 59, 19, 57, '_', 53], [33, 22, 18, 48, 16, 37]]"]
96
In the game 'Sort the Chars', we are given a table of n by m dimensions. This table contains n words, each with m characters, except for the first word which has m - 1 characters. Each character is written on a separate tile. The objective of the game is to rearrange the characters such that row i spells the i-th word in the list, with the blank tile ('_') placed in the top left corner of the board in the end. We can rearrange the tiles by swapping the blank space with any of its 4 diagonal neighboring tiles. Given the list of words and initial state of the board below, where the black space is represented as '_', what is the shortest list of swap actions (reported in python syntax) that can sort the board into the given list of target words? The list must only include the 4 diagonal swap directions: up-right, down-right, up-left, or down-left, representing the direction in ehich the blank space was swpped in. Target words: siena, locked, conche, celtic, blanco The initial board: [['o', 's', 'n', 'e', 'd', 'a'], ['l', 'k', 'c', 'c', 'e', 'h'], ['t', 'o', '_', 'c', 'n', 'e'], ['c', 'i', 'l', 'a', 'i', 'c'], ['b', 'l', 'e', 'n', 'c', 'o']]
8_puzzle_words
puzzle
4
["up-right", "down-right", "up-right", "up-left", "down-left", "up-left", "down-left", "down-left", "down-right", "up-right", "up-left", "down-left", "down-right", "down-right", "up-right", "up-left", "up-right", "up-left", "down-left", "up-left"]
20
0.39241790771484375
20
4
30
[[["o", "s", "n", "e", "d", "a"], ["l", "k", "c", "c", "e", "h"], ["t", "o", "_", "c", "n", "e"], ["c", "i", "l", "a", "i", "c"], ["b", "l", "e", "n", "c", "o"]]]
[[["o", "s", "n", "e", "d", "a"], ["l", "k", "c", "c", "e", "h"], ["t", "o", "_", "c", "n", "e"], ["c", "i", "l", "a", "i", "c"], ["b", "l", "e", "n", "c", "o"]], ["siena", "locked", "conche", "celtic", "blanco"]]
["[['o', 's', 'n', 'e', 'd', 'a'], ['l', 'k', 'c', 'c', 'e', 'h'], ['t', 'o', '_', 'c', 'n', 'e'], ['c', 'i', 'l', 'a', 'i', 'c'], ['b', 'l', 'e', 'n', 'c', 'o']]", "['siena', 'locked', 'conche', 'celtic', 'blanco']"]
96
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'O'. Our task is to visit city J and city K excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from K and J, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. R J E Y A L T K C N B S Z X O R 0 0 0 0 0 1 0 1 1 0 0 1 0 0 0 J 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 E 1 0 0 0 1 1 1 1 0 0 0 0 1 0 0 Y 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 A 1 0 0 1 0 0 0 0 1 1 1 0 1 0 0 L 1 1 0 0 1 0 0 0 1 0 0 0 1 0 0 T 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 K 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 C 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 N 0 0 1 0 0 1 0 1 1 0 0 0 0 0 0 B 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 S 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 Z 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 X 1 1 0 1 1 1 0 0 0 0 0 1 0 0 0 O 0 0 0 0 1 0 1 0 0 1 1 1 1 1 0
city_directed_graph
pathfinding
15
["O", "T", "J", "K", "X", "J", "K"]
7
0.03685426712036133
7
15
18
[[[0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0], [1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0], [1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 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, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0], [1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0]], ["R", "J", "E", "Y", "A", "L", "T", "K", "C", "N", "B", "S", "Z", "X", "O"], "O", "J", "K"]
["[[0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0], [1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0], [1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0], [1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0], [1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0]]", "['R', 'J', 'E', 'Y', 'A', 'L', 'T', 'K', 'C', 'N', 'B', 'S', 'Z', 'X', 'O']", "['O']", "['J', 'K']"]
96
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [22, 25, 37, 5, 46, 10, 23, 23, 3, 6, 34, 32, 34, 2, 3, 8, 4, 28, 32, 24, 15, 38, 17, 35, 9, 12, 12, 22, 34, 48, 39, 30, 7, 18, 10, 46, 30, 36, 49, 27, 22, 19, 9, 24, 43, 15], such that the sum of the chosen coins adds up to 463. 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 {18: 11, 17: 7, 7: 6, 43: 2, 22: 3, 24: 11, 9: 3, 36: 10, 46: 4, 10: 3, 39: 5, 5: 5, 35: 15, 28: 8, 15: 2, 34: 6, 27: 3, 38: 11, 30: 20, 23: 18, 25: 10, 12: 1, 4: 1, 49: 16, 37: 6, 48: 17, 2: 2, 8: 4, 3: 1, 6: 3, 19: 10, 32: 19}, 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
26
[46, 22, 27, 22, 43, 22, 12, 15, 15, 37, 39, 34, 49, 46, 34]
66
0.06879425048828125
15
46
46
[[22, 25, 37, 5, 46, 10, 23, 23, 3, 6, 34, 32, 34, 2, 3, 8, 4, 28, 32, 24, 15, 38, 17, 35, 9, 12, 12, 22, 34, 48, 39, 30, 7, 18, 10, 46, 30, 36, 49, 27, 22, 19, 9, 24, 43, 15]]
[[22, 25, 37, 5, 46, 10, 23, 23, 3, 6, 34, 32, 34, 2, 3, 8, 4, 28, 32, 24, 15, 38, 17, 35, 9, 12, 12, 22, 34, 48, 39, 30, 7, 18, 10, 46, 30, 36, 49, 27, 22, 19, 9, 24, 43, 15], {"18": 11, "17": 7, "7": 6, "43": 2, "22": 3, "24": 11, "9": 3, "36": 10, "46": 4, "10": 3, "39": 5, "5": 5, "35": 15, "28": 8, "15": 2, "34": 6, "27": 3, "38": 11, "30": 20, "23": 18, "25": 10, "12": 1, "4": 1, "49": 16, "37": 6, "48": 17, "2": 2, "8": 4, "3": 1, "6": 3, "19": 10, "32": 19}, 463]
["[22, 25, 37, 5, 46, 10, 23, 23, 3, 6, 34, 32, 34, 2, 3, 8, 4, 28, 32, 24, 15, 38, 17, 35, 9, 12, 12, 22, 34, 48, 39, 30, 7, 18, 10, 46, 30, 36, 49, 27, 22, 19, 9, 24, 43, 15]", "{18: 11, 17: 7, 7: 6, 43: 2, 22: 3, 24: 11, 9: 3, 36: 10, 46: 4, 10: 3, 39: 5, 5: 5, 35: 15, 28: 8, 15: 2, 34: 6, 27: 3, 38: 11, 30: 20, 23: 18, 25: 10, 12: 1, 4: 1, 49: 16, 37: 6, 48: 17, 2: 2, 8: 4, 3: 1, 6: 3, 19: 10, 32: 19}", "463"]
96
The game of 'Sort It' begins with 3 tubes, each filled with 6 balls of different colors. The goal is to sort the balls by color, with each tube containing balls of only one color. Only one ball can be moved at a time, taken from the top of one tube and placed on top of another. The capacity of each tube (maximum number of balls we can fit in each tube) is 9 balls. It is not allowed to place a ball in a tube that already has 9 balls. The solution should be a list of tuples, each containing, first, the index of the tube from which a ball is taken and, second, the index of the tube to which it is moved, indexing from 0. Given the initial state of the tubes, represented by the lists below (with the leftmost item being the color of the topmost ball in each tube), what is the shortest list of move tuples that will result in all the balls being correctly sorted? [['Blue', 'Green', 'Red', 'Red', 'Green', 'Blue'], ['Green', 'Blue', 'Blue', 'Blue', 'Red', 'Red'], ['Green', 'Green', 'Green', 'Blue', 'Red', 'Red']]
color_sorting
sorting
10
[[1, 2], [1, 0], [1, 0], [1, 0], [1, 2], [1, 2], [0, 1], [0, 1], [0, 1], [0, 1], [2, 1], [2, 1], [0, 2], [0, 1], [0, 1], [0, 2], [0, 1], [2, 0], [2, 0], [2, 0], [2, 0], [2, 0], [2, 0], [2, 0], [1, 0], [1, 2], [1, 2], [1, 2], [1, 2], [0, 1], [0, 1]]
31
507.0654656887054
31
6
18
[[["Blue", "Green", "Red", "Red", "Green", "Blue"], ["Green", "Blue", "Blue", "Blue", "Red", "Red"], ["Green", "Green", "Green", "Blue", "Red", "Red"]], 9]
[[["Blue", "Green", "Red", "Red", "Green", "Blue"], ["Green", "Blue", "Blue", "Blue", "Red", "Red"], ["Green", "Green", "Green", "Blue", "Red", "Red"]], 9]
["[['Blue', 'Green', 'Red', 'Red', 'Green', 'Blue'], ['Green', 'Blue', 'Blue', 'Blue', 'Red', 'Red'], ['Green', 'Green', 'Green', 'Blue', 'Red', 'Red']]", "9"]
96
We have a 4x4 numerical grid, with numbers ranging from 28 to 83 (28 included in the range but 83 is not included). The numbers in each row and column must be strictly increasing or decreasing. This means that either first > second > third > fourth or first < second < third < fourth in each row and column. If a grid cell is marked with an 'x', the number in that position is hidden. The objective is to replace the 'x's with unique integers from the given range, ensuring that each number only appears once in the grid. The replacements must maintain the consecutive order in each row and column. Additionally, the sum of the numbers in the topmost row plus the numbers in the rightmost column plus the numbers in the diagonal connecting the top-left corner of the grid to its bottom-right corner should be minimized. The solution should be given as a list of tuples in Python syntax. Each tuple should represent the replacement of a number with an 'x' number and contain three elements: the row index of the 'x', the column index of the 'x' (both starting from 0), and the value of the number that replaces the 'x'. The initial state of the grid is as follows: Grid: [['81' '52' 'x' 'x'] ['x' '50' '53' 'x'] ['42' 'x' '54' '74'] ['x' 'x' '56' '77']]
consecutive_grid
underdetermined_system
12
[[0, 0, 25], [0, 2, 64], [1, 0, 24], [2, 0, 23], [2, 1, 44], [2, 2, 46], [3, 2, 45]]
696
10.49123215675354
7
55
16
["[['', '58', '', '77'], ['', '49', '63', '70'], ['', '', '', '69'], ['22', '43', '', '68']]", 22, 82]
["[['', '58', '', '77'], ['', '49', '63', '70'], ['', '', '', '69'], ['22', '43', '', '68']]", 22, 82]
["[['', '58', '', '77'], ['', '49', '63', '70'], ['', '', '', '69'], ['22', '43', '', '68']]", "22", "82"]
96
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 11 to 62. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 148, 109, None for columns 1 to 2 respectively, and the sums of rows must be None, 105, 115, 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 134. 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' 'x' 'x' 'x'] ['x' '52' '20' 'x'] ['41' '13' 'x' 'x'] ['54' 'x' '16' '11']]
magic_square
underdetermined_system
8
[[0, 0, 14], [0, 1, 22], [0, 2, 24], [0, 3, 47], [1, 0, 15], [1, 3, 18], [2, 2, 49], [2, 3, 12], [3, 1, 61]]
469
202.49410438537598
9
36
16
["[['', '', '', ''], ['', '52', '20', ''], ['41', '13', '', ''], ['54', '', '16', '11']]", 4, 11, 62]
["[['', '', '', ''], ['', '52', '20', ''], ['41', '13', '', ''], ['54', '', '16', '11']]", 11, 62, [1, 3], [1, 3], [148, 109], [105, 115], 134]
["[['', '', '', ''], ['', '52', '20', ''], ['41', '13', '', ''], ['54', '', '16', '11']]", "11", "62", "[None, 148, 109, None]", "[None, 105, 115, None]", "134"]
96
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 (8, 13) to his destination workshop at index (3, 3), 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 3, district 2 covering rows 4 to 7, and district 3 covering rows 8 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 9 x 10 x 11 13 5 4 x x 19 13 x x] [x 6 3 8 18 8 1 5 2 x x 17 x x x] [x x 11 5 x 11 13 20 7 x x x x 15 4] [x 3 x 14 4 20 4 15 12 12 4 x 8 4 x] [4 1 x 9 17 x 17 x 11 16 6 12 x 18 x] [8 5 17 x x 1 x x x 19 14 2 1 x x] [11 9 x x 14 x x x x x x 2 12 4 16] [x x 2 x x 6 6 8 x 11 18 11 10 x x] [x x x 16 x 7 x x x x 7 11 18 9 17] [13 19 13 x 18 x 14 x 14 14 x x 20 15 15] [x x x x 17 x 8 x x x x x 6 11 x] [5 x 7 x 15 x x 19 1 x x 10 x x 18] [11 19 x 18 x 5 x 19 16 x x 13 x x 5] [8 16 6 13 1 x 14 4 x x x 1 x x 5] [x 19 5 x x x 12 5 9 16 11 9 14 x x]
traffic
pathfinding
7
[[8, 13], [8, 12], [7, 12], [7, 11], [6, 11], [5, 11], [4, 11], [4, 10], [3, 10], [3, 9], [3, 8], [3, 7], [3, 6], [3, 5], [3, 4], [3, 3]]
146
0.02926325798034668
16
4
4
[[["x", "9", "x", "10", "x", "11", "13", "5", "4", "x", "x", "19", "13", "x", "x"], ["x", "6", "3", "8", "18", "8", "1", "5", "2", "x", "x", "17", "x", "x", "x"], ["x", "x", "11", "5", "x", "11", "13", "20", "7", "x", "x", "x", "x", "15", "4"], ["x", "3", "x", "14", "4", "20", "4", "15", "12", "12", "4", "x", "8", "4", "x"], ["4", "1", "x", "9", "17", "x", "17", "x", "11", "16", "6", "12", "x", "18", "x"], ["8", "5", "17", "x", "x", "1", "x", "x", "x", "19", "14", "2", "1", "x", "x"], ["11", "9", "x", "x", "14", "x", "x", "x", "x", "x", "x", "2", "12", "4", "16"], ["x", "x", "2", "x", "x", "6", "6", "8", "x", "11", "18", "11", "10", "x", "x"], ["x", "x", "x", "16", "x", "7", "x", "x", "x", "x", "7", "11", "18", "9", "17"], ["13", "19", "13", "x", "18", "x", "14", "x", "14", "14", "x", "x", "20", "15", "15"], ["x", "x", "x", "x", "17", "x", "8", "x", "x", "x", "x", "x", "6", "11", "x"], ["5", "x", "7", "x", "15", "x", "x", "19", "1", "x", "x", "10", "x", "x", "18"], ["11", "19", "x", "18", "x", "5", "x", "19", "16", "x", "x", "13", "x", "x", "5"], ["8", "16", "6", "13", "1", "x", "14", "4", "x", "x", "x", "1", "x", "x", "5"], ["x", "19", "5", "x", "x", "x", "12", "5", "9", "16", "11", "9", "14", "x", "x"]]]
[[["x", "9", "x", "10", "x", "11", "13", "5", "4", "x", "x", "19", "13", "x", "x"], ["x", "6", "3", "8", "18", "8", "1", "5", "2", "x", "x", "17", "x", "x", "x"], ["x", "x", "11", "5", "x", "11", "13", "20", "7", "x", "x", "x", "x", "15", "4"], ["x", "3", "x", "14", "4", "20", "4", "15", "12", "12", "4", "x", "8", "4", "x"], ["4", "1", "x", "9", "17", "x", "17", "x", "11", "16", "6", "12", "x", "18", "x"], ["8", "5", "17", "x", "x", "1", "x", "x", "x", "19", "14", "2", "1", "x", "x"], ["11", "9", "x", "x", "14", "x", "x", "x", "x", "x", "x", "2", "12", "4", "16"], ["x", "x", "2", "x", "x", "6", "6", "8", "x", "11", "18", "11", "10", "x", "x"], ["x", "x", "x", "16", "x", "7", "x", "x", "x", "x", "7", "11", "18", "9", "17"], ["13", "19", "13", "x", "18", "x", "14", "x", "14", "14", "x", "x", "20", "15", "15"], ["x", "x", "x", "x", "17", "x", "8", "x", "x", "x", "x", "x", "6", "11", "x"], ["5", "x", "7", "x", "15", "x", "x", "19", "1", "x", "x", "10", "x", "x", "18"], ["11", "19", "x", "18", "x", "5", "x", "19", "16", "x", "x", "13", "x", "x", "5"], ["8", "16", "6", "13", "1", "x", "14", "4", "x", "x", "x", "1", "x", "x", "5"], ["x", "19", "5", "x", "x", "x", "12", "5", "9", "16", "11", "9", "14", "x", "x"]], [8, 13], [3, 3], 3, 7]
["[['x', '9', 'x', '10', 'x', '11', '13', '5', '4', 'x', 'x', '19', '13', 'x', 'x'], ['x', '6', '3', '8', '18', '8', '1', '5', '2', 'x', 'x', '17', 'x', 'x', 'x'], ['x', 'x', '11', '5', 'x', '11', '13', '20', '7', 'x', 'x', 'x', 'x', '15', '4'], ['x', '3', 'x', '14', '4', '20', '4', '15', '12', '12', '4', 'x', '8', '4', 'x'], ['4', '1', 'x', '9', '17', 'x', '17', 'x', '11', '16', '6', '12', 'x', '18', 'x'], ['8', '5', '17', 'x', 'x', '1', 'x', 'x', 'x', '19', '14', '2', '1', 'x', 'x'], ['11', '9', 'x', 'x', '14', 'x', 'x', 'x', 'x', 'x', 'x', '2', '12', '4', '16'], ['x', 'x', '2', 'x', 'x', '6', '6', '8', 'x', '11', '18', '11', '10', 'x', 'x'], ['x', 'x', 'x', '16', 'x', '7', 'x', 'x', 'x', 'x', '7', '11', '18', '9', '17'], ['13', '19', '13', 'x', '18', 'x', '14', 'x', '14', '14', 'x', 'x', '20', '15', '15'], ['x', 'x', 'x', 'x', '17', 'x', '8', 'x', 'x', 'x', 'x', 'x', '6', '11', 'x'], ['5', 'x', '7', 'x', '15', 'x', 'x', '19', '1', 'x', 'x', '10', 'x', 'x', '18'], ['11', '19', 'x', '18', 'x', '5', 'x', '19', '16', 'x', 'x', '13', 'x', 'x', '5'], ['8', '16', '6', '13', '1', 'x', '14', '4', 'x', 'x', 'x', '1', 'x', 'x', '5'], ['x', '19', '5', 'x', 'x', 'x', '12', '5', '9', '16', '11', '9', '14', 'x', 'x']]", "(8, 13)", "(3, 3)", "3", "7"]
96
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 (3, 10) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (13, 0). 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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, 0], [1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1], [1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0], [0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0], [0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1], [1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1], [0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0], [0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1]]", "(3, 10)", "(13, 0)", "5"]
96
Given 9 labeled water jugs with capacities 90, 21, 104, 111, 97, 22, 34, 15, 62, 52 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 177, 263, 294, 462 liters of water respectively. The amount of water in each unlabeled bucket can not at any point in time exceed the amount of water in the bucket placed after it. Jugs can only be filled to the top and emptied completely, and the unlabeled buckets cannot be overfilled. An action, represented as a tuple ('+', X, Y) or ('-', X, Y), involves adding to or removing water from the unlabeled bucket numbered Y, using the jug with capacity X. Determine the shortest sequence of actions needed to fill the buckets as specified, and present the solution as a list of action tuples in Python syntax.
water_jug
subset_sum
7
[["+", 52, 4], ["+", 62, 4], ["+", 111, 4], ["+", 111, 4], ["+", 104, 4], ["+", 22, 4], ["+", 90, 3], ["+", 90, 3], ["+", 52, 3], ["+", 62, 3], ["+", 90, 2], ["+", 111, 2], ["+", 62, 2], ["+", 52, 1], ["+", 104, 1], ["+", 21, 1]]
16
0.06696057319641113
16
80
3
[[90, 21, 104, 111, 97, 22, 34, 15, 62, 52], [177, 263, 294, 462]]
[[90, 21, 104, 111, 97, 22, 34, 15, 62, 52], [177, 263, 294, 462]]
["[90, 21, 104, 111, 97, 22, 34, 15, 62, 52]", "[177, 263, 294, 462]"]
97
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [[100, 96, 93, 82, 6, 19], [68, 53, 50, 9, '_', 24], [16, 15, 48, 10, 76, 74]]
8_puzzle
puzzle
6
[6, 82, 93, 50, 48, 10, 76, 74, 24, 6, 74, 76, 9, 48, 50, 93, 82, 74, 76, 24, 6, 19, 74, 76, 24, 6]
26
1.0652458667755127
26
4
18
[[[100, 96, 93, 82, 6, 19], [68, 53, 50, 9, "_", 24], [16, 15, 48, 10, 76, 74]]]
[[[100, 96, 93, 82, 6, 19], [68, 53, 50, 9, "_", 24], [16, 15, 48, 10, 76, 74]]]
["[[100, 96, 93, 82, 6, 19], [68, 53, 50, 9, '_', 24], [16, 15, 48, 10, 76, 74]]"]
97
In the game 'Sort the Chars', we are given a table of n by m dimensions. This table contains n words, each with m characters, except for the first word which has m - 1 characters. Each character is written on a separate tile. The objective of the game is to rearrange the characters such that row i spells the i-th word in the list, with the blank tile ('_') placed in the top left corner of the board in the end. We can rearrange the tiles by swapping the blank space with any of its 4 diagonal neighboring tiles. Given the list of words and initial state of the board below, where the black space is represented as '_', what is the shortest list of swap actions (reported in python syntax) that can sort the board into the given list of target words? The list must only include the 4 diagonal swap directions: up-right, down-right, up-left, or down-left, representing the direction in ehich the blank space was swpped in. Target words: burst, merril, monase, chivey, tilpah The initial board: [['e', 'b', 'v', 'r', 'l', 't'], ['m', 'u', 'r', 'm', 'i', 'r'], ['h', 'o', 'a', 'a', '_', 'e'], ['c', 'n', 'i', 's', 'e', 's'], ['t', 'i', 'l', 'p', 'y', 'h']]
8_puzzle_words
puzzle
4
["down-left", "up-left", "up-right", "down-right", "up-right", "up-left", "down-left", "up-left", "down-left", "down-right", "up-right", "down-right", "down-right", "down-left", "up-left", "up-left", "down-left", "up-left", "up-right", "up-left"]
20
0.3242766857147217
20
4
30
[[["e", "b", "v", "r", "l", "t"], ["m", "u", "r", "m", "i", "r"], ["h", "o", "a", "a", "_", "e"], ["c", "n", "i", "s", "e", "s"], ["t", "i", "l", "p", "y", "h"]]]
[[["e", "b", "v", "r", "l", "t"], ["m", "u", "r", "m", "i", "r"], ["h", "o", "a", "a", "_", "e"], ["c", "n", "i", "s", "e", "s"], ["t", "i", "l", "p", "y", "h"]], ["burst", "merril", "monase", "chivey", "tilpah"]]
["[['e', 'b', 'v', 'r', 'l', 't'], ['m', 'u', 'r', 'm', 'i', 'r'], ['h', 'o', 'a', 'a', '_', 'e'], ['c', 'n', 'i', 's', 'e', 's'], ['t', 'i', 'l', 'p', 'y', 'h']]", "['burst', 'merril', 'monase', 'chivey', 'tilpah']"]
97
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'Q'. Our task is to visit city Y and city N excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from N and Y, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. R Y W H J A O N U E Q L P V X R 0 0 0 0 1 1 0 0 0 0 0 0 0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, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0], [0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0]]", "['R', 'Y', 'W', 'H', 'J', 'A', 'O', 'N', 'U', 'E', 'Q', 'L', 'P', 'V', 'X']", "['Q']", "['Y', 'N']"]
97
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [39, 3, 38, 10, 3, 5, 6, 14, 32, 7, 30, 28, 17, 9, 8, 13, 17, 41, 25, 6, 19, 36, 5, 36, 8, 38, 6, 19, 25, 3, 22, 18, 3, 21, 57, 37, 42, 30, 54, 13, 36, 6, 13, 17, 10, 4, 36], such that the sum of the chosen coins adds up to 452. 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 {37: 2, 38: 4, 30: 18, 39: 18, 14: 1, 18: 1, 4: 1, 10: 8, 21: 10, 6: 5, 42: 13, 32: 10, 25: 2, 17: 15, 13: 2, 9: 4, 22: 17, 7: 5, 3: 2, 54: 7, 19: 15, 8: 2, 36: 17, 28: 6, 5: 5, 41: 9, 57: 12}, 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
27
[38, 18, 25, 37, 4, 13, 13, 25, 8, 13, 57, 54, 38, 28, 8, 41, 32]
70
0.06327366828918457
17
47
47
[[39, 3, 38, 10, 3, 5, 6, 14, 32, 7, 30, 28, 17, 9, 8, 13, 17, 41, 25, 6, 19, 36, 5, 36, 8, 38, 6, 19, 25, 3, 22, 18, 3, 21, 57, 37, 42, 30, 54, 13, 36, 6, 13, 17, 10, 4, 36]]
[[39, 3, 38, 10, 3, 5, 6, 14, 32, 7, 30, 28, 17, 9, 8, 13, 17, 41, 25, 6, 19, 36, 5, 36, 8, 38, 6, 19, 25, 3, 22, 18, 3, 21, 57, 37, 42, 30, 54, 13, 36, 6, 13, 17, 10, 4, 36], {"37": 2, "38": 4, "30": 18, "39": 18, "14": 1, "18": 1, "4": 1, "10": 8, "21": 10, "6": 5, "42": 13, "32": 10, "25": 2, "17": 15, "13": 2, "9": 4, "22": 17, "7": 5, "3": 2, "54": 7, "19": 15, "8": 2, "36": 17, "28": 6, "5": 5, "41": 9, "57": 12}, 452]
["[39, 3, 38, 10, 3, 5, 6, 14, 32, 7, 30, 28, 17, 9, 8, 13, 17, 41, 25, 6, 19, 36, 5, 36, 8, 38, 6, 19, 25, 3, 22, 18, 3, 21, 57, 37, 42, 30, 54, 13, 36, 6, 13, 17, 10, 4, 36]", "{37: 2, 38: 4, 30: 18, 39: 18, 14: 1, 18: 1, 4: 1, 10: 8, 21: 10, 6: 5, 42: 13, 32: 10, 25: 2, 17: 15, 13: 2, 9: 4, 22: 17, 7: 5, 3: 2, 54: 7, 19: 15, 8: 2, 36: 17, 28: 6, 5: 5, 41: 9, 57: 12}", "452"]
97
The game of 'Sort It' begins with 3 tubes, each filled with 6 balls of different colors. The goal is to sort the balls by color, with each tube containing balls of only one color. Only one ball can be moved at a time, taken from the top of one tube and placed on top of another. The capacity of each tube (maximum number of balls we can fit in each tube) is 9 balls. It is not allowed to place a ball in a tube that already has 9 balls. The solution should be a list of tuples, each containing, first, the index of the tube from which a ball is taken and, second, the index of the tube to which it is moved, indexing from 0. Given the initial state of the tubes, represented by the lists below (with the leftmost item being the color of the topmost ball in each tube), what is the shortest list of move tuples that will result in all the balls being correctly sorted? [['Red', 'Red', 'Blue', 'Red', 'Blue', 'Green'], ['Red', 'Green', 'Blue', 'Blue', 'Green', 'Red'], ['Blue', 'Green', 'Green', 'Red', 'Blue', 'Green']]
color_sorting
sorting
10
[[1, 0], [1, 0], [2, 1], [0, 1], [2, 1], [2, 1], [2, 0], [2, 0], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [0, 2], [1, 2], [1, 2], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [2, 1], [0, 1], [0, 2], [1, 0], [2, 1], [2, 0], [2, 0], [2, 0], [2, 0], [1, 2], [1, 2], [1, 2], [1, 0], [2, 1]]
36
382.4207499027252
36
6
18
[[["Red", "Red", "Blue", "Red", "Blue", "Green"], ["Red", "Green", "Blue", "Blue", "Green", "Red"], ["Blue", "Green", "Green", "Red", "Blue", "Green"]], 9]
[[["Red", "Red", "Blue", "Red", "Blue", "Green"], ["Red", "Green", "Blue", "Blue", "Green", "Red"], ["Blue", "Green", "Green", "Red", "Blue", "Green"]], 9]
["[['Red', 'Red', 'Blue', 'Red', 'Blue', 'Green'], ['Red', 'Green', 'Blue', 'Blue', 'Green', 'Red'], ['Blue', 'Green', 'Green', 'Red', 'Blue', 'Green']]", "9"]
97
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 11 to 62. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 117, 160, None for columns 1 to 2 respectively, and the sums of rows must be None, 175, 114, 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 114. 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: [['58' '19' 'x' 'x'] ['x' 'x' 'x' 'x'] ['x' '22' 'x' '39'] ['x' '16' '53' '29']]
magic_square
underdetermined_system
9
[[0, 2, 11], [0, 3, 14], [1, 0, 12], [1, 1, 60], [1, 2, 61], [1, 3, 42], [2, 0, 18], [2, 2, 35], [3, 0, 17]]
506
231.75803446769714
9
36
16
["[['58', '19', '', ''], ['', '', '', ''], ['', '22', '', '39'], ['', '16', '53', '29']]", 4, 11, 62]
["[['58', '19', '', ''], ['', '', '', ''], ['', '22', '', '39'], ['', '16', '53', '29']]", 11, 62, [1, 3], [1, 3], [117, 160], [175, 114], 114]
["[['58', '19', '', ''], ['', '', '', ''], ['', '22', '', '39'], ['', '16', '53', '29']]", "11", "62", "[None, 117, 160, None]", "[None, 175, 114, None]", "114"]
97
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 (9, 1) to his destination workshop at index (7, 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 5, district 2 covering rows 6 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. [17 8 x 3 x 13 x x 14 11 x x x x x] [x x x 7 x x 13 x x x x x 16 x 13] [x x 2 x x 12 10 x x x 2 x x 5 17] [4 3 x 14 x x 16 x x x 1 x x x x] [9 x 18 11 19 5 x x x x x x 3 x x] [x 14 x 4 14 12 1 x 13 7 10 8 8 6 9] [7 10 x 18 15 8 13 14 15 x x x 13 x 17] [17 7 19 15 20 19 x 15 13 x 9 x 11 x 1] [x 9 6 17 14 x 16 x 19 11 x 14 11 x x] [x 18 8 2 14 2 4 x 4 4 4 x x 8 19] [x x 5 x x x 1 5 x 11 x x 1 14 x] [x x x x 5 x 10 x x x x 10 18 x 19] [x x 2 x 1 x x x x x x x x 6 16] [x 12 1 12 x x 15 7 18 15 13 19 x 2 x] [x 13 8 19 5 1 x 13 x x x 17 x 3 x]
traffic
pathfinding
7
[[9, 1], [9, 2], [9, 3], [9, 4], [8, 4], [7, 4], [6, 4], [6, 5], [6, 6], [6, 7], [6, 8], [5, 8], [5, 9], [5, 10], [5, 11], [5, 12], [5, 13], [5, 14], [6, 14], [7, 14]]
202
0.027507543563842773
20
4
4
[[["17", "8", "x", "3", "x", "13", "x", "x", "14", "11", "x", "x", "x", "x", "x"], ["x", "x", "x", "7", "x", "x", "13", "x", "x", "x", "x", "x", "16", "x", "13"], ["x", "x", "2", "x", "x", "12", "10", "x", "x", "x", "2", "x", "x", "5", "17"], ["4", "3", "x", "14", "x", "x", "16", "x", "x", "x", "1", "x", "x", "x", "x"], ["9", "x", "18", "11", "19", "5", "x", "x", "x", "x", "x", "x", "3", "x", "x"], ["x", "14", "x", "4", "14", "12", "1", "x", "13", "7", "10", "8", "8", "6", "9"], ["7", "10", "x", "18", "15", "8", "13", "14", "15", "x", "x", "x", "13", "x", "17"], ["17", "7", "19", "15", "20", "19", "x", "15", "13", "x", "9", "x", "11", "x", "1"], ["x", "9", "6", "17", "14", "x", "16", "x", "19", "11", "x", "14", "11", "x", "x"], ["x", "18", "8", "2", "14", "2", "4", "x", "4", "4", "4", "x", "x", "8", "19"], ["x", "x", "5", "x", "x", "x", "1", "5", "x", "11", "x", "x", "1", "14", "x"], ["x", "x", "x", "x", "5", "x", "10", "x", "x", "x", "x", "10", "18", "x", "19"], ["x", "x", "2", "x", "1", "x", "x", "x", "x", "x", "x", "x", "x", "6", "16"], ["x", "12", "1", "12", "x", "x", "15", "7", "18", "15", "13", "19", "x", "2", "x"], ["x", "13", "8", "19", "5", "1", "x", "13", "x", "x", "x", "17", "x", "3", "x"]]]
[[["17", "8", "x", "3", "x", "13", "x", "x", "14", "11", "x", "x", "x", "x", "x"], ["x", "x", "x", "7", "x", "x", "13", "x", "x", "x", "x", "x", "16", "x", "13"], ["x", "x", "2", "x", "x", "12", "10", "x", "x", "x", "2", "x", "x", "5", "17"], ["4", "3", "x", "14", "x", "x", "16", "x", "x", "x", "1", "x", "x", "x", "x"], ["9", "x", "18", "11", "19", "5", "x", "x", "x", "x", "x", "x", "3", "x", "x"], ["x", "14", "x", "4", "14", "12", "1", "x", "13", "7", "10", "8", "8", "6", "9"], ["7", "10", "x", "18", "15", "8", "13", "14", "15", "x", "x", "x", "13", "x", "17"], ["17", "7", "19", "15", "20", "19", "x", "15", "13", "x", "9", "x", "11", "x", "1"], ["x", "9", "6", "17", "14", "x", "16", "x", "19", "11", "x", "14", "11", "x", "x"], ["x", "18", "8", "2", "14", "2", "4", "x", "4", "4", "4", "x", "x", "8", "19"], ["x", "x", "5", "x", "x", "x", "1", "5", "x", "11", "x", "x", "1", "14", "x"], ["x", "x", "x", "x", "5", "x", "10", "x", "x", "x", "x", "10", "18", "x", "19"], ["x", "x", "2", "x", "1", "x", "x", "x", "x", "x", "x", "x", "x", "6", "16"], ["x", "12", "1", "12", "x", "x", "15", "7", "18", "15", "13", "19", "x", "2", "x"], ["x", "13", "8", "19", "5", "1", "x", "13", "x", "x", "x", "17", "x", "3", "x"]], [9, 1], [7, 14], 5, 8]
["[['17', '8', 'x', '3', 'x', '13', 'x', 'x', '14', '11', 'x', 'x', 'x', 'x', 'x'], ['x', 'x', 'x', '7', 'x', 'x', '13', 'x', 'x', 'x', 'x', 'x', '16', 'x', '13'], ['x', 'x', '2', 'x', 'x', '12', '10', 'x', 'x', 'x', '2', 'x', 'x', '5', '17'], ['4', '3', 'x', '14', 'x', 'x', '16', 'x', 'x', 'x', '1', 'x', 'x', 'x', 'x'], ['9', 'x', '18', '11', '19', '5', 'x', 'x', 'x', 'x', 'x', 'x', '3', 'x', 'x'], ['x', '14', 'x', '4', '14', '12', '1', 'x', '13', '7', '10', '8', '8', '6', '9'], ['7', '10', 'x', '18', '15', '8', '13', '14', '15', 'x', 'x', 'x', '13', 'x', '17'], ['17', '7', '19', '15', '20', '19', 'x', '15', '13', 'x', '9', 'x', '11', 'x', '1'], ['x', '9', '6', '17', '14', 'x', '16', 'x', '19', '11', 'x', '14', '11', 'x', 'x'], ['x', '18', '8', '2', '14', '2', '4', 'x', '4', '4', '4', 'x', 'x', '8', '19'], ['x', 'x', '5', 'x', 'x', 'x', '1', '5', 'x', '11', 'x', 'x', '1', '14', 'x'], ['x', 'x', 'x', 'x', '5', 'x', '10', 'x', 'x', 'x', 'x', '10', '18', 'x', '19'], ['x', 'x', '2', 'x', '1', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '6', '16'], ['x', '12', '1', '12', 'x', 'x', '15', '7', '18', '15', '13', '19', 'x', '2', 'x'], ['x', '13', '8', '19', '5', '1', 'x', '13', 'x', 'x', 'x', '17', 'x', '3', 'x']]", "(9, 1)", "(7, 14)", "5", "8"]
97
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 (4, 14) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (11, 0). 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 1 1 1 0 1 1 0 1 0 1 0 1 0 0 1 0 0 0 1 1 0 1 1 1 1 1 1 0 0 1 0 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 0 1 1 0 0 1 1 1 1 1 0 0 1 0 1 1 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 0 1 1 1 0 0 1 1 0 0 0 0 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 0 0 0 1 0 1 1 0 0 0 0 0 1 1 1 0 0 1 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 0 1 0 0 1 1 1 1 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 0 1 1 0 0 0 1
trampoline_matrix
pathfinding
15
[[4, 14], [5, 13], [5, 12], [6, 12], [7, 11], [7, 10], [7, 9], [7, 8], [7, 7], [7, 6], [7, 5], [7, 4], [7, 3], [8, 3], [9, 2], [10, 1], [11, 0]]
17
0.02439427375793457
17
8
2
["[[1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0], [1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0], [1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1], [1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0], [1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0], [0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0], [1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1], [1, 0, 0, 0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, 0, 1, 1, 1, 1, 1, 1, 0, 0], [1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1], [1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0], [1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0], [0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0], [1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1], [1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1], [1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], [0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0], [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0], [0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1]]", "(4, 14)", "(11, 0)", "5"]
97
Given 9 labeled water jugs with capacities 59, 104, 79, 23, 20, 60, 14, 15, 119, 105 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 215, 403, 420, 504 liters of water respectively. The amount of water in each unlabeled bucket can not at any point in time exceed the amount of water in the bucket placed after it. Jugs can only be filled to the top and emptied completely, and the unlabeled buckets cannot be overfilled. An action, represented as a tuple ('+', X, Y) or ('-', X, Y), involves adding to or removing water from the unlabeled bucket numbered Y, using the jug with capacity X. Determine the shortest sequence of actions needed to fill the buckets as specified, and present the solution as a list of action tuples in Python syntax.
water_jug
subset_sum
7
[["+", 14, 4], ["+", 119, 4], ["+", 119, 4], ["+", 119, 4], ["+", 119, 4], ["+", 14, 4], ["+", 105, 3], ["+", 105, 3], ["+", 105, 3], ["+", 105, 3], ["+", 60, 2], ["+", 105, 2], ["+", 119, 2], ["+", 119, 2], ["+", 119, 1], ["-", 23, 1], ["+", 119, 1]]
17
0.03369307518005371
17
80
3
[[59, 104, 79, 23, 20, 60, 14, 15, 119, 105], [215, 403, 420, 504]]
[[59, 104, 79, 23, 20, 60, 14, 15, 119, 105], [215, 403, 420, 504]]
["[59, 104, 79, 23, 20, 60, 14, 15, 119, 105]", "[215, 403, 420, 504]"]
98
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [[89, 88, 62, 57, 79, 53], [92, 48, 61, 67, 78, 14], [32, 63, 27, '_', 19, 54]]
8_puzzle
puzzle
6
[19, 54, 14, 78, 67, 61, 62, 88, 89, 92, 48, 63, 32, 48, 63, 62, 61, 57, 79, 67, 78, 53, 67, 78, 54, 14]
26
0.06994152069091797
26
4
18
[[[89, 88, 62, 57, 79, 53], [92, 48, 61, 67, 78, 14], [32, 63, 27, "_", 19, 54]]]
[[[89, 88, 62, 57, 79, 53], [92, 48, 61, 67, 78, 14], [32, 63, 27, "_", 19, 54]]]
["[[89, 88, 62, 57, 79, 53], [92, 48, 61, 67, 78, 14], [32, 63, 27, '_', 19, 54]]"]
98
In the game 'Sort the Chars', we are given a table of n by m dimensions. This table contains n words, each with m characters, except for the first word which has m - 1 characters. Each character is written on a separate tile. The objective of the game is to rearrange the characters such that row i spells the i-th word in the list, with the blank tile ('_') placed in the top left corner of the board in the end. We can rearrange the tiles by swapping the blank space with any of its 4 diagonal neighboring tiles. Given the list of words and initial state of the board below, where the black space is represented as '_', what is the shortest list of swap actions (reported in python syntax) that can sort the board into the given list of target words? The list must only include the 4 diagonal swap directions: up-right, down-right, up-left, or down-left, representing the direction in ehich the blank space was swpped in. Target words: rafty, lapped, angina, lanose, acnida The initial board: [['a', 'r', 'o', 'f', 'n', 'y'], ['l', 'g', 'p', 'p', 'e', 'a'], ['a', 'n', 'n', 'i', '_', 'a'], ['l', 't', 'n', 'd', 's', 'e'], ['a', 'c', 'a', 'i', 'd', 'a']]
8_puzzle_words
puzzle
4
["down-left", "up-left", "up-right", "down-right", "up-right", "up-left", "down-left", "up-left", "down-left", "down-right", "down-left", "down-right", "up-right", "up-right", "up-left", "down-left", "down-right", "up-right", "up-right", "up-left", "down-left", "up-left", "down-left", "down-right", "up-right", "up-left", "down-left", "up-left"]
28
5.565536260604858
28
4
30
[[["a", "r", "o", "f", "n", "y"], ["l", "g", "p", "p", "e", "a"], ["a", "n", "n", "i", "_", "a"], ["l", "t", "n", "d", "s", "e"], ["a", "c", "a", "i", "d", "a"]]]
[[["a", "r", "o", "f", "n", "y"], ["l", "g", "p", "p", "e", "a"], ["a", "n", "n", "i", "_", "a"], ["l", "t", "n", "d", "s", "e"], ["a", "c", "a", "i", "d", "a"]], ["rafty", "lapped", "angina", "lanose", "acnida"]]
["[['a', 'r', 'o', 'f', 'n', 'y'], ['l', 'g', 'p', 'p', 'e', 'a'], ['a', 'n', 'n', 'i', '_', 'a'], ['l', 't', 'n', 'd', 's', 'e'], ['a', 'c', 'a', 'i', 'd', 'a']]", "['rafty', 'lapped', 'angina', 'lanose', 'acnida']"]
98
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'D'. Our task is to visit city J and city X excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from X and J, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. B X F Q V D A J N M G H K T S B 0 1 1 1 1 0 1 0 0 0 0 0 1 0 0 X 0 0 0 0 1 0 0 0 0 1 0 1 1 0 0 F 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 Q 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 V 0 0 0 0 0 0 0 1 1 1 1 1 0 1 0 D 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 A 0 1 0 1 1 0 0 0 0 0 0 0 0 1 0 J 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 N 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 M 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 G 1 0 0 1 0 1 0 0 1 1 0 1 0 0 0 H 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 K 0 0 0 0 0 1 1 0 0 0 1 1 0 1 1 T 1 0 0 0 0 0 0 0 0 1 1 0 0 0 1 S 0 1 0 1 0 0 0 0 1 0 1 1 0 1 0
city_directed_graph
pathfinding
15
["D", "B", "X", "K", "A", "X", "H", "J", "Q", "J"]
10
0.061826229095458984
10
15
18
[[[0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 1, 1, 0, 0, 0, 0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T", "S"], "D", "J", "X"]
["[[0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1], [0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0]]", "['B', 'X', 'F', 'Q', 'V', 'D', 'A', 'J', 'N', 'M', 'G', 'H', 'K', 'T', 'S']", "['D']", "['J', 'X']"]
98
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [35, 14, 15, 111, 8, 4, 6, 37, 14, 33, 45, 32, 46, 41, 38, 19, 34, 14, 2, 4, 24, 36, 46, 33, 12, 2, 14, 28, 12, 21, 34, 26, 28, 27, 25, 4, 23, 43, 43, 20, 10, 13, 5, 36, 27, 36], such that the sum of the chosen coins adds up to 462. 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 {33: 16, 21: 14, 4: 1, 13: 9, 23: 8, 2: 2, 12: 2, 41: 15, 46: 6, 45: 2, 34: 16, 24: 15, 19: 4, 5: 4, 35: 14, 6: 6, 37: 13, 26: 16, 43: 20, 15: 13, 111: 2, 38: 1, 10: 7, 32: 13, 20: 14, 27: 15, 36: 14, 25: 8, 14: 2, 28: 10, 8: 4}, 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
28
[46, 38, 14, 111, 46, 14, 12, 4, 19, 14, 4, 45, 28, 14, 12, 4, 37]
59
0.07613182067871094
17
46
46
[[35, 14, 15, 111, 8, 4, 6, 37, 14, 33, 45, 32, 46, 41, 38, 19, 34, 14, 2, 4, 24, 36, 46, 33, 12, 2, 14, 28, 12, 21, 34, 26, 28, 27, 25, 4, 23, 43, 43, 20, 10, 13, 5, 36, 27, 36]]
[[35, 14, 15, 111, 8, 4, 6, 37, 14, 33, 45, 32, 46, 41, 38, 19, 34, 14, 2, 4, 24, 36, 46, 33, 12, 2, 14, 28, 12, 21, 34, 26, 28, 27, 25, 4, 23, 43, 43, 20, 10, 13, 5, 36, 27, 36], {"33": 16, "21": 14, "4": 1, "13": 9, "23": 8, "2": 2, "12": 2, "41": 15, "46": 6, "45": 2, "34": 16, "24": 15, "19": 4, "5": 4, "35": 14, "6": 6, "37": 13, "26": 16, "43": 20, "15": 13, "111": 2, "38": 1, "10": 7, "32": 13, "20": 14, "27": 15, "36": 14, "25": 8, "14": 2, "28": 10, "8": 4}, 462]
["[35, 14, 15, 111, 8, 4, 6, 37, 14, 33, 45, 32, 46, 41, 38, 19, 34, 14, 2, 4, 24, 36, 46, 33, 12, 2, 14, 28, 12, 21, 34, 26, 28, 27, 25, 4, 23, 43, 43, 20, 10, 13, 5, 36, 27, 36]", "{33: 16, 21: 14, 4: 1, 13: 9, 23: 8, 2: 2, 12: 2, 41: 15, 46: 6, 45: 2, 34: 16, 24: 15, 19: 4, 5: 4, 35: 14, 6: 6, 37: 13, 26: 16, 43: 20, 15: 13, 111: 2, 38: 1, 10: 7, 32: 13, 20: 14, 27: 15, 36: 14, 25: 8, 14: 2, 28: 10, 8: 4}", "462"]
98
The game of 'Sort It' begins with 3 tubes, each filled with 6 balls of different colors. The goal is to sort the balls by color, with each tube containing balls of only one color. Only one ball can be moved at a time, taken from the top of one tube and placed on top of another. The capacity of each tube (maximum number of balls we can fit in each tube) is 9 balls. It is not allowed to place a ball in a tube that already has 9 balls. The solution should be a list of tuples, each containing, first, the index of the tube from which a ball is taken and, second, the index of the tube to which it is moved, indexing from 0. Given the initial state of the tubes, represented by the lists below (with the leftmost item being the color of the topmost ball in each tube), what is the shortest list of move tuples that will result in all the balls being correctly sorted? [['Blue', 'Red', 'Blue', 'Red', 'Blue', 'Red'], ['Blue', 'Blue', 'Red', 'Green', 'Green', 'Green'], ['Green', 'Red', 'Green', 'Blue', 'Green', 'Red']]
color_sorting
sorting
10
[[0, 1], [0, 2], [0, 1], [0, 2], [0, 1], [0, 2], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1], [2, 0], [2, 1], [2, 0], [2, 0], [2, 0], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [0, 1], [0, 2], [0, 1], [0, 1], [2, 0]]
29
370.69857454299927
29
6
18
[[["Blue", "Red", "Blue", "Red", "Blue", "Red"], ["Blue", "Blue", "Red", "Green", "Green", "Green"], ["Green", "Red", "Green", "Blue", "Green", "Red"]], 9]
[[["Blue", "Red", "Blue", "Red", "Blue", "Red"], ["Blue", "Blue", "Red", "Green", "Green", "Green"], ["Green", "Red", "Green", "Blue", "Green", "Red"]], 9]
["[['Blue', 'Red', 'Blue', 'Red', 'Blue', 'Red'], ['Blue', 'Blue', 'Red', 'Green', 'Green', 'Green'], ['Green', 'Red', 'Green', 'Blue', 'Green', 'Red']]", "9"]
98
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 33 to 84. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 189, 204, None for columns 1 to 2 respectively, and the sums of rows must be None, 229, 249, 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 219. 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: [['68' 'x' 'x' '76'] ['74' 'x' 'x' 'x'] ['x' 'x' '82' 'x'] ['66' 'x' '35' 'x']]
magic_square
underdetermined_system
9
[[0, 1, 34], [0, 2, 48], [1, 1, 80], [1, 2, 39], [1, 3, 36], [2, 0, 46], [2, 1, 38], [2, 3, 83], [3, 1, 37], [3, 3, 33]]
875
49.4717218875885
10
36
16
["[['68', '', '', '76'], ['74', '', '', ''], ['', '', '82', ''], ['66', '', '35', '']]", 4, 33, 84]
["[['68', '', '', '76'], ['74', '', '', ''], ['', '', '82', ''], ['66', '', '35', '']]", 33, 84, [1, 3], [1, 3], [189, 204], [229, 249], 219]
["[['68', '', '', '76'], ['74', '', '', ''], ['', '', '82', ''], ['66', '', '35', '']]", "33", "84", "[None, 189, 204, None]", "[None, 229, 249, None]", "219"]
98
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 (9, 3) 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 3, district 2 covering rows 4 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 19 4 x 17 11 x x 18 7 x 8 20 x 1] [x 16 x 1 9 1 x 8 16 x 15 7 1 x x] [7 x 9 9 9 x 18 x 15 13 10 x 19 16 9] [x x x 6 x x 7 10 18 17 x 8 9 6 5] [4 17 x x 19 5 20 1 15 18 x x 5 8 2] [x x x 3 10 19 17 20 x x x 3 x 5 x] [x x x 3 8 2 x x 7 19 x x 1 19 9] [x 19 16 6 5 19 x x x 12 x 3 8 10 x] [13 2 x 18 x x 5 x x x 13 1 x x 6] [19 8 8 10 x x x 12 14 5 14 2 6 x x] [x x x 12 18 x x x x x x 16 x 19 x] [11 x 12 x x 5 x 15 8 x 9 x x x x] [9 x 4 x x x x 2 18 x 11 x 11 x 19] [13 x 17 1 x 14 x x x x 16 x 2 x x] [3 16 x x 3 11 x 15 x x x x x 16 x]
traffic
pathfinding
7
[[9, 3], [8, 3], [7, 3], [6, 3], [6, 4], [6, 5], [5, 5], [4, 5], [4, 6], [4, 7], [3, 7], [3, 8], [2, 8], [2, 9], [2, 10], [1, 10], [1, 11], [1, 12], [2, 12], [3, 12], [3, 13], [3, 14], [4, 14]]
212
0.02391839027404785
23
4
4
[[["x", "19", "4", "x", "17", "11", "x", "x", "18", "7", "x", "8", "20", "x", "1"], ["x", "16", "x", "1", "9", "1", "x", "8", "16", "x", "15", "7", "1", "x", "x"], ["7", "x", "9", "9", "9", "x", "18", "x", "15", "13", "10", "x", "19", "16", "9"], ["x", "x", "x", "6", "x", "x", "7", "10", "18", "17", "x", "8", "9", "6", "5"], ["4", "17", "x", "x", "19", "5", "20", "1", "15", "18", "x", "x", "5", "8", "2"], ["x", "x", "x", "3", "10", "19", "17", "20", "x", "x", "x", "3", "x", "5", "x"], ["x", "x", "x", "3", "8", "2", "x", "x", "7", "19", "x", "x", "1", "19", "9"], ["x", "19", "16", "6", "5", "19", "x", "x", "x", "12", "x", "3", "8", "10", "x"], ["13", "2", "x", "18", "x", "x", "5", "x", "x", "x", "13", "1", "x", "x", "6"], ["19", "8", "8", "10", "x", "x", "x", "12", "14", "5", "14", "2", "6", "x", "x"], ["x", "x", "x", "12", "18", "x", "x", "x", "x", "x", "x", "16", "x", "19", "x"], ["11", "x", "12", "x", "x", "5", "x", "15", "8", "x", "9", "x", "x", "x", "x"], ["9", "x", "4", "x", "x", "x", "x", "2", "18", "x", "11", "x", "11", "x", "19"], ["13", "x", "17", "1", "x", "14", "x", "x", "x", "x", "16", "x", "2", "x", "x"], ["3", "16", "x", "x", "3", "11", "x", "15", "x", "x", "x", "x", "x", "16", "x"]]]
[[["x", "19", "4", "x", "17", "11", "x", "x", "18", "7", "x", "8", "20", "x", "1"], ["x", "16", "x", "1", "9", "1", "x", "8", "16", "x", "15", "7", "1", "x", "x"], ["7", "x", "9", "9", "9", "x", "18", "x", "15", "13", "10", "x", "19", "16", "9"], ["x", "x", "x", "6", "x", "x", "7", "10", "18", "17", "x", "8", "9", "6", "5"], ["4", "17", "x", "x", "19", "5", "20", "1", "15", "18", "x", "x", "5", "8", "2"], ["x", "x", "x", "3", "10", "19", "17", "20", "x", "x", "x", "3", "x", "5", "x"], ["x", "x", "x", "3", "8", "2", "x", "x", "7", "19", "x", "x", "1", "19", "9"], ["x", "19", "16", "6", "5", "19", "x", "x", "x", "12", "x", "3", "8", "10", "x"], ["13", "2", "x", "18", "x", "x", "5", "x", "x", "x", "13", "1", "x", "x", "6"], ["19", "8", "8", "10", "x", "x", "x", "12", "14", "5", "14", "2", "6", "x", "x"], ["x", "x", "x", "12", "18", "x", "x", "x", "x", "x", "x", "16", "x", "19", "x"], ["11", "x", "12", "x", "x", "5", "x", "15", "8", "x", "9", "x", "x", "x", "x"], ["9", "x", "4", "x", "x", "x", "x", "2", "18", "x", "11", "x", "11", "x", "19"], ["13", "x", "17", "1", "x", "14", "x", "x", "x", "x", "16", "x", "2", "x", "x"], ["3", "16", "x", "x", "3", "11", "x", "15", "x", "x", "x", "x", "x", "16", "x"]], [9, 3], [4, 14], 3, 8]
["[['x', '19', '4', 'x', '17', '11', 'x', 'x', '18', '7', 'x', '8', '20', 'x', '1'], ['x', '16', 'x', '1', '9', '1', 'x', '8', '16', 'x', '15', '7', '1', 'x', 'x'], ['7', 'x', '9', '9', '9', 'x', '18', 'x', '15', '13', '10', 'x', '19', '16', '9'], ['x', 'x', 'x', '6', 'x', 'x', '7', '10', '18', '17', 'x', '8', '9', '6', '5'], ['4', '17', 'x', 'x', '19', '5', '20', '1', '15', '18', 'x', 'x', '5', '8', '2'], ['x', 'x', 'x', '3', '10', '19', '17', '20', 'x', 'x', 'x', '3', 'x', '5', 'x'], ['x', 'x', 'x', '3', '8', '2', 'x', 'x', '7', '19', 'x', 'x', '1', '19', '9'], ['x', '19', '16', '6', '5', '19', 'x', 'x', 'x', '12', 'x', '3', '8', '10', 'x'], ['13', '2', 'x', '18', 'x', 'x', '5', 'x', 'x', 'x', '13', '1', 'x', 'x', '6'], ['19', '8', '8', '10', 'x', 'x', 'x', '12', '14', '5', '14', '2', '6', 'x', 'x'], ['x', 'x', 'x', '12', '18', 'x', 'x', 'x', 'x', 'x', 'x', '16', 'x', '19', 'x'], ['11', 'x', '12', 'x', 'x', '5', 'x', '15', '8', 'x', '9', 'x', 'x', 'x', 'x'], ['9', 'x', '4', 'x', 'x', 'x', 'x', '2', '18', 'x', '11', 'x', '11', 'x', '19'], ['13', 'x', '17', '1', 'x', '14', 'x', 'x', 'x', 'x', '16', 'x', '2', 'x', 'x'], ['3', '16', 'x', 'x', '3', '11', 'x', '15', 'x', 'x', 'x', 'x', 'x', '16', 'x']]", "(9, 3)", "(4, 14)", "3", "8"]
98
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 (1, 2) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (12, 11). 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 0 0 0 0 0 1 0 1 1 0 1 0 1 1 0 0 0 1 0 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 1 0 0 0 0 1 1 0 0 1 1 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 0 0 1 0 0 0 1 1 0 1 0 1 1 0 0 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 1 1 0 1 0 1 1 1 0 0 0 0 1 1 0 1 1 1 0 0 1 0 1 0 0 1 1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 1 1 1 0 1 0 1 1 1 0 0
trampoline_matrix
pathfinding
15
[[1, 2], [1, 3], [1, 4], [0, 4], [0, 5], [1, 6], [2, 6], [3, 6], [3, 7], [4, 8], [5, 8], [6, 8], [7, 8], [8, 8], [9, 8], [10, 9], [11, 10], [12, 11]]
18
0.02712726593017578
18
8
2
["[[1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0], [1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1], [0, 1, 0, 1, 1, 1, 0, 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 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0]]", [1, 2], [12, 11], 5]
["[[1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0], [1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1], [0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0], [1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1], [0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1], [1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0], [1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0]]", "(1, 2)", "(12, 11)", "5"]
98
Given 9 labeled water jugs with capacities 137, 100, 82, 25, 21, 101, 118, 117, 26, 131 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 272, 439, 458, 590 liters of water respectively. The amount of water in each unlabeled bucket can not at any point in time exceed the amount of water in the bucket placed after it. Jugs can only be filled to the top and emptied completely, and the unlabeled buckets cannot be overfilled. An action, represented as a tuple ('+', X, Y) or ('-', X, Y), involves adding to or removing water from the unlabeled bucket numbered Y, using the jug with capacity X. Determine the shortest sequence of actions needed to fill the buckets as specified, and present the solution as a list of action tuples in Python syntax.
water_jug
subset_sum
7
[["+", 82, 4], ["+", 117, 4], ["+", 117, 4], ["+", 137, 4], ["+", 137, 4], ["+", 26, 3], ["+", 137, 3], ["+", 137, 3], ["+", 137, 3], ["+", 21, 3], ["+", 100, 2], ["+", 101, 2], ["+", 101, 2], ["+", 137, 2], ["+", 117, 1], ["+", 137, 1], ["-", 82, 1], ["+", 100, 1]]
18
0.05659294128417969
18
80
3
[[137, 100, 82, 25, 21, 101, 118, 117, 26, 131], [272, 439, 458, 590]]
[[137, 100, 82, 25, 21, 101, 118, 117, 26, 131], [272, 439, 458, 590]]
["[137, 100, 82, 25, 21, 101, 118, 117, 26, 131]", "[272, 439, 458, 590]"]
99
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [[92, 75, 100, 61, 43, 87], [64, 34, 55, 90, 20, 86], [36, '_', 32, 5, 42, 83]]
8_puzzle
puzzle
6
[34, 64, 92, 75, 100, 61, 90, 20, 43, 87, 86, 83, 42, 5, 20, 55, 64, 92, 75, 100, 92, 64, 61, 90, 87, 86, 83, 42]
28
0.13985705375671387
28
4
18
[[[92, 75, 100, 61, 43, 87], [64, 34, 55, 90, 20, 86], [36, "_", 32, 5, 42, 83]]]
[[[92, 75, 100, 61, 43, 87], [64, 34, 55, 90, 20, 86], [36, "_", 32, 5, 42, 83]]]
["[[92, 75, 100, 61, 43, 87], [64, 34, 55, 90, 20, 86], [36, '_', 32, 5, 42, 83]]"]
99
In the game 'Sort the Chars', we are given a table of n by m dimensions. This table contains n words, each with m characters, except for the first word which has m - 1 characters. Each character is written on a separate tile. The objective of the game is to rearrange the characters such that row i spells the i-th word in the list, with the blank tile ('_') placed in the top left corner of the board in the end. We can rearrange the tiles by swapping the blank space with any of its 4 diagonal neighboring tiles. Given the list of words and initial state of the board below, where the black space is represented as '_', what is the shortest list of swap actions (reported in python syntax) that can sort the board into the given list of target words? The list must only include the 4 diagonal swap directions: up-right, down-right, up-left, or down-left, representing the direction in ehich the blank space was swpped in. Target words: chank, hormic, tigtag, tornal, zythum The initial board: [['o', 'c', 'a', 'a', 'n', 'k'], ['h', 'm', 'r', 'l', 'i', 'g'], ['h', 'i', 'o', 't', 'u', 'g'], ['t', 'n', 'r', 't', 'a', 'c'], ['z', 'y', 't', 'h', '_', 'm']]
8_puzzle_words
puzzle
4
["up-right", "up-left", "up-left", "up-left", "down-left", "down-right", "down-left", "down-right", "up-right", "down-right", "up-right", "up-left", "up-right", "up-left", "down-left", "down-right", "down-left", "up-left", "up-left", "down-left", "down-right", "up-right", "up-right", "up-right", "down-right", "down-left", "up-left", "up-left", "down-left", "up-left"]
30
13.15977692604065
30
4
30
[[["o", "c", "a", "a", "n", "k"], ["h", "m", "r", "l", "i", "g"], ["h", "i", "o", "t", "u", "g"], ["t", "n", "r", "t", "a", "c"], ["z", "y", "t", "h", "_", "m"]]]
[[["o", "c", "a", "a", "n", "k"], ["h", "m", "r", "l", "i", "g"], ["h", "i", "o", "t", "u", "g"], ["t", "n", "r", "t", "a", "c"], ["z", "y", "t", "h", "_", "m"]], ["chank", "hormic", "tigtag", "tornal", "zythum"]]
["[['o', 'c', 'a', 'a', 'n', 'k'], ['h', 'm', 'r', 'l', 'i', 'g'], ['h', 'i', 'o', 't', 'u', 'g'], ['t', 'n', 'r', 't', 'a', 'c'], ['z', 'y', 't', 'h', '_', 'm']]", "['chank', 'hormic', 'tigtag', 'tornal', 'zythum']"]
99
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'L'. Our task is to visit city W and city P excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from P and W, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. R P Z U H T E W F M D L Y C G R 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 P 1 0 0 0 0 1 1 1 0 1 0 0 0 0 1 Z 0 0 0 0 1 0 1 0 0 1 1 0 1 0 0 U 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 H 1 0 0 1 0 0 1 0 1 1 0 1 1 1 0 T 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 E 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 W 1 0 1 0 1 0 1 0 0 0 0 0 1 0 1 F 0 0 1 1 1 0 0 1 0 1 0 0 0 0 0 M 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 D 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 L 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 Y 1 0 0 0 0 1 0 1 1 0 0 0 0 0 1 C 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 G 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0
city_directed_graph
pathfinding
15
["L", "U", "P", "W", "E", "D", "P", "W"]
8
0.04042506217956543
8
15
18
[[[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0,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0, 0, 0, 0, 1], [0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]], ["R", "P", "Z", "U", "H", "T", "E", "W", "F", "M", "D", "L", "Y", "C", "G"], "L", "W", "P"]
["[[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1], [1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1], [0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1], [0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]]", "['R', 'P', 'Z', 'U', 'H', 'T', 'E', 'W', 'F', 'M', 'D', 'L', 'Y', 'C', 'G']", "['L']", "['W', 'P']"]
99
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [37, 4, 1, 15, 2, 7, 8, 33, 35, 14, 47, 36, 41, 44, 13, 31, 3, 7, 27, 25, 26, 38, 10, 19, 7, 18, 32, 45, 29, 35, 44, 17, 40, 13, 14, 40, 28, 15, 23, 11, 7, 16, 7, 35, 31, 45, 14, 22, 7, 36, 31], such that the sum of the chosen coins adds up to 465. 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 {44: 2, 1: 1, 36: 14, 26: 2, 22: 10, 33: 13, 16: 12, 23: 1, 41: 6, 8: 6, 18: 3, 13: 5, 2: 2, 7: 5, 29: 13, 25: 19, 3: 1, 45: 12, 35: 13, 17: 6, 47: 13, 10: 8, 15: 14, 31: 13, 4: 2, 14: 2, 32: 11, 40: 3, 11: 4, 28: 7, 37: 12, 27: 11, 19: 17, 38: 18}, 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
29
[44, 40, 26, 14, 23, 14, 41, 40, 28, 14, 45, 44, 45, 47]
69
0.07292604446411133
14
51
51
[[37, 4, 1, 15, 2, 7, 8, 33, 35, 14, 47, 36, 41, 44, 13, 31, 3, 7, 27, 25, 26, 38, 10, 19, 7, 18, 32, 45, 29, 35, 44, 17, 40, 13, 14, 40, 28, 15, 23, 11, 7, 16, 7, 35, 31, 45, 14, 22, 7, 36, 31]]
[[37, 4, 1, 15, 2, 7, 8, 33, 35, 14, 47, 36, 41, 44, 13, 31, 3, 7, 27, 25, 26, 38, 10, 19, 7, 18, 32, 45, 29, 35, 44, 17, 40, 13, 14, 40, 28, 15, 23, 11, 7, 16, 7, 35, 31, 45, 14, 22, 7, 36, 31], {"44": 2, "1": 1, "36": 14, "26": 2, "22": 10, "33": 13, "16": 12, "23": 1, "41": 6, "8": 6, "18": 3, "13": 5, "2": 2, "7": 5, "29": 13, "25": 19, "3": 1, "45": 12, "35": 13, "17": 6, "47": 13, "10": 8, "15": 14, "31": 13, "4": 2, "14": 2, "32": 11, "40": 3, "11": 4, "28": 7, "37": 12, "27": 11, "19": 17, "38": 18}, 465]
["[37, 4, 1, 15, 2, 7, 8, 33, 35, 14, 47, 36, 41, 44, 13, 31, 3, 7, 27, 25, 26, 38, 10, 19, 7, 18, 32, 45, 29, 35, 44, 17, 40, 13, 14, 40, 28, 15, 23, 11, 7, 16, 7, 35, 31, 45, 14, 22, 7, 36, 31]", "{44: 2, 1: 1, 36: 14, 26: 2, 22: 10, 33: 13, 16: 12, 23: 1, 41: 6, 8: 6, 18: 3, 13: 5, 2: 2, 7: 5, 29: 13, 25: 19, 3: 1, 45: 12, 35: 13, 17: 6, 47: 13, 10: 8, 15: 14, 31: 13, 4: 2, 14: 2, 32: 11, 40: 3, 11: 4, 28: 7, 37: 12, 27: 11, 19: 17, 38: 18}", "465"]
99
The game of 'Sort It' begins with 3 tubes, each filled with 6 balls of different colors. The goal is to sort the balls by color, with each tube containing balls of only one color. Only one ball can be moved at a time, taken from the top of one tube and placed on top of another. The capacity of each tube (maximum number of balls we can fit in each tube) is 9 balls. It is not allowed to place a ball in a tube that already has 9 balls. The solution should be a list of tuples, each containing, first, the index of the tube from which a ball is taken and, second, the index of the tube to which it is moved, indexing from 0. Given the initial state of the tubes, represented by the lists below (with the leftmost item being the color of the topmost ball in each tube), what is the shortest list of move tuples that will result in all the balls being correctly sorted? [['Blue', 'Red', 'Red', 'Green', 'Blue', 'Green'], ['Blue', 'Red', 'Red', 'Red', 'Green', 'Green'], ['Blue', 'Red', 'Blue', 'Blue', 'Green', 'Green']]
color_sorting
sorting
10
[[2, 1], [0, 1], [0, 2], [0, 2], [0, 2], [0, 1], [0, 2], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [2, 0], [2, 0], [1, 2], [1, 2], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [0, 2], [1, 0], [1, 0], [2, 1]]
33
52.178091049194336
33
6
18
[[["Blue", "Red", "Red", "Green", "Blue", "Green"], ["Blue", "Red", "Red", "Red", "Green", "Green"], ["Blue", "Red", "Blue", "Blue", "Green", "Green"]], 9]
[[["Blue", "Red", "Red", "Green", "Blue", "Green"], ["Blue", "Red", "Red", "Red", "Green", "Green"], ["Blue", "Red", "Blue", "Blue", "Green", "Green"]], 9]
["[['Blue', 'Red', 'Red', 'Green', 'Blue', 'Green'], ['Blue', 'Red', 'Red', 'Red', 'Green', 'Green'], ['Blue', 'Red', 'Blue', 'Blue', 'Green', 'Green']]", "9"]
99
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 30 to 86. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 239, 192, None for columns 1 to 2 respectively, and the sums of rows must be None, 220, 184, 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 199. 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' 'x' 'x' '67'] ['62' 'x' '32' '77'] ['66' 'x' '34' 'x'] ['x' 'x' '73' '35']]
magic_square
underdetermined_system
9
[[0, 0, 31], [0, 1, 51], [0, 2, 53], [1, 1, 49], [2, 1, 54], [2, 3, 30], [3, 0, 46], [3, 1, 85]]
845
26.860548496246338
8
36
16
["[['', '', '', '67'], ['62', '', '32', '77'], ['66', '', '34', ''], ['', '', '73', '35']]", 4, 30, 86]
["[['', '', '', '67'], ['62', '', '32', '77'], ['66', '', '34', ''], ['', '', '73', '35']]", 30, 86, [1, 3], [1, 3], [239, 192], [220, 184], 199]
["[['', '', '', '67'], ['62', '', '32', '77'], ['66', '', '34', ''], ['', '', '73', '35']]", "30", "86", "[None, 239, 192, None]", "[None, 220, 184, None]", "199"]
99
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 (4, 14) to his destination workshop at index (8, 3), 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 7, and district 3 covering rows 8 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. [7 6 11 x x x 19 x 9 15 12 8 10 15 5] [9 14 x x x x x x x x 18 2 11 x 10] [14 5 x x 4 4 12 x 18 x 17 11 3 18 19] [18 17 x 8 x x 9 x x 8 19 10 x x x] [7 x x 11 4 x x 10 1 2 3 12 8 12 15] [x 3 7 8 x x x x 4 16 13 19 14 10 13] [18 1 2 x 16 20 5 x 2 4 20 12 14 18 16] [1 x 1 x 15 19 11 9 19 16 x x x x 19] [x 8 x 1 7 x 2 3 x x x x 1 3 x] [6 16 x 3 x 18 x 2 18 x x 16 x x 8] [x 9 x 5 2 x x x x 17 x 6 18 14 x] [x x x x x x x 18 x x 3 x 10 x x] [x 2 15 x 5 15 18 8 19 x x x x x 10] [x x 4 x 7 2 2 x 19 x x x x x x] [17 x x x 5 x x x 4 1 18 x 9 2 8]
traffic
pathfinding
7
[[4, 14], [4, 13], [4, 12], [4, 11], [4, 10], [4, 9], [4, 8], [5, 8], [6, 8], [7, 8], [7, 7], [7, 6], [7, 5], [7, 4], [8, 4], [8, 3]]
125
0.02839803695678711
16
4
4
[[["7", "6", "11", "x", "x", "x", "19", "x", "9", "15", "12", "8", "10", "15", "5"], ["9", "14", "x", "x", "x", "x", "x", "x", "x", "x", "18", "2", "11", "x", "10"], ["14", "5", "x", "x", "4", "4", "12", "x", "18", "x", "17", "11", "3", "18", "19"], ["18", "17", "x", "8", "x", "x", "9", "x", "x", "8", "19", "10", "x", "x", "x"], ["7", "x", "x", "11", "4", "x", "x", "10", "1", "2", "3", "12", "8", "12", "15"], ["x", "3", "7", "8", "x", "x", "x", "x", "4", "16", "13", "19", "14", "10", "13"], ["18", "1", "2", "x", "16", "20", "5", "x", "2", "4", "20", "12", "14", "18", "16"], ["1", "x", "1", "x", "15", "19", "11", "9", "19", "16", "x", "x", "x", "x", "19"], ["x", "8", "x", "1", "7", "x", "2", "3", "x", "x", "x", "x", "1", "3", "x"], ["6", "16", "x", "3", "x", "18", "x", "2", "18", "x", "x", "16", "x", "x", "8"], ["x", "9", "x", "5", "2", "x", "x", "x", "x", "17", "x", "6", "18", "14", "x"], ["x", "x", "x", "x", "x", "x", "x", "18", "x", "x", "3", "x", "10", "x", "x"], ["x", "2", "15", "x", "5", "15", "18", "8", "19", "x", "x", "x", "x", "x", "10"], ["x", "x", "4", "x", "7", "2", "2", "x", "19", "x", "x", "x", "x", "x", "x"], ["17", "x", "x", "x", "5", "x", "x", "x", "4", "1", "18", "x", "9", "2", "8"]]]
[[["7", "6", "11", "x", "x", "x", "19", "x", "9", "15", "12", "8", "10", "15", "5"], ["9", "14", "x", "x", "x", "x", "x", "x", "x", "x", "18", "2", "11", "x", "10"], ["14", "5", "x", "x", "4", "4", "12", "x", "18", "x", "17", "11", "3", "18", "19"], ["18", "17", "x", "8", "x", "x", "9", "x", "x", "8", "19", "10", "x", "x", "x"], ["7", "x", "x", "11", "4", "x", "x", "10", "1", "2", "3", "12", "8", "12", "15"], ["x", "3", "7", "8", "x", "x", "x", "x", "4", "16", "13", "19", "14", "10", "13"], ["18", "1", "2", "x", "16", "20", "5", "x", "2", "4", "20", "12", "14", "18", "16"], ["1", "x", "1", "x", "15", "19", "11", "9", "19", "16", "x", "x", "x", "x", "19"], ["x", "8", "x", "1", "7", "x", "2", "3", "x", "x", "x", "x", "1", "3", "x"], ["6", "16", "x", "3", "x", "18", "x", "2", "18", "x", "x", "16", "x", "x", "8"], ["x", "9", "x", "5", "2", "x", "x", "x", "x", "17", "x", "6", "18", "14", "x"], ["x", "x", "x", "x", "x", "x", "x", "18", "x", "x", "3", "x", "10", "x", "x"], ["x", "2", "15", "x", "5", "15", "18", "8", "19", "x", "x", "x", "x", "x", "10"], ["x", "x", "4", "x", "7", "2", "2", "x", "19", "x", "x", "x", "x", "x", "x"], ["17", "x", "x", "x", "5", "x", "x", "x", "4", "1", "18", "x", "9", "2", "8"]], [4, 14], [8, 3], 4, 7]
["[['7', '6', '11', 'x', 'x', 'x', '19', 'x', '9', '15', '12', '8', '10', '15', '5'], ['9', '14', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '18', '2', '11', 'x', '10'], ['14', '5', 'x', 'x', '4', '4', '12', 'x', '18', 'x', '17', '11', '3', '18', '19'], ['18', '17', 'x', '8', 'x', 'x', '9', 'x', 'x', '8', '19', '10', 'x', 'x', 'x'], ['7', 'x', 'x', '11', '4', 'x', 'x', '10', '1', '2', '3', '12', '8', '12', '15'], ['x', '3', '7', '8', 'x', 'x', 'x', 'x', '4', '16', '13', '19', '14', '10', '13'], ['18', '1', '2', 'x', '16', '20', '5', 'x', '2', '4', '20', '12', '14', '18', '16'], ['1', 'x', '1', 'x', '15', '19', '11', '9', '19', '16', 'x', 'x', 'x', 'x', '19'], ['x', '8', 'x', '1', '7', 'x', '2', '3', 'x', 'x', 'x', 'x', '1', '3', 'x'], ['6', '16', 'x', '3', 'x', '18', 'x', '2', '18', 'x', 'x', '16', 'x', 'x', '8'], ['x', '9', 'x', '5', '2', 'x', 'x', 'x', 'x', '17', 'x', '6', '18', '14', 'x'], ['x', 'x', 'x', 'x', 'x', 'x', 'x', '18', 'x', 'x', '3', 'x', '10', 'x', 'x'], ['x', '2', '15', 'x', '5', '15', '18', '8', '19', 'x', 'x', 'x', 'x', 'x', '10'], ['x', 'x', '4', 'x', '7', '2', '2', 'x', '19', 'x', 'x', 'x', 'x', 'x', 'x'], ['17', 'x', 'x', 'x', '5', 'x', 'x', 'x', '4', '1', '18', 'x', '9', '2', '8']]", "(4, 14)", "(8, 3)", "4", "7"]
99
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 (11, 1) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (2, 12). 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 1 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 1 1 1 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 0 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1 0 1 0 0 1 0 1 1 0 0 0 1 1 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0
trampoline_matrix
pathfinding
15
[[11, 1], [10, 2], [9, 1], [8, 1], [7, 0], [6, 0], [6, 1], [6, 2], [6, 3], [6, 4], [5, 4], [4, 4], [4, 5], [3, 6], [3, 7], [3, 8], [3, 9], [3, 10], [3, 11], [2, 12]]
20
0.03243589401245117
20
8
2
["[[0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 1, 0, 0, 0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45, 74, 113 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 203, 429, 433, 477 liters of water respectively. The amount of water in each unlabeled bucket can not at any point in time exceed the amount of water in the bucket placed after it. Jugs can only be filled to the top and emptied completely, and the unlabeled buckets cannot be overfilled. An action, represented as a tuple ('+', X, Y) or ('-', X, Y), involves adding to or removing water from the unlabeled bucket numbered Y, using the jug with capacity X. Determine the shortest sequence of actions needed to fill the buckets as specified, and present the solution as a list of action tuples in Python syntax.
water_jug
subset_sum
7
[["+", 74, 4], ["+", 74, 4], ["+", 74, 4], ["+", 113, 4], ["+", 68, 4], ["+", 74, 4], ["+", 68, 3], ["+", 107, 3], ["+", 113, 3], ["+", 113, 3], ["+", 32, 3], ["+", 61, 2], ["+", 113, 2], ["+", 113, 2], ["+", 74, 2], ["+", 68, 2], ["+", 61, 1], ["+", 74, 1], ["+", 68, 1]]
19
0.048816680908203125
19
80
3
[[32, 73, 55, 68, 61, 107, 44, 45, 74, 113], [203, 429, 433, 477]]
[[32, 73, 55, 68, 61, 107, 44, 45, 74, 113], [203, 429, 433, 477]]
["[32, 73, 55, 68, 61, 107, 44, 45, 74, 113]", "[203, 429, 433, 477]"]
100
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [[94, 91, 76, '_', 74, 29], [61, 93, 17, 37, 34, 44], [67, 32, 55, 19, 26, 69]]
8_puzzle
puzzle
6
[37, 17, 55, 19, 26, 34, 44, 29, 74, 44, 29, 69, 34, 29, 17, 26, 29, 17, 44, 37, 76, 55, 19, 29, 26, 19, 55, 91, 93, 61, 67, 32, 29, 26, 19, 44, 37, 74, 69, 34]
40
21.31004285812378
40
4
18
[[[94, 91, 76, "_", 74, 29], [61, 93, 17, 37, 34, 44], [67, 32, 55, 19, 26, 69]]]
[[[94, 91, 76, "_", 74, 29], [61, 93, 17, 37, 34, 44], [67, 32, 55, 19, 26, 69]]]
["[[94, 91, 76, '_', 74, 29], [61, 93, 17, 37, 34, 44], [67, 32, 55, 19, 26, 69]]"]
100
In the game 'Sort the Chars', we are given a table of n by m dimensions. This table contains n words, each with m characters, except for the first word which has m - 1 characters. Each character is written on a separate tile. The objective of the game is to rearrange the characters such that row i spells the i-th word in the list, with the blank tile ('_') placed in the top left corner of the board in the end. We can rearrange the tiles by swapping the blank space with any of its 4 diagonal neighboring tiles. Given the list of words and initial state of the board below, where the black space is represented as '_', what is the shortest list of swap actions (reported in python syntax) that can sort the board into the given list of target words? The list must only include the 4 diagonal swap directions: up-right, down-right, up-left, or down-left, representing the direction in ehich the blank space was swpped in. Target words: katar, bonsai, sambar, mopane, voyeur The initial board: [['o', 'k', 's', 't', 'a', 'r'], ['b', 'y', 'n', 'i', 'a', 'a'], ['s', 'a', '_', 'b', 'a', 'r'], ['m', 'o', 'p', 'e', 'n', 'u'], ['v', 'o', 'm', 'e', 'a', 'r']]
8_puzzle_words
puzzle
4
["down-right", "up-right", "up-left", "up-right", "down-right", "down-left", "down-left", "up-left", "up-left", "up-right", "down-right", "down-right", "down-left", "up-left", "up-left", "down-left", "down-right", "down-right", "up-right", "down-right", "up-right", "up-left", "up-left", "down-left", "down-left", "up-left", "up-right", "up-left"]
28
19.604556798934937
28
4
30
[[["o", "k", "s", "t", "a", "r"], ["b", "y", "n", "i", "a", "a"], ["s", "a", "_", "b", "a", "r"], ["m", "o", "p", "e", "n", "u"], ["v", "o", "m", "e", "a", "r"]]]
[[["o", "k", "s", "t", "a", "r"], ["b", "y", "n", "i", "a", "a"], ["s", "a", "_", "b", "a", "r"], ["m", "o", "p", "e", "n", "u"], ["v", "o", "m", "e", "a", "r"]], ["katar", "bonsai", "sambar", "mopane", "voyeur"]]
["[['o', 'k', 's', 't', 'a', 'r'], ['b', 'y', 'n', 'i', 'a', 'a'], ['s', 'a', '_', 'b', 'a', 'r'], ['m', 'o', 'p', 'e', 'n', 'u'], ['v', 'o', 'm', 'e', 'a', 'r']]", "['katar', 'bonsai', 'sambar', 'mopane', 'voyeur']"]
100
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'R'. Our task is to visit city N and city X excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from X and N, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. I A Y K F H W D L U N R Z V X I 0 0 0 0 1 0 0 1 1 0 1 1 0 0 1 A 1 0 0 1 0 0 0 0 0 0 1 1 0 0 0 Y 0 0 0 0 0 0 1 0 0 0 0 1 1 0 1 K 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 F 0 0 1 1 0 1 0 0 0 0 0 1 0 0 0 H 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 W 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 D 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 L 0 0 1 0 1 1 0 0 0 1 0 0 0 0 1 U 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 N 0 0 0 1 1 1 1 0 0 1 0 0 0 1 0 R 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 Z 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 V 0 1 0 0 1 0 0 0 0 0 0 1 1 0 0 X 0 1 1 1 1 0 1 0 1 1 0 0 0 0 0
city_directed_graph
pathfinding
15
["R", "K", "N", "H", "X", "L", "X", "A", "N"]
9
0.15291357040405273
9
15
18
[[[0, 0, 0, 0, 1,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, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0], [0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0]]", "['I', 'A', 'Y', 'K', 'F', 'H', 'W', 'D', 'L', 'U', 'N', 'R', 'Z', 'V', 'X']", "['R']", "['N', 'X']"]
100
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [19, 11, 3, 37, 9, 29, 42, 12, 2, 13, 15, 11, 25, 14, 31, 17, 24, 45, 5, 18, 42, 21, 28, 23, 26, 40, 27, 42, 12, 13, 16, 14, 31, 38, 9, 24, 27, 36, 13, 27, 15, 43, 9, 14, 34, 7, 15, 12, 31, 44], such that the sum of the chosen coins adds up to 449. 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 {37: 7, 45: 7, 29: 6, 27: 2, 2: 2, 40: 6, 13: 9, 17: 2, 9: 2, 15: 12, 36: 2, 26: 18, 44: 5, 42: 4, 38: 8, 43: 2, 12: 4, 24: 20, 28: 15, 16: 7, 21: 13, 23: 5, 19: 4, 25: 16, 3: 2, 18: 13, 34: 16, 31: 2, 5: 4, 14: 2, 7: 1, 11: 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
30
[27, 27, 31, 31, 14, 27, 31, 43, 42, 45, 44, 42, 36, 2, 7]
41
0.05939221382141113
15
50
50
[[19, 11, 3, 37, 9, 29, 42, 12, 2, 13, 15, 11, 25, 14, 31, 17, 24, 45, 5, 18, 42, 21, 28, 23, 26, 40, 27, 42, 12, 13, 16, 14, 31, 38, 9, 24, 27, 36, 13, 27, 15, 43, 9, 14, 34, 7, 15, 12, 31, 44]]
[[19, 11, 3, 37, 9, 29, 42, 12, 2, 13, 15, 11, 25, 14, 31, 17, 24, 45, 5, 18, 42, 21, 28, 23, 26, 40, 27, 42, 12, 13, 16, 14, 31, 38, 9, 24, 27, 36, 13, 27, 15, 43, 9, 14, 34, 7, 15, 12, 31, 44], {"37": 7, "45": 7, "29": 6, "27": 2, "2": 2, "40": 6, "13": 9, "17": 2, "9": 2, "15": 12, "36": 2, "26": 18, "44": 5, "42": 4, "38": 8, "43": 2, "12": 4, "24": 20, "28": 15, "16": 7, "21": 13, "23": 5, "19": 4, "25": 16, "3": 2, "18": 13, "34": 16, "31": 2, "5": 4, "14": 2, "7": 1, "11": 8}, 449]
["[19, 11, 3, 37, 9, 29, 42, 12, 2, 13, 15, 11, 25, 14, 31, 17, 24, 45, 5, 18, 42, 21, 28, 23, 26, 40, 27, 42, 12, 13, 16, 14, 31, 38, 9, 24, 27, 36, 13, 27, 15, 43, 9, 14, 34, 7, 15, 12, 31, 44]", "{37: 7, 45: 7, 29: 6, 27: 2, 2: 2, 40: 6, 13: 9, 17: 2, 9: 2, 15: 12, 36: 2, 26: 18, 44: 5, 42: 4, 38: 8, 43: 2, 12: 4, 24: 20, 28: 15, 16: 7, 21: 13, 23: 5, 19: 4, 25: 16, 3: 2, 18: 13, 34: 16, 31: 2, 5: 4, 14: 2, 7: 1, 11: 8}", "449"]
100
The game of 'Sort It' begins with 3 tubes, each filled with 6 balls of different colors. The goal is to sort the balls by color, with each tube containing balls of only one color. Only one ball can be moved at a time, taken from the top of one tube and placed on top of another. The capacity of each tube (maximum number of balls we can fit in each tube) is 9 balls. It is not allowed to place a ball in a tube that already has 9 balls. The solution should be a list of tuples, each containing, first, the index of the tube from which a ball is taken and, second, the index of the tube to which it is moved, indexing from 0. Given the initial state of the tubes, represented by the lists below (with the leftmost item being the color of the topmost ball in each tube), what is the shortest list of move tuples that will result in all the balls being correctly sorted? [['Blue', 'Green', 'Red', 'Red', 'Blue', 'Green'], ['Blue', 'Red', 'Green', 'Green', 'Green', 'Red'], ['Blue', 'Blue', 'Blue', 'Red', 'Red', 'Green']]
color_sorting
sorting
10
[[0, 2], [1, 2], [0, 2], [0, 1], [0, 1], [2, 1], [0, 2], [0, 1], [2, 0], [2, 0], [2, 0], [2, 0], [2, 0], [2, 0], [2, 0], [2, 0], [1, 2], [1, 2], [1, 0], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [0, 1], [0, 1], [0, 1], [2, 0], [2, 0], [2, 0], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2]]
35
125.36433982849121
35
6
18
[[["Blue", "Green", "Red", "Red", "Blue", "Green"], ["Blue", "Red", "Green", "Green", "Green", "Red"], ["Blue", "Blue", "Blue", "Red", "Red", "Green"]], 9]
[[["Blue", "Green", "Red", "Red", "Blue", "Green"], ["Blue", "Red", "Green", "Green", "Green", "Red"], ["Blue", "Blue", "Blue", "Red", "Red", "Green"]], 9]
["[['Blue', 'Green', 'Red', 'Red', 'Blue', 'Green'], ['Blue', 'Red', 'Green', 'Green', 'Green', 'Red'], ['Blue', 'Blue', 'Blue', 'Red', 'Red', 'Green']]", "9"]
100
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 30 to 86. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 295, 204, None for columns 1 to 2 respectively, and the sums of rows must be None, 244, 251, 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 237. 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: [['32' '75' '36' 'x'] ['x' '83' 'x' 'x'] ['x' '77' '58' '44'] ['x' '60' 'x' 'x']]
magic_square
underdetermined_system
9
[[0, 3, 33], [1, 0, 35], [1, 2, 80], [1, 3, 46], [2, 0, 72], [3, 0, 47], [3, 2, 30], [3, 3, 31]]
839
14.697113037109375
8
36
16
["[['32', '75', '36', ''], ['', '83', '', ''], ['', '77', '58', '44'], ['', '60', '', '']]", 4, 30, 86]
["[['32', '75', '36', ''], ['', '83', '', ''], ['', '77', '58', '44'], ['', '60', '', '']]", 30, 86, [1, 3], [1, 3], [295, 204], [244, 251], 237]
["[['32', '75', '36', ''], ['', '83', '', ''], ['', '77', '58', '44'], ['', '60', '', '']]", "30", "86", "[None, 295, 204, None]", "[None, 244, 251, None]", "237"]
100
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 (4, 0) to his destination workshop at index (9, 11), 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 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. [x 2 16 x 9 x 14 x 8 x 16 x x 4 8] [9 x 4 x x 7 11 x x 13 x x 6 11 x] [x x 10 14 x x 18 x x x x x 6 16 x] [x 14 x 1 x 7 5 16 x 19 x x 10 7 x] [1 3 x 19 7 2 17 x x 6 x x x 10 14] [14 x x x 12 x 16 5 8 12 17 2 19 x 5] [9 9 8 15 18 x 16 x 10 x x 14 x x x] [18 20 x x 11 2 17 6 x 18 8 x 6 16 x] [12 x x x x 7 14 4 8 12 3 x 15 13 2] [16 x x x 12 x 8 1 7 7 12 17 2 2 7] [x 13 3 3 1 x 6 14 20 8 x 4 10 17 x] [1 8 x 16 x x x 9 x x 10 x x 5 8] [x x 1 x x 6 x x x 7 16 x x x x] [14 x x 10 18 x 6 13 x x x x x 15 x] [x 8 2 x 17 x 12 16 11 4 4 x x 17 x]
traffic
pathfinding
7
[[4, 0], [5, 0], [6, 0], [6, 1], [6, 2], [6, 3], [6, 4], [7, 4], [7, 5], [8, 5], [8, 6], [8, 7], [9, 7], [9, 8], [9, 9], [10, 9], [9, 9], [9, 10], [9, 11]]
170
0.028670310974121094
19
4
4
[[["x", "2", "16", "x", "9", "x", "14", "x", "8", "x", "16", "x", "x", "4", "8"], ["9", "x", "4", "x", "x", "7", "11", "x", "x", "13", "x", "x", "6", "11", "x"], ["x", "x", "10", "14", "x", "x", "18", "x", "x", "x", "x", "x", "6", "16", "x"], ["x", "14", "x", "1", "x", "7", "5", "16", "x", "19", "x", "x", "10", "7", "x"], ["1", "3", "x", "19", "7", "2", "17", "x", "x", "6", "x", "x", "x", "10", "14"], ["14", "x", "x", "x", "12", "x", "16", "5", "8", "12", "17", "2", "19", "x", "5"], ["9", "9", "8", "15", "18", "x", "16", "x", "10", "x", "x", "14", "x", "x", "x"], ["18", "20", "x", "x", "11", "2", "17", "6", "x", "18", "8", "x", "6", "16", "x"], ["12", "x", "x", "x", "x", "7", "14", "4", "8", "12", "3", "x", "15", "13", "2"], ["16", "x", "x", "x", "12", "x", "8", "1", "7", "7", "12", "17", "2", "2", "7"], ["x", "13", "3", "3", "1", "x", "6", "14", "20", "8", "x", "4", "10", "17", "x"], ["1", "8", "x", "16", "x", "x", "x", "9", "x", "x", "10", "x", "x", "5", "8"], ["x", "x", "1", "x", "x", "6", "x", "x", "x", "7", "16", "x", "x", "x", "x"], ["14", "x", "x", "10", "18", "x", "6", "13", "x", "x", "x", "x", "x", "15", "x"], ["x", "8", "2", "x", "17", "x", "12", "16", "11", "4", "4", "x", "x", "17", "x"]]]
[[["x", "2", "16", "x", "9", "x", "14", "x", "8", "x", "16", "x", "x", "4", "8"], ["9", "x", "4", "x", "x", "7", "11", "x", "x", "13", "x", "x", "6", "11", "x"], ["x", "x", "10", "14", "x", "x", "18", "x", "x", "x", "x", "x", "6", "16", "x"], ["x", "14", "x", "1", "x", "7", "5", "16", "x", "19", "x", "x", "10", "7", "x"], ["1", "3", "x", "19", "7", "2", "17", "x", "x", "6", "x", "x", "x", "10", "14"], ["14", "x", "x", "x", "12", "x", "16", "5", "8", "12", "17", "2", "19", "x", "5"], ["9", "9", "8", "15", "18", "x", "16", "x", "10", "x", "x", "14", "x", "x", "x"], ["18", "20", "x", "x", "11", "2", "17", "6", "x", "18", "8", "x", "6", "16", "x"], ["12", "x", "x", "x", "x", "7", "14", "4", "8", "12", "3", "x", "15", "13", "2"], ["16", "x", "x", "x", "12", "x", "8", "1", "7", "7", "12", "17", "2", "2", "7"], ["x", "13", "3", "3", "1", "x", "6", "14", "20", "8", "x", "4", "10", "17", "x"], ["1", "8", "x", "16", "x", "x", "x", "9", "x", "x", "10", "x", "x", "5", "8"], ["x", "x", "1", "x", "x", "6", "x", "x", "x", "7", "16", "x", "x", "x", "x"], ["14", "x", "x", "10", "18", "x", "6", "13", "x", "x", "x", "x", "x", "15", "x"], ["x", "8", "2", "x", "17", "x", "12", "16", "11", "4", "4", "x", "x", "17", "x"]], [4, 0], [9, 11], 4, 9]
["[['x', '2', '16', 'x', '9', 'x', '14', 'x', '8', 'x', '16', 'x', 'x', '4', '8'], ['9', 'x', '4', 'x', 'x', '7', '11', 'x', 'x', '13', 'x', 'x', '6', '11', 'x'], ['x', 'x', '10', '14', 'x', 'x', '18', 'x', 'x', 'x', 'x', 'x', '6', '16', 'x'], ['x', '14', 'x', '1', 'x', '7', '5', '16', 'x', '19', 'x', 'x', '10', '7', 'x'], ['1', '3', 'x', '19', '7', '2', '17', 'x', 'x', '6', 'x', 'x', 'x', '10', '14'], ['14', 'x', 'x', 'x', '12', 'x', '16', '5', '8', '12', '17', '2', '19', 'x', '5'], ['9', '9', '8', '15', '18', 'x', '16', 'x', '10', 'x', 'x', '14', 'x', 'x', 'x'], ['18', '20', 'x', 'x', '11', '2', '17', '6', 'x', '18', '8', 'x', '6', '16', 'x'], ['12', 'x', 'x', 'x', 'x', '7', '14', '4', '8', '12', '3', 'x', '15', '13', '2'], ['16', 'x', 'x', 'x', '12', 'x', '8', '1', '7', '7', '12', '17', '2', '2', '7'], ['x', '13', '3', '3', '1', 'x', '6', '14', '20', '8', 'x', '4', '10', '17', 'x'], ['1', '8', 'x', '16', 'x', 'x', 'x', '9', 'x', 'x', '10', 'x', 'x', '5', '8'], ['x', 'x', '1', 'x', 'x', '6', 'x', 'x', 'x', '7', '16', 'x', 'x', 'x', 'x'], ['14', 'x', 'x', '10', '18', 'x', '6', '13', 'x', 'x', 'x', 'x', 'x', '15', 'x'], ['x', '8', '2', 'x', '17', 'x', '12', '16', '11', '4', '4', 'x', 'x', '17', 'x']]", "(4, 0)", "(9, 11)", "4", "9"]
100
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 (2, 2) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (13, 14). 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 1 1 1 0 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 1 1 0 0 1 1 1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 0 0 1 1 0 1 1 1 1 1 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 1 1 1 0 0 0 0 0 1 1 0 0 1 1 0 0 1 0 0 0 0 1 1 1 1 1 0 1 0 0 1 1 0 1 0 0 0 1 0 1 0 0 1 1 0 1 0 1 0 0 0 0 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 1 1 0 0 0 1 0 0 1 0 1 1 1 0 0 1 0 0 0 1 1 0 0 1 1 1 1 1 0 0 0 0 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 1 0 1 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 0 0 1 1 0 1 1 1
trampoline_matrix
pathfinding
15
[[2, 2], [1, 3], [0, 4], [0, 5], [1, 5], [2, 5], [2, 6], [3, 6], [3, 7], [3, 8], [4, 8], [4, 9], [4, 10], [4, 11], [5, 11], [6, 11], [7, 12], [8, 12], [9, 12], [10, 13], [11, 13], [12, 14], [13, 14]]
23
0.03257179260253906
23
8
2
["[[1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0], [1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0], [1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0], [0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0], [0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1], [1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0], [1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0], [1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1]]", 5]
["[[1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0], [1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,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, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0], [1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0], [1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1]]", "(2, 2)", "(13, 14)", "5"]
100
Given 9 labeled water jugs with capacities 126, 120, 127, 110, 54, 39, 38, 47, 139, 99 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 219, 240, 312, 411 liters of water respectively. The amount of water in each unlabeled bucket can not at any point in time exceed the amount of water in the bucket placed after it. Jugs can only be filled to the top and emptied completely, and the unlabeled buckets cannot be overfilled. An action, represented as a tuple ('+', X, Y) or ('-', X, Y), involves adding to or removing water from the unlabeled bucket numbered Y, using the jug with capacity X. Determine the shortest sequence of actions needed to fill the buckets as specified, and present the solution as a list of action tuples in Python syntax.
water_jug
subset_sum
7
[["+", 99, 4], ["+", 139, 4], ["+", 47, 4], ["+", 126, 4], ["+", 47, 3], ["+", 126, 3], ["+", 139, 3], ["+", 120, 2], ["+", 120, 2], ["+", 99, 1], ["+", 120, 1]]
11
0.045166015625
11
80
3
[[126, 120, 127, 110, 54, 39, 38, 47, 139, 99], [219, 240, 312, 411]]
[[126, 120, 127, 110, 54, 39, 38, 47, 139, 99], [219, 240, 312, 411]]
["[126, 120, 127, 110, 54, 39, 38, 47, 139, 99]", "[219, 240, 312, 411]"]
101
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'P'. Our task is to visit city N and city I excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from I and N, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. S Z I R P T X B F A L M G N E S 0 1 0 0 1 0 0 1 0 1 1 0 0 0 1 Z 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 I 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 R 1 1 1 0 1 0 0 1 0 0 0 1 1 0 0 P 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 T 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 X 0 0 1 1 1 1 0 1 0 0 1 1 1 0 0 B 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 F 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 L 0 1 1 1 1 0 0 0 0 1 0 0 0 1 0 M 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 G 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 N 0 0 0 1 1 0 0 1 0 0 0 1 1 0 0 E 0 0 0 1 0 1 0 0 0 1 0 0 1 1 0
city_directed_graph
pathfinding
15
["P", "E", "N", "B", "N", "R", "I", "F", "X", "I"]
10
0.16242361068725586
10
15
18
[[[0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0], [1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0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M", "G", "N", "E"], "P", "N", "I"]
["[[0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0], [1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0]]", "['S', 'Z', 'I', 'R', 'P', 'T', 'X', 'B', 'F', 'A', 'L', 'M', 'G', 'N', 'E']", "['P']", "['N', 'I']"]
101
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [29, 25, 15, 12, 40, 23, 36, 22, 16, 24, 51, 34, 46, 29, 20, 14, 21, 27, 15, 31, 15, 17, 9, 42, 30, 45, 14, 14, 30, 16, 44, 32, 6, 15, 5, 41, 18, 43, 36, 31, 27, 26, 6, 44, 33, 23, 7, 19], 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 {41: 15, 22: 3, 9: 4, 34: 9, 32: 11, 36: 5, 18: 5, 40: 9, 46: 11, 45: 17, 33: 3, 14: 9, 12: 12, 7: 2, 43: 14, 25: 18, 31: 9, 51: 8, 24: 18, 17: 3, 16: 5, 19: 10, 6: 6, 27: 15, 42: 7, 23: 2, 29: 2, 21: 13, 30: 7, 44: 4, 5: 2, 20: 11, 26: 12, 15: 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
31
[44, 36, 22, 23, 23, 29, 29, 33, 51, 44, 42, 36, 18, 31, 16]
66
0.06806683540344238
15
48
48
[[29, 25, 15, 12, 40, 23, 36, 22, 16, 24, 51, 34, 46, 29, 20, 14, 21, 27, 15, 31, 15, 17, 9, 42, 30, 45, 14, 14, 30, 16, 44, 32, 6, 15, 5, 41, 18, 43, 36, 31, 27, 26, 6, 44, 33, 23, 7, 19]]
[[29, 25, 15, 12, 40, 23, 36, 22, 16, 24, 51, 34, 46, 29, 20, 14, 21, 27, 15, 31, 15, 17, 9, 42, 30, 45, 14, 14, 30, 16, 44, 32, 6, 15, 5, 41, 18, 43, 36, 31, 27, 26, 6, 44, 33, 23, 7, 19], {"41": 15, "22": 3, "9": 4, "34": 9, "32": 11, "36": 5, "18": 5, "40": 9, "46": 11, "45": 17, "33": 3, "14": 9, "12": 12, "7": 2, "43": 14, "25": 18, "31": 9, "51": 8, "24": 18, "17": 3, "16": 5, "19": 10, "6": 6, "27": 15, "42": 7, "23": 2, "29": 2, "21": 13, "30": 7, "44": 4, "5": 2, "20": 11, "26": 12, "15": 8}, 477]
["[29, 25, 15, 12, 40, 23, 36, 22, 16, 24, 51, 34, 46, 29, 20, 14, 21, 27, 15, 31, 15, 17, 9, 42, 30, 45, 14, 14, 30, 16, 44, 32, 6, 15, 5, 41, 18, 43, 36, 31, 27, 26, 6, 44, 33, 23, 7, 19]", "{41: 15, 22: 3, 9: 4, 34: 9, 32: 11, 36: 5, 18: 5, 40: 9, 46: 11, 45: 17, 33: 3, 14: 9, 12: 12, 7: 2, 43: 14, 25: 18, 31: 9, 51: 8, 24: 18, 17: 3, 16: 5, 19: 10, 6: 6, 27: 15, 42: 7, 23: 2, 29: 2, 21: 13, 30: 7, 44: 4, 5: 2, 20: 11, 26: 12, 15: 8}", "477"]
101
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 30 to 86. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 260, 216, None for columns 1 to 2 respectively, and the sums of rows must be None, 183, 217, 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 214. 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: [['70' 'x' '50' 'x'] ['x' '39' '46' 'x'] ['34' '60' 'x' '51'] ['x' 'x' 'x' '68']]
magic_square
underdetermined_system
10
[[0, 1, 76], [0, 3, 30], [1, 0, 31], [1, 3, 67], [2, 2, 72], [3, 0, 78], [3, 1, 85], [3, 2, 48]]
905
50.447338819503784
8
36
16
["[['70', '', '50', ''], ['', '39', '46', ''], ['34', '60', '', '51'], ['', '', '', '68']]", 4, 30, 86]
["[['70', '', '50', ''], ['', '39', '46', ''], ['34', '60', '', '51'], ['', '', '', '68']]", 30, 86, [1, 3], [1, 3], [260, 216], [183, 217], 214]
["[['70', '', '50', ''], ['', '39', '46', ''], ['34', '60', '', '51'], ['', '', '', '68']]", "30", "86", "[None, 260, 216, None]", "[None, 183, 217, None]", "214"]
101
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, 0) to his destination workshop at index (4, 13), 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 3 1 19 8 1 4 18 15 17 4 3 x 3 x] [x 11 x x x 12 x 19 15 4 x x x x x] [4 1 x 8 x 12 17 x 14 4 9 11 13 6 19] [2 x 6 14 15 x 18 9 x 10 10 x x 1 x] [x 11 x 8 x 5 x 8 7 6 x x 13 6 x] [x x x 17 x 13 x x x x 18 19 5 x x] [x 12 18 x x x 19 x 12 x 11 7 19 12 x] [6 6 x 6 4 x 18 x x 15 18 x 6 8 x] [10 10 x x 6 4 11 19 x 9 x 2 x 3 14] [x 18 14 10 x 1 x 6 x 15 x 6 x 14 x] [x x 7 10 x 2 x 7 14 4 11 x x x x] [12 x 6 x 8 5 6 6 8 x x x x 4 7] [x x 1 8 10 4 10 17 19 11 2 x x x 16] [x x x 17 8 19 x 14 x 17 17 5 7 6 7] [1 x 14 x 3 x 18 6 18 8 x 13 10 x x]
traffic
pathfinding
7
[[7, 0], [7, 1], [8, 1], [9, 1], [9, 2], [10, 2], [11, 2], [12, 2], [12, 3], [12, 4], [12, 5], [11, 5], [11, 6], [11, 7], [10, 7], [10, 8], [10, 9], [9, 9], [8, 9], [7, 9], [7, 10], [6, 10], [6, 11], [5, 11], [5, 12], [4, 12], [4, 13]]
244
0.02743220329284668
27
4
4
[[["x", "3", "1", "19", "8", "1", "4", "18", "15", "17", "4", "3", "x", "3", "x"], ["x", "11", "x", "x", "x", "12", "x", "19", "15", "4", "x", "x", "x", "x", "x"], ["4", "1", "x", "8", "x", "12", "17", "x", "14", "4", "9", "11", "13", "6", "19"], ["2", "x", "6", "14", "15", "x", "18", "9", "x", "10", "10", "x", "x", "1", "x"], ["x", "11", "x", "8", "x", "5", "x", "8", "7", "6", "x", "x", "13", "6", "x"], ["x", "x", "x", "17", "x", "13", "x", "x", "x", "x", "18", "19", "5", "x", "x"], ["x", "12", "18", "x", "x", "x", "19", "x", "12", "x", "11", "7", "19", "12", "x"], ["6", "6", "x", "6", "4", "x", "18", "x", "x", "15", "18", "x", "6", "8", "x"], ["10", "10", "x", "x", "6", "4", "11", "19", "x", "9", "x", "2", "x", "3", "14"], ["x", "18", "14", "10", "x", "1", "x", "6", "x", "15", "x", "6", "x", "14", "x"], ["x", "x", "7", "10", "x", "2", "x", "7", "14", "4", "11", "x", "x", "x", "x"], ["12", "x", "6", "x", "8", "5", "6", "6", "8", "x", "x", "x", "x", "4", "7"], ["x", "x", "1", "8", "10", "4", "10", "17", "19", "11", "2", "x", "x", "x", "16"], ["x", "x", "x", "17", "8", "19", "x", "14", "x", "17", "17", "5", "7", "6", "7"], ["1", "x", "14", "x", "3", "x", "18", "6", "18", "8", "x", "13", "10", "x", "x"]]]
[[["x", "3", "1", "19", "8", "1", "4", "18", "15", "17", "4", "3", "x", "3", "x"], ["x", "11", "x", "x", "x", "12", "x", "19", "15", "4", "x", "x", "x", "x", "x"], ["4", "1", "x", "8", "x", "12", "17", "x", "14", "4", "9", "11", "13", "6", "19"], ["2", "x", "6", "14", "15", "x", "18", "9", "x", "10", "10", "x", "x", "1", "x"], ["x", "11", "x", "8", "x", "5", "x", "8", "7", "6", "x", "x", "13", "6", "x"], ["x", "x", "x", "17", "x", "13", "x", "x", "x", "x", "18", "19", "5", "x", "x"], ["x", "12", "18", "x", "x", "x", "19", "x", "12", "x", "11", "7", "19", "12", "x"], ["6", "6", "x", "6", "4", "x", "18", "x", "x", "15", "18", "x", "6", "8", "x"], ["10", "10", "x", "x", "6", "4", "11", "19", "x", "9", "x", "2", "x", "3", "14"], ["x", "18", "14", "10", "x", "1", "x", "6", "x", "15", "x", "6", "x", "14", "x"], ["x", "x", "7", "10", "x", "2", "x", "7", "14", "4", "11", "x", "x", "x", "x"], ["12", "x", "6", "x", "8", "5", "6", "6", "8", "x", "x", "x", "x", "4", "7"], ["x", "x", "1", "8", "10", "4", "10", "17", "19", "11", "2", "x", "x", "x", "16"], ["x", "x", "x", "17", "8", "19", "x", "14", "x", "17", "17", "5", "7", "6", "7"], ["1", "x", "14", "x", "3", "x", "18", "6", "18", "8", "x", "13", "10", "x", "x"]], [7, 0], [4, 13], 4, 8]
["[['x', '3', '1', '19', '8', '1', '4', '18', '15', '17', '4', '3', 'x', '3', 'x'], ['x', '11', 'x', 'x', 'x', '12', 'x', '19', '15', '4', 'x', 'x', 'x', 'x', 'x'], ['4', '1', 'x', '8', 'x', '12', '17', 'x', '14', '4', '9', '11', '13', '6', '19'], ['2', 'x', '6', '14', '15', 'x', '18', '9', 'x', '10', '10', 'x', 'x', '1', 'x'], ['x', '11', 'x', '8', 'x', '5', 'x', '8', '7', '6', 'x', 'x', '13', '6', 'x'], ['x', 'x', 'x', '17', 'x', '13', 'x', 'x', 'x', 'x', '18', '19', '5', 'x', 'x'], ['x', '12', '18', 'x', 'x', 'x', '19', 'x', '12', 'x', '11', '7', '19', '12', 'x'], ['6', '6', 'x', '6', '4', 'x', '18', 'x', 'x', '15', '18', 'x', '6', '8', 'x'], ['10', '10', 'x', 'x', '6', '4', '11', '19', 'x', '9', 'x', '2', 'x', '3', '14'], ['x', '18', '14', '10', 'x', '1', 'x', '6', 'x', '15', 'x', '6', 'x', '14', 'x'], ['x', 'x', '7', '10', 'x', '2', 'x', '7', '14', '4', '11', 'x', 'x', 'x', 'x'], ['12', 'x', '6', 'x', '8', '5', '6', '6', '8', 'x', 'x', 'x', 'x', '4', '7'], ['x', 'x', '1', '8', '10', '4', '10', '17', '19', '11', '2', 'x', 'x', 'x', '16'], ['x', 'x', 'x', '17', '8', '19', 'x', '14', 'x', '17', '17', '5', '7', '6', '7'], ['1', 'x', '14', 'x', '3', 'x', '18', '6', '18', '8', 'x', '13', '10', 'x', 'x']]", "(7, 0)", "(4, 13)", "4", "8"]
101
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 (0, 3) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (14, 11). 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 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 1 1 1 0 0 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 0 1 1 1 0 0 1 0 0 1 0 1 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 1 1 0 1 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 1 0 0 1 1 1 1 0 1 1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 1
trampoline_matrix
pathfinding
15
[[0, 3], [0, 4], [1, 4], [2, 4], [3, 4], [4, 4], [4, 5], [5, 5], [6, 5], [7, 5], [8, 5], [9, 5], [9, 6], [10, 7], [11, 8], [12, 9], [13, 10], [14, 11]]
18
0.027624130249023438
18
8
2
["[[1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0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ter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'S'. Our task is to visit city T and city C excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from C and T, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. M Y Q T E A J S V F W N Z C I M 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 Y 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 Q 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 T 0 1 1 0 0 0 1 0 1 0 0 0 0 0 0 E 0 0 1 0 0 0 0 0 0 0 1 0 1 1 0 A 1 0 1 1 0 0 1 1 0 1 0 0 0 0 0 J 1 1 0 1 0 0 0 0 0 1 0 0 0 0 0 S 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 V 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 F 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 W 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 N 1 0 1 1 1 0 0 0 0 1 0 0 0 0 1 Z 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 C 0 0 0 1 0 0 0 0 1 1 0 1 0 0 0 I 0 0 1 0 1 1 1 0 1 0 0 0 0 0 0
city_directed_graph
pathfinding
15
["S", "J", "F", "C", "T", "V", "Z", "C", "T"]
9
0.04518413543701172
9
15
18
[[[0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0], [1, 0, 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0, 1, 0, 0, 0, 0, 1], [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0], [0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0]], ["M", "Y", "Q", "T", "E", "A", "J", "S", "V", "F", "W", "N", "Z", "C", "I"], "S", "T", "C"]
["[[0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0], [1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0], [0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0]]", "['M', 'Y', 'Q', 'T', 'E', 'A', 'J', 'S', 'V', 'F', 'W', 'N', 'Z', 'C', 'I']", "['S']", "['T', 'C']"]
102
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [14, 29, 39, 40, 16, 35, 17, 37, 43, 30, 28, 26, 13, 13, 42, 30, 10, 7, 44, 5, 34, 7, 32, 11, 40, 35, 12, 34, 35, 38, 29, 42, 33, 26, 4, 36, 41, 35, 26, 34, 16, 6, 38, 13, 41, 23, 20], such that the sum of the chosen coins adds up to 449. 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 {11: 4, 10: 3, 41: 9, 34: 4, 7: 2, 17: 16, 29: 8, 37: 1, 44: 8, 30: 13, 32: 9, 20: 18, 23: 8, 6: 4, 5: 3, 14: 3, 13: 7, 35: 4, 33: 5, 39: 9, 40: 11, 28: 3, 4: 2, 43: 14, 42: 15, 38: 14, 16: 5, 36: 5, 12: 9, 26: 1}, 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
32
[26, 35, 26, 35, 26, 35, 34, 35, 34, 37, 36, 34, 28, 14, 10, 4]
48
0.08744978904724121
16
47
47
[[14, 29, 39, 40, 16, 35, 17, 37, 43, 30, 28, 26, 13, 13, 42, 30, 10, 7, 44, 5, 34, 7, 32, 11, 40, 35, 12, 34, 35, 38, 29, 42, 33, 26, 4, 36, 41, 35, 26, 34, 16, 6, 38, 13, 41, 23, 20]]
[[14, 29, 39, 40, 16, 35, 17, 37, 43, 30, 28, 26, 13, 13, 42, 30, 10, 7, 44, 5, 34, 7, 32, 11, 40, 35, 12, 34, 35, 38, 29, 42, 33, 26, 4, 36, 41, 35, 26, 34, 16, 6, 38, 13, 41, 23, 20], {"11": 4, "10": 3, "41": 9, "34": 4, "7": 2, "17": 16, "29": 8, "37": 1, "44": 8, "30": 13, "32": 9, "20": 18, "23": 8, "6": 4, "5": 3, "14": 3, "13": 7, "35": 4, "33": 5, "39": 9, "40": 11, "28": 3, "4": 2, "43": 14, "42": 15, "38": 14, "16": 5, "36": 5, "12": 9, "26": 1}, 449]
["[14, 29, 39, 40, 16, 35, 17, 37, 43, 30, 28, 26, 13, 13, 42, 30, 10, 7, 44, 5, 34, 7, 32, 11, 40, 35, 12, 34, 35, 38, 29, 42, 33, 26, 4, 36, 41, 35, 26, 34, 16, 6, 38, 13, 41, 23, 20]", "{11: 4, 10: 3, 41: 9, 34: 4, 7: 2, 17: 16, 29: 8, 37: 1, 44: 8, 30: 13, 32: 9, 20: 18, 23: 8, 6: 4, 5: 3, 14: 3, 13: 7, 35: 4, 33: 5, 39: 9, 40: 11, 28: 3, 4: 2, 43: 14, 42: 15, 38: 14, 16: 5, 36: 5, 12: 9, 26: 1}", "449"]
102
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, 279, 306, None for columns 1 to 2 respectively, and the sums of rows must be None, 315, 234, 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 264. 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: [['44' 'x' 'x' 'x'] ['90' '52' 'x' '91'] ['x' '58' 'x' '62'] ['x' '80' 'x' 'x']]
magic_square
underdetermined_system
10
[[0, 1, 89], [0, 2, 59], [0, 3, 38], [1, 2, 82], [2, 0, 36], [2, 2, 78], [3, 0, 86], [3, 2, 87], [3, 3, 37]]
1069
51.39947175979614
9
36
16
["[['44', '', '', ''], ['90', '52', '', '91'], ['', '58', '', '62'], ['', '80', '', '']]", 4, 36, 92]
["[['44', '', '', ''], ['90', '52', '', '91'], ['', '58', '', '62'], ['', '80', '', '']]", 36, 92, [1, 3], [1, 3], [279, 306], [315, 234], 264]
["[['44', '', '', ''], ['90', '52', '', '91'], ['', '58', '', '62'], ['', '80', '', '']]", "36", "92", "[None, 279, 306, None]", "[None, 315, 234, None]", "264"]
102
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 (5, 0) to his destination workshop at index (7, 13), 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 5, district 2 covering rows 6 to 6, and district 3 covering rows 7 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 13 x x x x 3 4 x x 9 x 18 7 2] [1 10 17 x x x 11 13 x 10 x 9 13 x x] [x x 7 18 x x x x 7 x x x 1 x 16] [10 x x x 13 x 2 9 x x 8 x x 5 x] [x 7 12 x 1 18 14 x 7 x x 16 x x 19] [5 1 13 17 11 14 16 x 14 x 18 5 x 18 x] [x 15 19 4 x 13 x 5 x x 18 x 17 x x] [3 7 x x x 12 x x 17 4 x 13 19 3 10] [11 x x x x 2 2 19 13 4 7 17 16 x 17] [12 5 4 x x x x 12 8 11 x 17 14 19 2] [4 10 x x 6 11 16 17 x x 18 x 17 x x] [x x x x 11 9 18 17 12 x x x x x 1] [18 13 7 x x 5 4 13 x x 19 12 1 18 x] [15 x 17 x x x 17 x x x 10 x 15 16 x] [x x 11 15 x x 12 16 12 13 18 x 17 8 15]
traffic
pathfinding
7
[[5, 0], [5, 1], [5, 2], [5, 3], [5, 4], [5, 5], [6, 5], [7, 5], [8, 5], [8, 6], [8, 7], [8, 8], [8, 9], [8, 10], [8, 11], [7, 11], [7, 12], [7, 13]]
180
0.028650999069213867
18
4
4
[[["x", "13", "x", "x", "x", "x", "3", "4", "x", "x", "9", "x", "18", "7", "2"], ["1", "10", "17", "x", "x", "x", "11", "13", "x", "10", "x", "9", "13", "x", "x"], ["x", "x", "7", "18", "x", "x", "x", "x", "7", "x", "x", "x", "1", "x", "16"], ["10", "x", "x", "x", "13", "x", "2", "9", "x", "x", "8", "x", "x", "5", "x"], ["x", "7", "12", "x", "1", "18", "14", "x", "7", "x", "x", "16", "x", "x", "19"], ["5", "1", "13", "17", "11", "14", "16", "x", "14", "x", "18", "5", "x", "18", "x"], ["x", "15", "19", "4", "x", "13", "x", "5", "x", "x", "18", "x", "17", "x", "x"], ["3", "7", "x", "x", "x", "12", "x", "x", "17", "4", "x", "13", "19", "3", "10"], ["11", "x", "x", "x", "x", "2", "2", "19", "13", "4", "7", "17", "16", "x", "17"], ["12", "5", "4", "x", "x", "x", "x", "12", "8", "11", "x", "17", "14", "19", "2"], ["4", "10", "x", "x", "6", "11", "16", "17", "x", "x", "18", "x", "17", "x", "x"], ["x", "x", "x", "x", "11", "9", "18", "17", "12", "x", "x", "x", "x", "x", "1"], ["18", "13", "7", "x", "x", "5", "4", "13", "x", "x", "19", "12", "1", "18", "x"], ["15", "x", "17", "x", "x", "x", "17", "x", "x", "x", "10", "x", "15", "16", "x"], ["x", "x", "11", "15", "x", "x", "12", "16", "12", "13", "18", "x", "17", "8", "15"]]]
[[["x", "13", "x", "x", "x", "x", "3", "4", "x", "x", "9", "x", "18", "7", "2"], ["1", "10", "17", "x", "x", "x", "11", "13", "x", "10", "x", "9", "13", "x", "x"], ["x", "x", "7", "18", "x", "x", "x", "x", "7", "x", "x", "x", "1", "x", "16"], ["10", "x", "x", "x", "13", "x", "2", "9", "x", "x", "8", "x", "x", "5", "x"], ["x", "7", "12", "x", "1", "18", "14", "x", "7", "x", "x", "16", "x", "x", "19"], ["5", "1", "13", "17", "11", "14", "16", "x", "14", "x", "18", "5", "x", "18", "x"], ["x", "15", "19", "4", "x", "13", "x", "5", "x", "x", "18", "x", "17", "x", "x"], ["3", "7", "x", "x", "x", "12", "x", "x", "17", "4", "x", "13", "19", "3", "10"], ["11", "x", "x", "x", "x", "2", "2", "19", "13", "4", "7", "17", "16", "x", "17"], ["12", "5", "4", "x", "x", "x", "x", "12", "8", "11", "x", "17", "14", "19", "2"], ["4", "10", "x", "x", "6", "11", "16", "17", "x", "x", "18", "x", "17", "x", "x"], ["x", "x", "x", "x", "11", "9", "18", "17", "12", "x", "x", "x", "x", "x", "1"], ["18", "13", "7", "x", "x", "5", "4", "13", "x", "x", "19", "12", "1", "18", "x"], ["15", "x", "17", "x", "x", "x", "17", "x", "x", "x", "10", "x", "15", "16", "x"], ["x", "x", "11", "15", "x", "x", "12", "16", "12", "13", "18", "x", "17", "8", "15"]], [5, 0], [7, 13], 5, 6]
["[['x', '13', 'x', 'x', 'x', 'x', '3', '4', 'x', 'x', '9', 'x', '18', '7', '2'], ['1', '10', '17', 'x', 'x', 'x', '11', '13', 'x', '10', 'x', '9', '13', 'x', 'x'], ['x', 'x', '7', '18', 'x', 'x', 'x', 'x', '7', 'x', 'x', 'x', '1', 'x', '16'], ['10', 'x', 'x', 'x', '13', 'x', '2', '9', 'x', 'x', '8', 'x', 'x', '5', 'x'], ['x', '7', '12', 'x', '1', '18', '14', 'x', '7', 'x', 'x', '16', 'x', 'x', '19'], ['5', '1', '13', '17', '11', '14', '16', 'x', '14', 'x', '18', '5', 'x', '18', 'x'], ['x', '15', '19', '4', 'x', '13', 'x', '5', 'x', 'x', '18', 'x', '17', 'x', 'x'], ['3', '7', 'x', 'x', 'x', '12', 'x', 'x', '17', '4', 'x', '13', '19', '3', '10'], ['11', 'x', 'x', 'x', 'x', '2', '2', '19', '13', '4', '7', '17', '16', 'x', '17'], ['12', '5', '4', 'x', 'x', 'x', 'x', '12', '8', '11', 'x', '17', '14', '19', '2'], ['4', '10', 'x', 'x', '6', '11', '16', '17', 'x', 'x', '18', 'x', '17', 'x', 'x'], ['x', 'x', 'x', 'x', '11', '9', '18', '17', '12', 'x', 'x', 'x', 'x', 'x', '1'], ['18', '13', '7', 'x', 'x', '5', '4', '13', 'x', 'x', '19', '12', '1', '18', 'x'], ['15', 'x', '17', 'x', 'x', 'x', '17', 'x', 'x', 'x', '10', 'x', '15', '16', 'x'], ['x', 'x', '11', '15', 'x', 'x', '12', '16', '12', '13', '18', 'x', '17', '8', '15']]", "(5, 0)", "(7, 13)", "5", "6"]
102
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, 13) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (2, 5). 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 1 0 1 1 1 0 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 1 1 0 1 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 0 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 0 0 1 0 0 1 1 1 1 1 1 0 1 0 0 1 1 0 0 0 0 1 0 0 1 0 1 1 0 0 0 1 1 1 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0 0 0 0 1 1 1 1 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 1 0 1 1 1 0 1 0 1
trampoline_matrix
pathfinding
15
[[14, 13], [13, 13], [12, 13], [11, 13], [10, 13], [9, 12], [9, 11], [8, 10], [7, 10], [6, 10], [5, 10], [4, 9], [3, 8], [2, 7], [2, 6], [2, 5]]
16
0.03172016143798828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1, 0, 1, 0, 1]]", "(14, 13)", "(2, 5)", "5"]
103
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [40, 28, 46, 16, 13, 15, 38, 39, 3, 8, 40, 41, 18, 48, 16, 25, 39, 14, 47, 46, 31, 16, 41, 45, 9, 26, 33, 46, 17, 23, 6, 46, 7, 43, 10, 28, 47, 15, 35, 20, 32, 4, 32, 9, 48, 7, 34, 46, 10, 39, 44], such that the sum of the chosen coins adds up to 485. 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 {44: 6, 39: 15, 4: 2, 23: 11, 7: 2, 40: 10, 13: 10, 34: 8, 45: 9, 10: 3, 35: 18, 14: 2, 28: 5, 46: 12, 25: 3, 26: 18, 15: 11, 31: 2, 20: 15, 9: 7, 41: 13, 18: 16, 32: 11, 3: 3, 48: 20, 38: 4, 43: 6, 33: 9, 16: 13, 8: 4, 17: 1, 47: 17, 6: 5}, 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
33
[44, 38, 14, 25, 31, 28, 10, 4, 43, 34, 28, 45, 40, 10, 17, 33, 41]
91
0.0840153694152832
17
51
51
[[40, 28, 46, 16, 13, 15, 38, 39, 3, 8, 40, 41, 18, 48, 16, 25, 39, 14, 47, 46, 31, 16, 41, 45, 9, 26, 33, 46, 17, 23, 6, 46, 7, 43, 10, 28, 47, 15, 35, 20, 32, 4, 32, 9, 48, 7, 34, 46, 10, 39, 44]]
[[40, 28, 46, 16, 13, 15, 38, 39, 3, 8, 40, 41, 18, 48, 16, 25, 39, 14, 47, 46, 31, 16, 41, 45, 9, 26, 33, 46, 17, 23, 6, 46, 7, 43, 10, 28, 47, 15, 35, 20, 32, 4, 32, 9, 48, 7, 34, 46, 10, 39, 44], {"44": 6, "39": 15, "4": 2, "23": 11, "7": 2, "40": 10, "13": 10, "34": 8, "45": 9, "10": 3, "35": 18, "14": 2, "28": 5, "46": 12, "25": 3, "26": 18, "15": 11, "31": 2, "20": 15, "9": 7, "41": 13, "18": 16, "32": 11, "3": 3, "48": 20, "38": 4, "43": 6, "33": 9, "16": 13, "8": 4, "17": 1, "47": 17, "6": 5}, 485]
["[40, 28, 46, 16, 13, 15, 38, 39, 3, 8, 40, 41, 18, 48, 16, 25, 39, 14, 47, 46, 31, 16, 41, 45, 9, 26, 33, 46, 17, 23, 6, 46, 7, 43, 10, 28, 47, 15, 35, 20, 32, 4, 32, 9, 48, 7, 34, 46, 10, 39, 44]", "{44: 6, 39: 15, 4: 2, 23: 11, 7: 2, 40: 10, 13: 10, 34: 8, 45: 9, 10: 3, 35: 18, 14: 2, 28: 5, 46: 12, 25: 3, 26: 18, 15: 11, 31: 2, 20: 15, 9: 7, 41: 13, 18: 16, 32: 11, 3: 3, 48: 20, 38: 4, 43: 6, 33: 9, 16: 13, 8: 4, 17: 1, 47: 17, 6: 5}", "485"]
103
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, 295, 200, None for columns 1 to 2 respectively, and the sums of rows must be None, 234, 271, 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 248. 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: [['39' '47' 'x' 'x'] ['x' 'x' 'x' '40'] ['63' '82' '59' 'x'] ['x' '78' 'x' 'x']]
magic_square
underdetermined_system
10
[[0, 2, 36], [0, 3, 42], [1, 0, 38], [1, 1, 88], [1, 2, 68], [2, 3, 67], [3, 0, 56], [3, 2, 37], [3, 3, 41]]
881
8.308101177215576
9
36
16
["[['39', '47', '', ''], ['', '', '', '40'], ['63', '82', '59', ''], ['', '78', '', '']]", 4, 36, 92]
["[['39', '47', '', ''], ['', '', '', '40'], ['63', '82', '59', ''], ['', '78', '', '']]", 36, 92, [1, 3], [1, 3], [295, 200], [234, 271], 248]
["[['39', '47', '', ''], ['', '', '', '40'], ['63', '82', '59', ''], ['', '78', '', '']]", "36", "92", "[None, 295, 200, None]", "[None, 234, 271, None]", "248"]
103
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 (2, 0) to his destination workshop at index (6, 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 2, district 2 covering rows 3 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. [6 6 2 x 13 x x x x 11 x x x 3 x] [6 11 x 14 x x x 1 5 6 1 19 2 7 14] [16 4 12 13 17 4 x x x 14 x x 9 9 13] [x 11 6 14 x 16 x 1 10 18 11 x x 13 x] [x x 14 4 19 1 2 16 15 x 15 x x x x] [13 6 16 13 5 9 x 6 10 3 1 14 x 17 x] [x x 19 8 x 2 4 x x 4 9 13 13 11 5] [x 11 17 19 11 18 x 8 x x 17 17 13 9 15] [11 4 x 3 3 8 5 x x x 20 19 x x 12] [2 x x x x 16 7 13 4 x 7 16 x 5 1] [14 9 x x x x x x 19 x 14 20 11 16 x] [3 x 1 x 13 x 9 x 15 19 4 x x x 2] [x 8 x x x 6 x 16 x x x x 2 17 18] [x x 11 x x 14 6 x 15 x x 18 x x x] [8 x 5 1 7 14 x x x x 14 7 x 8 x]
traffic
pathfinding
7
[[2, 0], [2, 1], [3, 1], [3, 2], [3, 3], [4, 3], [4, 4], [4, 5], [4, 6], [4, 7], [5, 7], [5, 8], [5, 9], [5, 10], [6, 10], [6, 11], [6, 12], [6, 13], [6, 14], [7, 14], [8, 14], [9, 14], [8, 14], [7, 14], [6, 14]]
208
0.028629302978515625
25
4
4
[[["6", "6", "2", "x", "13", "x", "x", "x", "x", "11", "x", "x", "x", "3", "x"], ["6", "11", "x", "14", "x", "x", "x", "1", "5", "6", "1", "19", "2", "7", "14"], ["16", "4", "12", "13", "17", "4", "x", "x", "x", "14", "x", "x", "9", "9", "13"], ["x", "11", "6", "14", "x", "16", "x", "1", "10", "18", "11", "x", "x", "13", "x"], ["x", "x", "14", "4", "19", "1", "2", "16", "15", "x", "15", "x", "x", "x", "x"], ["13", "6", "16", "13", "5", "9", "x", "6", "10", "3", "1", "14", "x", "17", "x"], ["x", "x", "19", "8", "x", "2", "4", "x", "x", "4", "9", "13", "13", "11", "5"], ["x", "11", "17", "19", "11", "18", "x", "8", "x", "x", "17", "17", "13", "9", "15"], ["11", "4", "x", "3", "3", "8", "5", "x", "x", "x", "20", "19", "x", "x", "12"], ["2", "x", "x", "x", "x", "16", "7", "13", "4", "x", "7", "16", "x", "5", "1"], ["14", "9", "x", "x", "x", "x", "x", "x", "19", "x", "14", "20", "11", "16", "x"], ["3", "x", "1", "x", "13", "x", "9", "x", "15", "19", "4", "x", "x", "x", "2"], ["x", "8", "x", "x", "x", "6", "x", "16", "x", "x", "x", "x", "2", "17", "18"], ["x", "x", "11", "x", "x", "14", "6", "x", "15", "x", "x", "18", "x", "x", "x"], ["8", "x", "5", "1", "7", "14", "x", "x", "x", "x", "14", "7", "x", "8", "x"]]]
[[["6", "6", "2", "x", "13", "x", "x", "x", "x", "11", "x", "x", "x", "3", "x"], ["6", "11", "x", "14", "x", "x", "x", "1", "5", "6", "1", "19", "2", "7", "14"], ["16", "4", "12", "13", "17", "4", "x", "x", "x", "14", "x", "x", "9", "9", "13"], ["x", "11", "6", "14", "x", "16", "x", "1", "10", "18", "11", "x", "x", "13", "x"], ["x", "x", "14", "4", "19", "1", "2", "16", "15", "x", "15", "x", "x", "x", "x"], ["13", "6", "16", "13", "5", "9", "x", "6", "10", "3", "1", "14", "x", "17", "x"], ["x", "x", "19", "8", "x", "2", "4", "x", "x", "4", "9", "13", "13", "11", "5"], ["x", "11", "17", "19", "11", "18", "x", "8", "x", "x", "17", "17", "13", "9", "15"], ["11", "4", "x", "3", "3", "8", "5", "x", "x", "x", "20", "19", "x", "x", "12"], ["2", "x", "x", "x", "x", "16", "7", "13", "4", "x", "7", "16", "x", "5", "1"], ["14", "9", "x", "x", "x", "x", "x", "x", "19", "x", "14", "20", "11", "16", "x"], ["3", "x", "1", "x", "13", "x", "9", "x", "15", "19", "4", "x", "x", "x", "2"], ["x", "8", "x", "x", "x", "6", "x", "16", "x", "x", "x", "x", "2", "17", "18"], ["x", "x", "11", "x", "x", "14", "6", "x", "15", "x", "x", "18", "x", "x", "x"], ["8", "x", "5", "1", "7", "14", "x", "x", "x", "x", "14", "7", "x", "8", "x"]], [2, 0], [6, 14], 2, 8]
["[['6', '6', '2', 'x', '13', 'x', 'x', 'x', 'x', '11', 'x', 'x', 'x', '3', 'x'], ['6', '11', 'x', '14', 'x', 'x', 'x', '1', '5', '6', '1', '19', '2', '7', '14'], ['16', '4', '12', '13', '17', '4', 'x', 'x', 'x', '14', 'x', 'x', '9', '9', '13'], ['x', '11', '6', '14', 'x', '16', 'x', '1', '10', '18', '11', 'x', 'x', '13', 'x'], ['x', 'x', '14', '4', '19', '1', '2', '16', '15', 'x', '15', 'x', 'x', 'x', 'x'], ['13', '6', '16', '13', '5', '9', 'x', '6', '10', '3', '1', '14', 'x', '17', 'x'], ['x', 'x', '19', '8', 'x', '2', '4', 'x', 'x', '4', '9', '13', '13', '11', '5'], ['x', '11', '17', '19', '11', '18', 'x', '8', 'x', 'x', '17', '17', '13', '9', '15'], ['11', '4', 'x', '3', '3', '8', '5', 'x', 'x', 'x', '20', '19', 'x', 'x', '12'], ['2', 'x', 'x', 'x', 'x', '16', '7', '13', '4', 'x', '7', '16', 'x', '5', '1'], ['14', '9', 'x', 'x', 'x', 'x', 'x', 'x', '19', 'x', '14', '20', '11', '16', 'x'], ['3', 'x', '1', 'x', '13', 'x', '9', 'x', '15', '19', '4', 'x', 'x', 'x', '2'], ['x', '8', 'x', 'x', 'x', '6', 'x', '16', 'x', 'x', 'x', 'x', '2', '17', '18'], ['x', 'x', '11', 'x', 'x', '14', '6', 'x', '15', 'x', 'x', '18', 'x', 'x', 'x'], ['8', 'x', '5', '1', '7', '14', 'x', 'x', 'x', 'x', '14', '7', 'x', '8', 'x']]", "(2, 0)", "(6, 14)", "2", "8"]
103
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 (10, 1) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (3, 14). 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 0 0 1 1 1 1 1 0 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1 1 1 1 0 0 0 0 0 0 1 0 0 1 1 1 0 1 1 0 1 0 0 0 0 0 0 1 1 1 1 0 0 0 1 1 0 1 1 1 1 0 0 1 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 0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