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
73
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, 8) to his destination workshop at index (8, 0), 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 12. 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 14 15 10 x 14 x x 18 6 x x 4] [6 x x x 1 x 15 x x 2 x 17 x] [x 4 x 17 3 14 4 2 x 3 x 11 x] [6 6 x 19 x 13 x 11 13 6 3 x x] [3 10 11 x x 4 4 1 19 x x x 17] [8 x x 8 11 18 17 19 18 x 1 1 x] [14 14 1 19 6 x 19 19 18 9 x 12 18] [17 6 8 x 1 14 19 13 x x 9 x 3] [16 4 x x x 9 5 x x x 18 x x] [x x 10 x 18 x 1 x x 12 9 8 3] [x 13 17 x x x 5 8 1 x 1 10 x] [10 11 x 12 x 6 11 x 9 9 15 x 10] [5 15 1 x 8 5 x 6 x 9 18 x x]
traffic
pathfinding
5
[[3, 8], [3, 7], [4, 7], [4, 6], [4, 5], [5, 5], [5, 4], [6, 4], [6, 3], [6, 2], [7, 2], [7, 1], [8, 1], [8, 0]]
109
0.018488407135009766
14
4
4
[[["x", "14", "15", "10", "x", "14", "x", "x", "18", "6", "x", "x", "4"], ["6", "x", "x", "x", "1", "x", "15", "x", "x", "2", "x", "17", "x"], ["x", "4", "x", "17", "3", "14", "4", "2", "x", "3", "x", "11", "x"], ["6", "6", "x", "19", "x", "13", "x", "11", "13", "6", "3", "x", "x"], ["3", "10", "11", "x", "x", "4", "4", "1", "19", "x", "x", "x", "17"], ["8", "x", "x", "8", "11", "18", "17", "19", "18", "x", "1", "1", "x"], ["14", "14", "1", "19", "6", "x", "19", "19", "18", "9", "x", "12", "18"], ["17", "6", "8", "x", "1", "14", "19", "13", "x", "x", "9", "x", "3"], ["16", "4", "x", "x", "x", "9", "5", "x", "x", "x", "18", "x", "x"], ["x", "x", "10", "x", "18", "x", "1", "x", "x", "12", "9", "8", "3"], ["x", "13", "17", "x", "x", "x", "5", "8", "1", "x", "1", "10", "x"], ["10", "11", "x", "12", "x", "6", "11", "x", "9", "9", "15", "x", "10"], ["5", "15", "1", "x", "8", "5", "x", "6", "x", "9", "18", "x", "x"]]]
[[["x", "14", "15", "10", "x", "14", "x", "x", "18", "6", "x", "x", "4"], ["6", "x", "x", "x", "1", "x", "15", "x", "x", "2", "x", "17", "x"], ["x", "4", "x", "17", "3", "14", "4", "2", "x", "3", "x", "11", "x"], ["6", "6", "x", "19", "x", "13", "x", "11", "13", "6", "3", "x", "x"], ["3", "10", "11", "x", "x", "4", "4", "1", "19", "x", "x", "x", "17"], ["8", "x", "x", "8", "11", "18", "17", "19", "18", "x", "1", "1", "x"], ["14", "14", "1", "19", "6", "x", "19", "19", "18", "9", "x", "12", "18"], ["17", "6", "8", "x", "1", "14", "19", "13", "x", "x", "9", "x", "3"], ["16", "4", "x", "x", "x", "9", "5", "x", "x", "x", "18", "x", "x"], ["x", "x", "10", "x", "18", "x", "1", "x", "x", "12", "9", "8", "3"], ["x", "13", "17", "x", "x", "x", "5", "8", "1", "x", "1", "10", "x"], ["10", "11", "x", "12", "x", "6", "11", "x", "9", "9", "15", "x", "10"], ["5", "15", "1", "x", "8", "5", "x", "6", "x", "9", "18", "x", "x"]], [3, 8], [8, 0], 3, 7]
["[['x', '14', '15', '10', 'x', '14', 'x', 'x', '18', '6', 'x', 'x', '4'], ['6', 'x', 'x', 'x', '1', 'x', '15', 'x', 'x', '2', 'x', '17', 'x'], ['x', '4', 'x', '17', '3', '14', '4', '2', 'x', '3', 'x', '11', 'x'], ['6', '6', 'x', '19', 'x', '13', 'x', '11', '13', '6', '3', 'x', 'x'], ['3', '10', '11', 'x', 'x', '4', '4', '1', '19', 'x', 'x', 'x', '17'], ['8', 'x', 'x', '8', '11', '18', '17', '19', '18', 'x', '1', '1', 'x'], ['14', '14', '1', '19', '6', 'x', '19', '19', '18', '9', 'x', '12', '18'], ['17', '6', '8', 'x', '1', '14', '19', '13', 'x', 'x', '9', 'x', '3'], ['16', '4', 'x', 'x', 'x', '9', '5', 'x', 'x', 'x', '18', 'x', 'x'], ['x', 'x', '10', 'x', '18', 'x', '1', 'x', 'x', '12', '9', '8', '3'], ['x', '13', '17', 'x', 'x', 'x', '5', '8', '1', 'x', '1', '10', 'x'], ['10', '11', 'x', '12', 'x', '6', '11', 'x', '9', '9', '15', 'x', '10'], ['5', '15', '1', 'x', '8', '5', 'x', '6', 'x', '9', '18', 'x', 'x']]", "(3, 8)", "(8, 0)", "3", "7"]
73
Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 13x13. 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 4 diagonal jumps, no more, no less, on his path to his destination. He is currently on the trampoline at position (1, 12) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (8, 2). 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 1 0 0 1 1 1 1 1 1 0 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 0 0 0 0 0 1 0 0 0 1 1 1 1 1 0 1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0, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0], [1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1], [1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0], [0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1], [1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]]", [1, 12], [8, 2], 4]
["[[1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1], [1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0], [1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0], [1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1], [1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0], [0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1], [1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1], [1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1]]", "(1, 12)", "(8, 2)", "4"]
73
Given 7 labeled water jugs with capacities 56, 81, 132, 41, 86, 128, 57, 138 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 232, 401, 444, 451 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
6
[["+", 128, 4], ["+", 128, 4], ["+", 138, 4], ["+", 57, 4], ["+", 128, 3], ["+", 128, 3], ["+", 56, 3], ["+", 132, 3], ["+", 132, 2], ["+", 132, 2], ["+", 56, 2], ["+", 81, 2], ["+", 57, 1], ["+", 128, 1], ["-", 81, 1], ["+", 128, 1]]
16
0.05008697509765625
16
64
3
[[56, 81, 132, 41, 86, 128, 57, 138], [232, 401, 444, 451]]
[[56, 81, 132, 41, 86, 128, 57, 138], [232, 401, 444, 451]]
["[56, 81, 132, 41, 86, 128, 57, 138]", "[232, 401, 444, 451]"]
74
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: [[49, 20, 77, 78, 57], [41, '_', 52, 44, 72], [27, 81, 45, 16, 46]]
8_puzzle
puzzle
6
[81, 27, 41, 81, 52, 45, 16, 44, 72, 46, 44, 16, 45, 77, 20, 49, 81, 52, 77, 20, 78, 72, 46, 44, 16, 45, 20, 77, 49, 78, 77, 46, 45, 16]
34
2.7185001373291016
34
4
15
[[[49, 20, 77, 78, 57], [41, "_", 52, 44, 72], [27, 81, 45, 16, 46]]]
[[[49, 20, 77, 78, 57], [41, "_", 52, 44, 72], [27, 81, 45, 16, 46]]]
["[[49, 20, 77, 78, 57], [41, '_', 52, 44, 72], [27, 81, 45, 16, 46]]"]
74
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: zeta, sumac, showy, smeek, ajava The initial board: [['u', 'z', 's', 't', 'a'], ['s', 'e', 'm', 'o', 'c'], ['a', 'h', '_', 'w', 'y'], ['s', 'a', 'e', 'm', 'k'], ['a', 'j', 'e', 'v', 'a']]
8_puzzle_words
puzzle
3
["up-left", "up-right", "down-right", "down-left", "down-left", "up-left", "up-right", "up-right", "down-right", "down-left", "down-right", "down-left", "up-left", "up-right", "up-left", "up-left"]
16
0.29548144340515137
16
4
25
[[["u", "z", "s", "t", "a"], ["s", "e", "m", "o", "c"], ["a", "h", "_", "w", "y"], ["s", "a", "e", "m", "k"], ["a", "j", "e", "v", "a"]]]
[[["u", "z", "s", "t", "a"], ["s", "e", "m", "o", "c"], ["a", "h", "_", "w", "y"], ["s", "a", "e", "m", "k"], ["a", "j", "e", "v", "a"]], ["zeta", "sumac", "showy", "smeek", "ajava"]]
["[['u', 'z', 's', 't', 'a'], ['s', 'e', 'm', 'o', 'c'], ['a', 'h', '_', 'w', 'y'], ['s', 'a', 'e', 'm', 'k'], ['a', 'j', 'e', 'v', 'a']]", "['zeta', 'sumac', 'showy', 'smeek', 'ajava']"]
74
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 L and city Z 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 Z and L, 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. O M U L Q P D A S B K V E Z O 0 0 0 0 1 0 0 0 0 0 0 0 0 1 M 0 0 0 0 0 0 0 0 0 0 0 1 0 0 U 0 1 0 1 0 0 0 0 0 1 1 0 0 0 L 1 0 0 0 0 1 1 1 0 0 1 0 0 0 Q 0 0 0 1 0 1 0 1 1 0 0 1 1 0 P 0 0 1 0 0 0 0 1 0 1 0 0 0 1 D 0 1 1 0 0 1 0 0 0 0 0 1 0 0 A 0 1 1 0 1 0 0 0 0 1 0 0 0 1 S 1 1 0 0 0 0 1 0 0 0 0 0 0 0 B 0 1 0 1 0 0 0 0 1 0 0 1 0 0 K 0 1 0 1 1 0 1 1 1 0 0 1 0 0 V 1 0 0 0 0 0 1 0 0 0 0 0 0 1 E 0 0 0 0 0 0 1 1 1 1 1 0 0 1 Z 1 0 1 0 1 0 1 0 1 0 1 0 1 0
city_directed_graph
pathfinding
14
["M", "V", "Z", "E", "Z", "Q", "L", "K", "L"]
9
0.0362241268157959
9
14
17
[[[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0], [1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0], [0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [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 0, 1, 1, 0, 0, 0], [1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0], [0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]]", "['O', 'M', 'U', 'L', 'Q', 'P', 'D', 'A', 'S', 'B', 'K', 'V', 'E', 'Z']", "['M']", "['L', 'Z']"]
74
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [5, 15, 15, 77, 12, 38, 41, 30, 31, 30, 13, 19, 9, 2, 23, 37, 14, 34, 29, 22, 22, 4, 16, 2, 12, 17, 9, 18, 19, 21, 4, 28, 40, 11, 30, 24, 19, 9, 10, 76, 34], such that the sum of the chosen coins adds up to 419. 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 {13: 8, 29: 10, 4: 4, 2: 2, 77: 17, 16: 10, 11: 2, 22: 18, 17: 10, 18: 18, 38: 7, 9: 6, 5: 2, 41: 14, 31: 3, 12: 10, 19: 5, 24: 16, 40: 6, 14: 4, 34: 13, 15: 3, 23: 20, 76: 16, 37: 2, 21: 2, 28: 3, 10: 2, 30: 16}, 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
[15, 31, 28, 37, 77, 76, 40, 38, 10, 11, 21, 2, 19, 14]
74
0.058817148208618164
14
41
41
[[5, 15, 15, 77, 12, 38, 41, 30, 31, 30, 13, 19, 9, 2, 23, 37, 14, 34, 29, 22, 22, 4, 16, 2, 12, 17, 9, 18, 19, 21, 4, 28, 40, 11, 30, 24, 19, 9, 10, 76, 34]]
[[5, 15, 15, 77, 12, 38, 41, 30, 31, 30, 13, 19, 9, 2, 23, 37, 14, 34, 29, 22, 22, 4, 16, 2, 12, 17, 9, 18, 19, 21, 4, 28, 40, 11, 30, 24, 19, 9, 10, 76, 34], {"13": 8, "29": 10, "4": 4, "2": 2, "77": 17, "16": 10, "11": 2, "22": 18, "17": 10, "18": 18, "38": 7, "9": 6, "5": 2, "41": 14, "31": 3, "12": 10, "19": 5, "24": 16, "40": 6, "14": 4, "34": 13, "15": 3, "23": 20, "76": 16, "37": 2, "21": 2, "28": 3, "10": 2, "30": 16}, 419]
["[5, 15, 15, 77, 12, 38, 41, 30, 31, 30, 13, 19, 9, 2, 23, 37, 14, 34, 29, 22, 22, 4, 16, 2, 12, 17, 9, 18, 19, 21, 4, 28, 40, 11, 30, 24, 19, 9, 10, 76, 34]", "{13: 8, 29: 10, 4: 4, 2: 2, 77: 17, 16: 10, 11: 2, 22: 18, 17: 10, 18: 18, 38: 7, 9: 6, 5: 2, 41: 14, 31: 3, 12: 10, 19: 5, 24: 16, 40: 6, 14: 4, 34: 13, 15: 3, 23: 20, 76: 16, 37: 2, 21: 2, 28: 3, 10: 2, 30: 16}", "419"]
74
The game of 'Sort It' begins with 3 tubes, each filled with 5 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 8 balls. It is not allowed to place a ball in a tube that already has 8 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', 'Red', 'Green', 'Red', 'Green'], ['Blue', 'Red', 'Green', 'Blue', 'Green'], ['Red', 'Blue', 'Red', 'Blue', 'Blue']]
color_sorting
sorting
9
[[1, 0], [2, 1], [2, 0], [2, 1], [0, 2], [0, 2], [0, 2], [0, 1], [0, 2], [0, 1], [0, 2], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1], [0, 2], [0, 1]]
23
30.882342100143433
23
6
15
[[["Green", "Red", "Green", "Red", "Green"], ["Blue", "Red", "Green", "Blue", "Green"], ["Red", "Blue", "Red", "Blue", "Blue"]], 8]
[[["Green", "Red", "Green", "Red", "Green"], ["Blue", "Red", "Green", "Blue", "Green"], ["Red", "Blue", "Red", "Blue", "Blue"]], 8]
["[['Green', 'Red', 'Green', 'Red', 'Green'], ['Blue', 'Red', 'Green', 'Blue', 'Green'], ['Red', 'Blue', 'Red', 'Blue', 'Blue']]", "8"]
74
We have a 4x4 numerical grid, with numbers ranging from 44 to 89 (44 included in the range but 89 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: [['49' 'x' 'x' 'x'] ['x' '51' 'x' '84'] ['47' 'x' 'x' '79'] ['x' 'x' 'x' '77']]
consecutive_grid
underdetermined_system
15
[[0, 0, 24], [0, 1, 28], [1, 0, 23], [1, 2, 29], [1, 3, 51], [2, 2, 26], [3, 0, 14]]
495
83.38021159172058
7
45
16
["[['', '', '53', '62'], ['', '27', '', ''], ['21', '22', '', '50'], ['', '20', '25', '44']]", 14, 64]
["[['', '', '53', '62'], ['', '27', '', ''], ['21', '22', '', '50'], ['', '20', '25', '44']]", 14, 64]
["[['', '', '53', '62'], ['', '27', '', ''], ['21', '22', '', '50'], ['', '20', '25', '44']]", "14", "64"]
74
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 6 to 47. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 99, 126, None for columns 1 to 2 respectively, and the sums of rows must be None, 97, 107, 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 124. 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: [['15' '20' 'x' 'x'] ['6' 'x' 'x' '40'] ['x' 'x' '29' 'x'] ['46' '42' '34' 'x']]
magic_square
underdetermined_system
7
[[0, 2, 24], [0, 3, 14], [1, 1, 12], [1, 2, 39], [2, 0, 8], [2, 1, 25], [2, 3, 45], [3, 3, 7]]
406
1.2863490581512451
8
31
16
["[['15', '20', '', ''], ['6', '', '', '40'], ['', '', '29', ''], ['46', '42', '34', '']]", 4, 6, 47]
["[['15', '20', '', ''], ['6', '', '', '40'], ['', '', '29', ''], ['46', '42', '34', '']]", 6, 47, [1, 3], [1, 3], [99, 126], [97, 107], 124]
["[['15', '20', '', ''], ['6', '', '', '40'], ['', '', '29', ''], ['46', '42', '34', '']]", "6", "47", "[None, 99, 126, None]", "[None, 97, 107, None]", "124"]
74
In 'Restricted Sorting', there are 10 stacks each with a capacity of 6 blocks, with 5 stacks filled with blocks of varying shades and the remaining are empty. The challenge is to sort the blocks by shade such that if a stack is not empty, it is stacked with 5 blocks of a single shade. The player can only transfer one block at a time from the top of a stack to an empty stack or to a stack that has only blocks of that shade, without exceeding the stacks’ capacity. Transferring blocks to certain stacks is more expensive than others. The cost of moving one block to the top of each stack is: {0: 3, 1: 8, 2: 5, 3: 10, 4: 8, 5: 2, 6: 3, 7: 4, 8: 11, 9: 3}, where the keys are the index of each stack, indexing from 0. The cost of moving a block is always at least 1. The solution should be a list of tuples, each containing, first, the index of the stack from which a block is picked up from and, second, the index of the stack to which it is transferred, indexing from 0. Given the initial state of the stacks, represented by the lists below (with the leftmost item being the shade of the topmost block in each stack)(and the first stack being the stack at index 0), what is the list of transfer pairs (reported in python syntax) with the least possible cost, that will result in all the blocks being correctly sorted? [['Black', 'Blue', 'Red', 'White', 'Red', 'Green'], ['Red', 'Black', 'Red', 'Green', 'Blue', 'Black'], ['Black', 'Yellow', 'Yellow', 'White', 'White', 'Yellow'], [], [], ['White', 'Green', 'Green', 'Red', 'Green', 'Yellow'], [], ['Blue', 'Blue', 'Blue', 'Black', 'White', 'Yellow'], [], []]
restricted_sorting
sorting
3
[[0, 6], [0, 9], [2, 6], [5, 4], [7, 9], [7, 9], [7, 9], [7, 6], [7, 4], [1, 3], [2, 7], [2, 7], [2, 4], [2, 4], [2, 7], [0, 2], [0, 4], [0, 2], [1, 6], [1, 2], [1, 0], [1, 9], [5, 0], [5, 0], [5, 2], [5, 0], [3, 2], [5, 7], [1, 6]]
133
0.260591983795166
29
90
30
[[["Black", "Blue", "Red", "White", "Red", "Green"], ["Red", "Black", "Red", "Green", "Blue", "Black"], ["Black", "Yellow", "Yellow", "White", "White", "Yellow"], [], [], ["White", "Green", "Green", "Red", "Green", "Yellow"], [], ["Blue", "Blue", "Blue", "Black", "White", "Yellow"], [], []], 6, {"0": 3, "1": 8, "2": 5, "3": 10, "4": 8, "5": 2, "6": 3, "7": 4, "8": 11, "9": 3}]
[[["Black", "Blue", "Red", "White", "Red", "Green"], ["Red", "Black", "Red", "Green", "Blue", "Black"], ["Black", "Yellow", "Yellow", "White", "White", "Yellow"], [], [], ["White", "Green", "Green", "Red", "Green", "Yellow"], [], ["Blue", "Blue", "Blue", "Black", "White", "Yellow"], [], []], 6, {"0": 3, "1": 8, "2": 5, "3": 10, "4": 8, "5": 2, "6": 3, "7": 4, "8": 11, "9": 3}, 5]
["[['Black', 'Blue', 'Red', 'White', 'Red', 'Green'], ['Red', 'Black', 'Red', 'Green', 'Blue', 'Black'], ['Black', 'Yellow', 'Yellow', 'White', 'White', 'Yellow'], [], [], ['White', 'Green', 'Green', 'Red', 'Green', 'Yellow'], [], ['Blue', 'Blue', 'Blue', 'Black', 'White', 'Yellow'], [], []]", "{0: 3, 1: 8, 2: 5, 3: 10, 4: 8, 5: 2, 6: 3, 7: 4, 8: 11, 9: 3}", "6", "5"]
74
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, 12) to his destination workshop at index (7, 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 6, and district 3 covering rows 7 to 12. 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. [10 x x x 16 9 x 13 12 8 x 16 17] [9 2 x x 5 x x x 12 x 3 x x] [x x 7 3 12 x 11 18 10 x x 13 x] [x 6 x 19 2 x x 11 13 13 1 x 7] [x x 11 x 16 16 4 12 5 20 2 4 15] [19 x 18 5 11 x x 3 17 18 3 8 18] [12 x 9 x x x x 9 4 15 16 x 9] [x 15 x 6 10 x 1 1 x 9 4 7 1] [x 19 15 x 1 10 5 17 x 8 x 1 x] [x x x x 5 x 1 x x 7 4 x x] [9 x 4 x 5 13 x 15 x x 18 9 15] [17 2 x x x 18 8 x 8 x x 8 7] [x x 5 x x 8 x 8 x 15 19 x x]
traffic
pathfinding
5
[[3, 12], [4, 12], [4, 11], [4, 10], [5, 10], [6, 10], [6, 9], [6, 8], [6, 7], [7, 7], [7, 6], [8, 6], [8, 5], [8, 4], [7, 4], [7, 3]]
102
0.02852487564086914
16
4
4
[[["10", "x", "x", "x", "16", "9", "x", "13", "12", "8", "x", "16", "17"], ["9", "2", "x", "x", "5", "x", "x", "x", "12", "x", "3", "x", "x"], ["x", "x", "7", "3", "12", "x", "11", "18", "10", "x", "x", "13", "x"], ["x", "6", "x", "19", "2", "x", "x", "11", "13", "13", "1", "x", "7"], ["x", "x", "11", "x", "16", "16", "4", "12", "5", "20", "2", "4", "15"], ["19", "x", "18", "5", "11", "x", "x", "3", "17", "18", "3", "8", "18"], ["12", "x", "9", "x", "x", "x", "x", "9", "4", "15", "16", "x", "9"], ["x", "15", "x", "6", "10", "x", "1", "1", "x", "9", "4", "7", "1"], ["x", "19", "15", "x", "1", "10", "5", "17", "x", "8", "x", "1", "x"], ["x", "x", "x", "x", "5", "x", "1", "x", "x", "7", "4", "x", "x"], ["9", "x", "4", "x", "5", "13", "x", "15", "x", "x", "18", "9", "15"], ["17", "2", "x", "x", "x", "18", "8", "x", "8", "x", "x", "8", "7"], ["x", "x", "5", "x", "x", "8", "x", "8", "x", "15", "19", "x", "x"]]]
[[["10", "x", "x", "x", "16", "9", "x", "13", "12", "8", "x", "16", "17"], ["9", "2", "x", "x", "5", "x", "x", "x", "12", "x", "3", "x", "x"], ["x", "x", "7", "3", "12", "x", "11", "18", "10", "x", "x", "13", "x"], ["x", "6", "x", "19", "2", "x", "x", "11", "13", "13", "1", "x", "7"], ["x", "x", "11", "x", "16", "16", "4", "12", "5", "20", "2", "4", "15"], ["19", "x", "18", "5", "11", "x", "x", "3", "17", "18", "3", "8", "18"], ["12", "x", "9", "x", "x", "x", "x", "9", "4", "15", "16", "x", "9"], ["x", "15", "x", "6", "10", "x", "1", "1", "x", "9", "4", "7", "1"], ["x", "19", "15", "x", "1", "10", "5", "17", "x", "8", "x", "1", "x"], ["x", "x", "x", "x", "5", "x", "1", "x", "x", "7", "4", "x", "x"], ["9", "x", "4", "x", "5", "13", "x", "15", "x", "x", "18", "9", "15"], ["17", "2", "x", "x", "x", "18", "8", "x", "8", "x", "x", "8", "7"], ["x", "x", "5", "x", "x", "8", "x", "8", "x", "15", "19", "x", "x"]], [3, 12], [7, 3], 3, 6]
["[['10', 'x', 'x', 'x', '16', '9', 'x', '13', '12', '8', 'x', '16', '17'], ['9', '2', 'x', 'x', '5', 'x', 'x', 'x', '12', 'x', '3', 'x', 'x'], ['x', 'x', '7', '3', '12', 'x', '11', '18', '10', 'x', 'x', '13', 'x'], ['x', '6', 'x', '19', '2', 'x', 'x', '11', '13', '13', '1', 'x', '7'], ['x', 'x', '11', 'x', '16', '16', '4', '12', '5', '20', '2', '4', '15'], ['19', 'x', '18', '5', '11', 'x', 'x', '3', '17', '18', '3', '8', '18'], ['12', 'x', '9', 'x', 'x', 'x', 'x', '9', '4', '15', '16', 'x', '9'], ['x', '15', 'x', '6', '10', 'x', '1', '1', 'x', '9', '4', '7', '1'], ['x', '19', '15', 'x', '1', '10', '5', '17', 'x', '8', 'x', '1', 'x'], ['x', 'x', 'x', 'x', '5', 'x', '1', 'x', 'x', '7', '4', 'x', 'x'], ['9', 'x', '4', 'x', '5', '13', 'x', '15', 'x', 'x', '18', '9', '15'], ['17', '2', 'x', 'x', 'x', '18', '8', 'x', '8', 'x', 'x', '8', '7'], ['x', 'x', '5', 'x', 'x', '8', 'x', '8', 'x', '15', '19', 'x', 'x']]", "(3, 12)", "(7, 3)", "3", "6"]
74
Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 13x13. 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 4 diagonal jumps, no more, no less, on his path to his destination. He is currently on the trampoline at position (11, 3) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (1, 10). What is the shortest sequence of trampolines he should jump on to reach his destination (including the first and final trampolines)? The answer should be a list of tuples, in Python syntax, indicating the row and column of each trampoline Alex jumps on. 1 1 0 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 1 0 0 1 1 1 0 0 0 1 0 1 0 0 0 1 1 0 1 1 0 1 1 1 0 0 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 1 0 1 1 1 0 1 0 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 1 0 1 1 1 0 1 0 0 0 0 0 0 1 1 1 1 0 0 1 0 1
trampoline_matrix
pathfinding
13
[[11, 3], [10, 3], [9, 3], [9, 4], [8, 5], [7, 5], [7, 6], [6, 7], [5, 7], [4, 8], [4, 9], [3, 10], [2, 10], [1, 10]]
14
0.024291276931762695
14
8
2
["[[1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1], [1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1], [0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 0, 1, 1, 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0, 1, 0, 0, 1, 1, 1, 0, 0, 1], [1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1], [0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1]]", "(11, 3)", "(1, 10)", "4"]
74
Given 7 labeled water jugs with capacities 91, 141, 56, 65, 89, 40, 39, 92 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 294, 375, 459, 466 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
6
[["+", 92, 4], ["+", 141, 4], ["+", 141, 4], ["+", 92, 4], ["+", 141, 3], ["+", 141, 3], ["+", 141, 3], ["-", 56, 3], ["+", 92, 3], ["+", 56, 2], ["+", 89, 2], ["+", 89, 2], ["+", 141, 2], ["+", 56, 1], ["+", 91, 1], ["+", 91, 1], ["+", 56, 1]]
17
0.0752251148223877
17
64
3
[[91, 141, 56, 65, 89, 40, 39, 92], [294, 375, 459, 466]]
[[91, 141, 56, 65, 89, 40, 39, 92], [294, 375, 459, 466]]
["[91, 141, 56, 65, 89, 40, 39, 92]", "[294, 375, 459, 466]"]
75
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: [['_', 67, 21, 97, 69], [61, 68, 55, 16, 73], [42, 41, 31, 83, 53]]
8_puzzle
puzzle
6
[61, 42, 41, 31, 55, 21, 97, 16, 21, 68, 31, 55, 83, 21, 73, 69, 16, 73, 68, 83, 55, 31, 42, 61, 67, 97, 83, 42, 61, 67, 97, 83, 73, 68, 69, 16, 68, 69, 42, 55, 21, 53, 16, 42, 53, 16]
46
68.0147922039032
46
4
15
[[["_", 67, 21, 97, 69], [61, 68, 55, 16, 73], [42, 41, 31, 83, 53]]]
[[["_", 67, 21, 97, 69], [61, 68, 55, 16, 73], [42, 41, 31, 83, 53]]]
["[['_', 67, 21, 97, 69], [61, 68, 55, 16, 73], [42, 41, 31, 83, 53]]"]
75
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: soho, rilly, josip, drain, nival The initial board: [['_', 's', 's', 'h', 'o'], ['r', 'i', 'l', 'o', 'y'], ['j', 'o', 'l', 'i', 'p'], ['d', 'r', 'a', 'i', 'n'], ['n', 'i', 'v', 'a', 'l']]
8_puzzle_words
puzzle
3
["down-right", "up-right", "down-right", "down-left", "up-left", "up-left"]
6
0.19606399536132812
6
4
25
[[["_", "s", "s", "h", "o"], ["r", "i", "l", "o", "y"], ["j", "o", "l", "i", "p"], ["d", "r", "a", "i", "n"], ["n", "i", "v", "a", "l"]]]
[[["_", "s", "s", "h", "o"], ["r", "i", "l", "o", "y"], ["j", "o", "l", "i", "p"], ["d", "r", "a", "i", "n"], ["n", "i", "v", "a", "l"]], ["soho", "rilly", "josip", "drain", "nival"]]
["[['_', 's', 's', 'h', 'o'], ['r', 'i', 'l', 'o', 'y'], ['j', 'o', 'l', 'i', 'p'], ['d', 'r', 'a', 'i', 'n'], ['n', 'i', 'v', 'a', 'l']]", "['soho', 'rilly', 'josip', 'drain', 'nival']"]
75
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 'B'. Our task is to visit city W and city F 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 F 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. L S P R N F O K B H T W U E L 0 0 1 0 1 1 0 1 1 0 0 0 0 0 S 0 0 0 1 0 1 0 0 0 0 0 0 1 0 P 0 0 0 0 1 0 0 1 0 0 0 0 0 0 R 0 0 1 0 0 1 0 0 0 1 0 0 0 0 N 0 0 0 1 0 0 1 1 0 0 1 0 0 0 F 0 0 0 1 0 0 1 0 0 0 0 0 0 1 O 0 1 0 0 0 0 0 1 0 0 1 0 0 0 K 0 1 0 0 0 1 0 0 1 0 0 1 0 0 B 0 0 1 0 1 0 0 0 0 0 0 0 0 1 H 0 1 0 0 0 1 1 0 0 0 0 0 1 0 T 1 0 0 0 0 0 0 0 0 1 0 1 0 1 W 1 0 1 0 0 1 0 0 0 1 0 0 0 1 U 1 0 1 0 0 0 0 1 1 0 1 0 0 1 E 0 1 0 1 0 0 1 1 0 0 0 1 0 0
city_directed_graph
pathfinding
14
["B", "E", "W", "F", "O", "K", "W", "F"]
8
0.03292369842529297
8
14
17
[[[0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0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, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1], [1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0]], ["L", "S", "P", "R", "N", "F", "O", "K", "B", "H", "T", "W", "U", "E"], "B", "W", "F"]
["[[0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1], [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0], [0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1], [1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0]]", "['L', 'S', 'P', 'R', 'N', 'F', 'O', 'K', 'B', 'H', 'T', 'W', 'U', 'E']", "['B']", "['W', 'F']"]
75
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [8, 31, 28, 24, 19, 18, 26, 31, 43, 32, 3, 21, 21, 10, 36, 40, 19, 38, 3, 5, 24, 12, 11, 14, 40, 7, 19, 4, 22, 5, 33, 31, 40, 7, 5, 34, 33, 22, 14, 6, 14, 29], such that the sum of the chosen coins adds up to 408. 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 {31: 12, 40: 17, 32: 19, 26: 14, 12: 1, 5: 3, 36: 1, 33: 5, 3: 2, 6: 1, 34: 19, 18: 18, 8: 7, 21: 11, 43: 20, 22: 20, 4: 4, 11: 6, 28: 20, 7: 3, 38: 13, 24: 12, 19: 16, 10: 7, 14: 9, 29: 3}, 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
[36, 6, 29, 33, 33, 43, 40, 38, 24, 31, 31, 31, 12, 21]
125
0.06368541717529297
14
42
42
[[8, 31, 28, 24, 19, 18, 26, 31, 43, 32, 3, 21, 21, 10, 36, 40, 19, 38, 3, 5, 24, 12, 11, 14, 40, 7, 19, 4, 22, 5, 33, 31, 40, 7, 5, 34, 33, 22, 14, 6, 14, 29]]
[[8, 31, 28, 24, 19, 18, 26, 31, 43, 32, 3, 21, 21, 10, 36, 40, 19, 38, 3, 5, 24, 12, 11, 14, 40, 7, 19, 4, 22, 5, 33, 31, 40, 7, 5, 34, 33, 22, 14, 6, 14, 29], {"31": 12, "40": 17, "32": 19, "26": 14, "12": 1, "5": 3, "36": 1, "33": 5, "3": 2, "6": 1, "34": 19, "18": 18, "8": 7, "21": 11, "43": 20, "22": 20, "4": 4, "11": 6, "28": 20, "7": 3, "38": 13, "24": 12, "19": 16, "10": 7, "14": 9, "29": 3}, 408]
["[8, 31, 28, 24, 19, 18, 26, 31, 43, 32, 3, 21, 21, 10, 36, 40, 19, 38, 3, 5, 24, 12, 11, 14, 40, 7, 19, 4, 22, 5, 33, 31, 40, 7, 5, 34, 33, 22, 14, 6, 14, 29]", "{31: 12, 40: 17, 32: 19, 26: 14, 12: 1, 5: 3, 36: 1, 33: 5, 3: 2, 6: 1, 34: 19, 18: 18, 8: 7, 21: 11, 43: 20, 22: 20, 4: 4, 11: 6, 28: 20, 7: 3, 38: 13, 24: 12, 19: 16, 10: 7, 14: 9, 29: 3}", "408"]
75
The game of 'Sort It' begins with 3 tubes, each filled with 5 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 8 balls. It is not allowed to place a ball in a tube that already has 8 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', 'Blue', 'Red'], ['Green', 'Green', 'Red', 'Red', 'Green'], ['Blue', 'Blue', 'Green', 'Blue', 'Green']]
color_sorting
sorting
9
[[0, 1], [0, 1], [0, 2], [0, 2], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [0, 2], [0, 1], [0, 1], [0, 2], [0, 2], [1, 0], [1, 0], [1, 0], [1, 2], [0, 1]]
27
153.86922955513
27
6
15
[[["Red", "Red", "Blue", "Blue", "Red"], ["Green", "Green", "Red", "Red", "Green"], ["Blue", "Blue", "Green", "Blue", "Green"]], 8]
[[["Red", "Red", "Blue", "Blue", "Red"], ["Green", "Green", "Red", "Red", "Green"], ["Blue", "Blue", "Green", "Blue", "Green"]], 8]
["[['Red', 'Red', 'Blue', 'Blue', 'Red'], ['Green', 'Green', 'Red', 'Red', 'Green'], ['Blue', 'Blue', 'Green', 'Blue', 'Green']]", "8"]
75
We have a 4x4 numerical grid, with numbers ranging from 33 to 78 (33 included in the range but 78 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: [['x' '58' 'x' 'x'] ['x' 'x' 'x' '70'] ['x' '48' '52' 'x'] ['x' '43' 'x' '67']]
consecutive_grid
underdetermined_system
15
[[0, 2, 51], [1, 0, 38], [1, 2, 47], [2, 2, 44], [3, 0, 42], [3, 2, 23], [3, 3, 22]]
563
0.643829345703125
7
45
16
["[['37', '50', '', '70'], ['', '46', '', '65'], ['41', '43', '', '49'], ['', '30', '', '']]", 22, 72]
["[['37', '50', '', '70'], ['', '46', '', '65'], ['41', '43', '', '49'], ['', '30', '', '']]", 22, 72]
["[['37', '50', '', '70'], ['', '46', '', '65'], ['41', '43', '', '49'], ['', '30', '', '']]", "22", "72"]
75
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 6 to 47. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 125, 51, None for columns 1 to 2 respectively, and the sums of rows must be None, 101, 108, 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 90. 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'] ['28' '33' 'x' 'x'] ['16' 'x' 'x' '37'] ['36' '18' '7' '23']]
magic_square
underdetermined_system
7
[[0, 0, 8], [0, 1, 40], [0, 2, 9], [0, 3, 6], [1, 2, 14], [1, 3, 26], [2, 1, 34], [2, 2, 21]]
356
132.15215873718262
8
31
16
["[['', '', '', ''], ['28', '33', '', ''], ['16', '', '', '37'], ['36', '18', '7', '23']]", 4, 6, 47]
["[['', '', '', ''], ['28', '33', '', ''], ['16', '', '', '37'], ['36', '18', '7', '23']]", 6, 47, [1, 3], [1, 3], [125, 51], [101, 108], 90]
["[['', '', '', ''], ['28', '33', '', ''], ['16', '', '', '37'], ['36', '18', '7', '23']]", "6", "47", "[None, 125, 51, None]", "[None, 101, 108, None]", "90"]
75
In 'Restricted Sorting', there are 10 stacks each with a capacity of 6 blocks, with 5 stacks filled with blocks of varying shades and the remaining are empty. The challenge is to sort the blocks by shade such that if a stack is not empty, it is stacked with 5 blocks of a single shade. The player can only transfer one block at a time from the top of a stack to an empty stack or to a stack that has only blocks of that shade, without exceeding the stacks’ capacity. Transferring blocks to certain stacks is more expensive than others. The cost of moving one block to the top of each stack is: {0: 8, 1: 8, 2: 10, 3: 6, 4: 8, 5: 4, 6: 3, 7: 7, 8: 11, 9: 9}, where the keys are the index of each stack, indexing from 0. The cost of moving a block is always at least 1. The solution should be a list of tuples, each containing, first, the index of the stack from which a block is picked up from and, second, the index of the stack to which it is transferred, indexing from 0. Given the initial state of the stacks, represented by the lists below (with the leftmost item being the shade of the topmost block in each stack)(and the first stack being the stack at index 0), what is the list of transfer pairs (reported in python syntax) with the least possible cost, that will result in all the blocks being correctly sorted? [['White', 'Green', 'Red', 'Blue', 'Red', 'Yellow'], ['Black', 'Black', 'White', 'Blue', 'Green', 'Green'], ['White', 'Blue', 'White', 'Yellow', 'Black', 'Green'], [], [], [], [], ['Green', 'Yellow', 'Red', 'White', 'Blue', 'Black'], ['Yellow', 'Red', 'Blue', 'Red', 'Black', 'Yellow'], []]
restricted_sorting
sorting
3
[[0, 6], [0, 5], [7, 5], [1, 3], [1, 3], [1, 6], [1, 4], [7, 9], [8, 9], [2, 6], [2, 4], [2, 6], [2, 9], [2, 3], [1, 5], [1, 5], [7, 1], [7, 6], [7, 4], [0, 1], [0, 4], [0, 1], [8, 1], [8, 4], [8, 1], [8, 3], [0, 9], [8, 9], [7, 3], [2, 5]]
190
0.2266242504119873
30
90
30
[[["White", "Green", "Red", "Blue", "Red", "Yellow"], ["Black", "Black", "White", "Blue", "Green", "Green"], ["White", "Blue", "White", "Yellow", "Black", "Green"], [], [], [], [], ["Green", "Yellow", "Red", "White", "Blue", "Black"], ["Yellow", "Red", "Blue", "Red", "Black", "Yellow"], []], 6, {"0": 8, "1": 8, "2": 10, "3": 6, "4": 8, "5": 4, "6": 3, "7": 7, "8": 11, "9": 9}]
[[["White", "Green", "Red", "Blue", "Red", "Yellow"], ["Black", "Black", "White", "Blue", "Green", "Green"], ["White", "Blue", "White", "Yellow", "Black", "Green"], [], [], [], [], ["Green", "Yellow", "Red", "White", "Blue", "Black"], ["Yellow", "Red", "Blue", "Red", "Black", "Yellow"], []], 6, {"0": 8, "1": 8, "2": 10, "3": 6, "4": 8, "5": 4, "6": 3, "7": 7, "8": 11, "9": 9}, 5]
["[['White', 'Green', 'Red', 'Blue', 'Red', 'Yellow'], ['Black', 'Black', 'White', 'Blue', 'Green', 'Green'], ['White', 'Blue', 'White', 'Yellow', 'Black', 'Green'], [], [], [], [], ['Green', 'Yellow', 'Red', 'White', 'Blue', 'Black'], ['Yellow', 'Red', 'Blue', 'Red', 'Black', 'Yellow'], []]", "{0: 8, 1: 8, 2: 10, 3: 6, 4: 8, 5: 4, 6: 3, 7: 7, 8: 11, 9: 9}", "6", "5"]
75
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, 1) to his destination workshop at index (2, 10), 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 7, and district 3 covering rows 8 to 12. 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 4 8 x x 4 x 8 12 x x 14] [17 x 3 x 6 x 12 2 x x x 5 19] [x 8 8 x 5 x 15 14 14 3 10 12 3] [4 x 16 x x 11 12 x x 6 5 18 19] [x 4 9 17 x x x 13 4 7 x 2 16] [3 6 x x x 10 5 x 18 10 9 20 4] [x x x 14 18 x x x x 16 x x 4] [14 12 x 4 12 11 19 x 3 2 x 13 x] [19 6 2 18 x x 8 7 1 12 19 x x] [x 9 16 17 5 12 19 8 x 3 10 x x] [x 10 3 x 14 16 2 16 4 10 18 15 x] [15 5 5 x 13 x 3 7 x 4 1 17 15] [5 2 6 x x x x 8 16 x x x x]
traffic
pathfinding
5
[[7, 1], [8, 1], [8, 2], [8, 3], [7, 3], [7, 4], [7, 5], [7, 6], [8, 6], [8, 7], [8, 8], [7, 8], [7, 9], [6, 9], [5, 9], [4, 9], [3, 9], [2, 9], [2, 10]]
145
0.027338504791259766
19
4
4
[[["x", "9", "4", "8", "x", "x", "4", "x", "8", "12", "x", "x", "14"], ["17", "x", "3", "x", "6", "x", "12", "2", "x", "x", "x", "5", "19"], ["x", "8", "8", "x", "5", "x", "15", "14", "14", "3", "10", "12", "3"], ["4", "x", "16", "x", "x", "11", "12", "x", "x", "6", "5", "18", "19"], ["x", "4", "9", "17", "x", "x", "x", "13", "4", "7", "x", "2", "16"], ["3", "6", "x", "x", "x", "10", "5", "x", "18", "10", "9", "20", "4"], ["x", "x", "x", "14", "18", "x", "x", "x", "x", "16", "x", "x", "4"], ["14", "12", "x", "4", "12", "11", "19", "x", "3", "2", "x", "13", "x"], ["19", "6", "2", "18", "x", "x", "8", "7", "1", "12", "19", "x", "x"], ["x", "9", "16", "17", "5", "12", "19", "8", "x", "3", "10", "x", "x"], ["x", "10", "3", "x", "14", "16", "2", "16", "4", "10", "18", "15", "x"], ["15", "5", "5", "x", "13", "x", "3", "7", "x", "4", "1", "17", "15"], ["5", "2", "6", "x", "x", "x", "x", "8", "16", "x", "x", "x", "x"]]]
[[["x", "9", "4", "8", "x", "x", "4", "x", "8", "12", "x", "x", "14"], ["17", "x", "3", "x", "6", "x", "12", "2", "x", "x", "x", "5", "19"], ["x", "8", "8", "x", "5", "x", "15", "14", "14", "3", "10", "12", "3"], ["4", "x", "16", "x", "x", "11", "12", "x", "x", "6", "5", "18", "19"], ["x", "4", "9", "17", "x", "x", "x", "13", "4", "7", "x", "2", "16"], ["3", "6", "x", "x", "x", "10", "5", "x", "18", "10", "9", "20", "4"], ["x", "x", "x", "14", "18", "x", "x", "x", "x", "16", "x", "x", "4"], ["14", "12", "x", "4", "12", "11", "19", "x", "3", "2", "x", "13", "x"], ["19", "6", "2", "18", "x", "x", "8", "7", "1", "12", "19", "x", "x"], ["x", "9", "16", "17", "5", "12", "19", "8", "x", "3", "10", "x", "x"], ["x", "10", "3", "x", "14", "16", "2", "16", "4", "10", "18", "15", "x"], ["15", "5", "5", "x", "13", "x", "3", "7", "x", "4", "1", "17", "15"], ["5", "2", "6", "x", "x", "x", "x", "8", "16", "x", "x", "x", "x"]], [7, 1], [2, 10], 2, 7]
["[['x', '9', '4', '8', 'x', 'x', '4', 'x', '8', '12', 'x', 'x', '14'], ['17', 'x', '3', 'x', '6', 'x', '12', '2', 'x', 'x', 'x', '5', '19'], ['x', '8', '8', 'x', '5', 'x', '15', '14', '14', '3', '10', '12', '3'], ['4', 'x', '16', 'x', 'x', '11', '12', 'x', 'x', '6', '5', '18', '19'], ['x', '4', '9', '17', 'x', 'x', 'x', '13', '4', '7', 'x', '2', '16'], ['3', '6', 'x', 'x', 'x', '10', '5', 'x', '18', '10', '9', '20', '4'], ['x', 'x', 'x', '14', '18', 'x', 'x', 'x', 'x', '16', 'x', 'x', '4'], ['14', '12', 'x', '4', '12', '11', '19', 'x', '3', '2', 'x', '13', 'x'], ['19', '6', '2', '18', 'x', 'x', '8', '7', '1', '12', '19', 'x', 'x'], ['x', '9', '16', '17', '5', '12', '19', '8', 'x', '3', '10', 'x', 'x'], ['x', '10', '3', 'x', '14', '16', '2', '16', '4', '10', '18', '15', 'x'], ['15', '5', '5', 'x', '13', 'x', '3', '7', 'x', '4', '1', '17', '15'], ['5', '2', '6', 'x', 'x', 'x', 'x', '8', '16', 'x', 'x', 'x', 'x']]", "(7, 1)", "(2, 10)", "2", "7"]
75
Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 13x13. 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 4 diagonal jumps, no more, no less, on his path to his destination. He is currently on the trampoline at position (0, 7) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (12, 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. 0 0 1 1 0 1 0 0 1 1 1 1 0 1 0 0 0 0 1 0 0 1 1 1 1 1 0 0 1 0 0 0 1 1 1 1 0 1 0 1 1 1 1 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 1 1 1 0 1 0 1 1 1 0 0 0 0 1 1 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1
trampoline_matrix
pathfinding
13
[[0, 7], [1, 6], [2, 5], [3, 4], [4, 4], [5, 3], [6, 3], [7, 3], [7, 2], [7, 1], [8, 1], [9, 1], [10, 1], [11, 1], [11, 0], [12, 0]]
16
0.021950483322143555
16
8
2
["[[0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0], [1, 0, 0, 0,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 1, 0], [1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1], [0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0], [1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0], [1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0], [0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1], [0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1]]", "(0, 7)", "(12, 0)", "4"]
75
Given 7 labeled water jugs with capacities 98, 121, 131, 126, 141, 125, 20 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 309, 395, 407, 429 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
6
[["+", 131, 4], ["+", 141, 4], ["+", 141, 4], ["-", 125, 4], ["+", 141, 4], ["+", 125, 3], ["+", 141, 3], ["+", 141, 3], ["+", 125, 2], ["+", 125, 2], ["+", 20, 2], ["+", 125, 2], ["+", 141, 1], ["+", 141, 1], ["-", 98, 1], ["+", 125, 1]]
16
0.04790830612182617
16
56
3
[[98, 121, 131, 126, 141, 125, 20], [309, 395, 407, 429]]
[[98, 121, 131, 126, 141, 125, 20], [309, 395, 407, 429]]
["[98, 121, 131, 126, 141, 125, 20]", "[309, 395, 407, 429]"]
76
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: [[86, 78, 77, 39, 76], [54, 45, 25, 59, 21], [38, 46, 43, 27, '_']]
8_puzzle
puzzle
6
[21, 59, 25, 43, 27, 25, 39, 76, 59, 39, 43, 45, 46, 27, 25, 21]
16
0.03995919227600098
16
4
15
[[[86, 78, 77, 39, 76], [54, 45, 25, 59, 21], [38, 46, 43, 27, "_"]]]
[[[86, 78, 77, 39, 76], [54, 45, 25, 59, 21], [38, 46, 43, 27, "_"]]]
["[[86, 78, 77, 39, 76], [54, 45, 25, 59, 21], [38, 46, 43, 27, '_']]"]
76
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: quad, bhang, decay, honor, picky The initial board: [['h', 'q', 'n', 'a', '_'], ['b', 'y', 'a', 'd', 'g'], ['d', 'e', 'c', 'a', 'o'], ['h', 'o', 'n', 'u', 'r'], ['p', 'i', 'c', 'k', 'y']]
8_puzzle_words
puzzle
3
["down-left", "down-left", "up-left", "up-right", "down-right", "down-left", "down-right", "up-right", "up-left", "down-left", "up-left", "up-right", "down-right", "down-left", "up-left", "up-left"]
16
0.18000054359436035
16
4
25
[[["h", "q", "n", "a", "_"], ["b", "y", "a", "d", "g"], ["d", "e", "c", "a", "o"], ["h", "o", "n", "u", "r"], ["p", "i", "c", "k", "y"]]]
[[["h", "q", "n", "a", "_"], ["b", "y", "a", "d", "g"], ["d", "e", "c", "a", "o"], ["h", "o", "n", "u", "r"], ["p", "i", "c", "k", "y"]], ["quad", "bhang", "decay", "honor", "picky"]]
["[['h', 'q', 'n', 'a', '_'], ['b', 'y', 'a', 'd', 'g'], ['d', 'e', 'c', 'a', 'o'], ['h', 'o', 'n', 'u', 'r'], ['p', 'i', 'c', 'k', 'y']]", "['quad', 'bhang', 'decay', 'honor', 'picky']"]
76
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 K 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 K, 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. Q A E R D G X K B Z W F O L Q 0 1 0 0 0 1 0 0 0 0 0 0 0 1 A 0 0 0 0 0 0 1 0 1 0 0 0 1 0 E 1 0 0 0 0 0 0 0 1 1 0 0 0 0 R 1 1 0 0 0 0 0 0 0 0 1 0 0 0 D 0 0 0 0 0 0 0 0 0 1 0 0 0 0 G 0 1 1 0 0 0 0 0 1 1 0 1 1 0 X 0 0 1 0 0 1 0 1 1 0 0 0 0 1 K 0 0 1 1 0 0 0 0 0 1 1 0 0 0 B 0 0 0 0 0 0 0 1 0 0 1 0 0 1 Z 0 1 0 0 0 0 0 0 1 0 0 1 1 0 W 0 0 0 0 0 1 0 0 0 1 0 0 0 1 F 0 0 0 1 0 1 0 1 1 0 1 0 1 1 O 0 0 0 0 0 0 0 1 1 0 0 0 0 0 L 0 1 0 1 0 0 1 1 0 0 0 0 1 0
city_directed_graph
pathfinding
14
["D", "Z", "A", "X", "K", "W", "L", "X", "K"]
9
0.0372929573059082
9
14
17
[[[0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0], [0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1], [0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1], [0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0]], ["Q", "A", "E", "R", "D", "G", "X", "K", "B", "Z", "W", "F", "O", "L"], "K", "X"]
[[[0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0,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'R', 'D', 'G', 'X', 'K', 'B', 'Z', 'W', 'F', 'O', 'L']", "['D']", "['K', 'X']"]
76
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [8, 8, 6, 36, 7, 36, 33, 3, 31, 17, 21, 28, 41, 17, 23, 16, 39, 2, 3, 40, 23, 20, 5, 30, 8, 28, 17, 34, 38, 26, 16, 21, 15, 21, 11, 33, 5, 33, 2, 27, 26, 21, 14, 13, 7, 23], such that the sum of the chosen coins adds up to 403. 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 {28: 16, 5: 1, 3: 3, 40: 18, 33: 20, 34: 12, 20: 4, 39: 13, 2: 2, 31: 11, 36: 2, 17: 14, 7: 1, 14: 6, 23: 12, 8: 1, 30: 15, 27: 13, 15: 2, 21: 3, 11: 6, 26: 14, 41: 2, 38: 10, 6: 5, 16: 4, 13: 11}, 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
[7, 41, 36, 8, 15, 21, 21, 8, 21, 8, 21, 20, 16, 39, 38, 36, 16, 31]
70
0.0619659423828125
18
46
46
[[8, 8, 6, 36, 7, 36, 33, 3, 31, 17, 21, 28, 41, 17, 23, 16, 39, 2, 3, 40, 23, 20, 5, 30, 8, 28, 17, 34, 38, 26, 16, 21, 15, 21, 11, 33, 5, 33, 2, 27, 26, 21, 14, 13, 7, 23]]
[[8, 8, 6, 36, 7, 36, 33, 3, 31, 17, 21, 28, 41, 17, 23, 16, 39, 2, 3, 40, 23, 20, 5, 30, 8, 28, 17, 34, 38, 26, 16, 21, 15, 21, 11, 33, 5, 33, 2, 27, 26, 21, 14, 13, 7, 23], {"28": 16, "5": 1, "3": 3, "40": 18, "33": 20, "34": 12, "20": 4, "39": 13, "2": 2, "31": 11, "36": 2, "17": 14, "7": 1, "14": 6, "23": 12, "8": 1, "30": 15, "27": 13, "15": 2, "21": 3, "11": 6, "26": 14, "41": 2, "38": 10, "6": 5, "16": 4, "13": 11}, 403]
["[8, 8, 6, 36, 7, 36, 33, 3, 31, 17, 21, 28, 41, 17, 23, 16, 39, 2, 3, 40, 23, 20, 5, 30, 8, 28, 17, 34, 38, 26, 16, 21, 15, 21, 11, 33, 5, 33, 2, 27, 26, 21, 14, 13, 7, 23]", "{28: 16, 5: 1, 3: 3, 40: 18, 33: 20, 34: 12, 20: 4, 39: 13, 2: 2, 31: 11, 36: 2, 17: 14, 7: 1, 14: 6, 23: 12, 8: 1, 30: 15, 27: 13, 15: 2, 21: 3, 11: 6, 26: 14, 41: 2, 38: 10, 6: 5, 16: 4, 13: 11}", "403"]
76
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
491.6853485107422
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"]
76
We have a 4x4 numerical grid, with numbers ranging from 28 to 78 (28 included in the range but 78 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: [['x' '53' '60' '67'] ['x' 'x' '72' 'x'] ['50' '56' '74' 'x'] ['54' '65' '76' 'x']]
consecutive_grid
underdetermined_system
11
[[0, 2, 52], [1, 2, 56], [1, 3, 65], [2, 0, 54], [3, 0, 57], [3, 1, 58], [3, 3, 75]]
735
44.25528311729431
7
50
16
["[['47', '51', '', '64'], ['50', '53', '', ''], ['', '55', '68', '74'], ['', '', '72', '']]", 37, 87]
["[['47', '51', '', '64'], ['50', '53', '', ''], ['', '55', '68', '74'], ['', '', '72', '']]", 37, 87]
["[['47', '51', '', '64'], ['50', '53', '', ''], ['', '55', '68', '74'], ['', '', '72', '']]", "37", "87"]
76
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 6 to 47. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 128, 80, None for columns 1 to 2 respectively, and the sums of rows must be None, 94, 109, 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 99. 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: [['26' '38' '27' 'x'] ['x' 'x' 'x' '19'] ['x' '43' 'x' 'x'] ['42' 'x' '34' '20']]
magic_square
underdetermined_system
7
[[0, 3, 8], [1, 0, 29], [1, 1, 40], [1, 2, 6], [2, 0, 9], [2, 2, 13], [2, 3, 44], [3, 1, 7]]
405
1.2350444793701172
8
31
16
["[['26', '38', '27', ''], ['', '', '', '19'], ['', '43', '', ''], ['42', '', '34', '20']]", 4, 6, 47]
["[['26', '38', '27', ''], ['', '', '', '19'], ['', '43', '', ''], ['42', '', '34', '20']]", 6, 47, [1, 3], [1, 3], [128, 80], [94, 109], 99]
["[['26', '38', '27', ''], ['', '', '', '19'], ['', '43', '', ''], ['42', '', '34', '20']]", "6", "47", "[None, 128, 80, None]", "[None, 94, 109, None]", "99"]
76
In 'Restricted Sorting', there are 12 stacks each with a capacity of 7 blocks, with 6 stacks filled with blocks of varying shades and the remaining are empty. The challenge is to sort the blocks by shade such that if a stack is not empty, it is stacked with 6 blocks of a single shade. The player can only transfer one block at a time from the top of a stack to an empty stack or to a stack that has only blocks of that shade, without exceeding the stacks’ capacity. Transferring blocks to certain stacks is more expensive than others. The cost of moving one block to the top of each stack is: {0: 7, 1: 9, 2: 13, 3: 3, 4: 4, 5: 4, 6: 6, 7: 11, 8: 12, 9: 3, 10: 13, 11: 5}, where the keys are the index of each stack, indexing from 0. The cost of moving a block is always at least 1. The solution should be a list of tuples, each containing, first, the index of the stack from which a block is picked up from and, second, the index of the stack to which it is transferred, indexing from 0. Given the initial state of the stacks, represented by the lists below (with the leftmost item being the shade of the topmost block in each stack)(and the first stack being the stack at index 0), what is the list of transfer pairs (reported in python syntax) with the least possible cost, that will result in all the blocks being correctly sorted? [['Black', 'Blue', 'Green', 'Green', 'Pink', 'Black', 'Red'], [], ['Green', 'White', 'Yellow', 'Red', 'White', 'Blue', 'Pink'], [], [], ['Black', 'Green', 'Black', 'Yellow', 'Black', 'Blue', 'Black'], ['Green', 'Blue', 'Yellow', 'Yellow', 'Red', 'Yellow', 'Pink'], ['Red', 'White', 'Blue', 'Pink', 'Red', 'Blue', 'White'], [], [], ['Red', 'White', 'Pink', 'Green', 'Yellow', 'White', 'Pink'], []]
restricted_sorting
sorting
4
[[0, 3], [0, 9], [2, 4], [6, 4], [6, 9], [7, 11], [10, 11], [5, 3], [5, 4], [0, 4], [0, 4], [0, 1], [0, 3], [0, 11], [7, 0], [10, 0], [7, 9], [7, 1], [7, 11], [7, 9], [10, 1], [10, 4], [10, 8], [10, 0], [2, 0], [2, 8], [2, 11], [2, 0], [2, 9], [5, 3], [5, 8], [5, 3], [5, 9], [5, 3], [6, 5], [6, 5], [6, 11], [6, 5], [2, 1], [6, 1], [10, 1], [7, 0], [8, 5], [8, 5], [8, 5]]
246
1.6125590801239014
45
132
42
[[["Black", "Blue", "Green", "Green", "Pink", "Black", "Red"], [], ["Green", "White", "Yellow", "Red", "White", "Blue", "Pink"], [], [], ["Black", "Green", "Black", "Yellow", "Black", "Blue", "Black"], ["Green", "Blue", "Yellow", "Yellow", "Red", "Yellow", "Pink"], ["Red", "White", "Blue", "Pink", "Red", "Blue", "White"], [], [], ["Red", "White", "Pink", "Green", "Yellow", "White", "Pink"], []], 7, {"0": 7, "1": 9, "2": 13, "3": 3, "4": 4, "5": 4, "6": 6, "7": 11, "8": 12, "9": 3, "10": 13, "11": 5}]
[[["Black", "Blue", "Green", "Green", "Pink", "Black", "Red"], [], ["Green", "White", "Yellow", "Red", "White", "Blue", "Pink"], [], [], ["Black", "Green", "Black", "Yellow", "Black", "Blue", "Black"], ["Green", "Blue", "Yellow", "Yellow", "Red", "Yellow", "Pink"], ["Red", "White", "Blue", "Pink", "Red", "Blue", "White"], [], [], ["Red", "White", "Pink", "Green", "Yellow", "White", "Pink"], []], 7, {"0": 7, "1": 9, "2": 13, "3": 3, "4": 4, "5": 4, "6": 6, "7": 11, "8": 12, "9": 3, "10": 13, "11": 5}, 6]
["[['Black', 'Blue', 'Green', 'Green', 'Pink', 'Black', 'Red'], [], ['Green', 'White', 'Yellow', 'Red', 'White', 'Blue', 'Pink'], [], [], ['Black', 'Green', 'Black', 'Yellow', 'Black', 'Blue', 'Black'], ['Green', 'Blue', 'Yellow', 'Yellow', 'Red', 'Yellow', 'Pink'], ['Red', 'White', 'Blue', 'Pink', 'Red', 'Blue', 'White'], [], [], ['Red', 'White', 'Pink', 'Green', 'Yellow', 'White', 'Pink'], []]", "{0: 7, 1: 9, 2: 13, 3: 3, 4: 4, 5: 4, 6: 6, 7: 11, 8: 12, 9: 3, 10: 13, 11: 5}", "7", "6"]
76
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, 3) to his destination workshop at index (8, 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 7, and district 3 covering rows 8 to 13. 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 12 8 4 4 16 8 x x 17 18 9 x 16] [2 9 x 1 4 13 20 11 2 x 11 7 14 12] [x x x x 17 15 8 12 x x 7 x x x] [2 2 x 5 14 x 1 5 4 14 7 x x x] [19 x 11 1 19 19 12 x 12 13 5 3 17 17] [x x x x x 1 x x 4 x x x 8 19] [6 x 10 x 7 1 11 x x 3 x 3 2 x] [19 x 3 11 x 6 11 x 12 14 10 x 11 18] [13 x x x x x 4 x x x x x 10 5] [19 x x 16 x x 18 x 8 x 2 11 x 12] [x 14 x 6 x 18 x 11 x x 14 11 2 x] [x x 6 8 10 8 14 x x 13 x 10 x 19] [x 19 x 7 12 17 x 15 x 16 19 x 5 x] [8 x 17 x x 5 15 x x 16 1 x x 17]
traffic
pathfinding
6
[[4, 3], [3, 3], [3, 4], [2, 4], [2, 5], [2, 6], [3, 6], [3, 7], [3, 8], [3, 9], [3, 10], [4, 10], [4, 11], [4, 12], [5, 12], [6, 12], [7, 12], [8, 12], [8, 13]]
151
0.02843952178955078
19
4
4
[[["x", "12", "8", "4", "4", "16", "8", "x", "x", "17", "18", "9", "x", "16"], ["2", "9", "x", "1", "4", "13", "20", "11", "2", "x", "11", "7", "14", "12"], ["x", "x", "x", "x", "17", "15", "8", "12", "x", "x", "7", "x", "x", "x"], ["2", "2", "x", "5", "14", "x", "1", "5", "4", "14", "7", "x", "x", "x"], ["19", "x", "11", "1", "19", "19", "12", "x", "12", "13", "5", "3", "17", "17"], ["x", "x", "x", "x", "x", "1", "x", "x", "4", "x", "x", "x", "8", "19"], ["6", "x", "10", "x", "7", "1", "11", "x", "x", "3", "x", "3", "2", "x"], ["19", "x", "3", "11", "x", "6", "11", "x", "12", "14", "10", "x", "11", "18"], ["13", "x", "x", "x", "x", "x", "4", "x", "x", "x", "x", "x", "10", "5"], ["19", "x", "x", "16", "x", "x", "18", "x", "8", "x", "2", "11", "x", "12"], ["x", "14", "x", "6", "x", "18", "x", "11", "x", "x", "14", "11", "2", "x"], ["x", "x", "6", "8", "10", "8", "14", "x", "x", "13", "x", "10", "x", "19"], ["x", "19", "x", "7", "12", "17", "x", "15", "x", "16", "19", "x", "5", "x"], ["8", "x", "17", "x", "x", "5", "15", "x", "x", "16", "1", "x", "x", "17"]]]
[[["x", "12", "8", "4", "4", "16", "8", "x", "x", "17", "18", "9", "x", "16"], ["2", "9", "x", "1", "4", "13", "20", "11", "2", "x", "11", "7", "14", "12"], ["x", "x", "x", "x", "17", "15", "8", "12", "x", "x", "7", "x", "x", "x"], ["2", "2", "x", "5", "14", "x", "1", "5", "4", "14", "7", "x", "x", "x"], ["19", "x", "11", "1", "19", "19", "12", "x", "12", "13", "5", "3", "17", "17"], ["x", "x", "x", "x", "x", "1", "x", "x", "4", "x", "x", "x", "8", "19"], ["6", "x", "10", "x", "7", "1", "11", "x", "x", "3", "x", "3", "2", "x"], ["19", "x", "3", "11", "x", "6", "11", "x", "12", "14", "10", "x", "11", "18"], ["13", "x", "x", "x", "x", "x", "4", "x", "x", "x", "x", "x", "10", "5"], ["19", "x", "x", "16", "x", "x", "18", "x", "8", "x", "2", "11", "x", "12"], ["x", "14", "x", "6", "x", "18", "x", "11", "x", "x", "14", "11", "2", "x"], ["x", "x", "6", "8", "10", "8", "14", "x", "x", "13", "x", "10", "x", "19"], ["x", "19", "x", "7", "12", "17", "x", "15", "x", "16", "19", "x", "5", "x"], ["8", "x", "17", "x", "x", "5", "15", "x", "x", "16", "1", "x", "x", "17"]], [4, 3], [8, 13], 2, 7]
["[['x', '12', '8', '4', '4', '16', '8', 'x', 'x', '17', '18', '9', 'x', '16'], ['2', '9', 'x', '1', '4', '13', '20', '11', '2', 'x', '11', '7', '14', '12'], ['x', 'x', 'x', 'x', '17', '15', '8', '12', 'x', 'x', '7', 'x', 'x', 'x'], ['2', '2', 'x', '5', '14', 'x', '1', '5', '4', '14', '7', 'x', 'x', 'x'], ['19', 'x', '11', '1', '19', '19', '12', 'x', '12', '13', '5', '3', '17', '17'], ['x', 'x', 'x', 'x', 'x', '1', 'x', 'x', '4', 'x', 'x', 'x', '8', '19'], ['6', 'x', '10', 'x', '7', '1', '11', 'x', 'x', '3', 'x', '3', '2', 'x'], ['19', 'x', '3', '11', 'x', '6', '11', 'x', '12', '14', '10', 'x', '11', '18'], ['13', 'x', 'x', 'x', 'x', 'x', '4', 'x', 'x', 'x', 'x', 'x', '10', '5'], ['19', 'x', 'x', '16', 'x', 'x', '18', 'x', '8', 'x', '2', '11', 'x', '12'], ['x', '14', 'x', '6', 'x', '18', 'x', '11', 'x', 'x', '14', '11', '2', 'x'], ['x', 'x', '6', '8', '10', '8', '14', 'x', 'x', '13', 'x', '10', 'x', '19'], ['x', '19', 'x', '7', '12', '17', 'x', '15', 'x', '16', '19', 'x', '5', 'x'], ['8', 'x', '17', 'x', 'x', '5', '15', 'x', 'x', '16', '1', 'x', 'x', '17']]", "(4, 3)", "(8, 13)", "2", "7"]
76
Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 14x14. 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 4 diagonal jumps, no more, no less, on his path to his destination. He is currently on the trampoline at position (2, 12) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (10, 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 1 1 0 1 0 0 1 0 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 0 0 1 0 1 1 1 1 0 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 1 1 1 1 0 1 0 1 0 1 1 0 0 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1
trampoline_matrix
pathfinding
14
[[2, 12], [3, 11], [2, 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 0, 1, 1, 1, 1, 0, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0], [1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0], [1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1], [1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]", [2, 12], [10, 1], 4]
["[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1], [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0], [1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0], [1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0], [1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1], [1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]", "(2, 12)", "(10, 1)", "4"]
76
Given 7 labeled water jugs with capacities 117, 118, 23, 86, 109, 128, 104, 61 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 367, 390, 400, 470 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
6
[["+", 86, 4], ["+", 128, 4], ["+", 128, 4], ["+", 128, 4], ["+", 61, 3], ["+", 104, 3], ["+", 117, 3], ["+", 118, 3], ["+", 109, 2], ["+", 109, 2], ["+", 86, 2], ["+", 86, 2], ["+", 109, 1], ["+", 117, 1], ["+", 23, 1], ["+", 118, 1]]
16
0.038893938064575195
16
64
3
[[117, 118, 23, 86, 109, 128, 104, 61], [367, 390, 400, 470]]
[[117, 118, 23, 86, 109, 128, 104, 61], [367, 390, 400, 470]]
["[117, 118, 23, 86, 109, 128, 104, 61]", "[367, 390, 400, 470]"]
77
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: [[60, 66, 46, 8, 36], [81, '_', 88, 70, 24], [20, 17, 6, 62, 28]]
8_puzzle
puzzle
6
[88, 46, 66, 88, 81, 60, 88, 81, 46, 70, 8, 66, 70, 8, 24, 28, 62, 24, 28, 36, 66, 28, 36, 62, 24, 6, 8, 36, 28, 66, 62, 24]
32
1.3497884273529053
32
4
15
[[[60, 66, 46, 8, 36], [81, "_", 88, 70, 24], [20, 17, 6, 62, 28]]]
[[[60, 66, 46, 8, 36], [81, "_", 88, 70, 24], [20, 17, 6, 62, 28]]]
["[[60, 66, 46, 8, 36], [81, '_', 88, 70, 24], [20, 17, 6, 62, 28]]"]
77
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: gong, clown, brent, dewax, thorp The initial board: [['l', 'g', 'a', 'n', 'g'], ['c', 'o', 'o', 'e', 'n'], ['e', 'r', '_', 'n', 't'], ['d', 'b', 'w', 'o', 'x'], ['t', 'h', 'w', 'r', 'p']]
8_puzzle_words
puzzle
3
["up-left", "up-right", "down-right", "down-left", "up-left", "down-left", "down-right", "down-right", "up-right", "up-left", "down-left", "up-left", "up-right", "up-right", "down-right", "down-left", "up-left", "down-left", "down-right", "up-right", "up-left", "up-left"]
22
0.6303999423980713
22
4
25
[[["l", "g", "a", "n", "g"], ["c", "o", "o", "e", "n"], ["e", "r", "_", "n", "t"], ["d", "b", "w", "o", "x"], ["t", "h", "w", "r", "p"]]]
[[["l", "g", "a", "n", "g"], ["c", "o", "o", "e", "n"], ["e", "r", "_", "n", "t"], ["d", "b", "w", "o", "x"], ["t", "h", "w", "r", "p"]], ["gong", "clown", "brent", "dewax", "thorp"]]
["[['l', 'g', 'a', 'n', 'g'], ['c', 'o', 'o', 'e', 'n'], ['e', 'r', '_', 'n', 't'], ['d', 'b', 'w', 'o', 'x'], ['t', 'h', 'w', 'r', 'p']]", "['gong', 'clown', 'brent', 'dewax', 'thorp']"]
77
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 B and city H 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 H and B, 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 E D Y F B O H U I C Q Z J S 0 0 0 0 0 0 0 1 0 0 0 0 0 0 E 0 0 0 0 1 1 0 0 0 1 0 0 1 0 D 0 0 0 0 0 1 0 0 0 0 0 0 0 0 Y 0 1 1 0 0 0 0 0 0 0 1 0 1 0 F 0 0 0 0 0 1 1 0 1 1 0 0 0 0 B 1 0 1 1 0 0 0 0 1 0 1 0 0 0 O 1 0 0 0 0 0 0 0 0 0 1 1 0 1 H 0 0 0 1 1 0 0 0 0 0 0 1 0 1 U 1 0 1 1 0 0 0 1 0 0 1 0 0 0 I 1 0 0 0 0 0 1 0 0 0 0 0 1 0 C 0 0 0 0 0 0 0 0 0 1 0 0 0 0 Q 0 0 1 0 1 0 0 0 1 0 0 0 0 1 Z 0 1 1 0 0 0 1 1 0 0 0 1 0 1 J 0 1 1 1 1 0 0 0 1 0 0 0 0 0
city_directed_graph
pathfinding
14
["O", "S", "H", "F", "B", "D", "B", "U", "H"]
9
0.04355263710021973
9
14
17
[[[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0], [1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1], [1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 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 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0], [1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1], [1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 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, 0, 0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1], [0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1], [0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0]]", "['S', 'E', 'D', 'Y', 'F', 'B', 'O', 'H', 'U', 'I', 'C', 'Q', 'Z', 'J']", "['O']", "['B', 'H']"]
77
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [26, 32, 14, 36, 14, 8, 9, 3, 8, 18, 7, 23, 6, 20, 34, 8, 37, 19, 15, 6, 2, 13, 37, 7, 31, 2, 7, 4, 17, 9, 4, 22, 7, 16, 33, 14, 11, 30, 36, 14, 34, 37, 36, 37, 32, 38, 15, 17, 19, 14], such that the sum of the chosen coins adds up to 396. 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 {17: 16, 4: 2, 15: 2, 8: 1, 19: 5, 9: 4, 23: 7, 3: 2, 16: 13, 2: 1, 38: 13, 11: 2, 31: 6, 7: 6, 36: 8, 14: 8, 37: 17, 32: 5, 6: 1, 13: 11, 22: 9, 20: 8, 18: 4, 30: 6, 34: 2, 33: 1, 26: 3}, 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
[34, 26, 8, 15, 8, 15, 33, 32, 8, 11, 31, 30, 37, 34, 32, 2, 19, 19, 2]
68
0.06271767616271973
19
50
50
[[26, 32, 14, 36, 14, 8, 9, 3, 8, 18, 7, 23, 6, 20, 34, 8, 37, 19, 15, 6, 2, 13, 37, 7, 31, 2, 7, 4, 17, 9, 4, 22, 7, 16, 33, 14, 11, 30, 36, 14, 34, 37, 36, 37, 32, 38, 15, 17, 19, 14]]
[[26, 32, 14, 36, 14, 8, 9, 3, 8, 18, 7, 23, 6, 20, 34, 8, 37, 19, 15, 6, 2, 13, 37, 7, 31, 2, 7, 4, 17, 9, 4, 22, 7, 16, 33, 14, 11, 30, 36, 14, 34, 37, 36, 37, 32, 38, 15, 17, 19, 14], {"17": 16, "4": 2, "15": 2, "8": 1, "19": 5, "9": 4, "23": 7, "3": 2, "16": 13, "2": 1, "38": 13, "11": 2, "31": 6, "7": 6, "36": 8, "14": 8, "37": 17, "32": 5, "6": 1, "13": 11, "22": 9, "20": 8, "18": 4, "30": 6, "34": 2, "33": 1, "26": 3}, 396]
["[26, 32, 14, 36, 14, 8, 9, 3, 8, 18, 7, 23, 6, 20, 34, 8, 37, 19, 15, 6, 2, 13, 37, 7, 31, 2, 7, 4, 17, 9, 4, 22, 7, 16, 33, 14, 11, 30, 36, 14, 34, 37, 36, 37, 32, 38, 15, 17, 19, 14]", "{17: 16, 4: 2, 15: 2, 8: 1, 19: 5, 9: 4, 23: 7, 3: 2, 16: 13, 2: 1, 38: 13, 11: 2, 31: 6, 7: 6, 36: 8, 14: 8, 37: 17, 32: 5, 6: 1, 13: 11, 22: 9, 20: 8, 18: 4, 30: 6, 34: 2, 33: 1, 26: 3}", "396"]
77
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', 'Blue', 'Green', 'Red', 'Blue', 'Green'], ['Blue', 'Green', 'Green', 'Blue', 'Red', 'Blue'], ['Green', 'Red', 'Red', 'Green', 'Blue', 'Red']]
color_sorting
sorting
10
[[2, 1], [2, 0], [2, 0], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [1, 2], [0, 1], [0, 2], [0, 2], [1, 0], [1, 0], [1, 0], [1, 2], [1, 0], [1, 0], [1, 0], [1, 0], [2, 1], [2, 1], [2, 0], [2, 1], [2, 1], [0, 2], [0, 2], [0, 1]]
29
413.2857873439789
29
6
18
[[["Red", "Blue", "Green", "Red", "Blue", "Green"], ["Blue", "Green", "Green", "Blue", "Red", "Blue"], ["Green", "Red", "Red", "Green", "Blue", "Red"]], 9]
[[["Red", "Blue", "Green", "Red", "Blue", "Green"], ["Blue", "Green", "Green", "Blue", "Red", "Blue"], ["Green", "Red", "Red", "Green", "Blue", "Red"]], 9]
["[['Red', 'Blue', 'Green', 'Red', 'Blue', 'Green'], ['Blue', 'Green', 'Green', 'Blue', 'Red', 'Blue'], ['Green', 'Red', 'Red', 'Green', 'Blue', 'Red']]", "9"]
77
We have a 4x4 numerical grid, with numbers ranging from 21 to 71 (21 included in the range but 71 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: [['25' 'x' 'x' '57'] ['39' '45' '56' 'x'] ['43' 'x' '58' 'x'] ['46' 'x' '65' '69']]
consecutive_grid
underdetermined_system
11
[[1, 0, 22], [1, 1, 23], [1, 2, 34], [2, 0, 24], [2, 2, 39], [2, 3, 48], [3, 1, 40], [3, 3, 47]]
467
163.82063746452332
8
50
16
["[['20', '21', '33', '60'], ['', '', '', '49'], ['', '38', '', ''], ['36', '', '46', '']]", 14, 64]
["[['20', '21', '33', '60'], ['', '', '', '49'], ['', '38', '', ''], ['36', '', '46', '']]", 14, 64]
["[['20', '21', '33', '60'], ['', '', '', '49'], ['', '38', '', ''], ['36', '', '46', '']]", "14", "64"]
77
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 13 to 54. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 147, 128, None for columns 1 to 2 respectively, and the sums of rows must be None, 159, 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 150. 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' '37' '31'] ['x' 'x' 'x' '51'] ['x' 'x' '16' 'x'] ['41' 'x' '43' '42']]
magic_square
underdetermined_system
8
[[0, 0, 13], [0, 1, 14], [1, 0, 23], [1, 1, 53], [1, 2, 32], [2, 0, 17], [2, 1, 46], [2, 3, 35], [3, 1, 34]]
528
61.967140197753906
9
31
16
["[['', '', '37', '31'], ['', '', '', '51'], ['', '', '16', ''], ['41', '', '43', '42']]", 4, 13, 54]
["[['', '', '37', '31'], ['', '', '', '51'], ['', '', '16', ''], ['41', '', '43', '42']]", 13, 54, [1, 3], [1, 3], [147, 128], [159, 114], 150]
["[['', '', '37', '31'], ['', '', '', '51'], ['', '', '16', ''], ['41', '', '43', '42']]", "13", "54", "[None, 147, 128, None]", "[None, 159, 114, None]", "150"]
77
In 'Restricted Sorting', there are 12 stacks each with a capacity of 7 blocks, with 6 stacks filled with blocks of varying shades and the remaining are empty. The challenge is to sort the blocks by shade such that if a stack is not empty, it is stacked with 6 blocks of a single shade. The player can only transfer one block at a time from the top of a stack to an empty stack or to a stack that has only blocks of that shade, without exceeding the stacks’ capacity. Transferring blocks to certain stacks is more expensive than others. The cost of moving one block to the top of each stack is: {0: 13, 1: 5, 2: 8, 3: 11, 4: 6, 5: 9, 6: 5, 7: 11, 8: 2, 9: 11, 10: 11, 11: 7}, where the keys are the index of each stack, indexing from 0. The cost of moving a block is always at least 1. The solution should be a list of tuples, each containing, first, the index of the stack from which a block is picked up from and, second, the index of the stack to which it is transferred, indexing from 0. Given the initial state of the stacks, represented by the lists below (with the leftmost item being the shade of the topmost block in each stack)(and the first stack being the stack at index 0), what is the list of transfer pairs (reported in python syntax) with the least possible cost, that will result in all the blocks being correctly sorted? [['Green', 'Black', 'White', 'Red', 'White', 'Yellow', 'Blue'], [], ['White', 'Pink', 'White', 'White', 'Green', 'Red', 'Blue'], [], ['Pink', 'Black', 'Black', 'White', 'Black', 'Green', 'Blue'], ['Pink', 'Green', 'Pink', 'Yellow', 'Yellow', 'Blue', 'Red'], [], ['Red', 'Yellow', 'Yellow', 'Yellow', 'Blue', 'Red', 'Black'], [], [], [], ['Red', 'Green', 'Black', 'Blue', 'Pink', 'Pink', 'Green']]
restricted_sorting
sorting
4
[[4, 8], [5, 8], [0, 1], [5, 1], [5, 8], [7, 6], [11, 6], [11, 1], [0, 3], [11, 3], [11, 9], [11, 8], [11, 8], [11, 1], [0, 11], [0, 6], [0, 11], [2, 11], [2, 8], [2, 11], [2, 11], [2, 1], [2, 6], [0, 10], [5, 10], [5, 10], [5, 0], [4, 3], [4, 3], [4, 11], [4, 3], [4, 1], [7, 10], [7, 10], [7, 10], [7, 4], [7, 5], [7, 3], [0, 4], [0, 4], [2, 4], [9, 4], [5, 6], [5, 6]]
309
44.145676374435425
44
132
42
[[["Green", "Black", "White", "Red", "White", "Yellow", "Blue"], [], ["White", "Pink", "White", "White", "Green", "Red", "Blue"], [], ["Pink", "Black", "Black", "White", "Black", "Green", "Blue"], ["Pink", "Green", "Pink", "Yellow", "Yellow", "Blue", "Red"], [], ["Red", "Yellow", "Yellow", "Yellow", "Blue", "Red", "Black"], [], [], [], ["Red", "Green", "Black", "Blue", "Pink", "Pink", "Green"]], 7, {"0": 13, "1": 5, "2": 8, "3": 11, "4": 6, "5": 9, "6": 5, "7": 11, "8": 2, "9": 11, "10": 11, "11": 7}]
[[["Green", "Black", "White", "Red", "White", "Yellow", "Blue"], [], ["White", "Pink", "White", "White", "Green", "Red", "Blue"], [], ["Pink", "Black", "Black", "White", "Black", "Green", "Blue"], ["Pink", "Green", "Pink", "Yellow", "Yellow", "Blue", "Red"], [], ["Red", "Yellow", "Yellow", "Yellow", "Blue", "Red", "Black"], [], [], [], ["Red", "Green", "Black", "Blue", "Pink", "Pink", "Green"]], 7, {"0": 13, "1": 5, "2": 8, "3": 11, "4": 6, "5": 9, "6": 5, "7": 11, "8": 2, "9": 11, "10": 11, "11": 7}, 6]
["[['Green', 'Black', 'White', 'Red', 'White', 'Yellow', 'Blue'], [], ['White', 'Pink', 'White', 'White', 'Green', 'Red', 'Blue'], [], ['Pink', 'Black', 'Black', 'White', 'Black', 'Green', 'Blue'], ['Pink', 'Green', 'Pink', 'Yellow', 'Yellow', 'Blue', 'Red'], [], ['Red', 'Yellow', 'Yellow', 'Yellow', 'Blue', 'Red', 'Black'], [], [], [], ['Red', 'Green', 'Black', 'Blue', 'Pink', 'Pink', 'Green']]", "{0: 13, 1: 5, 2: 8, 3: 11, 4: 6, 5: 9, 6: 5, 7: 11, 8: 2, 9: 11, 10: 11, 11: 7}", "7", "6"]
77
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 (6, 1) to his destination workshop at index (3, 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 1, district 2 covering rows 2 to 5, and district 3 covering rows 6 to 13. 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 5 9 6 13 13 8 6 13 x 13 x x x] [3 10 16 x x 3 13 1 11 9 7 6 x 18] [9 11 3 x x 6 13 x 14 x 12 1 2 4] [x 17 13 x 14 4 6 8 x x 1 x 6 2] [7 x 11 x 14 x 11 7 x 5 x 1 12 x] [x 20 20 19 x 18 2 19 1 6 12 x x 16] [8 5 7 11 x 1 x x x 11 4 x x 3] [x 11 x 11 11 x x 18 x x x 7 6 x] [2 2 14 5 5 x x 11 19 16 x 14 7 19] [x 5 x x 7 x 10 x x x 3 15 x x] [19 x x x x 8 3 19 x 18 x x x 9] [17 x 19 x x x 5 3 x x 7 4 x x] [x x x x x 12 11 x x x x x 6 6] [x x x x x x 4 x x x 7 x 6 3]
traffic
pathfinding
6
[[6, 1], [6, 2], [5, 2], [4, 2], [3, 2], [2, 2], [1, 2], [0, 2], [0, 3], [0, 4], [0, 5], [0, 6], [0, 7], [1, 7], [1, 8], [1, 9], [1, 10], [1, 11], [2, 11], [2, 12], [2, 13], [3, 13]]
168
0.022469043731689453
22
4
4
[[["x", "5", "9", "6", "13", "13", "8", "6", "13", "x", "13", "x", "x", "x"], ["3", "10", "16", "x", "x", "3", "13", "1", "11", "9", "7", "6", "x", "18"], ["9", "11", "3", "x", "x", "6", "13", "x", "14", "x", "12", "1", "2", "4"], ["x", "17", "13", "x", "14", "4", "6", "8", "x", "x", "1", "x", "6", "2"], ["7", "x", "11", "x", "14", "x", "11", "7", "x", "5", "x", "1", "12", "x"], ["x", "20", "20", "19", "x", "18", "2", "19", "1", "6", "12", "x", "x", "16"], ["8", "5", "7", "11", "x", "1", "x", "x", "x", "11", "4", "x", "x", "3"], ["x", "11", "x", "11", "11", "x", "x", "18", "x", "x", "x", "7", "6", "x"], ["2", "2", "14", "5", "5", "x", "x", "11", "19", "16", "x", "14", "7", "19"], ["x", "5", "x", "x", "7", "x", "10", "x", "x", "x", "3", "15", "x", "x"], ["19", "x", "x", "x", "x", "8", "3", "19", "x", "18", "x", "x", "x", "9"], ["17", "x", "19", "x", "x", "x", "5", "3", "x", "x", "7", "4", "x", "x"], ["x", "x", "x", "x", "x", "12", "11", "x", "x", "x", "x", "x", "6", "6"], ["x", "x", "x", "x", "x", "x", "4", "x", "x", "x", "7", "x", "6", "3"]]]
[[["x", "5", "9", "6", "13", "13", "8", "6", "13", "x", "13", "x", "x", "x"], ["3", "10", "16", "x", "x", "3", "13", "1", "11", "9", "7", "6", "x", "18"], ["9", "11", "3", "x", "x", "6", "13", "x", "14", "x", "12", "1", "2", "4"], ["x", "17", "13", "x", "14", "4", "6", "8", "x", "x", "1", "x", "6", "2"], ["7", "x", "11", "x", "14", "x", "11", "7", "x", "5", "x", "1", "12", "x"], ["x", "20", "20", "19", "x", "18", "2", "19", "1", "6", "12", "x", "x", "16"], ["8", "5", "7", "11", "x", "1", "x", "x", "x", "11", "4", "x", "x", "3"], ["x", "11", "x", "11", "11", "x", "x", "18", "x", "x", "x", "7", "6", "x"], ["2", "2", "14", "5", "5", "x", "x", "11", "19", "16", "x", "14", "7", "19"], ["x", "5", "x", "x", "7", "x", "10", "x", "x", "x", "3", "15", "x", "x"], ["19", "x", "x", "x", "x", "8", "3", "19", "x", "18", "x", "x", "x", "9"], ["17", "x", "19", "x", "x", "x", "5", "3", "x", "x", "7", "4", "x", "x"], ["x", "x", "x", "x", "x", "12", "11", "x", "x", "x", "x", "x", "6", "6"], ["x", "x", "x", "x", "x", "x", "4", "x", "x", "x", "7", "x", "6", "3"]], [6, 1], [3, 13], 1, 5]
["[['x', '5', '9', '6', '13', '13', '8', '6', '13', 'x', '13', 'x', 'x', 'x'], ['3', '10', '16', 'x', 'x', '3', '13', '1', '11', '9', '7', '6', 'x', '18'], ['9', '11', '3', 'x', 'x', '6', '13', 'x', '14', 'x', '12', '1', '2', '4'], ['x', '17', '13', 'x', '14', '4', '6', '8', 'x', 'x', '1', 'x', '6', '2'], ['7', 'x', '11', 'x', '14', 'x', '11', '7', 'x', '5', 'x', '1', '12', 'x'], ['x', '20', '20', '19', 'x', '18', '2', '19', '1', '6', '12', 'x', 'x', '16'], ['8', '5', '7', '11', 'x', '1', 'x', 'x', 'x', '11', '4', 'x', 'x', '3'], ['x', '11', 'x', '11', '11', 'x', 'x', '18', 'x', 'x', 'x', '7', '6', 'x'], ['2', '2', '14', '5', '5', 'x', 'x', '11', '19', '16', 'x', '14', '7', '19'], ['x', '5', 'x', 'x', '7', 'x', '10', 'x', 'x', 'x', '3', '15', 'x', 'x'], ['19', 'x', 'x', 'x', 'x', '8', '3', '19', 'x', '18', 'x', 'x', 'x', '9'], ['17', 'x', '19', 'x', 'x', 'x', '5', '3', 'x', 'x', '7', '4', 'x', 'x'], ['x', 'x', 'x', 'x', 'x', '12', '11', 'x', 'x', 'x', 'x', 'x', '6', '6'], ['x', 'x', 'x', 'x', 'x', 'x', '4', 'x', 'x', 'x', '7', 'x', '6', '3']]", "(6, 1)", "(3, 13)", "1", "5"]
77
Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 14x14. 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 4 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 (8, 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. 0 0 1 1 0 0 1 1 1 1 0 0 0 0 0 1 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 1 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0 0 0 0 0 0 1 0 0 1 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 1 0 0 1 0 1 1 0 0 1 0 0 0 0 0 0 1 1 1 0 1 0 0 1 0 1 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1 0 0 1 1 1 0 1 0 1 0 1
trampoline_matrix
pathfinding
14
[[0, 13], [0, 12], [0, 11], [0, 10], [1, 10], [2, 10], [3, 9], [3, 8], [3, 7], [4, 7], [5, 7], [6, 6], [7, 5], [7, 4], [7, 3], [7, 2], [8, 1]]
17
0.03951430320739746
17
8
2
["[[0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0], [0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0], [1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0], [1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0], [1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0], [1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0,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 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0], [1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0], [1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1], [1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], [1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1]]", "(0, 13)", "(8, 1)", "4"]
77
Given 7 labeled water jugs with capacities 60, 59, 72, 93, 39, 74, 71, 84 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 166, 239, 286, 421 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
6
[["+", 71, 4], ["+", 71, 4], ["+", 93, 4], ["+", 93, 4], ["+", 93, 4], ["+", 71, 3], ["+", 84, 3], ["+", 60, 3], ["+", 71, 3], ["+", 71, 2], ["+", 84, 2], ["+", 84, 2], ["+", 39, 1], ["+", 93, 1], ["-", 59, 1], ["+", 93, 1]]
16
0.05889129638671875
16
64
3
[[60, 59, 72, 93, 39, 74, 71, 84], [166, 239, 286, 421]]
[[60, 59, 72, 93, 39, 74, 71, 84], [166, 239, 286, 421]]
["[60, 59, 72, 93, 39, 74, 71, 84]", "[166, 239, 286, 421]"]
78
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, 92, 77, 88, '_'], [82, 43, 76, 85, 87], [24, 66, 17, 79, 75]]
8_puzzle
puzzle
6
[87, 85, 76, 17, 66, 24, 82, 43, 24, 66, 17, 24, 43, 82, 66, 17, 79, 76, 24, 79, 17, 43, 79, 24, 76, 17, 24, 77, 88, 87, 85, 75]
32
4.894534587860107
32
4
15
[[[94, 92, 77, 88, "_"], [82, 43, 76, 85, 87], [24, 66, 17, 79, 75]]]
[[[94, 92, 77, 88, "_"], [82, 43, 76, 85, 87], [24, 66, 17, 79, 75]]]
["[[94, 92, 77, 88, '_'], [82, 43, 76, 85, 87], [24, 66, 17, 79, 75]]"]
78
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: jake, tawse, trypa, smash, creep The initial board: [['a', 'j', '_', 'k', 'e'], ['t', 's', 'w', 'y', 'e'], ['t', 'r', 'a', 'p', 'a'], ['s', 'e', 'a', 'm', 'h'], ['c', 'r', 's', 'e', 'p']]
8_puzzle_words
puzzle
3
["down-left", "down-right", "down-right", "down-left", "up-left", "up-right", "up-right", "up-left", "down-left", "up-left"]
10
0.18477082252502441
10
4
25
[[["a", "j", "_", "k", "e"], ["t", "s", "w", "y", "e"], ["t", "r", "a", "p", "a"], ["s", "e", "a", "m", "h"], ["c", "r", "s", "e", "p"]]]
[[["a", "j", "_", "k", "e"], ["t", "s", "w", "y", "e"], ["t", "r", "a", "p", "a"], ["s", "e", "a", "m", "h"], ["c", "r", "s", "e", "p"]], ["jake", "tawse", "trypa", "smash", "creep"]]
["[['a', 'j', '_', 'k', 'e'], ['t', 's', 'w', 'y', 'e'], ['t', 'r', 'a', 'p', 'a'], ['s', 'e', 'a', 'm', 'h'], ['c', 'r', 's', 'e', 'p']]", "['jake', 'tawse', 'trypa', 'smash', 'creep']"]
78
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 'A'. Our task is to visit city H and city W 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 W 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. B A M G V J T N W X K Y H C B 0 0 0 0 0 0 1 0 0 0 0 1 0 1 A 1 0 0 0 0 0 0 0 0 0 0 0 0 0 M 0 0 0 0 0 0 0 1 0 0 0 0 0 0 G 0 0 1 0 0 1 0 0 1 0 0 0 0 0 V 1 1 1 1 0 0 0 1 0 1 0 0 0 0 J 0 0 0 0 0 0 1 0 0 0 0 0 0 1 T 0 1 0 1 0 0 0 0 1 0 0 0 0 0 N 0 0 0 1 0 1 0 0 0 0 0 0 1 0 W 0 0 1 1 1 0 0 0 0 0 0 0 1 1 X 0 1 1 1 0 0 1 0 1 0 0 0 1 0 K 0 0 0 0 1 0 0 1 0 0 0 0 0 0 Y 0 0 1 1 1 0 1 0 0 1 1 0 0 0 H 0 0 1 0 0 1 0 0 0 0 1 0 0 0 C 0 0 0 0 1 0 1 0 0 0 0 0 1 0
city_directed_graph
pathfinding
14
["A", "B", "C", "H", "J", "T", "W", "G", "W", "H"]
10
0.0448455810546875
10
14
17
[[[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 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, 0, 0], [1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1], [0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0]], ["B", "A", "M", "G", "V", "J", "T", "N", "W", "X", "K", "Y", "H", "C"], "H", "W"]
[[[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 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, 0, 0], [1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1], [0, 1, 0, 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 'H', 'C']", "['A']", "['H', 'W']"]
78
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [29, 32, 2, 34, 7, 25, 7, 14, 33, 1, 26, 18, 13, 11, 32, 31, 13, 2, 28, 21, 38, 8, 11, 28, 26, 9, 4, 28, 34, 23, 18, 31, 35, 2, 25, 20, 15, 5, 12, 10, 7, 14, 17, 4, 13, 24, 11, 16, 14, 27, 29], such that the sum of the chosen coins adds up to 392. 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 {10: 1, 25: 18, 1: 1, 15: 7, 12: 1, 23: 16, 9: 7, 27: 15, 29: 16, 28: 2, 32: 12, 24: 6, 5: 1, 8: 1, 11: 8, 17: 13, 13: 6, 38: 6, 31: 19, 4: 2, 34: 12, 21: 3, 2: 2, 33: 12, 20: 13, 18: 1, 14: 13, 16: 8, 7: 5, 35: 16, 26: 10}, 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
[28, 18, 12, 10, 8, 21, 33, 28, 24, 18, 35, 34, 32, 28, 26, 2, 5, 4, 13, 13]
99
0.0646202564239502
20
51
51
[[29, 32, 2, 34, 7, 25, 7, 14, 33, 1, 26, 18, 13, 11, 32, 31, 13, 2, 28, 21, 38, 8, 11, 28, 26, 9, 4, 28, 34, 23, 18, 31, 35, 2, 25, 20, 15, 5, 12, 10, 7, 14, 17, 4, 13, 24, 11, 16, 14, 27, 29]]
[[29, 32, 2, 34, 7, 25, 7, 14, 33, 1, 26, 18, 13, 11, 32, 31, 13, 2, 28, 21, 38, 8, 11, 28, 26, 9, 4, 28, 34, 23, 18, 31, 35, 2, 25, 20, 15, 5, 12, 10, 7, 14, 17, 4, 13, 24, 11, 16, 14, 27, 29], {"10": 1, "25": 18, "1": 1, "15": 7, "12": 1, "23": 16, "9": 7, "27": 15, "29": 16, "28": 2, "32": 12, "24": 6, "5": 1, "8": 1, "11": 8, "17": 13, "13": 6, "38": 6, "31": 19, "4": 2, "34": 12, "21": 3, "2": 2, "33": 12, "20": 13, "18": 1, "14": 13, "16": 8, "7": 5, "35": 16, "26": 10}, 392]
["[29, 32, 2, 34, 7, 25, 7, 14, 33, 1, 26, 18, 13, 11, 32, 31, 13, 2, 28, 21, 38, 8, 11, 28, 26, 9, 4, 28, 34, 23, 18, 31, 35, 2, 25, 20, 15, 5, 12, 10, 7, 14, 17, 4, 13, 24, 11, 16, 14, 27, 29]", "{10: 1, 25: 18, 1: 1, 15: 7, 12: 1, 23: 16, 9: 7, 27: 15, 29: 16, 28: 2, 32: 12, 24: 6, 5: 1, 8: 1, 11: 8, 17: 13, 13: 6, 38: 6, 31: 19, 4: 2, 34: 12, 21: 3, 2: 2, 33: 12, 20: 13, 18: 1, 14: 13, 16: 8, 7: 5, 35: 16, 26: 10}", "392"]
78
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', 'Green', 'Blue'], ['Blue', 'Blue', 'Red', 'Blue', 'Green', 'Red'], ['Green', 'Red', 'Green', 'Blue', 'Green', 'Red']]
color_sorting
sorting
10
[[0, 1], [2, 0], [2, 1], [2, 0], [2, 1], [2, 0], [1, 0], [1, 2], [1, 2], [1, 2], [0, 2], [1, 2], [1, 2], [1, 2], [1, 0], [1, 2], [0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [2, 1], [0, 2], [0, 1], [0, 1], [2, 0], [2, 0], [2, 1], [2, 0], [2, 0], [2, 0], [1, 2], [1, 0], [1, 2], [1, 2], [0, 1]]
36
552.3669350147247
36
6
18
[[["Red", "Green", "Blue", "Red", "Green", "Blue"], ["Blue", "Blue", "Red", "Blue", "Green", "Red"], ["Green", "Red", "Green", "Blue", "Green", "Red"]], 9]
[[["Red", "Green", "Blue", "Red", "Green", "Blue"], ["Blue", "Blue", "Red", "Blue", "Green", "Red"], ["Green", "Red", "Green", "Blue", "Green", "Red"]], 9]
["[['Red', 'Green', 'Blue', 'Red', 'Green', 'Blue'], ['Blue', 'Blue', 'Red', 'Blue', 'Green', 'Red'], ['Green', 'Red', 'Green', 'Blue', 'Green', 'Red']]", "9"]
78
We have a 4x4 numerical grid, with numbers ranging from 17 to 67 (17 included in the range but 67 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: [['39' '40' '44' '62'] ['29' '33' '38' '61'] ['x' 'x' '35' '59'] ['x' 'x' 'x' 'x']]
consecutive_grid
underdetermined_system
11
[[0, 0, 61], [0, 1, 60], [0, 3, 36], [1, 3, 62], [2, 1, 45], [3, 0, 37], [3, 1, 38], [3, 2, 64]]
734
0.4792149066925049
8
50
16
["[['', '', '58', ''], ['44', '54', '59', ''], ['43', '', '63', '75'], ['', '', '', '84']]", 36, 86]
["[['', '', '58', ''], ['44', '54', '59', ''], ['43', '', '63', '75'], ['', '', '', '84']]", 36, 86]
["[['', '', '58', ''], ['44', '54', '59', ''], ['43', '', '63', '75'], ['', '', '', '84']]", "36", "86"]
78
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 13 to 54. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 135, 153, None for columns 1 to 2 respectively, and the sums of rows must be None, 158, 87, 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 140. 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' '22' 'x' 'x'] ['28' '47' '42' 'x'] ['16' 'x' '30' '24'] ['x' 'x' 'x' 'x']]
magic_square
underdetermined_system
8
[[0, 0, 13], [0, 2, 29], [0, 3, 31], [1, 3, 41], [2, 1, 17], [3, 0, 50], [3, 1, 49], [3, 2, 52], [3, 3, 14]]
505
17.9815993309021
9
31
16
["[['', '22', '', ''], ['28', '47', '42', ''], ['16', '', '30', '24'], ['', '', '', '']]", 4, 13, 54]
["[['', '22', '', ''], ['28', '47', '42', ''], ['16', '', '30', '24'], ['', '', '', '']]", 13, 54, [1, 3], [1, 3], [135, 153], [158, 87], 140]
["[['', '22', '', ''], ['28', '47', '42', ''], ['16', '', '30', '24'], ['', '', '', '']]", "13", "54", "[None, 135, 153, None]", "[None, 158, 87, None]", "140"]
78
In 'Restricted Sorting', there are 12 stacks each with a capacity of 7 blocks, with 6 stacks filled with blocks of varying shades and the remaining are empty. The challenge is to sort the blocks by shade such that if a stack is not empty, it is stacked with 6 blocks of a single shade. The player can only transfer one block at a time from the top of a stack to an empty stack or to a stack that has only blocks of that shade, without exceeding the stacks’ capacity. Transferring blocks to certain stacks is more expensive than others. The cost of moving one block to the top of each stack is: {0: 2, 1: 7, 2: 5, 3: 11, 4: 6, 5: 13, 6: 12, 7: 7, 8: 8, 9: 6, 10: 7, 11: 7}, where the keys are the index of each stack, indexing from 0. The cost of moving a block is always at least 1. The solution should be a list of tuples, each containing, first, the index of the stack from which a block is picked up from and, second, the index of the stack to which it is transferred, indexing from 0. Given the initial state of the stacks, represented by the lists below (with the leftmost item being the shade of the topmost block in each stack)(and the first stack being the stack at index 0), what is the list of transfer pairs (reported in python syntax) with the least possible cost, that will result in all the blocks being correctly sorted? [[], ['Blue', 'Pink', 'Red', 'Red', 'Yellow', 'White', 'Green'], [], [], ['White', 'Black', 'Blue', 'Yellow', 'Yellow', 'Pink', 'White'], ['Green', 'Pink', 'White', 'Blue', 'Pink', 'Red', 'Pink'], ['Black', 'Green', 'Yellow', 'White', 'Yellow', 'Red', 'Blue'], [], ['Red', 'White', 'Black', 'Blue', 'Black', 'Yellow', 'Green'], [], ['Green', 'Black', 'Pink', 'Black', 'Red', 'Green', 'Blue'], []]
restricted_sorting
sorting
4
[[5, 0], [10, 0], [6, 2], [6, 0], [4, 9], [4, 2], [1, 7], [4, 7], [8, 11], [8, 9], [8, 2], [8, 7], [8, 2], [8, 3], [8, 0], [1, 8], [10, 2], [10, 8], [10, 2], [10, 11], [10, 0], [1, 11], [1, 11], [10, 7], [1, 10], [1, 9], [4, 10], [4, 10], [4, 8], [6, 10], [6, 4], [6, 10], [6, 11], [5, 8], [5, 4], [5, 7], [5, 8], [5, 11], [5, 8], [3, 10], [6, 7], [4, 9], [4, 9], [4, 9], [1, 0]]
275
30.320260763168335
45
132
42
[[[], ["Blue", "Pink", "Red", "Red", "Yellow", "White", "Green"], [], [], ["White", "Black", "Blue", "Yellow", "Yellow", "Pink", "White"], ["Green", "Pink", "White", "Blue", "Pink", "Red", "Pink"], ["Black", "Green", "Yellow", "White", "Yellow", "Red", "Blue"], [], ["Red", "White", "Black", "Blue", "Black", "Yellow", "Green"], [], ["Green", "Black", "Pink", "Black", "Red", "Green", "Blue"], []], 7, {"0": 2, "1": 7, "2": 5, "3": 11, "4": 6, "5": 13, "6": 12, "7": 7, "8": 8, "9": 6, "10": 7, "11": 7}]
[[[], ["Blue", "Pink", "Red", "Red", "Yellow", "White", "Green"], [], [], ["White", "Black", "Blue", "Yellow", "Yellow", "Pink", "White"], ["Green", "Pink", "White", "Blue", "Pink", "Red", "Pink"], ["Black", "Green", "Yellow", "White", "Yellow", "Red", "Blue"], [], ["Red", "White", "Black", "Blue", "Black", "Yellow", "Green"], [], ["Green", "Black", "Pink", "Black", "Red", "Green", "Blue"], []], 7, {"0": 2, "1": 7, "2": 5, "3": 11, "4": 6, "5": 13, "6": 12, "7": 7, "8": 8, "9": 6, "10": 7, "11": 7}, 6]
["[[], ['Blue', 'Pink', 'Red', 'Red', 'Yellow', 'White', 'Green'], [], [], ['White', 'Black', 'Blue', 'Yellow', 'Yellow', 'Pink', 'White'], ['Green', 'Pink', 'White', 'Blue', 'Pink', 'Red', 'Pink'], ['Black', 'Green', 'Yellow', 'White', 'Yellow', 'Red', 'Blue'], [], ['Red', 'White', 'Black', 'Blue', 'Black', 'Yellow', 'Green'], [], ['Green', 'Black', 'Pink', 'Black', 'Red', 'Green', 'Blue'], []]", "{0: 2, 1: 7, 2: 5, 3: 11, 4: 6, 5: 13, 6: 12, 7: 7, 8: 8, 9: 6, 10: 7, 11: 7}", "7", "6"]
78
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, 12) to his destination workshop at index (2, 0), 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 13. 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 16 11 12 x x 17 3 x x 4 6] [4 17 x x 3 x x 1 9 11 12 4 x x] [5 x x 7 14 4 5 7 13 4 7 x x x] [6 6 19 3 15 x x x x 4 10 19 2 4] [3 16 8 x 5 x 12 17 16 x 9 5 6 x] [17 2 x x 16 x 5 x x 5 17 7 2 5] [19 x x x x 2 15 15 x 3 11 x 4 x] [x x 11 x x 17 5 x 5 x x 19 6 x] [16 17 16 x 12 x 2 18 9 7 x 13 x x] [18 11 x x 19 5 x x 18 4 x x x x] [x x x x 2 5 4 12 3 x 4 14 7 19] [18 x x x 7 17 x x 3 15 x 16 x 10] [x 11 15 x x x x x 2 13 x x x 3] [4 8 x x x x 12 13 x x 19 x 6 x]
traffic
pathfinding
6
[[7, 12], [6, 12], [5, 12], [4, 12], [4, 11], [4, 10], [3, 10], [3, 9], [2, 9], [2, 8], [2, 7], [2, 6], [2, 5], [2, 4], [2, 3], [3, 3], [3, 2], [3, 1], [3, 0], [2, 0]]
133
0.023016929626464844
20
4
4
[[["x", "x", "x", "16", "11", "12", "x", "x", "17", "3", "x", "x", "4", "6"], ["4", "17", "x", "x", "3", "x", "x", "1", "9", "11", "12", "4", "x", "x"], ["5", "x", "x", "7", "14", "4", "5", "7", "13", "4", "7", "x", "x", "x"], ["6", "6", "19", "3", "15", "x", "x", "x", "x", "4", "10", "19", "2", "4"], ["3", "16", "8", "x", "5", "x", "12", "17", "16", "x", "9", "5", "6", "x"], ["17", "2", "x", "x", "16", "x", "5", "x", "x", "5", "17", "7", "2", "5"], ["19", "x", "x", "x", "x", "2", "15", "15", "x", "3", "11", "x", "4", "x"], ["x", "x", "11", "x", "x", "17", "5", "x", "5", "x", "x", "19", "6", "x"], ["16", "17", "16", "x", "12", "x", "2", "18", "9", "7", "x", "13", "x", "x"], ["18", "11", "x", "x", "19", "5", "x", "x", "18", "4", "x", "x", "x", "x"], ["x", "x", "x", "x", "2", "5", "4", "12", "3", "x", "4", "14", "7", "19"], ["18", "x", "x", "x", "7", "17", "x", "x", "3", "15", "x", "16", "x", "10"], ["x", "11", "15", "x", "x", "x", "x", "x", "2", "13", "x", "x", "x", "3"], ["4", "8", "x", "x", "x", "x", "12", "13", "x", "x", "19", "x", "6", "x"]]]
[[["x", "x", "x", "16", "11", "12", "x", "x", "17", "3", "x", "x", "4", "6"], ["4", "17", "x", "x", "3", "x", "x", "1", "9", "11", "12", "4", "x", "x"], ["5", "x", "x", "7", "14", "4", "5", "7", "13", "4", "7", "x", "x", "x"], ["6", "6", "19", "3", "15", "x", "x", "x", "x", "4", "10", "19", "2", "4"], ["3", "16", "8", "x", "5", "x", "12", "17", "16", "x", "9", "5", "6", "x"], ["17", "2", "x", "x", "16", "x", "5", "x", "x", "5", "17", "7", "2", "5"], ["19", "x", "x", "x", "x", "2", "15", "15", "x", "3", "11", "x", "4", "x"], ["x", "x", "11", "x", "x", "17", "5", "x", "5", "x", "x", "19", "6", "x"], ["16", "17", "16", "x", "12", "x", "2", "18", "9", "7", "x", "13", "x", "x"], ["18", "11", "x", "x", "19", "5", "x", "x", "18", "4", "x", "x", "x", "x"], ["x", "x", "x", "x", "2", "5", "4", "12", "3", "x", "4", "14", "7", "19"], ["18", "x", "x", "x", "7", "17", "x", "x", "3", "15", "x", "16", "x", "10"], ["x", "11", "15", "x", "x", "x", "x", "x", "2", "13", "x", "x", "x", "3"], ["4", "8", "x", "x", "x", "x", "12", "13", "x", "x", "19", "x", "6", "x"]], [7, 12], [2, 0], 2, 6]
["[['x', 'x', 'x', '16', '11', '12', 'x', 'x', '17', '3', 'x', 'x', '4', '6'], ['4', '17', 'x', 'x', '3', 'x', 'x', '1', '9', '11', '12', '4', 'x', 'x'], ['5', 'x', 'x', '7', '14', '4', '5', '7', '13', '4', '7', 'x', 'x', 'x'], ['6', '6', '19', '3', '15', 'x', 'x', 'x', 'x', '4', '10', '19', '2', '4'], ['3', '16', '8', 'x', '5', 'x', '12', '17', '16', 'x', '9', '5', '6', 'x'], ['17', '2', 'x', 'x', '16', 'x', '5', 'x', 'x', '5', '17', '7', '2', '5'], ['19', 'x', 'x', 'x', 'x', '2', '15', '15', 'x', '3', '11', 'x', '4', 'x'], ['x', 'x', '11', 'x', 'x', '17', '5', 'x', '5', 'x', 'x', '19', '6', 'x'], ['16', '17', '16', 'x', '12', 'x', '2', '18', '9', '7', 'x', '13', 'x', 'x'], ['18', '11', 'x', 'x', '19', '5', 'x', 'x', '18', '4', 'x', 'x', 'x', 'x'], ['x', 'x', 'x', 'x', '2', '5', '4', '12', '3', 'x', '4', '14', '7', '19'], ['18', 'x', 'x', 'x', '7', '17', 'x', 'x', '3', '15', 'x', '16', 'x', '10'], ['x', '11', '15', 'x', 'x', 'x', 'x', 'x', '2', '13', 'x', 'x', 'x', '3'], ['4', '8', 'x', 'x', 'x', 'x', '12', '13', 'x', 'x', '19', 'x', '6', 'x']]", "(7, 12)", "(2, 0)", "2", "6"]
78
Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 14x14. 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 4 diagonal jumps, no more, no less, on his path to his destination. He is currently on the trampoline at position (10, 12) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (1, 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 0 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 1 1 1 0 0 1 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 0 1 1 1 1 0 0 0 0 0 1 0 1 1 0 1 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 0 0 1 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 0 0 1 0 0 1 1 1 0 1 0 0 1 1 1 1 1 1 0 1 0 1 1 1 0 1
trampoline_matrix
pathfinding
14
[[10, 12], [9, 11], [8, 10], [7, 9], [6, 8], [5, 8], [4, 8], [4, 7], [4, 6], [4, 5], [4, 4], [3, 4], [3, 3], [2, 3], [1, 3], [1, 2], [1, 1]]
17
0.030817031860351562
17
8
2
["[[1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0], [1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0], [1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1], [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0], [1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1], [0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1], [1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1], [0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0], [1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1]]", 4]
["[[1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0], [1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0], [1, 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]", "(10, 12)", "(1, 1)", "4"]
78
Given 7 labeled water jugs with capacities 58, 18, 19, 47, 86, 75, 119, 34 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 234, 331, 343, 379 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
6
[["+", 19, 4], ["+", 119, 4], ["+", 119, 4], ["+", 47, 4], ["+", 75, 4], ["+", 19, 3], ["+", 119, 3], ["+", 119, 3], ["+", 86, 3], ["+", 75, 2], ["+", 119, 2], ["+", 18, 2], ["+", 119, 2], ["+", 47, 1], ["+", 119, 1], ["-", 18, 1], ["+", 86, 1]]
17
0.05347609519958496
17
64
3
[[58, 18, 19, 47, 86, 75, 119, 34], [234, 331, 343, 379]]
[[58, 18, 19, 47, 86, 75, 119, 34], [234, 331, 343, 379]]
["[58, 18, 19, 47, 86, 75, 119, 34]", "[234, 331, 343, 379]"]
79
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: [[42, 89, 21, 58, 67], [54, 32, 99, 69, 38], [77, 33, '_', 39, 16]]
8_puzzle
puzzle
7
[99, 32, 89, 42, 54, 77, 33, 99, 32, 21, 42, 54, 77, 89, 99, 32, 21, 42, 58, 69, 42, 58, 54, 77, 89, 99, 58, 54, 77, 89, 99, 58, 54, 42, 39, 16]
36
5.105415344238281
36
4
15
[[[42, 89, 21, 58, 67], [54, 32, 99, 69, 38], [77, 33, "_", 39, 16]]]
[[[42, 89, 21, 58, 67], [54, 32, 99, 69, 38], [77, 33, "_", 39, 16]]]
["[[42, 89, 21, 58, 67], [54, 32, 99, 69, 38], [77, 33, '_', 39, 16]]"]
79
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: siva, bryce, birny, pugil, linne The initial board: [['r', 's', 'c', 'v', 'a'], ['b', 'b', 'y', 'r', 'e'], ['u', 'i', '_', 'n', 'i'], ['p', 'n', 'g', 'i', 'l'], ['l', 'i', 'y', 'n', 'e']]
8_puzzle_words
puzzle
3
["down-right", "down-left", "up-left", "up-left", "up-right", "up-right", "down-right", "down-right", "down-left", "up-left", "up-left", "up-right", "down-right", "down-left", "up-left", "up-left"]
16
0.3119840621948242
16
4
25
[[["r", "s", "c", "v", "a"], ["b", "b", "y", "r", "e"], ["u", "i", "_", "n", "i"], ["p", "n", "g", "i", "l"], ["l", "i", "y", "n", "e"]]]
[[["r", "s", "c", "v", "a"], ["b", "b", "y", "r", "e"], ["u", "i", "_", "n", "i"], ["p", "n", "g", "i", "l"], ["l", "i", "y", "n", "e"]], ["siva", "bryce", "birny", "pugil", "linne"]]
["[['r', 's', 'c', 'v', 'a'], ['b', 'b', 'y', 'r', 'e'], ['u', 'i', '_', 'n', 'i'], ['p', 'n', 'g', 'i', 'l'], ['l', 'i', 'y', 'n', 'e']]", "['siva', 'bryce', 'birny', 'pugil', 'linne']"]
79
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 S and city W 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 W and S, 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. Z G K N S X I F E C R V L W Z 0 0 0 1 0 0 0 1 0 0 0 0 0 0 G 0 0 0 0 0 0 0 0 1 0 1 0 0 1 K 0 0 0 1 1 0 0 0 0 0 0 1 0 1 N 0 0 0 0 1 1 0 0 0 0 0 0 0 0 S 0 0 0 0 0 1 0 0 1 0 0 0 0 0 X 0 1 0 0 0 0 1 1 0 1 0 0 1 0 I 0 0 0 0 0 0 0 0 0 0 0 1 0 0 F 0 0 0 1 1 0 0 0 0 1 0 0 0 1 E 1 0 1 0 0 1 1 0 0 1 1 0 0 0 C 0 1 0 1 0 0 0 0 0 0 0 0 0 1 R 0 0 1 0 0 0 0 0 0 1 0 0 0 0 V 0 1 1 0 1 0 1 0 1 0 1 0 0 0 L 0 1 0 0 0 0 1 1 0 0 0 0 0 0 W 1 0 0 0 0 1 0 0 0 1 0 1 1 0
city_directed_graph
pathfinding
14
["I", "V", "S", "E", "K", "W", "C", "W", "L", "F", "S"]
11
0.06302189826965332
11
14
17
[[[0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1], [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 1, 0, 1,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", "R", "V", "L", "W"], "I", "S", "W"]
["[[0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1], [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 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, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1], [1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0]]", "['Z', 'G', 'K', 'N', 'S', 'X', 'I', 'F', 'E', 'C', 'R', 'V', 'L', 'W']", "['I']", "['S', 'W']"]
79
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [33, 4, 5, 9, 31, 26, 25, 19, 31, 33, 24, 6, 13, 17, 15, 37, 7, 21, 3, 23, 22, 7, 3, 11, 19, 28, 24, 32, 27, 31, 24, 12, 23, 22, 16, 6, 33, 8, 19, 13, 5, 11, 10, 4, 8, 16, 14, 17, 13, 9, 25, 17], such that the sum of the chosen coins adds up to 389. 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 {3: 3, 19: 1, 5: 2, 9: 4, 17: 4, 24: 11, 8: 5, 22: 10, 4: 2, 32: 10, 16: 1, 37: 5, 23: 12, 26: 18, 12: 1, 27: 9, 14: 5, 25: 13, 15: 8, 6: 6, 21: 13, 10: 3, 31: 17, 7: 3, 33: 10, 11: 2, 28: 10, 13: 10}, 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
[11, 19, 19, 16, 19, 37, 16, 17, 17, 17, 27, 33, 10, 11, 33, 14, 33, 28, 12]
84
0.06765866279602051
19
52
52
[[33, 4, 5, 9, 31, 26, 25, 19, 31, 33, 24, 6, 13, 17, 15, 37, 7, 21, 3, 23, 22, 7, 3, 11, 19, 28, 24, 32, 27, 31, 24, 12, 23, 22, 16, 6, 33, 8, 19, 13, 5, 11, 10, 4, 8, 16, 14, 17, 13, 9, 25, 17]]
[[33, 4, 5, 9, 31, 26, 25, 19, 31, 33, 24, 6, 13, 17, 15, 37, 7, 21, 3, 23, 22, 7, 3, 11, 19, 28, 24, 32, 27, 31, 24, 12, 23, 22, 16, 6, 33, 8, 19, 13, 5, 11, 10, 4, 8, 16, 14, 17, 13, 9, 25, 17], {"3": 3, "19": 1, "5": 2, "9": 4, "17": 4, "24": 11, "8": 5, "22": 10, "4": 2, "32": 10, "16": 1, "37": 5, "23": 12, "26": 18, "12": 1, "27": 9, "14": 5, "25": 13, "15": 8, "6": 6, "21": 13, "10": 3, "31": 17, "7": 3, "33": 10, "11": 2, "28": 10, "13": 10}, 389]
["[33, 4, 5, 9, 31, 26, 25, 19, 31, 33, 24, 6, 13, 17, 15, 37, 7, 21, 3, 23, 22, 7, 3, 11, 19, 28, 24, 32, 27, 31, 24, 12, 23, 22, 16, 6, 33, 8, 19, 13, 5, 11, 10, 4, 8, 16, 14, 17, 13, 9, 25, 17]", "{3: 3, 19: 1, 5: 2, 9: 4, 17: 4, 24: 11, 8: 5, 22: 10, 4: 2, 32: 10, 16: 1, 37: 5, 23: 12, 26: 18, 12: 1, 27: 9, 14: 5, 25: 13, 15: 8, 6: 6, 21: 13, 10: 3, 31: 17, 7: 3, 33: 10, 11: 2, 28: 10, 13: 10}", "389"]
79
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', 'Blue', 'Blue', 'Green'], ['Green', 'Green', 'Red', 'Red', 'Blue', 'Blue'], ['Blue', 'Red', 'Green', 'Blue', 'Green', 'Red']]
color_sorting
sorting
10
[[2, 0], [1, 2], [1, 2], [0, 2], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1], [2, 0], [2, 1], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [0, 1], [0, 2], [0, 2], [0, 2], [1, 0], [1, 0], [1, 2], [1, 0], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1]]
30
487.9078462123871
30
6
18
[[["Red", "Green", "Red", "Blue", "Blue", "Green"], ["Green", "Green", "Red", "Red", "Blue", "Blue"], ["Blue", "Red", "Green", "Blue", "Green", "Red"]], 9]
[[["Red", "Green", "Red", "Blue", "Blue", "Green"], ["Green", "Green", "Red", "Red", "Blue", "Blue"], ["Blue", "Red", "Green", "Blue", "Green", "Red"]], 9]
["[['Red', 'Green', 'Red', 'Blue', 'Blue', 'Green'], ['Green', 'Green', 'Red', 'Red', 'Blue', 'Blue'], ['Blue', 'Red', 'Green', 'Blue', 'Green', 'Red']]", "9"]
79
We have a 4x4 numerical grid, with numbers ranging from 14 to 64 (14 included in the range but 64 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: [['x' 'x' '53' '62'] ['x' '27' 'x' 'x'] ['21' '22' 'x' '50'] ['x' '20' '25' '44']]
consecutive_grid
underdetermined_system
12
[[0, 0, 37], [0, 2, 24], [0, 3, 23], [1, 3, 39], [2, 1, 40], [2, 3, 44], [3, 0, 25], [3, 1, 41]]
447
2.1435494422912598
8
50
16
["[['', '35', '', ''], ['34', '36', '38', ''], ['29', '', '43', ''], ['', '', '49', '53']]", 23, 73]
["[['', '35', '', ''], ['34', '36', '38', ''], ['29', '', '43', ''], ['', '', '49', '53']]", 23, 73]
["[['', '35', '', ''], ['34', '36', '38', ''], ['29', '', '43', ''], ['', '', '49', '53']]", "23", "73"]
79
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 13 to 54. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 146, 168, None for columns 1 to 2 respectively, and the sums of rows must be None, 118, 120, 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 91. 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' '46' 'x' '22'] ['x' 'x' '36' '15'] ['47' 'x' 'x' '25'] ['x' 'x' '53' 'x']]
magic_square
underdetermined_system
8
[[0, 0, 13], [0, 2, 50], [1, 0, 16], [1, 1, 51], [2, 1, 19], [2, 2, 29], [3, 0, 14], [3, 1, 30], [3, 3, 17]]
483
56.54647707939148
9
31
16
["[['', '46', '', '22'], ['', '', '36', '15'], ['47', '', '', '25'], ['', '', '53', '']]", 4, 13, 54]
["[['', '46', '', '22'], ['', '', '36', '15'], ['47', '', '', '25'], ['', '', '53', '']]", 13, 54, [1, 3], [1, 3], [146, 168], [118, 120], 91]
["[['', '46', '', '22'], ['', '', '36', '15'], ['47', '', '', '25'], ['', '', '53', '']]", "13", "54", "[None, 146, 168, None]", "[None, 118, 120, None]", "91"]
79
In 'Restricted Sorting', there are 12 stacks each with a capacity of 7 blocks, with 6 stacks filled with blocks of varying shades and the remaining are empty. The challenge is to sort the blocks by shade such that if a stack is not empty, it is stacked with 6 blocks of a single shade. The player can only transfer one block at a time from the top of a stack to an empty stack or to a stack that has only blocks of that shade, without exceeding the stacks’ capacity. Transferring blocks to certain stacks is more expensive than others. The cost of moving one block to the top of each stack is: {0: 10, 1: 4, 2: 5, 3: 4, 4: 7, 5: 3, 6: 11, 7: 5, 8: 9, 9: 3, 10: 11, 11: 2}, where the keys are the index of each stack, indexing from 0. The cost of moving a block is always at least 1. The solution should be a list of tuples, each containing, first, the index of the stack from which a block is picked up from and, second, the index of the stack to which it is transferred, indexing from 0. Given the initial state of the stacks, represented by the lists below (with the leftmost item being the shade of the topmost block in each stack)(and the first stack being the stack at index 0), what is the list of transfer pairs (reported in python syntax) with the least possible cost, that will result in all the blocks being correctly sorted? [['Red', 'Pink', 'Pink', 'Pink', 'Red', 'Black', 'Pink'], [], ['Green', 'Green', 'Blue', 'White', 'Yellow', 'Blue', 'Blue'], [], ['Green', 'Blue', 'White', 'Red', 'Blue', 'Black', 'Red'], ['Pink', 'White', 'Yellow', 'Black', 'Yellow', 'Green', 'White'], [], ['Red', 'Green', 'Black', 'White', 'Green', 'Red', 'Black'], [], [], ['Yellow', 'White', 'Yellow', 'Blue', 'Black', 'Yellow', 'Pink'], []]
restricted_sorting
sorting
4
[[0, 11], [7, 11], [2, 9], [2, 9], [4, 9], [7, 9], [7, 1], [7, 3], [7, 9], [7, 11], [7, 1], [4, 7], [4, 3], [4, 11], [4, 7], [4, 1], [4, 11], [5, 4], [5, 3], [2, 7], [2, 3], [2, 8], [2, 7], [2, 7], [5, 2], [5, 1], [5, 2], [5, 9], [10, 2], [10, 3], [10, 2], [10, 7], [10, 1], [10, 2], [5, 3], [0, 5], [0, 5], [0, 5], [0, 11], [0, 1], [8, 2], [0, 5], [4, 5], [10, 5]]
172
1.1443188190460205
44
132
42
[[["Red", "Pink", "Pink", "Pink", "Red", "Black", "Pink"], [], ["Green", "Green", "Blue", "White", "Yellow", "Blue", "Blue"], [], ["Green", "Blue", "White", "Red", "Blue", "Black", "Red"], ["Pink", "White", "Yellow", "Black", "Yellow", "Green", "White"], [], ["Red", "Green", "Black", "White", "Green", "Red", "Black"], [], [], ["Yellow", "White", "Yellow", "Blue", "Black", "Yellow", "Pink"], []], 7, {"0": 10, "1": 4, "2": 5, "3": 4, "4": 7, "5": 3, "6": 11, "7": 5, "8": 9, "9": 3, "10": 11, "11": 2}]
[[["Red", "Pink", "Pink", "Pink", "Red", "Black", "Pink"], [], ["Green", "Green", "Blue", "White", "Yellow", "Blue", "Blue"], [], ["Green", "Blue", "White", "Red", "Blue", "Black", "Red"], ["Pink", "White", "Yellow", "Black", "Yellow", "Green", "White"], [], ["Red", "Green", "Black", "White", "Green", "Red", "Black"], [], [], ["Yellow", "White", "Yellow", "Blue", "Black", "Yellow", "Pink"], []], 7, {"0": 10, "1": 4, "2": 5, "3": 4, "4": 7, "5": 3, "6": 11, "7": 5, "8": 9, "9": 3, "10": 11, "11": 2}, 6]
["[['Red', 'Pink', 'Pink', 'Pink', 'Red', 'Black', 'Pink'], [], ['Green', 'Green', 'Blue', 'White', 'Yellow', 'Blue', 'Blue'], [], ['Green', 'Blue', 'White', 'Red', 'Blue', 'Black', 'Red'], ['Pink', 'White', 'Yellow', 'Black', 'Yellow', 'Green', 'White'], [], ['Red', 'Green', 'Black', 'White', 'Green', 'Red', 'Black'], [], [], ['Yellow', 'White', 'Yellow', 'Blue', 'Black', 'Yellow', 'Pink'], []]", "{0: 10, 1: 4, 2: 5, 3: 4, 4: 7, 5: 3, 6: 11, 7: 5, 8: 9, 9: 3, 10: 11, 11: 2}", "7", "6"]
79
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, 12) to his destination workshop at index (7, 0), 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 13. 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 17 7 x x 11 4 5 15 17 6 6 2] [17 x x 6 x x x x 1 8 x x x 7] [x x x 17 4 10 6 4 x 8 16 11 x x] [x 4 x x 10 x 8 10 x 11 x x 1 x] [x x 11 9 4 x 8 8 x x x 16 13 8] [x 12 3 15 13 13 x 15 19 x 2 2 6 x] [15 1 x x x x 5 4 x 5 12 2 5 x] [20 13 7 18 8 18 5 2 17 7 11 x 15 13] [4 11 x x 10 9 x 18 14 x 19 x x x] [19 x 2 x 18 17 10 x x x 13 15 x 10] [16 5 2 3 13 x x x x x x x x 3] [x x x x 17 9 x x x x x 6 x x] [11 x x 9 14 x x 16 x 15 13 13 15 1] [9 x x 10 14 x x x x x x x 1 19]
traffic
pathfinding
6
[[4, 12], [5, 12], [5, 11], [5, 10], [6, 10], [6, 9], [7, 9], [7, 8], [7, 7], [7, 6], [7, 5], [7, 4], [7, 3], [7, 2], [7, 1], [7, 0]]
142
0.02055048942565918
16
4
4
[[["x", "x", "17", "7", "x", "x", "11", "4", "5", "15", "17", "6", "6", "2"], ["17", "x", "x", "6", "x", "x", "x", "x", "1", "8", "x", "x", "x", "7"], ["x", "x", "x", "17", "4", "10", "6", "4", "x", "8", "16", "11", "x", "x"], ["x", "4", "x", "x", "10", "x", "8", "10", "x", "11", "x", "x", "1", "x"], ["x", "x", "11", "9", "4", "x", "8", "8", "x", "x", "x", "16", "13", "8"], ["x", "12", "3", "15", "13", "13", "x", "15", "19", "x", "2", "2", "6", "x"], ["15", "1", "x", "x", "x", "x", "5", "4", "x", "5", "12", "2", "5", "x"], ["20", "13", "7", "18", "8", "18", "5", "2", "17", "7", "11", "x", "15", "13"], ["4", "11", "x", "x", "10", "9", "x", "18", "14", "x", "19", "x", "x", "x"], ["19", "x", "2", "x", "18", "17", "10", "x", "x", "x", "13", "15", "x", "10"], ["16", "5", "2", "3", "13", "x", "x", "x", "x", "x", "x", "x", "x", "3"], ["x", "x", "x", "x", "17", "9", "x", "x", "x", "x", "x", "6", "x", "x"], ["11", "x", "x", "9", "14", "x", "x", "16", "x", "15", "13", "13", "15", "1"], ["9", "x", "x", "10", "14", "x", "x", "x", "x", "x", "x", "x", "1", "19"]]]
[[["x", "x", "17", "7", "x", "x", "11", "4", "5", "15", "17", "6", "6", "2"], ["17", "x", "x", "6", "x", "x", "x", "x", "1", "8", "x", "x", "x", "7"], ["x", "x", "x", "17", "4", "10", "6", "4", "x", "8", "16", "11", "x", "x"], ["x", "4", "x", "x", "10", "x", "8", "10", "x", "11", "x", "x", "1", "x"], ["x", "x", "11", "9", "4", "x", "8", "8", "x", "x", "x", "16", "13", "8"], ["x", "12", "3", "15", "13", "13", "x", "15", "19", "x", "2", "2", "6", "x"], ["15", "1", "x", "x", "x", "x", "5", "4", "x", "5", "12", "2", "5", "x"], ["20", "13", "7", "18", "8", "18", "5", "2", "17", "7", "11", "x", "15", "13"], ["4", "11", "x", "x", "10", "9", "x", "18", "14", "x", "19", "x", "x", "x"], ["19", "x", "2", "x", "18", "17", "10", "x", "x", "x", "13", "15", "x", "10"], ["16", "5", "2", "3", "13", "x", "x", "x", "x", "x", "x", "x", "x", "3"], ["x", "x", "x", "x", "17", "9", "x", "x", "x", "x", "x", "6", "x", "x"], ["11", "x", "x", "9", "14", "x", "x", "16", "x", "15", "13", "13", "15", "1"], ["9", "x", "x", "10", "14", "x", "x", "x", "x", "x", "x", "x", "1", "19"]], [4, 12], [7, 0], 4, 6]
["[['x', 'x', '17', '7', 'x', 'x', '11', '4', '5', '15', '17', '6', '6', '2'], ['17', 'x', 'x', '6', 'x', 'x', 'x', 'x', '1', '8', 'x', 'x', 'x', '7'], ['x', 'x', 'x', '17', '4', '10', '6', '4', 'x', '8', '16', '11', 'x', 'x'], ['x', '4', 'x', 'x', '10', 'x', '8', '10', 'x', '11', 'x', 'x', '1', 'x'], ['x', 'x', '11', '9', '4', 'x', '8', '8', 'x', 'x', 'x', '16', '13', '8'], ['x', '12', '3', '15', '13', '13', 'x', '15', '19', 'x', '2', '2', '6', 'x'], ['15', '1', 'x', 'x', 'x', 'x', '5', '4', 'x', '5', '12', '2', '5', 'x'], ['20', '13', '7', '18', '8', '18', '5', '2', '17', '7', '11', 'x', '15', '13'], ['4', '11', 'x', 'x', '10', '9', 'x', '18', '14', 'x', '19', 'x', 'x', 'x'], ['19', 'x', '2', 'x', '18', '17', '10', 'x', 'x', 'x', '13', '15', 'x', '10'], ['16', '5', '2', '3', '13', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '3'], ['x', 'x', 'x', 'x', '17', '9', 'x', 'x', 'x', 'x', 'x', '6', 'x', 'x'], ['11', 'x', 'x', '9', '14', 'x', 'x', '16', 'x', '15', '13', '13', '15', '1'], ['9', 'x', 'x', '10', '14', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '1', '19']]", "(4, 12)", "(7, 0)", "4", "6"]
79
Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 14x14. 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 4 diagonal jumps, no more, no less, on his path to his destination. He is currently on the trampoline at position (10, 10) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (1, 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. 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 1 1 1 0 0 1 1 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 1 0 1 1 0 0 0 1 0 0 1 1 1 1 0 0 0 0 0 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 0 1 1 1 0 0 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 0 1 1 1 1 1 0 0 1 0 1 1 1 1 0 1
trampoline_matrix
pathfinding
14
[[10, 10], [9, 10], [8, 10], [7, 10], [6, 10], [5, 10], [4, 9], [3, 8], [2, 7], [2, 6], [2, 5], [1, 4], [1, 3], [1, 2], [1, 1], [1, 0]]
16
0.03317451477050781
16
8
2
["[[0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0], [1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0], [1, 0, 1, 1, 1, 1,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 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1], [0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0], [1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0], [1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0], [0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1], [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1], [0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0], [1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1], [1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1]]", "(10, 10)", "(1, 0)", "4"]
79
Given 7 labeled water jugs with capacities 99, 47, 122, 123, 72, 136, 51, 71 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 274, 292, 361, 438 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
6
[["+", 122, 4], ["+", 122, 4], ["+", 71, 4], ["+", 123, 4], ["+", 51, 3], ["+", 51, 3], ["+", 123, 3], ["+", 136, 3], ["+", 122, 2], ["+", 123, 2], ["+", 47, 2], ["+", 99, 1], ["+", 99, 1], ["-", 47, 1], ["+", 123, 1]]
15
0.051012516021728516
15
64
3
[[99, 47, 122, 123, 72, 136, 51, 71], [274, 292, 361, 438]]
[[99, 47, 122, 123, 72, 136, 51, 71], [274, 292, 361, 438]]
["[99, 47, 122, 123, 72, 136, 51, 71]", "[274, 292, 361, 438]"]
80
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: [[97, 78, '_', 9, 67], [18, 65, 52, 27, 66], [38, 92, 50, 14, 6]]
8_puzzle
puzzle
7
[9, 67, 66, 27, 14, 50, 92, 38, 18, 65, 52, 92, 38, 52, 92, 14, 50, 38, 14, 9, 78, 92, 52, 14, 9, 50, 38, 6]
28
0.24241900444030762
28
4
15
[[[97, 78, "_", 9, 67], [18, 65, 52, 27, 66], [38, 92, 50, 14, 6]]]
[[[97, 78, "_", 9, 67], [18, 65, 52, 27, 66], [38, 92, 50, 14, 6]]]
["[[97, 78, '_', 9, 67], [18, 65, 52, 27, 66], [38, 92, 50, 14, 6]]"]
80
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: welt, eddic, equip, macer, yurta The initial board: [['d', 'w', 'p', 'l', 't'], ['e', 'i', 'd', 'e', 'c'], ['_', 'q', 'e', 'i', 'r'], ['m', 'e', 'c', 'u', 'r'], ['y', 'u', 'a', 't', 'a']]
8_puzzle_words
puzzle
3
["down-right", "up-right", "down-right", "up-right", "up-left", "up-left", "down-left", "down-left", "down-right", "down-right", "up-right", "up-right", "up-left", "up-left", "down-left", "up-left"]
16
0.22876906394958496
16
4
25
[[["d", "w", "p", "l", "t"], ["e", "i", "d", "e", "c"], ["_", "q", "e", "i", "r"], ["m", "e", "c", "u", "r"], ["y", "u", "a", "t", "a"]]]
[[["d", "w", "p", "l", "t"], ["e", "i", "d", "e", "c"], ["_", "q", "e", "i", "r"], ["m", "e", "c", "u", "r"], ["y", "u", "a", "t", "a"]], ["welt", "eddic", "equip", "macer", "yurta"]]
["[['d', 'w', 'p', 'l', 't'], ['e', 'i', 'd', 'e', 'c'], ['_', 'q', 'e', 'i', 'r'], ['m', 'e', 'c', 'u', 'r'], ['y', 'u', 'a', 't', 'a']]", "['welt', 'eddic', 'equip', 'macer', 'yurta']"]
80
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 'Y'. Our task is to visit city M and city B 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 B and M, 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 X G E P B O C L J M Y T W S 0 0 0 1 1 0 0 0 0 0 1 0 0 0 X 0 0 0 1 0 0 0 1 0 0 0 0 1 1 G 1 0 0 0 0 0 0 1 0 0 0 1 0 0 E 0 1 0 0 0 1 1 0 1 0 0 0 0 0 P 0 0 1 0 0 0 0 1 1 1 1 0 0 0 B 1 0 0 0 0 0 0 1 1 0 0 0 0 0 O 0 1 0 0 0 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 1 0 1 1 0 0 0 0 L 0 1 0 0 1 0 0 0 0 1 0 0 0 0 J 0 1 1 0 0 1 0 1 0 0 0 1 1 0 M 0 1 1 0 0 0 1 1 0 0 0 0 1 1 Y 0 0 0 0 1 0 0 0 0 0 0 0 0 1 T 1 0 1 1 0 1 0 1 0 0 0 0 0 0 W 0 0 1 0 0 1 0 0 0 0 0 1 1 0
city_directed_graph
pathfinding
14
["Y", "P", "M", "T", "B", "S", "M", "W", "B"]
9
0.04214882850646973
9
14
17
[[[0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0], [1, 0, 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, 0], [0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0], [0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0]], ["S", "X", "G", "E", "P", "B", "O", "C", "L", "J", "M", "Y", "T", "W"], "M", "B"]
[[[0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0], [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], [1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0]]", "['S', 'X', 'G', 'E', 'P', 'B', 'O', 'C', 'L', 'J', 'M', 'Y', 'T', 'W']", "['Y']", "['M', 'B']"]
80
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [8, 7, 5, 24, 3, 18, 36, 39, 36, 25, 25, 33, 16, 20, 34, 9, 1, 22, 25, 13, 8, 37, 35, 39, 11, 26, 36, 25, 25, 27, 2, 4, 35, 2, 16, 22, 12, 15, 19, 2, 17, 25, 28, 12, 26, 17, 33, 5, 30, 3, 21, 3], such that the sum of the chosen coins adds up to 397. 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 {13: 7, 39: 4, 20: 18, 5: 1, 12: 7, 9: 5, 28: 20, 24: 11, 3: 3, 17: 3, 21: 9, 37: 6, 16: 8, 15: 1, 26: 10, 36: 6, 22: 9, 2: 2, 8: 1, 25: 20, 4: 3, 7: 5, 19: 7, 30: 6, 27: 12, 1: 1, 34: 7, 35: 5, 11: 6, 18: 12, 33: 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
31
[5, 33, 33, 39, 8, 39, 36, 8, 15, 35, 35, 37, 36, 34, 4]
58
0.06058311462402344
15
52
52
[[8, 7, 5, 24, 3, 18, 36, 39, 36, 25, 25, 33, 16, 20, 34, 9, 1, 22, 25, 13, 8, 37, 35, 39, 11, 26, 36, 25, 25, 27, 2, 4, 35, 2, 16, 22, 12, 15, 19, 2, 17, 25, 28, 12, 26, 17, 33, 5, 30, 3, 21, 3]]
[[8, 7, 5, 24, 3, 18, 36, 39, 36, 25, 25, 33, 16, 20, 34, 9, 1, 22, 25, 13, 8, 37, 35, 39, 11, 26, 36, 25, 25, 27, 2, 4, 35, 2, 16, 22, 12, 15, 19, 2, 17, 25, 28, 12, 26, 17, 33, 5, 30, 3, 21, 3], {"13": 7, "39": 4, "20": 18, "5": 1, "12": 7, "9": 5, "28": 20, "24": 11, "3": 3, "17": 3, "21": 9, "37": 6, "16": 8, "15": 1, "26": 10, "36": 6, "22": 9, "2": 2, "8": 1, "25": 20, "4": 3, "7": 5, "19": 7, "30": 6, "27": 12, "1": 1, "34": 7, "35": 5, "11": 6, "18": 12, "33": 4}, 397]
["[8, 7, 5, 24, 3, 18, 36, 39, 36, 25, 25, 33, 16, 20, 34, 9, 1, 22, 25, 13, 8, 37, 35, 39, 11, 26, 36, 25, 25, 27, 2, 4, 35, 2, 16, 22, 12, 15, 19, 2, 17, 25, 28, 12, 26, 17, 33, 5, 30, 3, 21, 3]", "{13: 7, 39: 4, 20: 18, 5: 1, 12: 7, 9: 5, 28: 20, 24: 11, 3: 3, 17: 3, 21: 9, 37: 6, 16: 8, 15: 1, 26: 10, 36: 6, 22: 9, 2: 2, 8: 1, 25: 20, 4: 3, 7: 5, 19: 7, 30: 6, 27: 12, 1: 1, 34: 7, 35: 5, 11: 6, 18: 12, 33: 4}", "397"]
80
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', 'Green', 'Blue', 'Green'], ['Green', 'Green', 'Green', 'Blue', 'Blue', 'Red'], ['Green', 'Blue', 'Red', 'Red', 'Red', 'Red']]
color_sorting
sorting
10
[[0, 1], [2, 1], [2, 1], [0, 2], [0, 2], [1, 2], [0, 1], [0, 2], [1, 0], [1, 0], [1, 2], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1], [2, 1], [0, 2], [0, 1], [0, 1]]
24
30.166829586029053
24
6
18
[[["Blue", "Red", "Blue", "Green", "Blue", "Green"], ["Green", "Green", "Green", "Blue", "Blue", "Red"], ["Green", "Blue", "Red", "Red", "Red", "Red"]], 9]
[[["Blue", "Red", "Blue", "Green", "Blue", "Green"], ["Green", "Green", "Green", "Blue", "Blue", "Red"], ["Green", "Blue", "Red", "Red", "Red", "Red"]], 9]
["[['Blue', 'Red', 'Blue', 'Green', 'Blue', 'Green'], ['Green', 'Green', 'Green', 'Blue', 'Blue', 'Red'], ['Green', 'Blue', 'Red', 'Red', 'Red', 'Red']]", "9"]
80
We have a 4x4 numerical grid, with numbers ranging from 22 to 72 (22 included in the range but 72 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: [['37' '50' 'x' '70'] ['x' '46' 'x' '65'] ['41' '43' 'x' '49'] ['x' '30' 'x' 'x']]
consecutive_grid
underdetermined_system
12
[[0, 0, 10], [1, 0, 11], [1, 1, 16], [1, 2, 19], [2, 0, 12], [2, 1, 15], [2, 2, 18], [3, 0, 13], [3, 1, 14], [3, 2, 17]]
423
58.67084217071533
10
50
16
["[['', '33', '34', '47'], ['', '', '', '50'], ['', '', '', '52'], ['', '', '', '53']]", 10, 60]
["[['', '33', '34', '47'], ['', '', '', '50'], ['', '', '', '52'], ['', '', '', '53']]", 10, 60]
["[['', '33', '34', '47'], ['', '', '', '50'], ['', '', '', '52'], ['', '', '', '53']]", "10", "60"]
80
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 35 to 76. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 247, 236, None for columns 1 to 2 respectively, and the sums of rows must be None, 231, 259, 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 234. 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' '60'] ['72' 'x' 'x' 'x'] ['63' '70' 'x' 'x'] ['61' '75' 'x' 'x']]
magic_square
underdetermined_system
8
[[0, 0, 35], [0, 1, 36], [0, 2, 46], [1, 1, 66], [1, 2, 43], [1, 3, 50], [2, 2, 74], [2, 3, 52], [3, 2, 73], [3, 3, 37]]
913
48.18892478942871
10
31
16
["[['', '', '', '60'], ['72', '', '', ''], ['63', '70', '', ''], ['61', '75', '', '']]", 4, 35, 76]
["[['', '', '', '60'], ['72', '', '', ''], ['63', '70', '', ''], ['61', '75', '', '']]", 35, 76, [1, 3], [1, 3], [247, 236], [231, 259], 234]
["[['', '', '', '60'], ['72', '', '', ''], ['63', '70', '', ''], ['61', '75', '', '']]", "35", "76", "[None, 247, 236, None]", "[None, 231, 259, None]", "234"]
80
In 'Restricted Sorting', there are 12 stacks each with a capacity of 7 blocks, with 6 stacks filled with blocks of varying shades and the remaining are empty. The challenge is to sort the blocks by shade such that if a stack is not empty, it is stacked with 6 blocks of a single shade. The player can only transfer one block at a time from the top of a stack to an empty stack or to a stack that has only blocks of that shade, without exceeding the stacks’ capacity. Transferring blocks to certain stacks is more expensive than others. The cost of moving one block to the top of each stack is: {0: 12, 1: 11, 2: 5, 3: 11, 4: 10, 5: 9, 6: 5, 7: 5, 8: 3, 9: 10, 10: 5, 11: 5}, where the keys are the index of each stack, indexing from 0. The cost of moving a block is always at least 1. The solution should be a list of tuples, each containing, first, the index of the stack from which a block is picked up from and, second, the index of the stack to which it is transferred, indexing from 0. Given the initial state of the stacks, represented by the lists below (with the leftmost item being the shade of the topmost block in each stack)(and the first stack being the stack at index 0), what is the list of transfer pairs (reported in python syntax) with the least possible cost, that will result in all the blocks being correctly sorted? [['Yellow', 'Yellow', 'Pink', 'Black', 'Green', 'Green', 'Yellow'], ['Pink', 'Yellow', 'White', 'Red', 'Black', 'Blue', 'Blue'], [], [], ['Pink', 'Green', 'Pink', 'Pink', 'Blue', 'Red', 'Red'], ['Black', 'Black', 'Black', 'Blue', 'Yellow', 'Red', 'White'], [], [], [], [], ['Green', 'Blue', 'Red', 'Red', 'Green', 'White', 'Black'], ['White', 'White', 'Green', 'Yellow', 'Blue', 'White', 'Pink']]
restricted_sorting
sorting
4
[[1, 8], [1, 2], [1, 6], [10, 7], [4, 8], [4, 7], [4, 8], [4, 8], [0, 2], [0, 2], [0, 8], [11, 6], [11, 6], [11, 7], [11, 2], [0, 9], [0, 7], [0, 7], [1, 3], [1, 9], [4, 1], [10, 1], [11, 1], [11, 6], [11, 8], [10, 11], [10, 11], [10, 7], [10, 6], [5, 10], [5, 10], [5, 10], [5, 1], [5, 2], [5, 11], [0, 2], [3, 11], [4, 11], [4, 11], [5, 6], [9, 10], [9, 10]]
238
2.470271110534668
42
132
42
[[["Yellow", "Yellow", "Pink", "Black", "Green", "Green", "Yellow"], ["Pink", "Yellow", "White", "Red", "Black", "Blue", "Blue"], [], [], ["Pink", "Green", "Pink", "Pink", "Blue", "Red", "Red"], ["Black", "Black", "Black", "Blue", "Yellow", "Red", "White"], [], [], [], [], ["Green", "Blue", "Red", "Red", "Green", "White", "Black"], ["White", "White", "Green", "Yellow", "Blue", "White", "Pink"]], 7, {"0": 12, "1": 11, "2": 5, "3": 11, "4": 10, "5": 9, "6": 5, "7": 5, "8": 3, "9": 10, "10": 5, "11": 5}]
[[["Yellow", "Yellow", "Pink", "Black", "Green", "Green", "Yellow"], ["Pink", "Yellow", "White", "Red", "Black", "Blue", "Blue"], [], [], ["Pink", "Green", "Pink", "Pink", "Blue", "Red", "Red"], ["Black", "Black", "Black", "Blue", "Yellow", "Red", "White"], [], [], [], [], ["Green", "Blue", "Red", "Red", "Green", "White", "Black"], ["White", "White", "Green", "Yellow", "Blue", "White", "Pink"]], 7, {"0": 12, "1": 11, "2": 5, "3": 11, "4": 10, "5": 9, "6": 5, "7": 5, "8": 3, "9": 10, "10": 5, "11": 5}, 6]
["[['Yellow', 'Yellow', 'Pink', 'Black', 'Green', 'Green', 'Yellow'], ['Pink', 'Yellow', 'White', 'Red', 'Black', 'Blue', 'Blue'], [], [], ['Pink', 'Green', 'Pink', 'Pink', 'Blue', 'Red', 'Red'], ['Black', 'Black', 'Black', 'Blue', 'Yellow', 'Red', 'White'], [], [], [], [], ['Green', 'Blue', 'Red', 'Red', 'Green', 'White', 'Black'], ['White', 'White', 'Green', 'Yellow', 'Blue', 'White', 'Pink']]", "{0: 12, 1: 11, 2: 5, 3: 11, 4: 10, 5: 9, 6: 5, 7: 5, 8: 3, 9: 10, 10: 5, 11: 5}", "7", "6"]
80
Using the provided matrix map of a city, where numbers represent travel time in minutes (all numbers are positive integers) and 'x' marks closed workshops, find the quickest route for Ben to travel from his current workshop at index (1, 10) to his destination workshop at index (7, 2), indexing from 0. Ben's car can move north, south, east, or west from a given crossroad, provided there's no x in that direction. Also, there are 3 districts in the city with district 1 covering rows 0 to 1, district 2 covering rows 2 to 6, and district 3 covering rows 7 to 13. 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 8 16 3 x 15 17 2 x x 5 x x] [x x 17 x 13 x 4 x 13 3 3 6 11 x] [x x 8 x 14 1 15 11 x 18 12 x x x] [x 13 19 4 13 2 13 3 x 1 20 18 x 15] [13 x 1 x 11 x 8 14 4 11 3 x x x] [12 11 16 1 1 x 5 1 x 9 x x 1 x] [8 x 6 15 x 7 19 13 2 x 3 3 x 2] [18 x 19 15 2 x x 18 2 x 10 x x 1] [3 4 x 19 x 6 x 7 x x x x 15 x] [x x x 16 7 17 11 x 7 x x x x 15] [x 9 x x x 19 19 7 3 12 14 11 16 7] [8 19 15 1 x 14 x 1 x x x x x x] [x 14 x x x x x 18 x x 2 11 7 x] [x x x x x 3 11 12 x x x 2 6 x]
traffic
pathfinding
6
[[1, 10], [1, 9], [2, 9], [3, 9], [4, 9], [4, 8], [4, 7], [3, 7], [3, 6], [3, 5], [3, 4], [4, 4], [5, 4], [5, 3], [6, 3], [6, 2], [7, 2]]
135
0.02765035629272461
17
4
4
[[["x", "x", "8", "16", "3", "x", "15", "17", "2", "x", "x", "5", "x", "x"], ["x", "x", "17", "x", "13", "x", "4", "x", "13", "3", "3", "6", "11", "x"], ["x", "x", "8", "x", "14", "1", "15", "11", "x", "18", "12", "x", "x", "x"], ["x", "13", "19", "4", "13", "2", "13", "3", "x", "1", "20", "18", "x", "15"], ["13", "x", "1", "x", "11", "x", "8", "14", "4", "11", "3", "x", "x", "x"], ["12", "11", "16", "1", "1", "x", "5", "1", "x", "9", "x", "x", "1", "x"], ["8", "x", "6", "15", "x", "7", "19", "13", "2", "x", "3", "3", "x", "2"], ["18", "x", "19", "15", "2", "x", "x", "18", "2", "x", "10", "x", "x", "1"], ["3", "4", "x", "19", "x", "6", "x", "7", "x", "x", "x", "x", "15", "x"], ["x", "x", "x", "16", "7", "17", "11", "x", "7", "x", "x", "x", "x", "15"], ["x", "9", "x", "x", "x", "19", "19", "7", "3", "12", "14", "11", "16", "7"], ["8", "19", "15", "1", "x", "14", "x", "1", "x", "x", "x", "x", "x", "x"], ["x", "14", "x", "x", "x", "x", "x", "18", "x", "x", "2", "11", "7", "x"], ["x", "x", "x", "x", "x", "3", "11", "12", "x", "x", "x", "2", "6", "x"]]]
[[["x", "x", "8", "16", "3", "x", "15", "17", "2", "x", "x", "5", "x", "x"], ["x", "x", "17", "x", "13", "x", "4", "x", "13", "3", "3", "6", "11", "x"], ["x", "x", "8", "x", "14", "1", "15", "11", "x", "18", "12", "x", "x", "x"], ["x", "13", "19", "4", "13", "2", "13", "3", "x", "1", "20", "18", "x", "15"], ["13", "x", "1", "x", "11", "x", "8", "14", "4", "11", "3", "x", "x", "x"], ["12", "11", "16", "1", "1", "x", "5", "1", "x", "9", "x", "x", "1", "x"], ["8", "x", "6", "15", "x", "7", "19", "13", "2", "x", "3", "3", "x", "2"], ["18", "x", "19", "15", "2", "x", "x", "18", "2", "x", "10", "x", "x", "1"], ["3", "4", "x", "19", "x", "6", "x", "7", "x", "x", "x", "x", "15", "x"], ["x", "x", "x", "16", "7", "17", "11", "x", "7", "x", "x", "x", "x", "15"], ["x", "9", "x", "x", "x", "19", "19", "7", "3", "12", "14", "11", "16", "7"], ["8", "19", "15", "1", "x", "14", "x", "1", "x", "x", "x", "x", "x", "x"], ["x", "14", "x", "x", "x", "x", "x", "18", "x", "x", "2", "11", "7", "x"], ["x", "x", "x", "x", "x", "3", "11", "12", "x", "x", "x", "2", "6", "x"]], [1, 10], [7, 2], 1, 6]
["[['x', 'x', '8', '16', '3', 'x', '15', '17', '2', 'x', 'x', '5', 'x', 'x'], ['x', 'x', '17', 'x', '13', 'x', '4', 'x', '13', '3', '3', '6', '11', 'x'], ['x', 'x', '8', 'x', '14', '1', '15', '11', 'x', '18', '12', 'x', 'x', 'x'], ['x', '13', '19', '4', '13', '2', '13', '3', 'x', '1', '20', '18', 'x', '15'], ['13', 'x', '1', 'x', '11', 'x', '8', '14', '4', '11', '3', 'x', 'x', 'x'], ['12', '11', '16', '1', '1', 'x', '5', '1', 'x', '9', 'x', 'x', '1', 'x'], ['8', 'x', '6', '15', 'x', '7', '19', '13', '2', 'x', '3', '3', 'x', '2'], ['18', 'x', '19', '15', '2', 'x', 'x', '18', '2', 'x', '10', 'x', 'x', '1'], ['3', '4', 'x', '19', 'x', '6', 'x', '7', 'x', 'x', 'x', 'x', '15', 'x'], ['x', 'x', 'x', '16', '7', '17', '11', 'x', '7', 'x', 'x', 'x', 'x', '15'], ['x', '9', 'x', 'x', 'x', '19', '19', '7', '3', '12', '14', '11', '16', '7'], ['8', '19', '15', '1', 'x', '14', 'x', '1', 'x', 'x', 'x', 'x', 'x', 'x'], ['x', '14', 'x', 'x', 'x', 'x', 'x', '18', 'x', 'x', '2', '11', '7', 'x'], ['x', 'x', 'x', 'x', 'x', '3', '11', '12', 'x', 'x', 'x', '2', '6', 'x']]", "(1, 10)", "(7, 2)", "1", "6"]
80
Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 14x14. 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 4 diagonal jumps, no more, no less, on his path to his destination. He is currently on the trampoline at position (7, 13) (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 1 1 0 1 0 0 1 0 1 0 0 0 1 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 0 1 1 1 0 0 1 0 0 1 1 0 1 1 0 0 0 0 1 0 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
trampoline_matrix
pathfinding
14
[[7, 13], [8, 12], [9, 12], [10, 12], [11, 11], [12, 10], [12, 9], [13, 8], [13, 7], [13, 6], [13, 5], [13, 4], [13, 3], [13, 2], [13, 1], [13, 0]]
16
0.029587268829345703
16
8
2
["[[1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0], [1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0], [0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1], [0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0], [1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1], [0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0], [0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0], [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0], [0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0], [1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]", 4]
["[[1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0], [1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0], [1, 1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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]", "(7, 13)", "(13, 0)", "4"]
80
Given 7 labeled water jugs with capacities 110, 146, 117, 118, 148, 104, 79, 103 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 278, 378, 457, 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
6
[["+", 117, 4], ["+", 118, 4], ["+", 79, 4], ["+", 148, 4], ["+", 103, 3], ["+", 103, 3], ["+", 103, 3], ["+", 148, 3], ["+", 79, 2], ["+", 79, 2], ["+", 103, 2], ["+", 117, 2], ["+", 103, 1], ["+", 146, 1], ["-", 117, 1], ["+", 146, 1]]
16
0.0686345100402832
16
64
3
[[110, 146, 117, 118, 148, 104, 79, 103], [278, 378, 457, 462]]
[[110, 146, 117, 118, 148, 104, 79, 103], [278, 378, 457, 462]]
["[110, 146, 117, 118, 148, 104, 79, 103]", "[278, 378, 457, 462]"]
81
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: [[12, 76, '_', 72, 53], [61, 97, 49, 65, 52], [89, 64, 22, 26, 13]]
8_puzzle
puzzle
7
[72, 65, 49, 22, 26, 13, 52, 53, 65, 72, 76, 12, 61, 89, 64, 26, 22, 76, 12, 61, 89, 97, 61, 89, 97, 64, 26, 22, 13, 49, 53, 65, 72, 12, 76, 53, 12, 72, 65, 52, 49, 12, 52, 49]
44
85.10252380371094
44
4
15
[[[12, 76, "_", 72, 53], [61, 97, 49, 65, 52], [89, 64, 22, 26, 13]]]
[[[12, 76, "_", 72, 53], [61, 97, 49, 65, 52], [89, 64, 22, 26, 13]]]
["[[12, 76, '_', 72, 53], [61, 97, 49, 65, 52], [89, 64, 22, 26, 13]]"]
81
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: core, reuel, rinch, kizil, iztle The initial board: [['e', 'c', 'o', 'r', 'e'], ['r', 'e', 'u', 't', 'l'], ['r', 'i', 'i', 'c', 'i'], ['k', 'n', 'z', 'e', 'l'], ['i', 'z', 'h', 'l', '_']]
8_puzzle_words
puzzle
3
["up-left", "up-right", "up-left", "down-left", "down-right", "down-left", "up-left", "up-right", "down-right", "up-right", "up-left", "down-left", "up-left", "down-left", "down-right", "down-right", "up-right", "up-right", "up-left", "down-left", "down-left", "up-left", "up-right", "up-left"]
24
1.593846082687378
24
4
25
[[["e", "c", "o", "r", "e"], ["r", "e", "u", "t", "l"], ["r", "i", "i", "c", "i"], ["k", "n", "z", "e", "l"], ["i", "z", "h", "l", "_"]]]
[[["e", "c", "o", "r", "e"], ["r", "e", "u", "t", "l"], ["r", "i", "i", "c", "i"], ["k", "n", "z", "e", "l"], ["i", "z", "h", "l", "_"]], ["core", "reuel", "rinch", "kizil", "iztle"]]
["[['e', 'c', 'o', 'r', 'e'], ['r', 'e', 'u', 't', 'l'], ['r', 'i', 'i', 'c', 'i'], ['k', 'n', 'z', 'e', 'l'], ['i', 'z', 'h', 'l', '_']]", "['core', 'reuel', 'rinch', 'kizil', 'iztle']"]
81
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 'U'. Our task is to visit city H and city L 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 L 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. T J X U L S C H Z O D Q G W T 0 0 0 0 1 1 0 1 0 0 1 0 0 1 J 0 0 0 0 1 0 0 0 0 0 0 0 0 0 X 0 1 0 1 0 0 0 1 0 0 0 1 0 1 U 0 0 0 0 0 0 1 0 1 0 0 0 0 0 L 0 0 0 1 0 0 0 0 0 0 0 0 1 0 S 0 0 0 1 0 0 0 1 0 0 1 0 0 0 C 0 1 1 0 0 0 0 0 0 1 0 0 0 0 H 1 1 1 0 0 0 1 0 1 0 1 0 0 0 Z 0 1 0 0 0 1 1 0 0 0 1 0 0 0 O 0 0 0 0 0 1 0 0 0 0 1 1 0 0 D 0 1 0 1 1 1 1 0 1 0 0 0 0 0 Q 0 1 0 1 1 1 0 0 0 0 0 0 0 0 G 1 0 1 0 0 0 1 1 1 1 0 0 0 0 W 0 1 0 0 1 1 0 0 0 1 0 0 0 0
city_directed_graph
pathfinding
14
["U", "C", "J", "L", "G", "H", "T", "H", "D", "L"]
10
0.050522565841674805
10
14
17
[[[0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0,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1, 1, 1, 1, 0, 0, 0, 0], [0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0]], ["T", "J", "X", "U", "L", "S", "C", "H", "Z", "O", "D", "Q", "G", "W"], "U", "H", "L"]
["[[0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0], [0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0], [0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0], [0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0], [0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0], [0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0]]", "['T', 'J', 'X', 'U', 'L', 'S', 'C', 'H', 'Z', 'O', 'D', 'Q', 'G', 'W']", "['U']", "['H', 'L']"]
81
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [13, 30, 19, 13, 34, 12, 16, 21, 24, 39, 37, 32, 3, 5, 30, 37, 29, 20, 15, 23, 30, 24, 12, 21, 19, 10, 26, 29, 3, 23, 20, 40, 22, 13, 2, 36, 8, 40, 6, 24, 24, 11, 26, 37, 16, 57, 39, 21, 17], such that the sum of the chosen coins adds up to 412. 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 {2: 2, 21: 6, 24: 9, 26: 2, 5: 3, 29: 10, 10: 7, 13: 13, 30: 17, 36: 15, 3: 1, 32: 7, 8: 5, 20: 2, 22: 3, 57: 19, 40: 8, 6: 4, 23: 8, 39: 3, 16: 5, 37: 6, 12: 9, 11: 11, 34: 6, 17: 2, 15: 10, 19: 17}, 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
[17, 39, 26, 20, 39, 22, 20, 21, 37, 37, 37, 34, 32, 26, 2, 3]
59
0.06411933898925781
16
49
49
[[13, 30, 19, 13, 34, 12, 16, 21, 24, 39, 37, 32, 3, 5, 30, 37, 29, 20, 15, 23, 30, 24, 12, 21, 19, 10, 26, 29, 3, 23, 20, 40, 22, 13, 2, 36, 8, 40, 6, 24, 24, 11, 26, 37, 16, 57, 39, 21, 17]]
[[13, 30, 19, 13, 34, 12, 16, 21, 24, 39, 37, 32, 3, 5, 30, 37, 29, 20, 15, 23, 30, 24, 12, 21, 19, 10, 26, 29, 3, 23, 20, 40, 22, 13, 2, 36, 8, 40, 6, 24, 24, 11, 26, 37, 16, 57, 39, 21, 17], {"2": 2, "21": 6, "24": 9, "26": 2, "5": 3, "29": 10, "10": 7, "13": 13, "30": 17, "36": 15, "3": 1, "32": 7, "8": 5, "20": 2, "22": 3, "57": 19, "40": 8, "6": 4, "23": 8, "39": 3, "16": 5, "37": 6, "12": 9, "11": 11, "34": 6, "17": 2, "15": 10, "19": 17}, 412]
["[13, 30, 19, 13, 34, 12, 16, 21, 24, 39, 37, 32, 3, 5, 30, 37, 29, 20, 15, 23, 30, 24, 12, 21, 19, 10, 26, 29, 3, 23, 20, 40, 22, 13, 2, 36, 8, 40, 6, 24, 24, 11, 26, 37, 16, 57, 39, 21, 17]", "{2: 2, 21: 6, 24: 9, 26: 2, 5: 3, 29: 10, 10: 7, 13: 13, 30: 17, 36: 15, 3: 1, 32: 7, 8: 5, 20: 2, 22: 3, 57: 19, 40: 8, 6: 4, 23: 8, 39: 3, 16: 5, 37: 6, 12: 9, 11: 11, 34: 6, 17: 2, 15: 10, 19: 17}", "412"]
81
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', 'Red', 'Red', 'Red', 'Green', 'Green'], ['Green', 'Red', 'Red', 'Blue', 'Red', 'Blue'], ['Blue', 'Blue', 'Blue', 'Green', 'Blue', 'Green']]
color_sorting
sorting
10
[[0, 1], [2, 0], [2, 0], [2, 0], [2, 1], [2, 0], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [0, 2], [0, 2], [0, 2], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 2], [1, 0], [1, 2], [1, 0], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [0, 2], [0, 2], [0, 1]]
31
517.1900751590729
31
6
18
[[["Green", "Red", "Red", "Red", "Green", "Green"], ["Green", "Red", "Red", "Blue", "Red", "Blue"], ["Blue", "Blue", "Blue", "Green", "Blue", "Green"]], 9]
[[["Green", "Red", "Red", "Red", "Green", "Green"], ["Green", "Red", "Red", "Blue", "Red", "Blue"], ["Blue", "Blue", "Blue", "Green", "Blue", "Green"]], 9]
["[['Green', 'Red', 'Red', 'Red', 'Green', 'Green'], ['Green', 'Red', 'Red', 'Blue', 'Red', 'Blue'], ['Blue', 'Blue', 'Blue', 'Green', 'Blue', 'Green']]", "9"]
81
We have a 4x4 numerical grid, with numbers ranging from 37 to 87 (37 included in the range but 87 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: [['47' '51' 'x' '64'] ['50' '53' 'x' 'x'] ['x' '55' '68' '74'] ['x' 'x' '72' 'x']]
consecutive_grid
underdetermined_system
12
[[0, 0, 10], [0, 2, 34], [0, 3, 52], [1, 2, 32], [2, 2, 30], [2, 3, 31]]
342
11.79056978225708
6
50
16
["[['', '21', '', ''], ['18', '27', '', '51'], ['24', '29', '', ''], ['54', '33', '25', '12']]", 10, 65]
["[['', '21', '', ''], ['18', '27', '', '51'], ['24', '29', '', ''], ['54', '33', '25', '12']]", 10, 65]
["[['', '21', '', ''], ['18', '27', '', '51'], ['24', '29', '', ''], ['54', '33', '25', '12']]", "10", "65"]
81
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 35 to 76. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 188, 234, None for columns 1 to 2 respectively, and the sums of rows must be None, 247, 238, 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 215. 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: [['61' 'x' '50' 'x'] ['x' 'x' 'x' 'x'] ['68' '40' '57' 'x'] ['x' '42' 'x' 'x']]
magic_square
underdetermined_system
9
[[0, 1, 35], [0, 3, 37], [1, 0, 39], [1, 1, 71], [1, 2, 75], [1, 3, 62], [2, 3, 73], [3, 0, 63], [3, 2, 52], [3, 3, 36]]
861
137.55204916000366
10
31
16
["[['61', '', '50', ''], ['', '', '', ''], ['68', '40', '57', ''], ['', '42', '', '']]", 4, 35, 76]
["[['61', '', '50', ''], ['', '', '', ''], ['68', '40', '57', ''], ['', '42', '', '']]", 35, 76, [1, 3], [1, 3], [188, 234], [247, 238], 215]
["[['61', '', '50', ''], ['', '', '', ''], ['68', '40', '57', ''], ['', '42', '', '']]", "35", "76", "[None, 188, 234, None]", "[None, 247, 238, None]", "215"]
81
In 'Restricted Sorting', there are 12 stacks each with a capacity of 7 blocks, with 6 stacks filled with blocks of varying shades and the remaining are empty. The challenge is to sort the blocks by shade such that if a stack is not empty, it is stacked with 6 blocks of a single shade. The player can only transfer one block at a time from the top of a stack to an empty stack or to a stack that has only blocks of that shade, without exceeding the stacks’ capacity. Transferring blocks to certain stacks is more expensive than others. The cost of moving one block to the top of each stack is: {0: 5, 1: 3, 2: 3, 3: 4, 4: 2, 5: 2, 6: 12, 7: 9, 8: 5, 9: 11, 10: 11, 11: 10}, where the keys are the index of each stack, indexing from 0. The cost of moving a block is always at least 1. The solution should be a list of tuples, each containing, first, the index of the stack from which a block is picked up from and, second, the index of the stack to which it is transferred, indexing from 0. Given the initial state of the stacks, represented by the lists below (with the leftmost item being the shade of the topmost block in each stack)(and the first stack being the stack at index 0), what is the list of transfer pairs (reported in python syntax) with the least possible cost, that will result in all the blocks being correctly sorted? [[], ['White', 'Black', 'Yellow', 'Black', 'Green', 'Blue', 'Pink'], ['Black', 'Red', 'Yellow', 'White', 'Yellow', 'Black', 'Green'], ['Yellow', 'White', 'Green', 'White', 'White', 'Black', 'Blue'], ['Blue', 'Pink', 'Red', 'Pink', 'Green', 'Yellow', 'Black'], ['White', 'Red', 'Pink', 'Blue', 'Blue', 'Pink', 'Green'], [], [], [], ['Red', 'Pink', 'Red', 'Blue', 'Red', 'Green', 'Yellow'], [], []]
restricted_sorting
sorting
4
[[1, 0], [2, 8], [5, 0], [2, 7], [5, 7], [3, 11], [4, 10], [1, 8], [1, 11], [1, 8], [1, 6], [1, 10], [5, 1], [4, 1], [4, 7], [4, 1], [2, 11], [2, 0], [2, 11], [2, 8], [3, 0], [3, 2], [3, 0], [3, 0], [3, 8], [5, 3], [5, 3], [5, 1], [4, 5], [4, 11], [9, 7], [9, 1], [9, 7], [9, 3], [9, 7], [9, 2], [9, 11], [4, 8], [10, 3], [10, 3], [5, 2], [5, 2], [6, 2]]
260
34.757015228271484
43
132
42
[[[], ["White", "Black", "Yellow", "Black", "Green", "Blue", "Pink"], ["Black", "Red", "Yellow", "White", "Yellow", "Black", "Green"], ["Yellow", "White", "Green", "White", "White", "Black", "Blue"], ["Blue", "Pink", "Red", "Pink", "Green", "Yellow", "Black"], ["White", "Red", "Pink", "Blue", "Blue", "Pink", "Green"], [], [], [], ["Red", "Pink", "Red", "Blue", "Red", "Green", "Yellow"], [], []], 7, {"0": 5, "1": 3, "2": 3, "3": 4, "4": 2, "5": 2, "6": 12, "7": 9, "8": 5, "9": 11, "10": 11, "11": 10}]
[[[], ["White", "Black", "Yellow", "Black", "Green", "Blue", "Pink"], ["Black", "Red", "Yellow", "White", "Yellow", "Black", "Green"], ["Yellow", "White", "Green", "White", "White", "Black", "Blue"], ["Blue", "Pink", "Red", "Pink", "Green", "Yellow", "Black"], ["White", "Red", "Pink", "Blue", "Blue", "Pink", "Green"], [], [], [], ["Red", "Pink", "Red", "Blue", "Red", "Green", "Yellow"], [], []], 7, {"0": 5, "1": 3, "2": 3, "3": 4, "4": 2, "5": 2, "6": 12, "7": 9, "8": 5, "9": 11, "10": 11, "11": 10}, 6]
["[[], ['White', 'Black', 'Yellow', 'Black', 'Green', 'Blue', 'Pink'], ['Black', 'Red', 'Yellow', 'White', 'Yellow', 'Black', 'Green'], ['Yellow', 'White', 'Green', 'White', 'White', 'Black', 'Blue'], ['Blue', 'Pink', 'Red', 'Pink', 'Green', 'Yellow', 'Black'], ['White', 'Red', 'Pink', 'Blue', 'Blue', 'Pink', 'Green'], [], [], [], ['Red', 'Pink', 'Red', 'Blue', 'Red', 'Green', 'Yellow'], [], []]", "{0: 5, 1: 3, 2: 3, 3: 4, 4: 2, 5: 2, 6: 12, 7: 9, 8: 5, 9: 11, 10: 11, 11: 10}", "7", "6"]
81
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, 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 2, district 2 covering rows 3 to 5, and district 3 covering rows 6 to 13. 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. [8 15 3 10 6 15 x 4 x x x x x 4] [3 x 14 8 16 19 x 18 4 x 2 x 6 x] [18 18 x 4 x 17 11 10 17 9 x 4 1 5] [x 2 x 12 1 x 13 17 14 15 17 x 15 x] [x x x 15 x 2 2 11 7 x 5 7 4 18] [16 x 5 x 19 12 5 9 13 16 9 x 3 x] [x x x x 14 18 x 16 13 x 1 5 10 x] [3 11 x 1 8 x x x 18 8 11 x x 6] [19 2 x 19 5 x x x 9 x 6 x x 4] [x 2 x 10 9 15 x x x 16 x 8 x x] [18 8 10 x 3 x 11 x 17 x 17 x x x] [14 12 x 2 x 19 2 19 14 x x x 3 x] [7 x x x x x x 9 8 7 x 15 2 x] [x x 15 x x 15 16 x x x 19 x 13 1]
traffic
pathfinding
6
[[2, 0], [1, 0], [0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [0, 5], [1, 5], [2, 5], [2, 6], [3, 6], [4, 6], [5, 6], [5, 7], [5, 8], [5, 9], [5, 10], [6, 10], [6, 11]]
180
0.027744293212890625
20
4
4
[[["8", "15", "3", "10", "6", "15", "x", "4", "x", "x", "x", "x", "x", "4"], ["3", "x", "14", "8", "16", "19", "x", "18", "4", "x", "2", "x", "6", "x"], ["18", "18", "x", "4", "x", "17", "11", "10", "17", "9", "x", "4", "1", "5"], ["x", "2", "x", "12", "1", "x", "13", "17", "14", "15", "17", "x", "15", "x"], ["x", "x", "x", "15", "x", "2", "2", "11", "7", "x", "5", "7", "4", "18"], ["16", "x", "5", "x", "19", "12", "5", "9", "13", "16", "9", "x", "3", "x"], ["x", "x", "x", "x", "14", "18", "x", "16", "13", "x", "1", "5", "10", "x"], ["3", "11", "x", "1", "8", "x", "x", "x", "18", "8", "11", "x", "x", "6"], ["19", "2", "x", "19", "5", "x", "x", "x", "9", "x", "6", "x", "x", "4"], ["x", "2", "x", "10", "9", "15", "x", "x", "x", "16", "x", "8", "x", "x"], ["18", "8", "10", "x", "3", "x", "11", "x", "17", "x", "17", "x", "x", "x"], ["14", "12", "x", "2", "x", "19", "2", "19", "14", "x", "x", "x", "3", "x"], ["7", "x", "x", "x", "x", "x", "x", "9", "8", "7", "x", "15", "2", "x"], ["x", "x", "15", "x", "x", "15", "16", "x", "x", "x", "19", "x", "13", "1"]]]
[[["8", "15", "3", "10", "6", "15", "x", "4", "x", "x", "x", "x", "x", "4"], ["3", "x", "14", "8", "16", "19", "x", "18", "4", "x", "2", "x", "6", "x"], ["18", "18", "x", "4", "x", "17", "11", "10", "17", "9", "x", "4", "1", "5"], ["x", "2", "x", "12", "1", "x", "13", "17", "14", "15", "17", "x", "15", "x"], ["x", "x", "x", "15", "x", "2", "2", "11", "7", "x", "5", "7", "4", "18"], ["16", "x", "5", "x", "19", "12", "5", "9", "13", "16", "9", "x", "3", "x"], ["x", "x", "x", "x", "14", "18", "x", "16", "13", "x", "1", "5", "10", "x"], ["3", "11", "x", "1", "8", "x", "x", "x", "18", "8", "11", "x", "x", "6"], ["19", "2", "x", "19", "5", "x", "x", "x", "9", "x", "6", "x", "x", "4"], ["x", "2", "x", "10", "9", "15", "x", "x", "x", "16", "x", "8", "x", "x"], ["18", "8", "10", "x", "3", "x", "11", "x", "17", "x", "17", "x", "x", "x"], ["14", "12", "x", "2", "x", "19", "2", "19", "14", "x", "x", "x", "3", "x"], ["7", "x", "x", "x", "x", "x", "x", "9", "8", "7", "x", "15", "2", "x"], ["x", "x", "15", "x", "x", "15", "16", "x", "x", "x", "19", "x", "13", "1"]], [2, 0], [6, 11], 2, 5]
["[['8', '15', '3', '10', '6', '15', 'x', '4', 'x', 'x', 'x', 'x', 'x', '4'], ['3', 'x', '14', '8', '16', '19', 'x', '18', '4', 'x', '2', 'x', '6', 'x'], ['18', '18', 'x', '4', 'x', '17', '11', '10', '17', '9', 'x', '4', '1', '5'], ['x', '2', 'x', '12', '1', 'x', '13', '17', '14', '15', '17', 'x', '15', 'x'], ['x', 'x', 'x', '15', 'x', '2', '2', '11', '7', 'x', '5', '7', '4', '18'], ['16', 'x', '5', 'x', '19', '12', '5', '9', '13', '16', '9', 'x', '3', 'x'], ['x', 'x', 'x', 'x', '14', '18', 'x', '16', '13', 'x', '1', '5', '10', 'x'], ['3', '11', 'x', '1', '8', 'x', 'x', 'x', '18', '8', '11', 'x', 'x', '6'], ['19', '2', 'x', '19', '5', 'x', 'x', 'x', '9', 'x', '6', 'x', 'x', '4'], ['x', '2', 'x', '10', '9', '15', 'x', 'x', 'x', '16', 'x', '8', 'x', 'x'], ['18', '8', '10', 'x', '3', 'x', '11', 'x', '17', 'x', '17', 'x', 'x', 'x'], ['14', '12', 'x', '2', 'x', '19', '2', '19', '14', 'x', 'x', 'x', '3', 'x'], ['7', 'x', 'x', 'x', 'x', 'x', 'x', '9', '8', '7', 'x', '15', '2', 'x'], ['x', 'x', '15', 'x', 'x', '15', '16', 'x', 'x', 'x', '19', 'x', '13', '1']]", "(2, 0)", "(6, 11)", "2", "5"]
81
Alex is at a trampoline park with a grid of mini trampolines, arranged in a square of 14x14. 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 4 diagonal jumps, no more, no less, on his path to his destination. He is currently on the trampoline at position (11, 12) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (3, 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. 0 1 1 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 0 1 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 0 0 1 1 1 0 0 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 0 1 0 0 0 1 0 0 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 0
trampoline_matrix
pathfinding
14
[[11, 12], [11, 11], [11, 10], [10, 9], [9, 8], [8, 7], [7, 6], [7, 5], [6, 5], [6, 4], [5, 4], [5, 3], [4, 3], [4, 2], [3, 2], [3, 1]]
16
0.025336027145385742
16
8
2
["[[0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1], [0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0], [1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1], [0, 0, 0, 1,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, 1, 1, 0, 1, 1, 0, 0]]", [11, 12], [3, 1], 4]
["[[0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1], [0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0], [1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1], [0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1], [1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0], [0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1], [1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1], [1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0]]", "(11, 12)", "(3, 1)", "4"]
81
Given 7 labeled water jugs with capacities 127, 96, 108, 126, 132, 139, 146, 14 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 273, 349, 435, 503 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
6
[["+", 96, 4], ["+", 108, 4], ["+", 139, 4], ["+", 146, 4], ["+", 14, 4], ["+", 139, 3], ["+", 146, 3], ["+", 126, 3], ["-", 108, 3], ["+", 132, 3], ["+", 96, 2], ["+", 126, 2], ["+", 127, 2], ["+", 127, 1], ["+", 146, 1]]
15
0.04054760932922363
15
64
3
[[127, 96, 108, 126, 132, 139, 146, 14], [273, 349, 435, 503]]
[[127, 96, 108, 126, 132, 139, 146, 14], [273, 349, 435, 503]]
["[127, 96, 108, 126, 132, 139, 146, 14]", "[273, 349, 435, 503]"]
82
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: [[60, 70, 88, 51, 72], [87, 43, 39, 85, 30], ['_', 64, 27, 84, 47]]
8_puzzle
puzzle
7
[87, 60, 70, 88, 51, 85, 84, 27, 64, 43, 60, 87, 43, 64, 39, 51, 85, 84, 30, 47, 27, 30, 51, 60, 87, 70, 88, 87, 64, 39, 30, 27]
32
0.7831065654754639
32
4
15
[[[60, 70, 88, 51, 72], [87, 43, 39, 85, 30], ["_", 64, 27, 84, 47]]]
[[[60, 70, 88, 51, 72], [87, 43, 39, 85, 30], ["_", 64, 27, 84, 47]]]
["[[60, 70, 88, 51, 72], [87, 43, 39, 85, 30], ['_', 64, 27, 84, 47]]"]
82
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: ekka, bifer, magma, dinka, brett The initial board: [['i', 'e', 'k', 'k', 'a'], ['b', 'e', 'f', 'a', 'r'], ['g', 'a', '_', 'm', 'e'], ['d', 'i', 'n', 'k', 'a'], ['b', 'r', 'm', 't', 't']]
8_puzzle_words
puzzle
3
["down-left", "down-right", "up-right", "up-left", "up-left", "down-left", "down-right", "down-right", "up-right", "up-right", "up-left", "down-left", "down-left", "down-right", "up-right", "up-left", "up-left", "up-left"]
18
0.7136387825012207
18
4
25
[[["i", "e", "k", "k", "a"], ["b", "e", "f", "a", "r"], ["g", "a", "_", "m", "e"], ["d", "i", "n", "k", "a"], ["b", "r", "m", "t", "t"]]]
[[["i", "e", "k", "k", "a"], ["b", "e", "f", "a", "r"], ["g", "a", "_", "m", "e"], ["d", "i", "n", "k", "a"], ["b", "r", "m", "t", "t"]], ["ekka", "bifer", "magma", "dinka", "brett"]]
["[['i', 'e', 'k', 'k', 'a'], ['b', 'e', 'f', 'a', 'r'], ['g', 'a', '_', 'm', 'e'], ['d', 'i', 'n', 'k', 'a'], ['b', 'r', 'm', 't', 't']]", "['ekka', 'bifer', 'magma', 'dinka', 'brett']"]
82
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 'J'. Our task is to visit city F and city L 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 L and F, 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 K U F Q B N W H J T X R L C 0 0 1 1 0 1 0 0 0 0 1 1 0 1 K 1 0 0 1 0 1 1 0 1 0 0 0 0 0 U 0 0 0 1 0 0 0 0 0 0 1 0 0 1 F 0 1 0 0 0 1 0 0 0 0 1 0 1 0 Q 0 1 1 1 0 0 0 0 0 0 1 0 1 1 B 1 0 0 0 1 0 0 0 0 0 0 1 0 0 N 1 0 0 1 0 0 0 1 1 0 0 0 0 0 W 0 0 1 0 0 0 0 0 0 0 0 0 0 1 H 0 0 0 0 1 0 0 0 0 0 0 1 1 0 J 1 1 0 0 1 1 0 0 0 0 0 0 0 0 T 0 0 0 1 0 0 1 0 0 0 0 0 1 0 X 0 1 0 1 1 0 0 1 0 1 0 0 0 0 R 0 0 1 0 0 1 0 1 0 0 0 0 0 0 L 0 0 1 0 0 0 1 1 1 0 0 0 0 0
city_directed_graph
pathfinding
14
["J", "C", "L", "U", "L", "N", "F", "K", "F"]
9
0.11440420150756836
9
14
17
[[[0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1], [1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1], [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 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, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0], [1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0]], ["C", "K", "U", "F", "Q", "B", "N", "W", "H", "J", "T", "X", "R", "L"], "F", "L"]
[[[0, 0, 1, 1,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, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0]]", "['C', 'K', 'U', 'F', 'Q', 'B', 'N', 'W', 'H', 'J', 'T', 'X', 'R', 'L']", "['J']", "['F', 'L']"]
82
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [7, 2, 20, 24, 9, 24, 29, 6, 32, 26, 17, 61, 33, 14, 12, 20, 15, 34, 60, 18, 18, 37, 25, 9, 9, 21, 24, 30, 28, 3, 21, 32, 13, 10, 4, 2, 33, 36, 13, 24, 27, 7, 21, 4, 8, 17, 22, 3, 21, 12], such that the sum of the chosen coins adds up to 389. 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 {28: 10, 36: 13, 18: 13, 17: 8, 24: 3, 37: 19, 60: 16, 13: 5, 14: 8, 30: 18, 20: 5, 27: 16, 26: 11, 2: 2, 21: 3, 7: 7, 8: 6, 3: 3, 25: 20, 22: 8, 15: 12, 12: 4, 32: 11, 9: 5, 34: 15, 4: 2, 29: 5, 33: 6, 6: 6, 10: 3, 61: 10}, 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
[24, 10, 21, 21, 21, 29, 24, 33, 24, 33, 24, 61, 60, 4]
69
0.05933260917663574
14
50
50
[[7, 2, 20, 24, 9, 24, 29, 6, 32, 26, 17, 61, 33, 14, 12, 20, 15, 34, 60, 18, 18, 37, 25, 9, 9, 21, 24, 30, 28, 3, 21, 32, 13, 10, 4, 2, 33, 36, 13, 24, 27, 7, 21, 4, 8, 17, 22, 3, 21, 12]]
[[7, 2, 20, 24, 9, 24, 29, 6, 32, 26, 17, 61, 33, 14, 12, 20, 15, 34, 60, 18, 18, 37, 25, 9, 9, 21, 24, 30, 28, 3, 21, 32, 13, 10, 4, 2, 33, 36, 13, 24, 27, 7, 21, 4, 8, 17, 22, 3, 21, 12], {"28": 10, "36": 13, "18": 13, "17": 8, "24": 3, "37": 19, "60": 16, "13": 5, "14": 8, "30": 18, "20": 5, "27": 16, "26": 11, "2": 2, "21": 3, "7": 7, "8": 6, "3": 3, "25": 20, "22": 8, "15": 12, "12": 4, "32": 11, "9": 5, "34": 15, "4": 2, "29": 5, "33": 6, "6": 6, "10": 3, "61": 10}, 389]
["[7, 2, 20, 24, 9, 24, 29, 6, 32, 26, 17, 61, 33, 14, 12, 20, 15, 34, 60, 18, 18, 37, 25, 9, 9, 21, 24, 30, 28, 3, 21, 32, 13, 10, 4, 2, 33, 36, 13, 24, 27, 7, 21, 4, 8, 17, 22, 3, 21, 12]", "{28: 10, 36: 13, 18: 13, 17: 8, 24: 3, 37: 19, 60: 16, 13: 5, 14: 8, 30: 18, 20: 5, 27: 16, 26: 11, 2: 2, 21: 3, 7: 7, 8: 6, 3: 3, 25: 20, 22: 8, 15: 12, 12: 4, 32: 11, 9: 5, 34: 15, 4: 2, 29: 5, 33: 6, 6: 6, 10: 3, 61: 10}", "389"]
82
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', 'Blue', 'Blue', 'Green'], ['Green', 'Green', 'Red', 'Red', 'Blue', 'Blue'], ['Blue', 'Red', 'Green', 'Blue', 'Green', 'Red']]
color_sorting
sorting
10
[[2, 0], [1, 2], [1, 2], [0, 2], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1], [2, 0], [2, 1], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [0, 1], [0, 2], [0, 2], [0, 2], [1, 0], [1, 0], [1, 2], [1, 0], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1]]
30
488.8873255252838
30
6
18
[[["Red", "Green", "Red", "Blue", "Blue", "Green"], ["Green", "Green", "Red", "Red", "Blue", "Blue"], ["Blue", "Red", "Green", "Blue", "Green", "Red"]], 9]
[[["Red", "Green", "Red", "Blue", "Blue", "Green"], ["Green", "Green", "Red", "Red", "Blue", "Blue"], ["Blue", "Red", "Green", "Blue", "Green", "Red"]], 9]
["[['Red', 'Green', 'Red', 'Blue', 'Blue', 'Green'], ['Green', 'Green', 'Red', 'Red', 'Blue', 'Blue'], ['Blue', 'Red', 'Green', 'Blue', 'Green', 'Red']]", "9"]
82
We have a 4x4 numerical grid, with numbers ranging from 14 to 64 (14 included in the range but 64 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: [['20' '21' '33' '60'] ['x' 'x' 'x' '49'] ['x' '38' 'x' 'x'] ['36' 'x' '46' 'x']]
consecutive_grid
underdetermined_system
13
[[0, 3, 31], [1, 0, 43], [1, 1, 60], [2, 0, 42], [2, 2, 67], [2, 3, 71]]
796
63.96863031387329
6
50
16
["[['85', '73', '59', ''], ['', '', '66', '70'], ['', '59', '', ''], ['40', '41', '79', '82']]", 31, 86]
["[['85', '73', '59', ''], ['', '', '66', '70'], ['', '59', '', ''], ['40', '41', '79', '82']]", 31, 86]
["[['85', '73', '59', ''], ['', '', '66', '70'], ['', '59', '', ''], ['40', '41', '79', '82']]", "31", "86"]
82
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 35 to 76. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 188, 234, None for columns 1 to 2 respectively, and the sums of rows must be None, 247, 238, 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 215. 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: [['61' 'x' '50' 'x'] ['x' 'x' 'x' 'x'] ['68' '40' '57' 'x'] ['x' '42' 'x' 'x']]
magic_square
underdetermined_system
9
[[0, 1, 35], [0, 3, 37], [1, 0, 39], [1, 1, 71], [1, 2, 75], [1, 3, 62], [2, 3, 73], [3, 0, 63], [3, 2, 52], [3, 3, 36]]
861
137.55204916000366
10
31
16
["[['61', '', '50', ''], ['', '', '', ''], ['68', '40', '57', ''], ['', '42', '', '']]", 4, 35, 76]
["[['61', '', '50', ''], ['', '', '', ''], ['68', '40', '57', ''], ['', '42', '', '']]", 35, 76, [1, 3], [1, 3], [188, 234], [247, 238], 215]
["[['61', '', '50', ''], ['', '', '', ''], ['68', '40', '57', ''], ['', '42', '', '']]", "35", "76", "[None, 188, 234, None]", "[None, 247, 238, None]", "215"]
82
In 'Restricted Sorting', there are 12 stacks each with a capacity of 7 blocks, with 6 stacks filled with blocks of varying shades and the remaining are empty. The challenge is to sort the blocks by shade such that if a stack is not empty, it is stacked with 6 blocks of a single shade. The player can only transfer one block at a time from the top of a stack to an empty stack or to a stack that has only blocks of that shade, without exceeding the stacks’ capacity. Transferring blocks to certain stacks is more expensive than others. The cost of moving one block to the top of each stack is: {0: 7, 1: 13, 2: 10, 3: 12, 4: 4, 5: 13, 6: 2, 7: 11, 8: 11, 9: 10, 10: 8, 11: 9}, where the keys are the index of each stack, indexing from 0. The cost of moving a block is always at least 1. The solution should be a list of tuples, each containing, first, the index of the stack from which a block is picked up from and, second, the index of the stack to which it is transferred, indexing from 0. Given the initial state of the stacks, represented by the lists below (with the leftmost item being the shade of the topmost block in each stack)(and the first stack being the stack at index 0), what is the list of transfer pairs (reported in python syntax) with the least possible cost, that will result in all the blocks being correctly sorted? [['Red', 'Black', 'Yellow', 'Black', 'White', 'Blue', 'White'], [], ['White', 'Blue', 'Green', 'Yellow', 'Blue', 'Yellow', 'Pink'], ['Yellow', 'Red', 'Pink', 'Green', 'Black', 'Red', 'White'], [], ['Pink', 'Red', 'Green', 'Green', 'Green', 'Black', 'Blue'], ['Pink', 'Blue', 'Blue', 'Black', 'Red', 'Pink', 'Black'], ['Yellow', 'Red', 'Pink', 'White', 'White', 'Yellow', 'Green'], [], [], [], []]
restricted_sorting
sorting
4
[[3, 4], [7, 4], [0, 10], [7, 10], [0, 11], [0, 4], [0, 11], [5, 9], [5, 10], [6, 9], [7, 9], [6, 8], [6, 8], [6, 11], [6, 10], [6, 9], [6, 11], [2, 6], [7, 6], [7, 6], [7, 4], [2, 8], [2, 7], [3, 10], [3, 9], [3, 7], [3, 11], [2, 4], [2, 8], [2, 4], [3, 1], [5, 7], [5, 7], [5, 7], [5, 11], [0, 6], [0, 8], [5, 8], [2, 9], [1, 10], [0, 6], [3, 6]]
332
7.222944021224976
42
132
42
[[["Red", "Black", "Yellow", "Black", "White", "Blue", "White"], [], ["White", "Blue", "Green", "Yellow", "Blue", "Yellow", "Pink"], ["Yellow", "Red", "Pink", "Green", "Black", "Red", "White"], [], ["Pink", "Red", "Green", "Green", "Green", "Black", "Blue"], ["Pink", "Blue", "Blue", "Black", "Red", "Pink", "Black"], ["Yellow", "Red", "Pink", "White", "White", "Yellow", "Green"], [], [], [], []], 7, {"0": 7, "1": 13, "2": 10, "3": 12, "4": 4, "5": 13, "6": 2, "7": 11, "8": 11, "9": 10, "10": 8, "11": 9}]
[[["Red", "Black", "Yellow", "Black", "White", "Blue", "White"], [], ["White", "Blue", "Green", "Yellow", "Blue", "Yellow", "Pink"], ["Yellow", "Red", "Pink", "Green", "Black", "Red", "White"], [], ["Pink", "Red", "Green", "Green", "Green", "Black", "Blue"], ["Pink", "Blue", "Blue", "Black", "Red", "Pink", "Black"], ["Yellow", "Red", "Pink", "White", "White", "Yellow", "Green"], [], [], [], []], 7, {"0": 7, "1": 13, "2": 10, "3": 12, "4": 4, "5": 13, "6": 2, "7": 11, "8": 11, "9": 10, "10": 8, "11": 9}, 6]
["[['Red', 'Black', 'Yellow', 'Black', 'White', 'Blue', 'White'], [], ['White', 'Blue', 'Green', 'Yellow', 'Blue', 'Yellow', 'Pink'], ['Yellow', 'Red', 'Pink', 'Green', 'Black', 'Red', 'White'], [], ['Pink', 'Red', 'Green', 'Green', 'Green', 'Black', 'Blue'], ['Pink', 'Blue', 'Blue', 'Black', 'Red', 'Pink', 'Black'], ['Yellow', 'Red', 'Pink', 'White', 'White', 'Yellow', 'Green'], [], [], [], []]", "{0: 7, 1: 13, 2: 10, 3: 12, 4: 4, 5: 13, 6: 2, 7: 11, 8: 11, 9: 10, 10: 8, 11: 9}", "7", "6"]
82
Using the provided matrix map of a city, where numbers represent travel time in minutes (all numbers are positive integers) and 'x' marks closed workshops, find the quickest route for Ben to travel from his current workshop at index (1, 13) to his destination workshop at index (7, 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 1, district 2 covering rows 2 to 6, and district 3 covering rows 7 to 13. 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 19 13 4 x x 13 7 16 6 x x 17 x] [2 2 x 7 x 12 12 x 19 x 10 4 14 2] [11 x x 3 7 x 7 x x 6 x 19 x 1] [x x 11 x 3 x 17 x 1 20 17 8 15 1] [x x 13 x 12 17 5 4 x 16 9 x 19 14] [x 16 x x 13 17 14 6 2 17 19 6 13 6] [x 1 x x 3 10 2 18 7 8 x 8 x x] [12 2 1 6 11 7 10 x x x 4 2 8 x] [x x x 13 16 2 x 6 9 2 11 7 14 6] [x x x x x 11 x 16 x x x x x 3] [x x x x 10 x 3 x 18 9 x x x 15] [x x 11 9 3 x x 16 x 5 x 4 10 x] [18 1 13 x 7 x 7 5 x 11 10 2 x 2] [x x x x x x x 11 x 10 x x 14 6]
traffic
pathfinding
6
[[1, 13], [2, 13], [3, 13], [4, 13], [5, 13], [5, 12], [5, 11], [5, 10], [5, 9], [5, 8], [5, 7], [5, 6], [6, 6], [6, 5], [6, 4], [7, 4]]
125
0.027818918228149414
16
4
4
[[["15", "19", "13", "4", "x", "x", "13", "7", "16", "6", "x", "x", "17", "x"], ["2", "2", "x", "7", "x", "12", "12", "x", "19", "x", "10", "4", "14", "2"], ["11", "x", "x", "3", "7", "x", "7", "x", "x", "6", "x", "19", "x", "1"], ["x", "x", "11", "x", "3", "x", "17", "x", "1", "20", "17", "8", "15", "1"], ["x", "x", "13", "x", "12", "17", "5", "4", "x", "16", "9", "x", "19", "14"], ["x", "16", "x", "x", "13", "17", "14", "6", "2", "17", "19", "6", "13", "6"], ["x", "1", "x", "x", "3", "10", "2", "18", "7", "8", "x", "8", "x", "x"], ["12", "2", "1", "6", "11", "7", "10", "x", "x", "x", "4", "2", "8", "x"], ["x", "x", "x", "13", "16", "2", "x", "6", "9", "2", "11", "7", "14", "6"], ["x", "x", "x", "x", "x", "11", "x", "16", "x", "x", "x", "x", "x", "3"], ["x", "x", "x", "x", "10", "x", "3", "x", "18", "9", "x", "x", "x", "15"], ["x", "x", "11", "9", "3", "x", "x", "16", "x", "5", "x", "4", "10", "x"], ["18", "1", "13", "x", "7", "x", "7", "5", "x", "11", "10", "2", "x", "2"], ["x", "x", "x", "x", "x", "x", "x", "11", "x", "10", "x", "x", "14", "6"]]]
[[["15", "19", "13", "4", "x", "x", "13", "7", "16", "6", "x", "x", "17", "x"], ["2", "2", "x", "7", "x", "12", "12", "x", "19", "x", "10", "4", "14", "2"], ["11", "x", "x", "3", "7", "x", "7", "x", "x", "6", "x", "19", "x", "1"], ["x", "x", "11", "x", "3", "x", "17", "x", "1", "20", "17", "8", "15", "1"], ["x", "x", "13", "x", "12", "17", "5", "4", "x", "16", "9", "x", "19", "14"], ["x", "16", "x", "x", "13", "17", "14", "6", "2", "17", "19", "6", "13", "6"], ["x", "1", "x", "x", "3", "10", "2", "18", "7", "8", "x", "8", "x", "x"], ["12", "2", "1", "6", "11", "7", "10", "x", "x", "x", "4", "2", "8", "x"], ["x", "x", "x", "13", "16", "2", "x", "6", "9", "2", "11", "7", "14", "6"], ["x", "x", "x", "x", "x", "11", "x", "16", "x", "x", "x", "x", "x", "3"], ["x", "x", "x", "x", "10", "x", "3", "x", "18", "9", "x", "x", "x", "15"], ["x", "x", "11", "9", "3", "x", "x", "16", "x", "5", "x", "4", "10", "x"], ["18", "1", "13", "x", "7", "x", "7", "5", "x", "11", "10", "2", "x", "2"], ["x", "x", "x", "x", "x", "x", "x", "11", "x", "10", "x", "x", "14", "6"]], [1, 13], [7, 4], 1, 6]
["[['15', '19', '13', '4', 'x', 'x', '13', '7', '16', '6', 'x', 'x', '17', 'x'], ['2', '2', 'x', '7', 'x', '12', '12', 'x', '19', 'x', '10', '4', '14', '2'], ['11', 'x', 'x', '3', '7', 'x', '7', 'x', 'x', '6', 'x', '19', 'x', '1'], ['x', 'x', '11', 'x', '3', 'x', '17', 'x', '1', '20', '17', '8', '15', '1'], ['x', 'x', '13', 'x', '12', '17', '5', '4', 'x', '16', '9', 'x', '19', '14'], ['x', '16', 'x', 'x', '13', '17', '14', '6', '2', '17', '19', '6', '13', '6'], ['x', '1', 'x', 'x', '3', '10', '2', '18', '7', '8', 'x', '8', 'x', 'x'], ['12', '2', '1', '6', '11', '7', '10', 'x', 'x', 'x', '4', '2', '8', 'x'], ['x', 'x', 'x', '13', '16', '2', 'x', '6', '9', '2', '11', '7', '14', '6'], ['x', 'x', 'x', 'x', 'x', '11', 'x', '16', 'x', 'x', 'x', 'x', 'x', '3'], ['x', 'x', 'x', 'x', '10', 'x', '3', 'x', '18', '9', 'x', 'x', 'x', '15'], ['x', 'x', '11', '9', '3', 'x', 'x', '16', 'x', '5', 'x', '4', '10', 'x'], ['18', '1', '13', 'x', '7', 'x', '7', '5', 'x', '11', '10', '2', 'x', '2'], ['x', 'x', 'x', 'x', 'x', 'x', 'x', '11', 'x', '10', 'x', 'x', '14', '6']]", "(1, 13)", "(7, 4)", "1", "6"]