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
64
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: 6, 1: 7, 2: 11, 3: 10, 4: 7, 5: 2, 6: 3, 7: 3, 8: 11, 9: 8}, 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', 'White', 'Yellow', 'White', 'White', 'Black'], [], ['Red', 'Red', 'Green', 'Green', 'Green', 'Red'], ['Black', 'Yellow', 'Black', 'Yellow', 'Blue', 'Green'], ['Yellow', 'Blue', 'Black', 'Green', 'Blue', 'Red'], [], ['Red', 'Black', 'Blue', 'Yellow', 'Blue', 'White'], [], [], []]
restricted_sorting
sorting
3
[[2, 5], [2, 5], [6, 5], [4, 7], [3, 1], [6, 1], [3, 7], [3, 1], [3, 7], [3, 9], [6, 9], [6, 7], [6, 9], [4, 9], [4, 1], [4, 3], [4, 9], [4, 5], [0, 4], [0, 4], [0, 7], [0, 4], [0, 4], [0, 1], [6, 4], [2, 6], [2, 6], [2, 6], [3, 6], [3, 6], [2, 5]]
160
1.107576847076416
31
90
30
[[["White", "White", "Yellow", "White", "White", "Black"], [], ["Red", "Red", "Green", "Green", "Green", "Red"], ["Black", "Yellow", "Black", "Yellow", "Blue", "Green"], ["Yellow", "Blue", "Black", "Green", "Blue", "Red"], [], ["Red", "Black", "Blue", "Yellow", "Blue", "White"], [], [], []], 6, {"0": 6, "1": 7, "2": 11, "3": 10, "4": 7, "5": 2, "6": 3, "7": 3, "8": 11, "9": 8}]
[[["White", "White", "Yellow", "White", "White", "Black"], [], ["Red", "Red", "Green", "Green", "Green", "Red"], ["Black", "Yellow", "Black", "Yellow", "Blue", "Green"], ["Yellow", "Blue", "Black", "Green", "Blue", "Red"], [], ["Red", "Black", "Blue", "Yellow", "Blue", "White"], [], [], []], 6, {"0": 6, "1": 7, "2": 11, "3": 10, "4": 7, "5": 2, "6": 3, "7": 3, "8": 11, "9": 8}, 5]
["[['White', 'White', 'Yellow', 'White', 'White', 'Black'], [], ['Red', 'Red', 'Green', 'Green', 'Green', 'Red'], ['Black', 'Yellow', 'Black', 'Yellow', 'Blue', 'Green'], ['Yellow', 'Blue', 'Black', 'Green', 'Blue', 'Red'], [], ['Red', 'Black', 'Blue', 'Yellow', 'Blue', 'White'], [], [], []]", "{0: 6, 1: 7, 2: 11, 3: 10, 4: 7, 5: 2, 6: 3, 7: 3, 8: 11, 9: 8}", "6", "5"]
64
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, 0) to his destination workshop at index (6, 12), 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 5, and district 3 covering rows 6 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. [8 x 12 x 16 x x x 7 x x x x] [x x x x 16 x 7 8 x 17 x 19 x] [7 x 13 x 19 x 6 x 14 x 18 x 19] [9 20 2 x 10 6 x 18 x x x 18 x] [x x 8 12 7 14 13 9 8 6 14 11 7] [x 14 x x x 19 13 15 3 12 16 16 3] [x x x 13 x 9 13 10 x 14 x 4 18] [6 12 10 x x 18 7 20 18 x 13 1 x] [x 5 x 18 12 x x 3 12 14 19 16 x] [10 x 19 x x x x 11 14 16 12 x 8] [8 x x x x x x 9 16 15 x x 8] [x x 2 x 1 x x 16 x x 3 x x] [9 x 5 x x 15 x x x 7 15 9 x]
traffic
pathfinding
5
[[3, 0], [3, 1], [3, 2], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6], [4, 7], [4, 8], [4, 9], [4, 10], [4, 11], [4, 12], [5, 12], [6, 12]]
152
0.018406391143798828
16
4
4
[[["8", "x", "12", "x", "16", "x", "x", "x", "7", "x", "x", "x", "x"], ["x", "x", "x", "x", "16", "x", "7", "8", "x", "17", "x", "19", "x"], ["7", "x", "13", "x", "19", "x", "6", "x", "14", "x", "18", "x", "19"], ["9", "20", "2", "x", "10", "6", "x", "18", "x", "x", "x", "18", "x"], ["x", "x", "8", "12", "7", "14", "13", "9", "8", "6", "14", "11", "7"], ["x", "14", "x", "x", "x", "19", "13", "15", "3", "12", "16", "16", "3"], ["x", "x", "x", "13", "x", "9", "13", "10", "x", "14", "x", "4", "18"], ["6", "12", "10", "x", "x", "18", "7", "20", "18", "x", "13", "1", "x"], ["x", "5", "x", "18", "12", "x", "x", "3", "12", "14", "19", "16", "x"], ["10", "x", "19", "x", "x", "x", "x", "11", "14", "16", "12", "x", "8"], ["8", "x", "x", "x", "x", "x", "x", "9", "16", "15", "x", "x", "8"], ["x", "x", "2", "x", "1", "x", "x", "16", "x", "x", "3", "x", "x"], ["9", "x", "5", "x", "x", "15", "x", "x", "x", "7", "15", "9", "x"]]]
[[["8", "x", "12", "x", "16", "x", "x", "x", "7", "x", "x", "x", "x"], ["x", "x", "x", "x", "16", "x", "7", "8", "x", "17", "x", "19", "x"], ["7", "x", "13", "x", "19", "x", "6", "x", "14", "x", "18", "x", "19"], ["9", "20", "2", "x", "10", "6", "x", "18", "x", "x", "x", "18", "x"], ["x", "x", "8", "12", "7", "14", "13", "9", "8", "6", "14", "11", "7"], ["x", "14", "x", "x", "x", "19", "13", "15", "3", "12", "16", "16", "3"], ["x", "x", "x", "13", "x", "9", "13", "10", "x", "14", "x", "4", "18"], ["6", "12", "10", "x", "x", "18", "7", "20", "18", "x", "13", "1", "x"], ["x", "5", "x", "18", "12", "x", "x", "3", "12", "14", "19", "16", "x"], ["10", "x", "19", "x", "x", "x", "x", "11", "14", "16", "12", "x", "8"], ["8", "x", "x", "x", "x", "x", "x", "9", "16", "15", "x", "x", "8"], ["x", "x", "2", "x", "1", "x", "x", "16", "x", "x", "3", "x", "x"], ["9", "x", "5", "x", "x", "15", "x", "x", "x", "7", "15", "9", "x"]], [3, 0], [6, 12], 3, 5]
["[['8', 'x', '12', 'x', '16', 'x', 'x', 'x', '7', 'x', 'x', 'x', 'x'], ['x', 'x', 'x', 'x', '16', 'x', '7', '8', 'x', '17', 'x', '19', 'x'], ['7', 'x', '13', 'x', '19', 'x', '6', 'x', '14', 'x', '18', 'x', '19'], ['9', '20', '2', 'x', '10', '6', 'x', '18', 'x', 'x', 'x', '18', 'x'], ['x', 'x', '8', '12', '7', '14', '13', '9', '8', '6', '14', '11', '7'], ['x', '14', 'x', 'x', 'x', '19', '13', '15', '3', '12', '16', '16', '3'], ['x', 'x', 'x', '13', 'x', '9', '13', '10', 'x', '14', 'x', '4', '18'], ['6', '12', '10', 'x', 'x', '18', '7', '20', '18', 'x', '13', '1', 'x'], ['x', '5', 'x', '18', '12', 'x', 'x', '3', '12', '14', '19', '16', 'x'], ['10', 'x', '19', 'x', 'x', 'x', 'x', '11', '14', '16', '12', 'x', '8'], ['8', 'x', 'x', 'x', 'x', 'x', 'x', '9', '16', '15', 'x', 'x', '8'], ['x', 'x', '2', 'x', '1', 'x', 'x', '16', 'x', 'x', '3', 'x', 'x'], ['9', 'x', '5', 'x', 'x', '15', 'x', 'x', 'x', '7', '15', '9', 'x']]", "(3, 0)", "(6, 12)", "3", "5"]
64
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, 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 1 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 0 0 0 0 1 0 1 1 1 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 1 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 1 1 0 1 0 1 0 0 1 0 0 1 1 0 0 1 1 1 1 1 1 1 0 0 1 1 1 0 1 0 0 1 0 1 1 1 0 0 1 0 1 0 0 0 0 1 0 0
trampoline_matrix
pathfinding
13
[[0, 7], [1, 6], [2, 5], [3, 5], [4, 5], [5, 4], [5, 3], [5, 2], [6, 2], [6, 1], [6, 0], [7, 0], [8, 0], [9, 0], [10, 0], [11, 0], [12, 1]]
17
0.031978607177734375
17
8
2
["[[1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1], [0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 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0, 0, 1, 1, 1, 0, 1], [1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0], [1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1], [0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1], [0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1], [0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1], [0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0]]", "(0, 7)", "(12, 1)", "4"]
64
Given 5 labeled water jugs with capacities 14, 42, 113, 131, 41, 147 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 240, 257, 350, 369 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
5
[["+", 41, 4], ["+", 42, 4], ["+", 113, 4], ["+", 131, 4], ["+", 42, 4], ["+", 42, 3], ["+", 147, 3], ["+", 14, 3], ["+", 147, 3], ["+", 42, 2], ["+", 42, 2], ["+", 42, 2], ["+", 131, 2], ["+", 113, 1], ["+", 113, 1], ["+", 14, 1]]
16
0.02796316146850586
16
48
3
[[14, 42, 113, 131, 41, 147], [240, 257, 350, 369]]
[[14, 42, 113, 131, 41, 147], [240, 257, 350, 369]]
["[14, 42, 113, 131, 41, 147]", "[240, 257, 350, 369]"]
65
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, 93, 84, 27, 6], [55, 18, 91, 82, 8], [19, 32, 37, 30, '_']]
8_puzzle
puzzle
4
[8, 6, 27, 82, 30, 8, 6, 27, 82, 84, 91, 37, 32, 18, 37, 32, 8, 6]
18
0.03599905967712402
18
4
15
[[[94, 93, 84, 27, 6], [55, 18, 91, 82, 8], [19, 32, 37, 30, "_"]]]
[[[94, 93, 84, 27, 6], [55, 18, 91, 82, 8], [19, 32, 37, 30, "_"]]]
["[[94, 93, 84, 27, 6], [55, 18, 91, 82, 8], [19, 32, 37, 30, '_']]"]
65
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: ned, wham, royt, hell, miek The initial board: [['h', 'n', '_', 'd'], ['w', 'r', 'a', 'e'], ['e', 'o', 'y', 't'], ['h', 'e', 'l', 'm'], ['m', 'i', 'l', 'k']]
8_puzzle_words
puzzle
2
["down-left", "down-right", "down-left", "up-left", "up-right", "down-right", "down-right", "down-left", "up-left", "up-left", "up-right", "up-right", "down-right", "down-left", "down-left", "up-left", "up-right", "up-left"]
18
0.29477596282958984
18
4
20
[[["h", "n", "_", "d"], ["w", "r", "a", "e"], ["e", "o", "y", "t"], ["h", "e", "l", "m"], ["m", "i", "l", "k"]]]
[[["h", "n", "_", "d"], ["w", "r", "a", "e"], ["e", "o", "y", "t"], ["h", "e", "l", "m"], ["m", "i", "l", "k"]], ["ned", "wham", "royt", "hell", "miek"]]
["[['h', 'n', '_', 'd'], ['w', 'r', 'a', 'e'], ['e', 'o', 'y', 't'], ['h', 'e', 'l', 'm'], ['m', 'i', 'l', 'k']]", "['ned', 'wham', 'royt', 'hell', 'miek']"]
65
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'Q'. Our task is to visit city F and city N excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from N and 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. F D E Z G Y N I X P S Q C F 0 0 0 1 0 0 0 1 0 1 0 0 0 D 1 0 1 0 0 0 0 1 0 0 0 0 0 E 0 0 0 0 1 0 0 0 0 0 1 0 1 Z 0 0 1 0 0 1 0 0 1 0 1 0 1 G 1 0 0 0 0 0 0 1 0 1 0 0 0 Y 0 0 0 0 1 0 0 1 0 0 0 0 0 N 0 0 0 0 0 1 0 0 0 0 0 0 0 I 0 0 1 1 0 0 0 0 1 0 0 0 0 X 0 0 1 0 1 0 0 0 0 1 0 0 0 P 0 1 0 1 0 0 0 0 0 0 0 1 0 S 1 1 0 0 0 0 1 0 1 0 0 0 1 Q 0 1 0 0 0 0 0 0 1 0 0 0 0 C 0 0 0 0 1 0 1 1 1 0 0 0 0
city_directed_graph
pathfinding
13
["Q", "D", "F", "I", "E", "C", "N", "Y", "G", "F", "Z", "S", "N"]
13
0.07228732109069824
13
13
16
[[[0, 0, 0, 1, 0, 0, 0, 1,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 1, 1, 1, 0, 0, 0, 0]], ["F", "D", "E", "Z", "G", "Y", "N", "I", "X", "P", "S", "Q", "C"], "Q", "F", "N"]
["[[0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0], [1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1], [0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0]]", "['F', 'D', 'E', 'Z', 'G', 'Y', 'N', 'I', 'X', 'P', 'S', 'Q', 'C']", "['Q']", "['F', 'N']"]
65
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [9, 30, 18, 32, 31, 20, 34, 9, 12, 18, 14, 16, 29, 37, 37, 6, 24, 10, 10, 35, 23, 4, 30, 121, 31, 16, 35], such that the sum of the chosen coins adds up to 406. 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 {35: 20, 4: 2, 18: 11, 24: 10, 10: 7, 14: 3, 37: 1, 16: 14, 12: 7, 6: 2, 29: 18, 34: 19, 121: 10, 31: 7, 30: 12, 32: 12, 23: 8, 20: 8, 9: 9}, 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
16
[31, 37, 121, 6, 31, 30, 24, 37, 32, 20, 14, 23]
81
0.04330945014953613
12
27
27
[[9, 30, 18, 32, 31, 20, 34, 9, 12, 18, 14, 16, 29, 37, 37, 6, 24, 10, 10, 35, 23, 4, 30, 121, 31, 16, 35]]
[[9, 30, 18, 32, 31, 20, 34, 9, 12, 18, 14, 16, 29, 37, 37, 6, 24, 10, 10, 35, 23, 4, 30, 121, 31, 16, 35], {"35": 20, "4": 2, "18": 11, "24": 10, "10": 7, "14": 3, "37": 1, "16": 14, "12": 7, "6": 2, "29": 18, "34": 19, "121": 10, "31": 7, "30": 12, "32": 12, "23": 8, "20": 8, "9": 9}, 406]
["[9, 30, 18, 32, 31, 20, 34, 9, 12, 18, 14, 16, 29, 37, 37, 6, 24, 10, 10, 35, 23, 4, 30, 121, 31, 16, 35]", "{35: 20, 4: 2, 18: 11, 24: 10, 10: 7, 14: 3, 37: 1, 16: 14, 12: 7, 6: 2, 29: 18, 34: 19, 121: 10, 31: 7, 30: 12, 32: 12, 23: 8, 20: 8, 9: 9}", "406"]
65
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? [['Blue', 'Green', 'Blue', 'Red', 'Red'], ['Red', 'Red', 'Blue', 'Green', 'Blue'], ['Green', 'Green', 'Red', 'Blue', 'Green']]
color_sorting
sorting
9
[[0, 1], [2, 0], [2, 0], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [1, 2], [1, 0], [1, 2], [1, 0], [1, 0], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1], [0, 2], [0, 1]]
21
12.990425109863281
21
6
15
[[["Blue", "Green", "Blue", "Red", "Red"], ["Red", "Red", "Blue", "Green", "Blue"], ["Green", "Green", "Red", "Blue", "Green"]], 8]
[[["Blue", "Green", "Blue", "Red", "Red"], ["Red", "Red", "Blue", "Green", "Blue"], ["Green", "Green", "Red", "Blue", "Green"]], 8]
["[['Blue', 'Green', 'Blue', 'Red', 'Red'], ['Red', 'Red', 'Blue', 'Green', 'Blue'], ['Green', 'Green', 'Red', 'Blue', 'Green']]", "8"]
65
We have a 4x4 numerical grid, with numbers ranging from 31 to 76 (31 included in the range but 76 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' '68' '71' 'x'] ['x' 'x' '62' 'x'] ['43' 'x' '55' 'x'] ['44' '45' '52' '58']]
consecutive_grid
underdetermined_system
12
[[1, 0, 11], [1, 3, 47], [2, 2, 44], [2, 3, 48], [3, 0, 22], [3, 1, 41], [3, 2, 45]]
444
0.25410008430480957
7
45
16
["[['10', '26', '30', '46'], ['', '33', '43', ''], ['21', '40', '', ''], ['', '', '', '52']]", 9, 54]
["[['10', '26', '30', '46'], ['', '33', '43', ''], ['21', '40', '', ''], ['', '', '', '52']]", 9, 54]
["[['10', '26', '30', '46'], ['', '33', '43', ''], ['21', '40', '', ''], ['', '', '', '52']]", "9", "54"]
65
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 30 to 66. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 191, 190, None for columns 1 to 2 respectively, and the sums of rows must be None, 192, 173, 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 180. 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' '65' '49' '35'] ['40' 'x' '52' 'x'] ['x' 'x' '34' 'x'] ['x' 'x' '55' '61']]
magic_square
underdetermined_system
9
[[0, 0, 31], [1, 1, 36], [1, 3, 64], [2, 0, 32], [2, 1, 60], [2, 3, 47], [3, 0, 33], [3, 1, 30]]
724
7.544063568115234
8
26
16
["[['', '65', '49', '35'], ['40', '', '52', ''], ['', '', '34', ''], ['', '', '55', '61']]", 4, 30, 66]
["[['', '65', '49', '35'], ['40', '', '52', ''], ['', '', '34', ''], ['', '', '55', '61']]", 30, 66, [1, 3], [1, 3], [191, 190], [192, 173], 180]
["[['', '65', '49', '35'], ['40', '', '52', ''], ['', '', '34', ''], ['', '', '55', '61']]", "30", "66", "[None, 191, 190, None]", "[None, 192, 173, None]", "180"]
65
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: 6, 2: 3, 3: 6, 4: 9, 5: 6, 6: 6, 7: 10, 8: 2, 9: 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', 'White', 'Blue', 'Yellow', 'Red', 'White'], [], [], ['Blue', 'Blue', 'Green', 'Black', 'Black', 'Red'], ['Black', 'Green', 'Yellow', 'Yellow', 'Blue', 'Black'], [], ['White', 'Blue', 'Green', 'White', 'Yellow', 'Red'], [], ['Green', 'White', 'Black', 'Red', 'Green', 'Red']]
restricted_sorting
sorting
3
[[4, 8], [4, 8], [4, 0], [9, 0], [9, 2], [7, 2], [7, 8], [7, 0], [7, 2], [1, 3], [5, 6], [5, 0], [7, 3], [9, 6], [1, 2], [1, 8], [1, 3], [5, 3], [5, 3], [5, 8], [4, 6], [4, 6], [5, 6], [9, 5], [9, 0], [1, 9], [4, 9], [5, 9], [7, 9], [1, 2]]
126
0.4554884433746338
30
90
30
[[[], ["Yellow", "White", "Blue", "Yellow", "Red", "White"], [], [], ["Blue", "Blue", "Green", "Black", "Black", "Red"], ["Black", "Green", "Yellow", "Yellow", "Blue", "Black"], [], ["White", "Blue", "Green", "White", "Yellow", "Red"], [], ["Green", "White", "Black", "Red", "Green", "Red"]], 6, {"0": 3, "1": 6, "2": 3, "3": 6, "4": 9, "5": 6, "6": 6, "7": 10, "8": 2, "9": 5}]
[[[], ["Yellow", "White", "Blue", "Yellow", "Red", "White"], [], [], ["Blue", "Blue", "Green", "Black", "Black", "Red"], ["Black", "Green", "Yellow", "Yellow", "Blue", "Black"], [], ["White", "Blue", "Green", "White", "Yellow", "Red"], [], ["Green", "White", "Black", "Red", "Green", "Red"]], 6, {"0": 3, "1": 6, "2": 3, "3": 6, "4": 9, "5": 6, "6": 6, "7": 10, "8": 2, "9": 5}, 5]
["[[], ['Yellow', 'White', 'Blue', 'Yellow', 'Red', 'White'], [], [], ['Blue', 'Blue', 'Green', 'Black', 'Black', 'Red'], ['Black', 'Green', 'Yellow', 'Yellow', 'Blue', 'Black'], [], ['White', 'Blue', 'Green', 'White', 'Yellow', 'Red'], [], ['Green', 'White', 'Black', 'Red', 'Green', 'Red']]", "{0: 3, 1: 6, 2: 3, 3: 6, 4: 9, 5: 6, 6: 6, 7: 10, 8: 2, 9: 5}", "6", "5"]
65
Using the provided matrix map of a city, where numbers represent travel time in minutes (all numbers are positive integers) and 'x' marks closed workshops, find the quickest route for Ben to travel from his current workshop at index (8, 11) to his destination workshop at index (2, 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 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. [11 x x x 15 5 18 4 1 17 14 x 9] [x 10 10 7 12 12 6 x x 8 4 19 11] [17 x x 12 8 x x x 14 19 x 18 16] [17 x 16 x x 17 4 x 15 x x x 17] [17 x x 6 x x 12 6 10 3 11 x 19] [10 x 9 15 17 4 x x x x 14 17 18] [4 x x x x 13 18 13 x 17 12 x 19] [x 2 11 7 6 14 9 x 12 17 9 13 14] [x 18 16 x x x 11 6 12 x x 10 x] [5 3 x x x 5 x 14 x x x x x] [18 x x x x 14 x x 13 1 3 x x] [1 16 10 x x 14 13 x 10 x 1 x 18] [8 x x 10 2 10 x x x x x 13 5]
traffic
pathfinding
5
[[8, 11], [7, 11], [7, 10], [6, 10], [5, 10], [4, 10], [4, 9], [4, 8], [3, 8], [2, 8], [2, 9], [1, 9], [0, 9], [0, 8], [0, 7], [0, 6], [0, 5], [1, 5], [1, 4], [1, 3], [2, 3]]
216
0.018636226654052734
21
4
4
[[["11", "x", "x", "x", "15", "5", "18", "4", "1", "17", "14", "x", "9"], ["x", "10", "10", "7", "12", "12", "6", "x", "x", "8", "4", "19", "11"], ["17", "x", "x", "12", "8", "x", "x", "x", "14", "19", "x", "18", "16"], ["17", "x", "16", "x", "x", "17", "4", "x", "15", "x", "x", "x", "17"], ["17", "x", "x", "6", "x", "x", "12", "6", "10", "3", "11", "x", "19"], ["10", "x", "9", "15", "17", "4", "x", "x", "x", "x", "14", "17", "18"], ["4", "x", "x", "x", "x", "13", "18", "13", "x", "17", "12", "x", "19"], ["x", "2", "11", "7", "6", "14", "9", "x", "12", "17", "9", "13", "14"], ["x", "18", "16", "x", "x", "x", "11", "6", "12", "x", "x", "10", "x"], ["5", "3", "x", "x", "x", "5", "x", "14", "x", "x", "x", "x", "x"], ["18", "x", "x", "x", "x", "14", "x", "x", "13", "1", "3", "x", "x"], ["1", "16", "10", "x", "x", "14", "13", "x", "10", "x", "1", "x", "18"], ["8", "x", "x", "10", "2", "10", "x", "x", "x", "x", "x", "13", "5"]]]
[[["11", "x", "x", "x", "15", "5", "18", "4", "1", "17", "14", "x", "9"], ["x", "10", "10", "7", "12", "12", "6", "x", "x", "8", "4", "19", "11"], ["17", "x", "x", "12", "8", "x", "x", "x", "14", "19", "x", "18", "16"], ["17", "x", "16", "x", "x", "17", "4", "x", "15", "x", "x", "x", "17"], ["17", "x", "x", "6", "x", "x", "12", "6", "10", "3", "11", "x", "19"], ["10", "x", "9", "15", "17", "4", "x", "x", "x", "x", "14", "17", "18"], ["4", "x", "x", "x", "x", "13", "18", "13", "x", "17", "12", "x", "19"], ["x", "2", "11", "7", "6", "14", "9", "x", "12", "17", "9", "13", "14"], ["x", "18", "16", "x", "x", "x", "11", "6", "12", "x", "x", "10", "x"], ["5", "3", "x", "x", "x", "5", "x", "14", "x", "x", "x", "x", "x"], ["18", "x", "x", "x", "x", "14", "x", "x", "13", "1", "3", "x", "x"], ["1", "16", "10", "x", "x", "14", "13", "x", "10", "x", "1", "x", "18"], ["8", "x", "x", "10", "2", "10", "x", "x", "x", "x", "x", "13", "5"]], [8, 11], [2, 3], 2, 7]
["[['11', 'x', 'x', 'x', '15', '5', '18', '4', '1', '17', '14', 'x', '9'], ['x', '10', '10', '7', '12', '12', '6', 'x', 'x', '8', '4', '19', '11'], ['17', 'x', 'x', '12', '8', 'x', 'x', 'x', '14', '19', 'x', '18', '16'], ['17', 'x', '16', 'x', 'x', '17', '4', 'x', '15', 'x', 'x', 'x', '17'], ['17', 'x', 'x', '6', 'x', 'x', '12', '6', '10', '3', '11', 'x', '19'], ['10', 'x', '9', '15', '17', '4', 'x', 'x', 'x', 'x', '14', '17', '18'], ['4', 'x', 'x', 'x', 'x', '13', '18', '13', 'x', '17', '12', 'x', '19'], ['x', '2', '11', '7', '6', '14', '9', 'x', '12', '17', '9', '13', '14'], ['x', '18', '16', 'x', 'x', 'x', '11', '6', '12', 'x', 'x', '10', 'x'], ['5', '3', 'x', 'x', 'x', '5', 'x', '14', 'x', 'x', 'x', 'x', 'x'], ['18', 'x', 'x', 'x', 'x', '14', 'x', 'x', '13', '1', '3', 'x', 'x'], ['1', '16', '10', 'x', 'x', '14', '13', 'x', '10', 'x', '1', 'x', '18'], ['8', 'x', 'x', '10', '2', '10', 'x', 'x', 'x', 'x', 'x', '13', '5']]", "(8, 11)", "(2, 3)", "2", "7"]
65
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, 0) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (8, 9). 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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water jugs with capacities 141, 116, 66, 83, 142 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 397, 401, 419, 425 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
5
[["+", 141, 4], ["+", 142, 4], ["+", 142, 4], ["+", 142, 3], ["+", 142, 3], ["-", 66, 3], ["+", 142, 3], ["-", 83, 3], ["+", 142, 3], ["+", 116, 2], ["+", 142, 2], ["+", 142, 2], ["-", 141, 2], ["+", 142, 2], ["+", 66, 1], ["+", 66, 1], ["+", 66, 1], ["+", 116, 1], ["+", 83, 1]]
19
0.0269773006439209
19
40
3
[[141, 116, 66, 83, 142], [397, 401, 419, 425]]
[[141, 116, 66, 83, 142], [397, 401, 419, 425]]
["[141, 116, 66, 83, 142]", "[397, 401, 419, 425]"]
66
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [[94, 91, 33, 29, 78], [97, 20, 14, 54, 25], [38, 22, 32, 17, '_']]
8_puzzle
puzzle
4
[25, 54, 14, 33, 91, 94, 97, 38, 22, 20, 33, 32, 17, 14, 29, 78, 54, 25]
18
0.03129744529724121
18
4
15
[[[94, 91, 33, 29, 78], [97, 20, 14, 54, 25], [38, 22, 32, 17, "_"]]]
[[[94, 91, 33, 29, 78], [97, 20, 14, 54, 25], [38, 22, 32, 17, "_"]]]
["[[94, 91, 33, 29, 78], [97, 20, 14, 54, 25], [38, 22, 32, 17, '_']]"]
66
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: jay, eppy, home, roon, ward The initial board: [['p', 'j', 'm', 'y'], ['e', 'h', 'p', 'o'], ['y', 'o', '_', 'e'], ['r', 'a', 'o', 'n'], ['w', 'a', 'r', 'd']]
8_puzzle_words
puzzle
2
["up-left", "down-left", "down-right", "up-right", "up-right", "up-left", "down-left", "down-left", "down-right", "up-right", "up-right", "up-left", "down-left", "up-left"]
14
0.16893219947814941
14
4
20
[[["p", "j", "m", "y"], ["e", "h", "p", "o"], ["y", "o", "_", "e"], ["r", "a", "o", "n"], ["w", "a", "r", "d"]]]
[[["p", "j", "m", "y"], ["e", "h", "p", "o"], ["y", "o", "_", "e"], ["r", "a", "o", "n"], ["w", "a", "r", "d"]], ["jay", "eppy", "home", "roon", "ward"]]
["[['p', 'j', 'm', 'y'], ['e', 'h', 'p', 'o'], ['y', 'o', '_', 'e'], ['r', 'a', 'o', 'n'], ['w', 'a', 'r', 'd']]", "['jay', 'eppy', 'home', 'roon', 'ward']"]
66
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'L'. Our task is to visit city K and city J 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 J 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. L A J U E P Q Y H R K M F L 0 0 0 0 0 0 0 0 0 0 0 0 1 A 1 0 0 1 0 1 0 0 0 0 0 0 0 J 0 1 0 0 0 0 0 1 0 0 0 1 0 U 0 0 0 0 1 0 0 0 0 1 1 1 0 E 0 0 0 0 0 0 1 0 0 0 0 1 0 P 0 0 0 0 0 0 1 0 0 0 1 1 0 Q 0 0 1 1 0 0 0 0 0 1 1 0 1 Y 1 1 0 1 0 0 0 0 0 1 0 0 0 H 1 0 1 1 0 1 0 1 0 1 0 0 1 R 0 0 0 0 1 0 0 0 0 0 1 0 0 K 0 1 0 0 1 1 0 0 0 1 0 0 0 M 0 0 0 0 0 1 1 0 1 0 0 0 0 F 0 1 0 0 1 1 0 1 0 0 1 0 0
city_directed_graph
pathfinding
13
["L", "F", "K", "P", "K", "E", "Q", "J", "M", "H", "J"]
11
0.05126047134399414
11
13
16
[[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0], [0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1], [1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], [1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0], [0, 1, 0, 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, 0, 1, 0, 0], [0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0]]", "['L', 'A', 'J', 'U', 'E', 'P', 'Q', 'Y', 'H', 'R', 'K', 'M', 'F']", "['L']", "['K', 'J']"]
66
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [3, 35, 33, 20, 31, 29, 12, 31, 8, 10, 3, 17, 2, 28, 6, 25, 10, 13, 31, 25, 37, 35, 9, 15, 113, 26, 18, 34, 30], such that the sum of the chosen coins adds up to 384. 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: 11, 15: 6, 13: 13, 28: 1, 9: 6, 20: 1, 34: 15, 6: 5, 113: 20, 12: 6, 2: 1, 29: 10, 37: 2, 25: 11, 26: 10, 3: 3, 33: 19, 8: 7, 18: 6, 17: 7, 10: 8, 35: 11, 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
17
[37, 28, 18, 35, 113, 26, 29, 31, 35, 20, 12]
89
0.043546199798583984
11
29
29
[[3, 35, 33, 20, 31, 29, 12, 31, 8, 10, 3, 17, 2, 28, 6, 25, 10, 13, 31, 25, 37, 35, 9, 15, 113, 26, 18, 34, 30]]
[[3, 35, 33, 20, 31, 29, 12, 31, 8, 10, 3, 17, 2, 28, 6, 25, 10, 13, 31, 25, 37, 35, 9, 15, 113, 26, 18, 34, 30], {"31": 11, "15": 6, "13": 13, "28": 1, "9": 6, "20": 1, "34": 15, "6": 5, "113": 20, "12": 6, "2": 1, "29": 10, "37": 2, "25": 11, "26": 10, "3": 3, "33": 19, "8": 7, "18": 6, "17": 7, "10": 8, "35": 11, "30": 16}, 384]
["[3, 35, 33, 20, 31, 29, 12, 31, 8, 10, 3, 17, 2, 28, 6, 25, 10, 13, 31, 25, 37, 35, 9, 15, 113, 26, 18, 34, 30]", "{31: 11, 15: 6, 13: 13, 28: 1, 9: 6, 20: 1, 34: 15, 6: 5, 113: 20, 12: 6, 2: 1, 29: 10, 37: 2, 25: 11, 26: 10, 3: 3, 33: 19, 8: 7, 18: 6, 17: 7, 10: 8, 35: 11, 30: 16}", "384"]
66
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', 'Green', 'Blue', 'Green', 'Red'], ['Red', 'Blue', 'Blue', 'Green', 'Red'], ['Red', 'Blue', 'Green', 'Green', 'Blue']]
color_sorting
sorting
9
[[0, 2], [1, 2], [0, 1], [0, 1], [0, 1], [2, 0], [2, 0], [2, 0], [1, 0], [2, 1], [2, 0], [2, 0], [1, 2], [1, 2], [1, 0], [1, 2], [1, 2], [1, 2], [1, 2], [0, 1], [0, 1], [0, 1], [0, 1], [2, 0], [2, 1]]
25
84.72133731842041
25
6
15
[[["Red", "Green", "Blue", "Green", "Red"], ["Red", "Blue", "Blue", "Green", "Red"], ["Red", "Blue", "Green", "Green", "Blue"]], 8]
[[["Red", "Green", "Blue", "Green", "Red"], ["Red", "Blue", "Blue", "Green", "Red"], ["Red", "Blue", "Green", "Green", "Blue"]], 8]
["[['Red', 'Green', 'Blue', 'Green', 'Red'], ['Red', 'Blue', 'Blue', 'Green', 'Red'], ['Red', 'Blue', 'Green', 'Green', 'Blue']]", "8"]
66
We have a 4x4 numerical grid, with numbers ranging from 9 to 54 (9 included in the range but 54 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: [['10' '26' '30' '46'] ['x' '33' '43' 'x'] ['21' '40' 'x' 'x'] ['x' 'x' 'x' '52']]
consecutive_grid
underdetermined_system
12
[[0, 0, 17], [0, 2, 41], [0, 3, 46], [1, 0, 16], [1, 3, 45], [2, 1, 21], [2, 2, 39], [3, 3, 38]]
443
425.06947112083435
8
45
16
["[['', '37', '', ''], ['', '35', '40', ''], ['15', '', '', '44'], ['11', '20', '36', '']]", 9, 54]
["[['', '37', '', ''], ['', '35', '40', ''], ['15', '', '', '44'], ['11', '20', '36', '']]", 9, 54]
["[['', '37', '', ''], ['', '35', '40', ''], ['15', '', '', '44'], ['11', '20', '36', '']]", "9", "54"]
66
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 31 to 67. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 217, 193, None for columns 1 to 2 respectively, and the sums of rows must be None, 156, 208, 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 166. 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' '64' 'x'] ['34' '54' 'x' 'x'] ['x' '56' '53' 'x'] ['36' 'x' 'x' '49']]
magic_square
underdetermined_system
9
[[0, 0, 31], [0, 1, 42], [0, 3, 39], [1, 2, 35], [1, 3, 33], [2, 0, 37], [2, 3, 62], [3, 1, 65], [3, 2, 41]]
731
11.399878740310669
9
26
16
["[['', '', '64', ''], ['34', '54', '', ''], ['', '56', '53', ''], ['36', '', '', '49']]", 4, 31, 67]
["[['', '', '64', ''], ['34', '54', '', ''], ['', '56', '53', ''], ['36', '', '', '49']]", 31, 67, [1, 3], [1, 3], [217, 193], [156, 208], 166]
["[['', '', '64', ''], ['34', '54', '', ''], ['', '56', '53', ''], ['36', '', '', '49']]", "31", "67", "[None, 217, 193, None]", "[None, 156, 208, None]", "166"]
66
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: 4, 1: 5, 2: 2, 3: 10, 4: 6, 5: 8, 6: 2, 7: 11, 8: 2, 9: 8}, 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', 'Green', 'White', 'Green', 'Blue'], ['Red', 'Green', 'Black', 'Red', 'White', 'Yellow'], [], ['Yellow', 'Black', 'Yellow', 'Red', 'Green', 'White'], [], ['White', 'Blue', 'Red', 'Red', 'Blue', 'Black'], [], ['Yellow', 'Blue', 'Yellow', 'Blue', 'Green', 'Black']]
restricted_sorting
sorting
3
[[2, 6], [7, 6], [7, 8], [9, 0], [2, 1], [9, 8], [9, 0], [9, 8], [9, 4], [5, 0], [5, 1], [5, 0], [2, 4], [2, 6], [2, 4], [2, 8], [5, 2], [7, 2], [7, 2], [7, 8], [5, 4], [3, 2], [3, 4], [3, 1], [3, 2], [3, 6], [7, 1], [9, 1], [3, 0], [5, 6]]
105
0.0666203498840332
30
90
30
[[[], [], ["White", "Black", "Green", "White", "Green", "Blue"], ["Red", "Green", "Black", "Red", "White", "Yellow"], [], ["Yellow", "Black", "Yellow", "Red", "Green", "White"], [], ["White", "Blue", "Red", "Red", "Blue", "Black"], [], ["Yellow", "Blue", "Yellow", "Blue", "Green", "Black"]], 6, {"0": 4, "1": 5, "2": 2, "3": 10, "4": 6, "5": 8, "6": 2, "7": 11, "8": 2, "9": 8}]
[[[], [], ["White", "Black", "Green", "White", "Green", "Blue"], ["Red", "Green", "Black", "Red", "White", "Yellow"], [], ["Yellow", "Black", "Yellow", "Red", "Green", "White"], [], ["White", "Blue", "Red", "Red", "Blue", "Black"], [], ["Yellow", "Blue", "Yellow", "Blue", "Green", "Black"]], 6, {"0": 4, "1": 5, "2": 2, "3": 10, "4": 6, "5": 8, "6": 2, "7": 11, "8": 2, "9": 8}, 5]
["[[], [], ['White', 'Black', 'Green', 'White', 'Green', 'Blue'], ['Red', 'Green', 'Black', 'Red', 'White', 'Yellow'], [], ['Yellow', 'Black', 'Yellow', 'Red', 'Green', 'White'], [], ['White', 'Blue', 'Red', 'Red', 'Blue', 'Black'], [], ['Yellow', 'Blue', 'Yellow', 'Blue', 'Green', 'Black']]", "{0: 4, 1: 5, 2: 2, 3: 10, 4: 6, 5: 8, 6: 2, 7: 11, 8: 2, 9: 8}", "6", "5"]
66
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, 10) to his destination workshop at index (9, 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 3, district 2 covering rows 4 to 8, and district 3 covering rows 9 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 17 14 18 x x 8 18 10 5 5 x x] [x x x x 17 18 17 17 6 12 x 7 16] [17 x 17 6 18 x 10 13 10 19 15 4 13] [15 5 15 3 17 3 x x 18 15 19 3 2] [x x x x 2 10 x x x 18 14 5 12] [x 16 x 12 4 7 x x 9 x x x x] [x 7 x x 16 2 9 1 3 x x 4 x] [15 16 x 10 1 16 x x 2 18 1 x x] [x x 8 3 x 19 x x x 5 9 x x] [x 8 12 14 x x x 16 x 8 x 3 2] [8 1 x x x x 13 x x x 9 x 12] [x x 3 3 11 x x 16 x x 5 x x] [x 11 17 x x x x 9 x x 2 15 x]
traffic
pathfinding
5
[[3, 10], [3, 9], [3, 8], [2, 8], [1, 8], [1, 7], [1, 6], [1, 5], [1, 4], [2, 4], [3, 4], [4, 4], [5, 4], [6, 4], [7, 4], [7, 3], [8, 3], [8, 2], [9, 2]]
209
0.019596099853515625
19
4
4
[[["x", "17", "14", "18", "x", "x", "8", "18", "10", "5", "5", "x", "x"], ["x", "x", "x", "x", "17", "18", "17", "17", "6", "12", "x", "7", "16"], ["17", "x", "17", "6", "18", "x", "10", "13", "10", "19", "15", "4", "13"], ["15", "5", "15", "3", "17", "3", "x", "x", "18", "15", "19", "3", "2"], ["x", "x", "x", "x", "2", "10", "x", "x", "x", "18", "14", "5", "12"], ["x", "16", "x", "12", "4", "7", "x", "x", "9", "x", "x", "x", "x"], ["x", "7", "x", "x", "16", "2", "9", "1", "3", "x", "x", "4", "x"], ["15", "16", "x", "10", "1", "16", "x", "x", "2", "18", "1", "x", "x"], ["x", "x", "8", "3", "x", "19", "x", "x", "x", "5", "9", "x", "x"], ["x", "8", "12", "14", "x", "x", "x", "16", "x", "8", "x", "3", "2"], ["8", "1", "x", "x", "x", "x", "13", "x", "x", "x", "9", "x", "12"], ["x", "x", "3", "3", "11", "x", "x", "16", "x", "x", "5", "x", "x"], ["x", "11", "17", "x", "x", "x", "x", "9", "x", "x", "2", "15", "x"]]]
[[["x", "17", "14", "18", "x", "x", "8", "18", "10", "5", "5", "x", "x"], ["x", "x", "x", "x", "17", "18", "17", "17", "6", "12", "x", "7", "16"], ["17", "x", "17", "6", "18", "x", "10", "13", "10", "19", "15", "4", "13"], ["15", "5", "15", "3", "17", "3", "x", "x", "18", "15", "19", "3", "2"], ["x", "x", "x", "x", "2", "10", "x", "x", "x", "18", "14", "5", "12"], ["x", "16", "x", "12", "4", "7", "x", "x", "9", "x", "x", "x", "x"], ["x", "7", "x", "x", "16", "2", "9", "1", "3", "x", "x", "4", "x"], ["15", "16", "x", "10", "1", "16", "x", "x", "2", "18", "1", "x", "x"], ["x", "x", "8", "3", "x", "19", "x", "x", "x", "5", "9", "x", "x"], ["x", "8", "12", "14", "x", "x", "x", "16", "x", "8", "x", "3", "2"], ["8", "1", "x", "x", "x", "x", "13", "x", "x", "x", "9", "x", "12"], ["x", "x", "3", "3", "11", "x", "x", "16", "x", "x", "5", "x", "x"], ["x", "11", "17", "x", "x", "x", "x", "9", "x", "x", "2", "15", "x"]], [3, 10], [9, 2], 3, 8]
["[['x', '17', '14', '18', 'x', 'x', '8', '18', '10', '5', '5', 'x', 'x'], ['x', 'x', 'x', 'x', '17', '18', '17', '17', '6', '12', 'x', '7', '16'], ['17', 'x', '17', '6', '18', 'x', '10', '13', '10', '19', '15', '4', '13'], ['15', '5', '15', '3', '17', '3', 'x', 'x', '18', '15', '19', '3', '2'], ['x', 'x', 'x', 'x', '2', '10', 'x', 'x', 'x', '18', '14', '5', '12'], ['x', '16', 'x', '12', '4', '7', 'x', 'x', '9', 'x', 'x', 'x', 'x'], ['x', '7', 'x', 'x', '16', '2', '9', '1', '3', 'x', 'x', '4', 'x'], ['15', '16', 'x', '10', '1', '16', 'x', 'x', '2', '18', '1', 'x', 'x'], ['x', 'x', '8', '3', 'x', '19', 'x', 'x', 'x', '5', '9', 'x', 'x'], ['x', '8', '12', '14', 'x', 'x', 'x', '16', 'x', '8', 'x', '3', '2'], ['8', '1', 'x', 'x', 'x', 'x', '13', 'x', 'x', 'x', '9', 'x', '12'], ['x', 'x', '3', '3', '11', 'x', 'x', '16', 'x', 'x', '5', 'x', 'x'], ['x', '11', '17', 'x', 'x', 'x', 'x', '9', 'x', 'x', '2', '15', 'x']]", "(3, 10)", "(9, 2)", "3", "8"]
66
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 (12, 9) (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 0 1 1 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 0 0 0 0 0 1 0 1 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 1 1 0 1 1 1 0 1 0 0 0 1 0 1 1 1 1 1 1 1 1 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 1 0 0 0 1 1 0 1 1 1 1 0 0 1 1 0 0 0 1 0 1
trampoline_matrix
pathfin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 0, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1], [1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1]]", [12, 9], [3, 1], 4]
["[[0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0], [0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0], [1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0], [1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1], [1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0], [1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1], [1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1], [1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1], [1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1], [1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1], [1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1], [1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1]]", "(12, 9)", "(3, 1)", "4"]
66
Given 5 labeled water jugs with capacities 122, 121, 124, 28, 89, 73 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 270, 311, 372, 389 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
5
[["+", 121, 4], ["+", 122, 4], ["+", 73, 4], ["+", 73, 4], ["+", 124, 3], ["+", 124, 3], ["+", 124, 3], ["+", 73, 2], ["+", 89, 2], ["+", 28, 2], ["+", 121, 2], ["+", 121, 1], ["+", 121, 1], ["+", 28, 1]]
14
0.027414321899414062
14
48
3
[[122, 121, 124, 28, 89, 73], [270, 311, 372, 389]]
[[122, 121, 124, 28, 89, 73], [270, 311, 372, 389]]
["[122, 121, 124, 28, 89, 73]", "[270, 311, 372, 389]"]
67
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: [[58, 51, 56, 43, 33], [91, 71, 21, 14, 24], [46, 45, '_', 17, 13]]
8_puzzle
puzzle
5
[21, 56, 51, 58, 91, 71, 45, 21, 17, 14, 43, 51, 56, 45, 71, 46, 21, 17, 14, 13, 24, 33, 51, 56, 58, 71, 45, 43, 33, 24]
30
0.723954439163208
30
4
15
[[[58, 51, 56, 43, 33], [91, 71, 21, 14, 24], [46, 45, "_", 17, 13]]]
[[[58, 51, 56, 43, 33], [91, 71, 21, 14, 24], [46, 45, "_", 17, 13]]]
["[[58, 51, 56, 43, 33], [91, 71, 21, 14, 24], [46, 45, '_', 17, 13]]"]
67
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: lew, keck, flea, susu, herb The initial board: [['e', 'l', 'u', 'w'], ['k', 'k', 'c', 'e'], ['f', 'l', '_', 'a'], ['s', 'r', 's', 'e'], ['h', 'e', 'u', 'b']]
8_puzzle_words
puzzle
2
["down-right", "down-left", "up-left", "up-left", "up-right", "up-right", "down-right", "down-left", "up-left", "down-left", "down-right", "up-right", "up-left", "up-right", "down-right", "down-left", "up-left", "up-left"]
18
0.2113971710205078
18
4
20
[[["e", "l", "u", "w"], ["k", "k", "c", "e"], ["f", "l", "_", "a"], ["s", "r", "s", "e"], ["h", "e", "u", "b"]]]
[[["e", "l", "u", "w"], ["k", "k", "c", "e"], ["f", "l", "_", "a"], ["s", "r", "s", "e"], ["h", "e", "u", "b"]], ["lew", "keck", "flea", "susu", "herb"]]
["[['e', 'l', 'u', 'w'], ['k', 'k', 'c', 'e'], ['f', 'l', '_', 'a'], ['s', 'r', 's', 'e'], ['h', 'e', 'u', 'b']]", "['lew', 'keck', 'flea', 'susu', 'herb']"]
67
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 'S'. Our task is to visit city N and city R excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from R and N, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. A K G U Q D N X S V Y R Z A 0 0 0 0 1 0 1 0 0 0 0 0 0 K 0 0 0 0 0 1 0 1 0 0 0 0 0 G 0 1 0 0 0 0 0 0 0 0 0 0 1 U 0 0 0 0 0 0 0 0 0 0 0 1 0 Q 0 0 0 0 0 0 0 0 0 0 1 1 0 D 1 1 0 0 1 0 0 0 0 1 1 0 0 N 0 0 1 0 1 0 0 0 0 0 1 0 0 X 1 0 0 1 0 0 1 0 0 0 0 0 0 S 1 1 0 0 1 0 0 1 0 0 1 0 0 V 0 0 1 0 0 0 1 1 1 0 0 0 0 Y 1 0 0 0 1 0 0 0 0 0 0 0 0 R 0 1 0 0 0 0 1 1 0 0 1 0 0 Z 1 1 0 1 0 0 0 1 1 1 1 1 0
city_directed_graph
pathfinding
13
["S", "Q", "R", "N", "G", "Z", "R", "N"]
8
0.03870034217834473
8
13
16
[[[0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0], [1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0], [0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0], [1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0], [1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0]], ["A", "K", "G", "U", "Q", "D", "N", "X", "S", "V", "Y", "R", "Z"], "N", "R"]
[[[0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0], [1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0], [0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0], [1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0], [1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0]], ["A", "K", "G", "U", "Q", "D", "N", "X", "S", "V", "Y", "R", "Z"], "S", "N", "R"]
["[[0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0], [1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0], [0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0], [1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0], [1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0]]", "['A', 'K', 'G', 'U', 'Q', 'D', 'N', 'X', 'S', 'V', 'Y', 'R', 'Z']", "['S']", "['N', 'R']"]
67
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [8, 13, 16, 4, 35, 2, 19, 2, 21, 26, 28, 12, 58, 28, 12, 35, 33, 4, 19, 27, 61, 30, 17, 20, 27, 25, 30, 31, 9, 15, 4, 13, 11, 29], such that the sum of the chosen coins adds up to 384. 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: 1, 4: 1, 61: 2, 30: 19, 12: 4, 20: 16, 29: 10, 2: 2, 35: 17, 31: 17, 19: 15, 25: 11, 21: 8, 27: 16, 17: 17, 11: 7, 58: 12, 26: 4, 15: 14, 28: 10, 8: 5, 16: 5, 9: 8, 33: 13}, 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
18
[4, 13, 12, 4, 61, 58, 28, 26, 16, 12, 13, 29, 28, 8, 33, 4, 35]
101
0.04987359046936035
17
34
34
[[8, 13, 16, 4, 35, 2, 19, 2, 21, 26, 28, 12, 58, 28, 12, 35, 33, 4, 19, 27, 61, 30, 17, 20, 27, 25, 30, 31, 9, 15, 4, 13, 11, 29]]
[[8, 13, 16, 4, 35, 2, 19, 2, 21, 26, 28, 12, 58, 28, 12, 35, 33, 4, 19, 27, 61, 30, 17, 20, 27, 25, 30, 31, 9, 15, 4, 13, 11, 29], {"13": 1, "4": 1, "61": 2, "30": 19, "12": 4, "20": 16, "29": 10, "2": 2, "35": 17, "31": 17, "19": 15, "25": 11, "21": 8, "27": 16, "17": 17, "11": 7, "58": 12, "26": 4, "15": 14, "28": 10, "8": 5, "16": 5, "9": 8, "33": 13}, 384]
["[8, 13, 16, 4, 35, 2, 19, 2, 21, 26, 28, 12, 58, 28, 12, 35, 33, 4, 19, 27, 61, 30, 17, 20, 27, 25, 30, 31, 9, 15, 4, 13, 11, 29]", "{13: 1, 4: 1, 61: 2, 30: 19, 12: 4, 20: 16, 29: 10, 2: 2, 35: 17, 31: 17, 19: 15, 25: 11, 21: 8, 27: 16, 17: 17, 11: 7, 58: 12, 26: 4, 15: 14, 28: 10, 8: 5, 16: 5, 9: 8, 33: 13}", "384"]
67
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? [['Blue', 'Blue', 'Green', 'Red', 'Red'], ['Green', 'Blue', 'Green', 'Blue', 'Blue'], ['Red', 'Green', 'Red', 'Red', 'Green']]
color_sorting
sorting
9
[[0, 2], [0, 2], [1, 0], [1, 2], [1, 0], [2, 1], [2, 1], [2, 1], [2, 1], [2, 0], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [1, 0], [1, 0], [1, 0]]
19
4.2806196212768555
19
6
15
[[["Blue", "Blue", "Green", "Red", "Red"], ["Green", "Blue", "Green", "Blue", "Blue"], ["Red", "Green", "Red", "Red", "Green"]], 8]
[[["Blue", "Blue", "Green", "Red", "Red"], ["Green", "Blue", "Green", "Blue", "Blue"], ["Red", "Green", "Red", "Red", "Green"]], 8]
["[['Blue', 'Blue', 'Green', 'Red', 'Red'], ['Green', 'Blue', 'Green', 'Blue', 'Blue'], ['Red', 'Green', 'Red', 'Red', 'Green']]", "8"]
67
We have a 4x4 numerical grid, with numbers ranging from 9 to 54 (9 included in the range but 54 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' '37' 'x' 'x'] ['x' '35' '40' 'x'] ['15' 'x' 'x' '44'] ['11' '20' '36' 'x']]
consecutive_grid
underdetermined_system
13
[[0, 0, 30], [0, 2, 48], [1, 2, 36], [1, 3, 37], [2, 1, 31], [2, 2, 32], [3, 0, 12], [3, 2, 27], [3, 3, 28]]
459
351.63161611557007
9
45
16
["[['', '47', '', '55'], ['29', '34', '', ''], ['16', '', '', '35'], ['', '26', '', '']]", 12, 57]
["[['', '47', '', '55'], ['29', '34', '', ''], ['16', '', '', '35'], ['', '26', '', '']]", 12, 57]
["[['', '47', '', '55'], ['29', '34', '', ''], ['16', '', '', '35'], ['', '26', '', '']]", "12", "57"]
67
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 31 to 67. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 204, 206, None for columns 1 to 2 respectively, and the sums of rows must be None, 187, 203, None for rows 1 to 2 respectively, where None means that we do not have any constraints on the sum of the numbers in the row or column at that index. Also, the sum of the numbers in the diagonal from the top right to the bottom left corner of the grid should equal 199. The goal is to find unique integers (ie each number can be in the final grid only once) in the given range to replace with ‘x’s in the grid below such that the sum of the specified rows, columns, and diagonal equals the given amounts and the sum of all of the numbers in the grid is as low as possible. The solution should be provided as a list of tuples in Python syntax. Each tuple should contain three numbers for each 'x' position: the row index, the column index (both starting from 0), and the value of the unique integer replaced with 'x' at that position. Grid: [['x' '59' '52' '54'] ['x' 'x' 'x' '62'] ['x' '58' 'x' 'x'] ['x' 'x' '63' '42']]
magic_square
underdetermined_system
9
[[0, 0, 31], [1, 0, 32], [1, 1, 40], [1, 2, 53], [2, 0, 41], [2, 2, 38], [2, 3, 66], [3, 0, 34], [3, 1, 47]]
772
36.59412097930908
9
26
16
["[['', '59', '52', '54'], ['', '', '', '62'], ['', '58', '', ''], ['', '', '63', '42']]", 4, 31, 67]
["[['', '59', '52', '54'], ['', '', '', '62'], ['', '58', '', ''], ['', '', '63', '42']]", 31, 67, [1, 3], [1, 3], [204, 206], [187, 203], 199]
["[['', '59', '52', '54'], ['', '', '', '62'], ['', '58', '', ''], ['', '', '63', '42']]", "31", "67", "[None, 204, 206, None]", "[None, 187, 203, None]", "199"]
67
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, 3) to his destination workshop at index (8, 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 x 10 x x x 3 x x x x x x] [6 19 x x x 12 x x 3 x x x x] [5 3 7 7 x 7 9 x 18 x x x x] [1 4 19 19 16 6 x 2 10 x 1 7 x] [14 10 x x 2 3 5 3 13 7 x 8 x] [x 8 11 14 18 x x 16 15 8 x 10 x] [x 17 x x 15 x x 1 17 9 7 x 10] [18 6 14 4 12 12 x 12 5 x x 5 18] [x x x x x x x 7 17 4 16 x x] [x 6 17 x x x x x 15 x x 12 x] [14 x x 12 3 11 x x x x x x 17] [x 16 x x x 3 5 19 x 16 14 x 19] [13 x 11 x 3 16 x 1 x x 1 x x]
traffic
pathfinding
5
[[2, 3], [3, 3], [3, 4], [4, 4], [4, 5], [4, 6], [4, 7], [5, 7], [6, 7], [7, 7], [7, 8], [8, 8], [8, 9], [8, 10]]
119
0.020412206649780273
14
4
4
[[["x", "x", "10", "x", "x", "x", "3", "x", "x", "x", "x", "x", "x"], ["6", "19", "x", "x", "x", "12", "x", "x", "3", "x", "x", "x", "x"], ["5", "3", "7", "7", "x", "7", "9", "x", "18", "x", "x", "x", "x"], ["1", "4", "19", "19", "16", "6", "x", "2", "10", "x", "1", "7", "x"], ["14", "10", "x", "x", "2", "3", "5", "3", "13", "7", "x", "8", "x"], ["x", "8", "11", "14", "18", "x", "x", "16", "15", "8", "x", "10", "x"], ["x", "17", "x", "x", "15", "x", "x", "1", "17", "9", "7", "x", "10"], ["18", "6", "14", "4", "12", "12", "x", "12", "5", "x", "x", "5", "18"], ["x", "x", "x", "x", "x", "x", "x", "7", "17", "4", "16", "x", "x"], ["x", "6", "17", "x", "x", "x", "x", "x", "15", "x", "x", "12", "x"], ["14", "x", "x", "12", "3", "11", "x", "x", "x", "x", "x", "x", "17"], ["x", "16", "x", "x", "x", "3", "5", "19", "x", "16", "14", "x", "19"], ["13", "x", "11", "x", "3", "16", "x", "1", "x", "x", "1", "x", "x"]]]
[[["x", "x", "10", "x", "x", "x", "3", "x", "x", "x", "x", "x", "x"], ["6", "19", "x", "x", "x", "12", "x", "x", "3", "x", "x", "x", "x"], ["5", "3", "7", "7", "x", "7", "9", "x", "18", "x", "x", "x", "x"], ["1", "4", "19", "19", "16", "6", "x", "2", "10", "x", "1", "7", "x"], ["14", "10", "x", "x", "2", "3", "5", "3", "13", "7", "x", "8", "x"], ["x", "8", "11", "14", "18", "x", "x", "16", "15", "8", "x", "10", "x"], ["x", "17", "x", "x", "15", "x", "x", "1", "17", "9", "7", "x", "10"], ["18", "6", "14", "4", "12", "12", "x", "12", "5", "x", "x", "5", "18"], ["x", "x", "x", "x", "x", "x", "x", "7", "17", "4", "16", "x", "x"], ["x", "6", "17", "x", "x", "x", "x", "x", "15", "x", "x", "12", "x"], ["14", "x", "x", "12", "3", "11", "x", "x", "x", "x", "x", "x", "17"], ["x", "16", "x", "x", "x", "3", "5", "19", "x", "16", "14", "x", "19"], ["13", "x", "11", "x", "3", "16", "x", "1", "x", "x", "1", "x", "x"]], [2, 3], [8, 10], 2, 7]
["[['x', 'x', '10', 'x', 'x', 'x', '3', 'x', 'x', 'x', 'x', 'x', 'x'], ['6', '19', 'x', 'x', 'x', '12', 'x', 'x', '3', 'x', 'x', 'x', 'x'], ['5', '3', '7', '7', 'x', '7', '9', 'x', '18', 'x', 'x', 'x', 'x'], ['1', '4', '19', '19', '16', '6', 'x', '2', '10', 'x', '1', '7', 'x'], ['14', '10', 'x', 'x', '2', '3', '5', '3', '13', '7', 'x', '8', 'x'], ['x', '8', '11', '14', '18', 'x', 'x', '16', '15', '8', 'x', '10', 'x'], ['x', '17', 'x', 'x', '15', 'x', 'x', '1', '17', '9', '7', 'x', '10'], ['18', '6', '14', '4', '12', '12', 'x', '12', '5', 'x', 'x', '5', '18'], ['x', 'x', 'x', 'x', 'x', 'x', 'x', '7', '17', '4', '16', 'x', 'x'], ['x', '6', '17', 'x', 'x', 'x', 'x', 'x', '15', 'x', 'x', '12', 'x'], ['14', 'x', 'x', '12', '3', '11', 'x', 'x', 'x', 'x', 'x', 'x', '17'], ['x', '16', 'x', 'x', 'x', '3', '5', '19', 'x', '16', '14', 'x', '19'], ['13', 'x', '11', 'x', '3', '16', 'x', '1', 'x', 'x', '1', 'x', 'x']]", "(2, 3)", "(8, 10)", "2", "7"]
67
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 (3, 0) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (9, 11). What is the shortest sequence of trampolines he should jump on to reach his destination (including the first and final trampolines)? The answer should be a list of tuples, in Python syntax, indicating the row and column of each trampoline Alex jumps on. 1 1 1 0 1 1 1 1 0 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 0 0 0 1 0 1 1 1 0 1 0 0 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 1 0 1 0 0 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 0], [0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1], [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1], [0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1]]", [3, 0], [9, 11], 4]
["[[1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1], [1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0], [0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0], [0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1], [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1], [0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1]]", "(3, 0)", "(9, 11)", "4"]
67
Given 5 labeled water jugs with capacities 116, 115, 29, 129, 39, 114 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 353, 368, 396, 403 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
5
[["+", 116, 4], ["+", 129, 4], ["+", 29, 4], ["+", 129, 4], ["+", 114, 3], ["+", 129, 3], ["+", 39, 3], ["+", 114, 3], ["+", 114, 2], ["+", 115, 2], ["+", 129, 2], ["-", 29, 2], ["+", 39, 2], ["+", 114, 1], ["+", 114, 1], ["+", 115, 1], ["-", 29, 1], ["+", 39, 1]]
18
0.03425145149230957
18
48
3
[[116, 115, 29, 129, 39, 114], [353, 368, 396, 403]]
[[116, 115, 29, 129, 39, 114], [353, 368, 396, 403]]
["[116, 115, 29, 129, 39, 114]", "[353, 368, 396, 403]"]
68
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: [[72, 92, '_', 78, 74], [70, 67, 85, 75, 66], [48, 42, 32, 26, 50]]
8_puzzle
puzzle
5
[85, 67, 70, 72, 92, 85, 78, 75, 66, 50]
10
0.019316434860229492
10
4
15
[[[72, 92, "_", 78, 74], [70, 67, 85, 75, 66], [48, 42, 32, 26, 50]]]
[[[72, 92, "_", 78, 74], [70, 67, 85, 75, 66], [48, 42, 32, 26, 50]]]
["[[72, 92, '_', 78, 74], [70, 67, 85, 75, 66], [48, 42, 32, 26, 50]]"]
68
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: sat, leep, mack, pogo, drew The initial board: [['e', 's', '_', 't'], ['l', 'o', 'e', 'm'], ['c', 'a', 'o', 'k'], ['p', 'p', 'g', 'e'], ['d', 'r', 'a', 'w']]
8_puzzle_words
puzzle
2
["down-left", "down-left", "down-right", "down-right", "up-right", "up-left", "down-left", "up-left", "up-right", "up-right", "down-right", "down-left", "down-left", "up-left", "up-right", "up-right", "down-right", "down-left", "down-left", "up-left", "up-right", "up-left"]
22
0.2691648006439209
22
4
20
[[["e", "s", "_", "t"], ["l", "o", "e", "m"], ["c", "a", "o", "k"], ["p", "p", "g", "e"], ["d", "r", "a", "w"]]]
[[["e", "s", "_", "t"], ["l", "o", "e", "m"], ["c", "a", "o", "k"], ["p", "p", "g", "e"], ["d", "r", "a", "w"]], ["sat", "leep", "mack", "pogo", "drew"]]
["[['e', 's', '_', 't'], ['l', 'o', 'e', 'm'], ['c', 'a', 'o', 'k'], ['p', 'p', 'g', 'e'], ['d', 'r', 'a', 'w']]", "['sat', 'leep', 'mack', 'pogo', 'drew']"]
68
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'P'. Our task is to visit city J and city G 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 G and J, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. P G W V L M B S J H D N R P 0 0 0 0 0 0 0 0 0 1 0 0 1 G 0 0 0 1 0 1 0 0 0 0 0 0 0 W 0 0 0 0 1 0 1 1 0 0 1 0 0 V 0 0 0 0 1 0 0 1 0 0 0 1 0 L 0 1 0 0 0 1 1 1 0 0 0 1 0 M 0 0 1 1 0 0 0 0 1 0 1 0 0 B 1 1 0 0 1 0 0 0 0 0 1 0 0 S 0 1 0 0 0 0 0 0 0 0 0 1 0 J 0 0 1 1 1 0 1 0 0 0 0 0 0 H 1 0 1 0 0 1 1 1 0 0 0 0 1 D 0 1 0 1 0 0 0 0 1 0 0 0 1 N 0 0 0 0 0 0 0 0 1 1 1 0 0 R 0 1 0 1 0 1 0 0 0 1 0 1 0
city_directed_graph
pathfinding
13
["P", "R", "G", "M", "J", "B", "D", "J", "L", "G"]
10
0.06922531127929688
10
13
16
[[[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0], [0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0], [1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1], [0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0], [0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0]], ["P", "G", "W", "V", "L", "M", "B", "S", "J", "H", "D", "N", "R"], "J", "G"]
[[[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1], [0, 0, 0, 1, 0, 1, 0, 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V', 'L', 'M', 'B', 'S', 'J', 'H', 'D', 'N', 'R']", "['P']", "['J', 'G']"]
68
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [5, 29, 12, 96, 4, 13, 8, 23, 14, 25, 18, 23, 36, 32, 17, 37, 34, 7, 9, 32, 29, 37, 30, 40, 99, 9, 2, 40, 35, 14], such that the sum of the chosen coins adds up to 427. 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 {14: 4, 4: 2, 18: 12, 23: 12, 36: 15, 5: 1, 12: 3, 13: 13, 9: 7, 32: 8, 99: 16, 8: 7, 96: 17, 35: 13, 29: 19, 30: 19, 7: 1, 34: 16, 37: 15, 2: 2, 17: 3, 40: 18, 25: 9}, 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
19
[5, 7, 17, 99, 96, 32, 14, 35, 32, 14, 25, 12, 37, 2]
104
0.04604029655456543
14
30
30
[[5, 29, 12, 96, 4, 13, 8, 23, 14, 25, 18, 23, 36, 32, 17, 37, 34, 7, 9, 32, 29, 37, 30, 40, 99, 9, 2, 40, 35, 14]]
[[5, 29, 12, 96, 4, 13, 8, 23, 14, 25, 18, 23, 36, 32, 17, 37, 34, 7, 9, 32, 29, 37, 30, 40, 99, 9, 2, 40, 35, 14], {"14": 4, "4": 2, "18": 12, "23": 12, "36": 15, "5": 1, "12": 3, "13": 13, "9": 7, "32": 8, "99": 16, "8": 7, "96": 17, "35": 13, "29": 19, "30": 19, "7": 1, "34": 16, "37": 15, "2": 2, "17": 3, "40": 18, "25": 9}, 427]
["[5, 29, 12, 96, 4, 13, 8, 23, 14, 25, 18, 23, 36, 32, 17, 37, 34, 7, 9, 32, 29, 37, 30, 40, 99, 9, 2, 40, 35, 14]", "{14: 4, 4: 2, 18: 12, 23: 12, 36: 15, 5: 1, 12: 3, 13: 13, 9: 7, 32: 8, 99: 16, 8: 7, 96: 17, 35: 13, 29: 19, 30: 19, 7: 1, 34: 16, 37: 15, 2: 2, 17: 3, 40: 18, 25: 9}", "427"]
68
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? [['Blue', 'Green', 'Blue', 'Blue', 'Blue'], ['Blue', 'Green', 'Red', 'Red', 'Green'], ['Green', 'Red', 'Red', 'Green', 'Red']]
color_sorting
sorting
9
[[0, 1], [0, 2], [1, 0], [1, 0], [1, 2], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1], [2, 1], [2, 1], [2, 0], [1, 2], [1, 2], [0, 1], [0, 2], [0, 2]]
18
2.5658318996429443
18
6
15
[[["Blue", "Green", "Blue", "Blue", "Blue"], ["Blue", "Green", "Red", "Red", "Green"], ["Green", "Red", "Red", "Green", "Red"]], 8]
[[["Blue", "Green", "Blue", "Blue", "Blue"], ["Blue", "Green", "Red", "Red", "Green"], ["Green", "Red", "Red", "Green", "Red"]], 8]
["[['Blue', 'Green', 'Blue', 'Blue', 'Blue'], ['Blue', 'Green', 'Red', 'Red', 'Green'], ['Green', 'Red', 'Red', 'Green', 'Red']]", "8"]
68
We have a 4x4 numerical grid, with numbers ranging from 34 to 79 (34 included in the range but 79 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: [['35' 'x' '47' 'x'] ['40' '49' 'x' '63'] ['41' 'x' 'x' '65'] ['x' 'x' '70' 'x']]
consecutive_grid
underdetermined_system
13
[[0, 0, 25], [0, 2, 41], [1, 1, 42], [1, 3, 64], [2, 0, 35], [2, 1, 43], [2, 2, 54], [3, 0, 36], [3, 2, 57]]
608
48.17496109008789
9
45
16
["[['', '40', '', '65'], ['34', '', '53', ''], ['', '', '', '63'], ['', '56', '', '62']]", 25, 70]
["[['', '40', '', '65'], ['34', '', '53', ''], ['', '', '', '63'], ['', '56', '', '62']]", 25, 70]
["[['', '40', '', '65'], ['34', '', '53', ''], ['', '', '', '63'], ['', '56', '', '62']]", "25", "70"]
68
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 31 to 67. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 224, 226, None for columns 1 to 2 respectively, and the sums of rows must be None, 220, 216, 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 211. 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' '40' 'x' 'x'] ['x' '58' 'x' '37'] ['47' 'x' 'x' '44'] ['45' 'x' 'x' '42']]
magic_square
underdetermined_system
9
[[0, 0, 31], [0, 2, 36], [0, 3, 35], [1, 0, 59], [1, 2, 66], [2, 1, 65], [2, 2, 60], [3, 1, 61], [3, 2, 64]]
790
85.8753867149353
9
26
16
["[['', '40', '', ''], ['', '58', '', '37'], ['47', '', '', '44'], ['45', '', '', '42']]", 4, 31, 67]
["[['', '40', '', ''], ['', '58', '', '37'], ['47', '', '', '44'], ['45', '', '', '42']]", 31, 67, [1, 3], [1, 3], [224, 226], [220, 216], 211]
["[['', '40', '', ''], ['', '58', '', '37'], ['47', '', '', '44'], ['45', '', '', '42']]", "31", "67", "[None, 224, 226, None]", "[None, 220, 216, None]", "211"]
68
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: 9, 1: 11, 2: 2, 3: 10, 4: 8, 5: 6, 6: 4, 7: 4, 8: 7, 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', 'Black', 'White', 'Blue', 'Yellow', 'White'], ['Black', 'Blue', 'Red', 'Blue', 'Red', 'Green'], [], ['Black', 'White', 'Red', 'Green', 'White', 'Blue'], ['Yellow', 'Blue', 'Red', 'Green', 'Green', 'Yellow'], [], ['Green', 'Black', 'Red', 'White', 'Yellow', 'Yellow'], [], [], []]
restricted_sorting
sorting
3
[[0, 2], [0, 2], [1, 2], [3, 2], [1, 9], [4, 7], [4, 9], [6, 5], [6, 2], [4, 8], [6, 8], [1, 8], [1, 9], [1, 8], [4, 5], [4, 5], [4, 7], [6, 4], [6, 7], [6, 7], [0, 6], [0, 9], [0, 7], [3, 6], [3, 8], [3, 5], [3, 6], [1, 5], [0, 6], [4, 6], [3, 9]]
138
0.08098411560058594
31
90
30
[[["Black", "Black", "White", "Blue", "Yellow", "White"], ["Black", "Blue", "Red", "Blue", "Red", "Green"], [], ["Black", "White", "Red", "Green", "White", "Blue"], ["Yellow", "Blue", "Red", "Green", "Green", "Yellow"], [], ["Green", "Black", "Red", "White", "Yellow", "Yellow"], [], [], []], 6, {"0": 9, "1": 11, "2": 2, "3": 10, "4": 8, "5": 6, "6": 4, "7": 4, "8": 7, "9": 3}]
[[["Black", "Black", "White", "Blue", "Yellow", "White"], ["Black", "Blue", "Red", "Blue", "Red", "Green"], [], ["Black", "White", "Red", "Green", "White", "Blue"], ["Yellow", "Blue", "Red", "Green", "Green", "Yellow"], [], ["Green", "Black", "Red", "White", "Yellow", "Yellow"], [], [], []], 6, {"0": 9, "1": 11, "2": 2, "3": 10, "4": 8, "5": 6, "6": 4, "7": 4, "8": 7, "9": 3}, 5]
["[['Black', 'Black', 'White', 'Blue', 'Yellow', 'White'], ['Black', 'Blue', 'Red', 'Blue', 'Red', 'Green'], [], ['Black', 'White', 'Red', 'Green', 'White', 'Blue'], ['Yellow', 'Blue', 'Red', 'Green', 'Green', 'Yellow'], [], ['Green', 'Black', 'Red', 'White', 'Yellow', 'Yellow'], [], [], []]", "{0: 9, 1: 11, 2: 2, 3: 10, 4: 8, 5: 6, 6: 4, 7: 4, 8: 7, 9: 3}", "6", "5"]
68
Using the provided matrix map of a city, where numbers represent travel time in minutes (all numbers are positive integers) and 'x' marks closed workshops, find the quickest route for Ben to travel from his current workshop at index (5, 12) to his destination workshop at index (1, 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 5, and district 3 covering rows 6 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. [18 x x x 19 x x 8 6 3 x x x] [x x 8 1 11 x x x x x 4 6 4] [1 4 15 13 17 11 x 15 x 13 1 x x] [3 x 6 1 15 2 x 13 13 x 10 x x] [17 12 13 11 6 1 3 x x 19 6 6 x] [x 17 7 12 1 15 17 20 3 x x 18 10] [16 14 15 x x 11 x 17 20 15 7 10 x] [5 11 x 7 19 x 6 18 15 x 8 x 1] [10 x 1 x x 6 x 11 x 13 x x x] [x x x x 4 x 8 x 12 x 12 13 x] [x x 18 14 x x 5 x x 13 1 x x] [x x 1 17 8 18 x 7 x x 16 8 x] [x x x 16 1 x 19 x x x x 14 x]
traffic
pathfinding
5
[[5, 12], [5, 11], [6, 11], [6, 10], [6, 9], [6, 8], [5, 8], [5, 7], [5, 6], [4, 6], [4, 5], [3, 5], [3, 4], [3, 3], [2, 3], [1, 3], [1, 2]]
154
0.0203857421875
17
4
4
[[["18", "x", "x", "x", "19", "x", "x", "8", "6", "3", "x", "x", "x"], ["x", "x", "8", "1", "11", "x", "x", "x", "x", "x", "4", "6", "4"], ["1", "4", "15", "13", "17", "11", "x", "15", "x", "13", "1", "x", "x"], ["3", "x", "6", "1", "15", "2", "x", "13", "13", "x", "10", "x", "x"], ["17", "12", "13", "11", "6", "1", "3", "x", "x", "19", "6", "6", "x"], ["x", "17", "7", "12", "1", "15", "17", "20", "3", "x", "x", "18", "10"], ["16", "14", "15", "x", "x", "11", "x", "17", "20", "15", "7", "10", "x"], ["5", "11", "x", "7", "19", "x", "6", "18", "15", "x", "8", "x", "1"], ["10", "x", "1", "x", "x", "6", "x", "11", "x", "13", "x", "x", "x"], ["x", "x", "x", "x", "4", "x", "8", "x", "12", "x", "12", "13", "x"], ["x", "x", "18", "14", "x", "x", "5", "x", "x", "13", "1", "x", "x"], ["x", "x", "1", "17", "8", "18", "x", "7", "x", "x", "16", "8", "x"], ["x", "x", "x", "16", "1", "x", "19", "x", "x", "x", "x", "14", "x"]]]
[[["18", "x", "x", "x", "19", "x", "x", "8", "6", "3", "x", "x", "x"], ["x", "x", "8", "1", "11", "x", "x", "x", "x", "x", "4", "6", "4"], ["1", "4", "15", "13", "17", "11", "x", "15", "x", "13", "1", "x", "x"], ["3", "x", "6", "1", "15", "2", "x", "13", "13", "x", "10", "x", "x"], ["17", "12", "13", "11", "6", "1", "3", "x", "x", "19", "6", "6", "x"], ["x", "17", "7", "12", "1", "15", "17", "20", "3", "x", "x", "18", "10"], ["16", "14", "15", "x", "x", "11", "x", "17", "20", "15", "7", "10", "x"], ["5", "11", "x", "7", "19", "x", "6", "18", "15", "x", "8", "x", "1"], ["10", "x", "1", "x", "x", "6", "x", "11", "x", "13", "x", "x", "x"], ["x", "x", "x", "x", "4", "x", "8", "x", "12", "x", "12", "13", "x"], ["x", "x", "18", "14", "x", "x", "5", "x", "x", "13", "1", "x", "x"], ["x", "x", "1", "17", "8", "18", "x", "7", "x", "x", "16", "8", "x"], ["x", "x", "x", "16", "1", "x", "19", "x", "x", "x", "x", "14", "x"]], [5, 12], [1, 2], 1, 5]
["[['18', 'x', 'x', 'x', '19', 'x', 'x', '8', '6', '3', 'x', 'x', 'x'], ['x', 'x', '8', '1', '11', 'x', 'x', 'x', 'x', 'x', '4', '6', '4'], ['1', '4', '15', '13', '17', '11', 'x', '15', 'x', '13', '1', 'x', 'x'], ['3', 'x', '6', '1', '15', '2', 'x', '13', '13', 'x', '10', 'x', 'x'], ['17', '12', '13', '11', '6', '1', '3', 'x', 'x', '19', '6', '6', 'x'], ['x', '17', '7', '12', '1', '15', '17', '20', '3', 'x', 'x', '18', '10'], ['16', '14', '15', 'x', 'x', '11', 'x', '17', '20', '15', '7', '10', 'x'], ['5', '11', 'x', '7', '19', 'x', '6', '18', '15', 'x', '8', 'x', '1'], ['10', 'x', '1', 'x', 'x', '6', 'x', '11', 'x', '13', 'x', 'x', 'x'], ['x', 'x', 'x', 'x', '4', 'x', '8', 'x', '12', 'x', '12', '13', 'x'], ['x', 'x', '18', '14', 'x', 'x', '5', 'x', 'x', '13', '1', 'x', 'x'], ['x', 'x', '1', '17', '8', '18', 'x', '7', 'x', 'x', '16', '8', 'x'], ['x', 'x', 'x', '16', '1', 'x', '19', 'x', 'x', 'x', 'x', '14', 'x']]", "(5, 12)", "(1, 2)", "1", "5"]
68
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, 5) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (0, 12). What is the shortest sequence of trampolines he should jump on to reach his destination (including the first and final trampolines)? The answer should be a list of tuples, in Python syntax, indicating the row and column of each trampoline Alex jumps on. 1 0 1 1 1 0 1 0 0 0 0 0 0 1 1 1 1 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 1 1 1 1 1 0 1 1 0 1 1 0 0 1 0 1 0 0 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 1 1 0 1 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 1 1 1 0 1 0 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0 1 0 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 0 1 1 1 0 1 0 0 0 0 0 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1
trampoline_matrix
pathfinding
13
[[11, 5], [10, 5], [9, 5], [8, 5], [7, 5], [6, 6], [5, 7], [4, 7], [3, 7], [2, 7], [1, 8], [0, 9], [0, 10], [0, 11], [0, 12]]
15
0.03449535369873047
15
8
2
["[[1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0], [1, 1, 1, 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0, 0, 0], [1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1], [1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1], [0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1], [1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1], [0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0], [1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0], [1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1], [1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0], [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1], [1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]", "(11, 5)", "(0, 12)", "4"]
68
Given 5 labeled water jugs with capacities 73, 129, 120, 38, 72, 138 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 278, 295, 323, 383 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
5
[["+", 72, 4], ["+", 138, 4], ["+", 138, 4], ["-", 38, 4], ["+", 73, 4], ["+", 120, 3], ["+", 138, 3], ["-", 73, 3], ["+", 138, 3], ["+", 72, 2], ["+", 138, 2], ["+", 38, 2], ["-", 73, 2], ["+", 120, 2], ["+", 120, 1], ["+", 120, 1], ["+", 38, 1]]
17
0.030396461486816406
17
48
3
[[73, 129, 120, 38, 72, 138], [278, 295, 323, 383]]
[[73, 129, 120, 38, 72, 138], [278, 295, 323, 383]]
["[73, 129, 120, 38, 72, 138]", "[278, 295, 323, 383]"]
69
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: [['_', 83, 11, 57, 59], [89, 61, 99, 76, 63], [42, 35, 25, 48, 54]]
8_puzzle
puzzle
5
[83, 11, 57, 59, 63, 54, 48, 25, 35, 61, 99, 57, 11, 83, 89, 99, 61, 35, 57, 11, 59, 76, 11, 59, 83, 89, 99, 61, 59, 57, 25, 11, 54, 48]
34
3.8137171268463135
34
4
15
[[["_", 83, 11, 57, 59], [89, 61, 99, 76, 63], [42, 35, 25, 48, 54]]]
[[["_", 83, 11, 57, 59], [89, 61, 99, 76, 63], [42, 35, 25, 48, 54]]]
["[['_', 83, 11, 57, 59], [89, 61, 99, 76, 63], [42, 35, 25, 48, 54]]"]
69
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: orc, icho, dear, four, peai The initial board: [['c', 'o', 'a', 'c'], ['i', 'o', 'h', 'r'], ['d', 'e', 'r', 'r'], ['f', 'o', 'u', 'a'], ['p', 'e', '_', 'i']]
8_puzzle_words
puzzle
2
["up-right", "up-left", "up-left", "up-right", "down-right", "down-left", "up-left", "up-left"]
8
0.19328975677490234
8
4
20
[[["c", "o", "a", "c"], ["i", "o", "h", "r"], ["d", "e", "r", "r"], ["f", "o", "u", "a"], ["p", "e", "_", "i"]]]
[[["c", "o", "a", "c"], ["i", "o", "h", "r"], ["d", "e", "r", "r"], ["f", "o", "u", "a"], ["p", "e", "_", "i"]], ["orc", "icho", "dear", "four", "peai"]]
["[['c', 'o', 'a', 'c'], ['i', 'o', 'h', 'r'], ['d', 'e', 'r', 'r'], ['f', 'o', 'u', 'a'], ['p', 'e', '_', 'i']]", "['orc', 'icho', 'dear', 'four', 'peai']"]
69
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'P'. Our task is to visit city N and city R excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from R and N, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. N Y P L Q H C G U K J B R T N 0 1 0 0 0 1 0 1 0 0 0 0 0 1 Y 1 0 0 0 0 0 0 0 1 0 0 0 0 1 P 0 0 0 0 1 0 0 0 1 0 0 0 0 1 L 1 1 0 0 1 0 0 0 1 0 0 0 0 1 Q 0 0 0 0 0 0 0 0 0 0 0 0 1 0 H 0 0 0 1 0 0 0 0 0 1 0 1 0 0 C 1 1 1 1 1 1 0 1 0 0 0 0 1 0 G 0 1 1 1 1 0 0 0 0 0 0 0 0 0 U 0 0 0 0 1 0 1 1 0 0 0 0 0 0 K 1 1 0 1 0 0 0 0 0 0 0 0 1 0 J 1 1 1 1 0 0 1 0 0 0 0 0 1 0 B 1 0 0 0 0 0 1 1 0 1 1 0 0 1 R 0 1 1 1 1 0 0 0 1 0 1 0 0 0 T 0 1 0 0 1 0 1 0 0 1 1 0 0 0
city_directed_graph
pathfinding
14
["P", "Q", "R", "J", "R", "L", "N", "Y", "N"]
9
0.05361437797546387
9
14
17
[[[0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0], [1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0], [0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1], [0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0]], ["N", "Y", "P", "L", "Q", "H", "C", "G", "U", "K", "J", "B", "R", "T"], "N", "R"]
[[[0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0], [1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1,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In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [28, 11, 40, 15, 21, 6, 20, 6, 12, 22, 8, 18, 34, 24, 22, 30, 35, 41, 6, 39, 5, 15, 19, 8, 26, 38, 11, 29, 31, 14, 37, 28, 8, 11, 28, 27, 38], such that the sum of the chosen coins adds up to 423. 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 {40: 1, 41: 13, 8: 5, 28: 2, 21: 18, 15: 7, 5: 4, 14: 13, 37: 12, 22: 12, 29: 3, 30: 15, 35: 4, 26: 19, 39: 7, 31: 14, 11: 7, 20: 3, 6: 2, 12: 8, 27: 13, 19: 19, 34: 5, 18: 9, 38: 16, 24: 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
20
[40, 28, 6, 35, 6, 29, 28, 6, 39, 34, 20, 37, 41, 38, 28, 8]
81
0.05535292625427246
16
37
37
[[28, 11, 40, 15, 21, 6, 20, 6, 12, 22, 8, 18, 34, 24, 22, 30, 35, 41, 6, 39, 5, 15, 19, 8, 26, 38, 11, 29, 31, 14, 37, 28, 8, 11, 28, 27, 38]]
[[28, 11, 40, 15, 21, 6, 20, 6, 12, 22, 8, 18, 34, 24, 22, 30, 35, 41, 6, 39, 5, 15, 19, 8, 26, 38, 11, 29, 31, 14, 37, 28, 8, 11, 28, 27, 38], {"40": 1, "41": 13, "8": 5, "28": 2, "21": 18, "15": 7, "5": 4, "14": 13, "37": 12, "22": 12, "29": 3, "30": 15, "35": 4, "26": 19, "39": 7, "31": 14, "11": 7, "20": 3, "6": 2, "12": 8, "27": 13, "19": 19, "34": 5, "18": 9, "38": 16, "24": 17}, 423]
["[28, 11, 40, 15, 21, 6, 20, 6, 12, 22, 8, 18, 34, 24, 22, 30, 35, 41, 6, 39, 5, 15, 19, 8, 26, 38, 11, 29, 31, 14, 37, 28, 8, 11, 28, 27, 38]", "{40: 1, 41: 13, 8: 5, 28: 2, 21: 18, 15: 7, 5: 4, 14: 13, 37: 12, 22: 12, 29: 3, 30: 15, 35: 4, 26: 19, 39: 7, 31: 14, 11: 7, 20: 3, 6: 2, 12: 8, 27: 13, 19: 19, 34: 5, 18: 9, 38: 16, 24: 17}", "423"]
69
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', 'Blue', 'Blue', 'Green', 'Blue'], ['Blue', 'Red', 'Red', 'Blue', 'Red'], ['Red', 'Red', 'Green', 'Green', 'Green']]
color_sorting
sorting
9
[[0, 2], [0, 1], [0, 1], [0, 2], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 2], [0, 1], [0, 1], [2, 0], [2, 0], [2, 0], [2, 1], [2, 1], [0, 2], [0, 2]]
19
4.277469635009766
19
6
15
[[["Green", "Blue", "Blue", "Green", "Blue"], ["Blue", "Red", "Red", "Blue", "Red"], ["Red", "Red", "Green", "Green", "Green"]], 8]
[[["Green", "Blue", "Blue", "Green", "Blue"], ["Blue", "Red", "Red", "Blue", "Red"], ["Red", "Red", "Green", "Green", "Green"]], 8]
["[['Green', 'Blue', 'Blue', 'Green', 'Blue'], ['Blue', 'Red', 'Red', 'Blue', 'Red'], ['Red', 'Red', 'Green', 'Green', 'Green']]", "8"]
69
We have a 4x4 numerical grid, with numbers ranging from 48 to 93 (48 included in the range but 93 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: [['48' '52' '56' 'x'] ['55' 'x' 'x' '71'] ['59' 'x' '74' '82'] ['x' 'x' 'x' 'x']]
consecutive_grid
underdetermined_system
13
[[0, 1, 32], [0, 2, 35], [1, 2, 34], [1, 3, 36], [2, 3, 33], [3, 0, 27], [3, 1, 11], [3, 2, 10], [3, 3, 9]]
370
7.134505748748779
9
45
16
["[['24', '', '', '53'], ['25', '31', '', ''], ['26', '29', '31', ''], ['', '', '', '']]", 9, 54]
["[['24', '', '', '53'], ['25', '31', '', ''], ['26', '29', '31', ''], ['', '', '', '']]", 9, 54]
["[['24', '', '', '53'], ['25', '31', '', ''], ['26', '29', '31', ''], ['', '', '', '']]", "9", "54"]
69
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 31 to 67. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 205, 218, None for columns 1 to 2 respectively, and the sums of rows must be None, 219, 220, 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 182. 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: [['43' '65' 'x' 'x'] ['42' 'x' '59' 'x'] ['54' '45' 'x' 'x'] ['x' 'x' 'x' '35']]
magic_square
underdetermined_system
10
[[0, 2, 32], [0, 3, 31], [1, 1, 62], [1, 3, 56], [2, 2, 66], [2, 3, 55], [3, 0, 47], [3, 1, 33], [3, 2, 61]]
786
41.5692081451416
9
26
16
["[['43', '65', '', ''], ['42', '', '59', ''], ['54', '45', '', ''], ['', '', '', '35']]", 4, 31, 67]
["[['43', '65', '', ''], ['42', '', '59', ''], ['54', '45', '', ''], ['', '', '', '35']]", 31, 67, [1, 3], [1, 3], [205, 218], [219, 220], 182]
["[['43', '65', '', ''], ['42', '', '59', ''], ['54', '45', '', ''], ['', '', '', '35']]", "31", "67", "[None, 205, 218, None]", "[None, 219, 220, None]", "182"]
69
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: 5, 1: 4, 2: 7, 3: 7, 4: 11, 5: 11, 6: 8, 7: 3, 8: 7, 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? [[], ['Blue', 'Black', 'Black', 'Yellow', 'White', 'Green'], ['Green', 'Black', 'Red', 'Green', 'Yellow', 'Blue'], [], ['Green', 'Red', 'Blue', 'Yellow', 'Green', 'Blue'], ['Black', 'White', 'White', 'Red', 'White', 'Black'], [], ['White', 'Red', 'Blue', 'Yellow', 'Yellow', 'Red'], [], []]
restricted_sorting
sorting
3
[[1, 0], [4, 3], [4, 8], [5, 6], [7, 9], [7, 8], [7, 0], [2, 3], [2, 6], [2, 8], [2, 3], [1, 6], [1, 6], [5, 9], [5, 9], [5, 8], [5, 9], [5, 6], [1, 5], [1, 9], [1, 3], [2, 1], [7, 1], [7, 1], [4, 0], [4, 1], [4, 3], [7, 8], [2, 0], [4, 0], [5, 1]]
211
0.1563878059387207
31
90
30
[[[], ["Blue", "Black", "Black", "Yellow", "White", "Green"], ["Green", "Black", "Red", "Green", "Yellow", "Blue"], [], ["Green", "Red", "Blue", "Yellow", "Green", "Blue"], ["Black", "White", "White", "Red", "White", "Black"], [], ["White", "Red", "Blue", "Yellow", "Yellow", "Red"], [], []], 6, {"0": 5, "1": 4, "2": 7, "3": 7, "4": 11, "5": 11, "6": 8, "7": 3, "8": 7, "9": 9}]
[[[], ["Blue", "Black", "Black", "Yellow", "White", "Green"], ["Green", "Black", "Red", "Green", "Yellow", "Blue"], [], ["Green", "Red", "Blue", "Yellow", "Green", "Blue"], ["Black", "White", "White", "Red", "White", "Black"], [], ["White", "Red", "Blue", "Yellow", "Yellow", "Red"], [], []], 6, {"0": 5, "1": 4, "2": 7, "3": 7, "4": 11, "5": 11, "6": 8, "7": 3, "8": 7, "9": 9}, 5]
["[[], ['Blue', 'Black', 'Black', 'Yellow', 'White', 'Green'], ['Green', 'Black', 'Red', 'Green', 'Yellow', 'Blue'], [], ['Green', 'Red', 'Blue', 'Yellow', 'Green', 'Blue'], ['Black', 'White', 'White', 'Red', 'White', 'Black'], [], ['White', 'Red', 'Blue', 'Yellow', 'Yellow', 'Red'], [], []]", "{0: 5, 1: 4, 2: 7, 3: 7, 4: 11, 5: 11, 6: 8, 7: 3, 8: 7, 9: 9}", "6", "5"]
69
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: 5, 1: 4, 2: 7, 3: 7, 4: 11, 5: 11, 6: 8, 7: 3, 8: 7, 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? [[], ['Blue', 'Black', 'Black', 'Yellow', 'White', 'Green'], ['Green', 'Black', 'Red', 'Green', 'Yellow', 'Blue'], [], ['Green', 'Red', 'Blue', 'Yellow', 'Green', 'Blue'], ['Black', 'White', 'White', 'Red', 'White', 'Black'], [], ['White', 'Red', 'Blue', 'Yellow', 'Yellow', 'Red'], [], []]
restricted_sorting
sorting
3
[[1, 0], [4, 3], [4, 8], [5, 6], [7, 9], [7, 8], [7, 0], [2, 3], [2, 6], [2, 8], [2, 3], [1, 6], [1, 6], [5, 9], [5, 9], [5, 8], [5, 9], [5, 6], [1, 5], [1, 9], [1, 3], [2, 1], [7, 1], [7, 1], [4, 0], [4, 1], [4, 3], [7, 8], [2, 0], [4, 0], [5, 1]]
211
0.1563878059387207
31
90
30
[[[], ["Blue", "Black", "Black", "Yellow", "White", "Green"], ["Green", "Black", "Red", "Green", "Yellow", "Blue"], [], ["Green", "Red", "Blue", "Yellow", "Green", "Blue"], ["Black", "White", "White", "Red", "White", "Black"], [], ["White", "Red", "Blue", "Yellow", "Yellow", "Red"], [], []], 6, {"0": 5, "1": 4, "2": 7, "3": 7, "4": 11, "5": 11, "6": 8, "7": 3, "8": 7, "9": 9}]
[[[], ["Blue", "Black", "Black", "Yellow", "White", "Green"], ["Green", "Black", "Red", "Green", "Yellow", "Blue"], [], ["Green", "Red", "Blue", "Yellow", "Green", "Blue"], ["Black", "White", "White", "Red", "White", "Black"], [], ["White", "Red", "Blue", "Yellow", "Yellow", "Red"], [], []], 6, {"0": 5, "1": 4, "2": 7, "3": 7, "4": 11, "5": 11, "6": 8, "7": 3, "8": 7, "9": 9}, 5]
["[[], ['Blue', 'Black', 'Black', 'Yellow', 'White', 'Green'], ['Green', 'Black', 'Red', 'Green', 'Yellow', 'Blue'], [], ['Green', 'Red', 'Blue', 'Yellow', 'Green', 'Blue'], ['Black', 'White', 'White', 'Red', 'White', 'Black'], [], ['White', 'Red', 'Blue', 'Yellow', 'Yellow', 'Red'], [], []]", "{0: 5, 1: 4, 2: 7, 3: 7, 4: 11, 5: 11, 6: 8, 7: 3, 8: 7, 9: 9}", "6", "5"]
69
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, 12) to his destination workshop at index (6, 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 1, district 2 covering rows 2 to 5, and district 3 covering rows 6 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. [17 x x x 5 x x 12 16 x x 5 16] [x x x x x x x x x x 12 4 6] [9 x x x x x 19 x x 13 6 11 19] [1 x x x 13 x x x 3 2 7 4 3] [x x x 14 19 20 10 13 14 2 x 9 3] [15 x 11 7 x 11 6 16 x x x 8 19] [19 16 4 8 5 5 5 11 10 17 9 x 5] [x 3 17 x x 6 17 19 x x 14 x x] [x x x x x 14 x 10 14 13 x 13 x] [15 5 4 x x x x 2 12 6 x 16 14] [10 x x x 9 x x x x x 13 2 x] [x x 17 x x x x 7 x x 16 x x] [12 10 x 15 16 x x 7 11 7 x 17 x]
traffic
pathfinding
5
[[1, 12], [1, 11], [2, 11], [3, 11], [3, 10], [3, 9], [4, 9], [4, 8], [4, 7], [4, 6], [5, 6], [6, 6], [6, 5], [6, 4], [6, 3]]
96
0.021815061569213867
15
4
4
[[["17", "x", "x", "x", "5", "x", "x", "12", "16", "x", "x", "5", "16"], ["x", "x", "x", "x", "x", "x", "x", "x", "x", "x", "12", "4", "6"], ["9", "x", "x", "x", "x", "x", "19", "x", "x", "13", "6", "11", "19"], ["1", "x", "x", "x", "13", "x", "x", "x", "3", "2", "7", "4", "3"], ["x", "x", "x", "14", "19", "20", "10", "13", "14", "2", "x", "9", "3"], ["15", "x", "11", "7", "x", "11", "6", "16", "x", "x", "x", "8", "19"], ["19", "16", "4", "8", "5", "5", "5", "11", "10", "17", "9", "x", "5"], ["x", "3", "17", "x", "x", "6", "17", "19", "x", "x", "14", "x", "x"], ["x", "x", "x", "x", "x", "14", "x", "10", "14", "13", "x", "13", "x"], ["15", "5", "4", "x", "x", "x", "x", "2", "12", "6", "x", "16", "14"], ["10", "x", "x", "x", "9", "x", "x", "x", "x", "x", "13", "2", "x"], ["x", "x", "17", "x", "x", "x", "x", "7", "x", "x", "16", "x", "x"], ["12", "10", "x", "15", "16", "x", "x", "7", "11", "7", "x", "17", "x"]]]
[[["17", "x", "x", "x", "5", "x", "x", "12", "16", "x", "x", "5", "16"], ["x", "x", "x", "x", "x", "x", "x", "x", "x", "x", "12", "4", "6"], ["9", "x", "x", "x", "x", "x", "19", "x", "x", "13", "6", "11", "19"], ["1", "x", "x", "x", "13", "x", "x", "x", "3", "2", "7", "4", "3"], ["x", "x", "x", "14", "19", "20", "10", "13", "14", "2", "x", "9", "3"], ["15", "x", "11", "7", "x", "11", "6", "16", "x", "x", "x", "8", "19"], ["19", "16", "4", "8", "5", "5", "5", "11", "10", "17", "9", "x", "5"], ["x", "3", "17", "x", "x", "6", "17", "19", "x", "x", "14", "x", "x"], ["x", "x", "x", "x", "x", "14", "x", "10", "14", "13", "x", "13", "x"], ["15", "5", "4", "x", "x", "x", "x", "2", "12", "6", "x", "16", "14"], ["10", "x", "x", "x", "9", "x", "x", "x", "x", "x", "13", "2", "x"], ["x", "x", "17", "x", "x", "x", "x", "7", "x", "x", "16", "x", "x"], ["12", "10", "x", "15", "16", "x", "x", "7", "11", "7", "x", "17", "x"]], [1, 12], [6, 3], 1, 5]
["[['17', 'x', 'x', 'x', '5', 'x', 'x', '12', '16', 'x', 'x', '5', '16'], ['x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '12', '4', '6'], ['9', 'x', 'x', 'x', 'x', 'x', '19', 'x', 'x', '13', '6', '11', '19'], ['1', 'x', 'x', 'x', '13', 'x', 'x', 'x', '3', '2', '7', '4', '3'], ['x', 'x', 'x', '14', '19', '20', '10', '13', '14', '2', 'x', '9', '3'], ['15', 'x', '11', '7', 'x', '11', '6', '16', 'x', 'x', 'x', '8', '19'], ['19', '16', '4', '8', '5', '5', '5', '11', '10', '17', '9', 'x', '5'], ['x', '3', '17', 'x', 'x', '6', '17', '19', 'x', 'x', '14', 'x', 'x'], ['x', 'x', 'x', 'x', 'x', '14', 'x', '10', '14', '13', 'x', '13', 'x'], ['15', '5', '4', 'x', 'x', 'x', 'x', '2', '12', '6', 'x', '16', '14'], ['10', 'x', 'x', 'x', '9', 'x', 'x', 'x', 'x', 'x', '13', '2', 'x'], ['x', 'x', '17', 'x', 'x', 'x', 'x', '7', 'x', 'x', '16', 'x', 'x'], ['12', '10', 'x', '15', '16', 'x', 'x', '7', '11', '7', 'x', '17', 'x']]", "(1, 12)", "(6, 3)", "1", "5"]
69
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 (12, 0) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (3, 8). What is the shortest sequence of trampolines he should jump on to reach his destination (including the first and final trampolines)? The answer should be a list of tuples, in Python syntax, indicating the row and column of each trampoline Alex jumps on. 0 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 0 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 0 1 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 0 0 0 0 1 0 1 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 1 1 0 1 1 1 0 1 1
trampoline_matrix
pathfinding
13
[[12, 0], [11, 0], [11, 1], [11, 2], [10, 3], [9, 4], [8, 5], [7, 5], [6, 6], [5, 6], [4, 6], [4, 7], [3, 7], [3, 8]]
14
0.03328585624694824
14
8
2
["[[0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0], [1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1], [1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1], [0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1], [0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1], [1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1], [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1], [0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 1,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[0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1]]", "(12, 0)", "(3, 8)", "4"]
69
Given 5 labeled water jugs with capacities 34, 98, 27, 19, 52, 53 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 257, 260, 269, 291 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
5
[["+", 27, 4], ["+", 98, 4], ["+", 98, 4], ["+", 34, 4], ["+", 34, 4], ["+", 19, 3], ["+", 98, 3], ["+", 98, 3], ["+", 27, 3], ["+", 27, 3], ["+", 98, 2], ["+", 98, 2], ["-", 34, 2], ["+", 98, 2], ["+", 98, 1], ["+", 98, 1], ["+", 27, 1], ["+", 34, 1]]
18
0.034804582595825195
18
48
3
[[34, 98, 27, 19, 52, 53], [257, 260, 269, 291]]
[[34, 98, 27, 19, 52, 53], [257, 260, 269, 291]]
["[34, 98, 27, 19, 52, 53]", "[257, 260, 269, 291]"]
70
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, 100, 92, 37, 95], [88, '_', 97, 10, 67], [32, 82, 19, 53, 4]]
8_puzzle
puzzle
5
[88, 86, 100, 88, 97, 10, 67, 95, 37, 92, 88, 97, 82, 19, 10, 67, 92, 88, 67, 92, 95, 37, 88, 95, 92, 67, 95, 92, 53, 4]
30
0.4556577205657959
30
4
15
[[[86, 100, 92, 37, 95], [88, "_", 97, 10, 67], [32, 82, 19, 53, 4]]]
[[[86, 100, 92, 37, 95], [88, "_", 97, 10, 67], [32, 82, 19, 53, 4]]]
["[[86, 100, 92, 37, 95], [88, '_', 97, 10, 67], [32, 82, 19, 53, 4]]"]
70
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: map, pahi, yeel, vial, wusp The initial board: [['a', 'm', '_', 'p'], ['p', 'e', 'h', 'a'], ['l', 'e', 'y', 'l'], ['v', 'i', 'a', 'i'], ['w', 'u', 's', 'p']]
8_puzzle_words
puzzle
2
["down-left", "down-right", "down-right", "down-left", "up-left", "up-left", "up-right", "up-right", "down-right", "down-left", "down-left", "down-right", "up-right", "up-left", "up-left", "up-left"]
16
0.2252347469329834
16
4
20
[[["a", "m", "_", "p"], ["p", "e", "h", "a"], ["l", "e", "y", "l"], ["v", "i", "a", "i"], ["w", "u", "s", "p"]]]
[[["a", "m", "_", "p"], ["p", "e", "h", "a"], ["l", "e", "y", "l"], ["v", "i", "a", "i"], ["w", "u", "s", "p"]], ["map", "pahi", "yeel", "vial", "wusp"]]
["[['a', 'm', '_', 'p'], ['p', 'e', 'h', 'a'], ['l', 'e', 'y', 'l'], ['v', 'i', 'a', 'i'], ['w', 'u', 's', 'p']]", "['map', 'pahi', 'yeel', 'vial', 'wusp']"]
70
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 'V'. Our task is to visit city E and city U 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 U and E, we can only visit each city once on our path. Provide the solution as a list of the city names on our path, including the start, in Python syntax. K I E B Y J U D L A X C F V K 0 1 0 0 0 0 0 0 0 0 0 1 0 0 I 0 0 0 0 1 0 1 1 0 0 0 0 0 0 E 0 0 0 1 1 0 0 1 0 0 1 0 0 0 B 0 0 0 0 0 0 1 0 0 0 0 0 0 0 Y 1 0 0 0 0 0 0 1 0 0 1 0 0 0 J 0 0 0 1 1 0 0 1 0 0 0 0 1 1 U 1 0 0 0 0 0 0 0 0 1 0 0 0 1 D 0 0 0 0 0 0 0 0 1 1 0 0 0 0 L 1 0 1 0 0 1 1 0 0 0 0 0 1 0 A 1 0 0 1 0 0 0 0 1 0 0 0 0 0 X 1 1 0 0 1 0 0 0 0 0 0 1 0 0 C 0 0 1 0 0 0 1 0 1 1 0 0 0 0 F 0 0 0 0 0 1 0 0 1 0 0 0 0 0 V 0 0 0 1 1 1 0 0 0 0 0 0 0 0
city_directed_graph
pathfinding
14
["V", "B", "U", "A", "L", "E", "X", "I", "U", "K", "C", "E"]
12
0.04632735252380371
12
14
17
[[[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], ["K", "I", "E", "B", "Y", "J", "U", "D", "L", "A", "X", "C", "F", "V"], "E", "U"]
[[[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], ["K", "I", "E", "B", "Y", "J", "U", "D", "L", "A", "X", "C", "F", "V"], "V", "E", "U"]
["[[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]", "['K', 'I', 'E', 'B', 'Y', 'J', 'U', 'D', 'L', 'A', 'X', 'C', 'F', 'V']", "['V']", "['E', 'U']"]
70
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [30, 28, 81, 26, 24, 20, 5, 18, 33, 19, 30, 27, 6, 10, 22, 10, 33, 10, 15, 26, 9, 6, 22, 31, 36, 16, 4, 11, 24, 7, 17, 30, 3, 7, 8, 8, 34], such that the sum of the chosen coins adds up to 387. 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 {24: 7, 22: 3, 11: 10, 28: 17, 7: 7, 20: 10, 5: 2, 8: 2, 9: 5, 15: 14, 81: 17, 30: 5, 31: 17, 33: 9, 18: 3, 36: 2, 16: 14, 10: 1, 19: 15, 3: 1, 34: 12, 26: 13, 6: 3, 4: 1, 27: 11, 17: 5}, where the tax for coins of the same value is the same. Also, if the coin chosen is smaller than the previous one, it must have an even value, otherwise, if the coin is larger than or equal to the previous coin chosen, it must have an odd value. The objective is to determine which subset of coins should be selected to minimize the total tax paid. The solution should be presented as a list of numbers, representing the value of the coins chosen in order, with the first coins chosen being in index 0, formatted in Python syntax.
coin_exchange
subset_sum
21
[36, 30, 22, 10, 33, 30, 22, 18, 10, 8, 81, 30, 10, 8, 33, 6]
71
0.055295467376708984
16
37
37
[[30, 28, 81, 26, 24, 20, 5, 18, 33, 19, 30, 27, 6, 10, 22, 10, 33, 10, 15, 26, 9, 6, 22, 31, 36, 16, 4, 11, 24, 7, 17, 30, 3, 7, 8, 8, 34]]
[[30, 28, 81, 26, 24, 20, 5, 18, 33, 19, 30, 27, 6, 10, 22, 10, 33, 10, 15, 26, 9, 6, 22, 31, 36, 16, 4, 11, 24, 7, 17, 30, 3, 7, 8, 8, 34], {"24": 7, "22": 3, "11": 10, "28": 17, "7": 7, "20": 10, "5": 2, "8": 2, "9": 5, "15": 14, "81": 17, "30": 5, "31": 17, "33": 9, "18": 3, "36": 2, "16": 14, "10": 1, "19": 15, "3": 1, "34": 12, "26": 13, "6": 3, "4": 1, "27": 11, "17": 5}, 387]
["[30, 28, 81, 26, 24, 20, 5, 18, 33, 19, 30, 27, 6, 10, 22, 10, 33, 10, 15, 26, 9, 6, 22, 31, 36, 16, 4, 11, 24, 7, 17, 30, 3, 7, 8, 8, 34]", "{24: 7, 22: 3, 11: 10, 28: 17, 7: 7, 20: 10, 5: 2, 8: 2, 9: 5, 15: 14, 81: 17, 30: 5, 31: 17, 33: 9, 18: 3, 36: 2, 16: 14, 10: 1, 19: 15, 3: 1, 34: 12, 26: 13, 6: 3, 4: 1, 27: 11, 17: 5}", "387"]
70
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', 'Green', 'Green', 'Red', 'Blue'], ['Blue', 'Blue', 'Red', 'Green', 'Red'], ['Red', 'Green', 'Blue', 'Blue', 'Red']]
color_sorting
sorting
9
[[1, 2], [1, 0], [1, 2], [1, 0], [2, 1], [2, 0], [2, 1], [0, 1], [2, 0], [2, 1], [2, 1], [2, 1], [0, 2], [0, 2], [0, 1], [0, 2], [0, 2], [0, 2], [0, 2], [1, 0], [1, 2], [1, 0], [1, 0], [1, 0], [2, 1], [2, 1]]
26
114.16396856307983
26
6
15
[[["Green", "Green", "Green", "Red", "Blue"], ["Blue", "Blue", "Red", "Green", "Red"], ["Red", "Green", "Blue", "Blue", "Red"]], 8]
[[["Green", "Green", "Green", "Red", "Blue"], ["Blue", "Blue", "Red", "Green", "Red"], ["Red", "Green", "Blue", "Blue", "Red"]], 8]
["[['Green', 'Green', 'Green', 'Red', 'Blue'], ['Blue', 'Blue', 'Red', 'Green', 'Red'], ['Red', 'Green', 'Blue', 'Blue', 'Red']]", "8"]
70
We have a 4x4 numerical grid, with numbers ranging from 12 to 57 (12 included in the range but 57 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' '47' 'x' '55'] ['29' '34' 'x' 'x'] ['16' 'x' 'x' '35'] ['x' '26' 'x' 'x']]
consecutive_grid
underdetermined_system
14
[[0, 1, 50], [0, 2, 52], [0, 3, 85], [1, 0, 48], [1, 2, 53], [2, 1, 54], [2, 2, 55], [3, 0, 44], [3, 1, 56], [3, 2, 57]]
793
8.519564151763916
10
45
16
["[['49', '', '', ''], ['', '51', '', '84'], ['47', '', '', '79'], ['', '', '', '77']]", 44, 89]
["[['49', '', '', ''], ['', '51', '', '84'], ['47', '', '', '79'], ['', '', '', '77']]", 44, 89]
["[['49', '', '', ''], ['', '51', '', '84'], ['47', '', '', '79'], ['', '', '', '77']]", "44", "89"]
70
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 28 to 64. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 156, 185, None for columns 1 to 2 respectively, and the sums of rows must be None, 152, 158, 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 165. 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: [['36' '47' 'x' 'x'] ['x' '28' '40' 'x'] ['x' '33' 'x' 'x'] ['50' 'x' 'x' 'x']]
magic_square
underdetermined_system
10
[[0, 2, 31], [0, 3, 42], [1, 0, 35], [1, 3, 49], [2, 0, 30], [2, 2, 63], [2, 3, 32], [3, 1, 48], [3, 2, 51], [3, 3, 29]]
644
107.55870532989502
10
26
16
["[['36', '47', '', ''], ['', '28', '40', ''], ['', '33', '', ''], ['50', '', '', '']]", 4, 28, 64]
["[['36', '47', '', ''], ['', '28', '40', ''], ['', '33', '', ''], ['50', '', '', '']]", 28, 64, [1, 3], [1, 3], [156, 185], [152, 158], 165]
["[['36', '47', '', ''], ['', '28', '40', ''], ['', '33', '', ''], ['50', '', '', '']]", "28", "64", "[None, 156, 185, None]", "[None, 152, 158, None]", "165"]
70
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: 11, 1: 5, 2: 9, 3: 5, 4: 2, 5: 2, 6: 6, 7: 6, 8: 6, 9: 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', 'Green', 'Blue', 'Yellow', 'Yellow', 'Blue'], [], [], [], ['White', 'Black', 'White', 'Red', 'White', 'Blue'], ['Black', 'Green', 'Red', 'Black', 'Green', 'Yellow'], [], ['Red', 'White', 'Yellow', 'Black', 'Green', 'White'], [], ['Blue', 'Blue', 'Black', 'Green', 'Red', 'Yellow']]
restricted_sorting
sorting
3
[[0, 1], [0, 3], [7, 1], [0, 6], [5, 8], [5, 3], [5, 1], [5, 8], [5, 3], [9, 6], [9, 6], [9, 8], [9, 3], [9, 1], [5, 9], [7, 5], [7, 9], [7, 8], [7, 3], [4, 5], [4, 8], [4, 5], [4, 1], [4, 5], [0, 9], [0, 9], [0, 4], [6, 4], [6, 4], [6, 4], [7, 5]]
124
0.2532999515533447
31
90
30
[[["Red", "Green", "Blue", "Yellow", "Yellow", "Blue"], [], [], [], ["White", "Black", "White", "Red", "White", "Blue"], ["Black", "Green", "Red", "Black", "Green", "Yellow"], [], ["Red", "White", "Yellow", "Black", "Green", "White"], [], ["Blue", "Blue", "Black", "Green", "Red", "Yellow"]], 6, {"0": 11, "1": 5, "2": 9, "3": 5, "4": 2, "5": 2, "6": 6, "7": 6, "8": 6, "9": 2}]
[[["Red", "Green", "Blue", "Yellow", "Yellow", "Blue"], [], [], [], ["White", "Black", "White", "Red", "White", "Blue"], ["Black", "Green", "Red", "Black", "Green", "Yellow"], [], ["Red", "White", "Yellow", "Black", "Green", "White"], [], ["Blue", "Blue", "Black", "Green", "Red", "Yellow"]], 6, {"0": 11, "1": 5, "2": 9, "3": 5, "4": 2, "5": 2, "6": 6, "7": 6, "8": 6, "9": 2}, 5]
["[['Red', 'Green', 'Blue', 'Yellow', 'Yellow', 'Blue'], [], [], [], ['White', 'Black', 'White', 'Red', 'White', 'Blue'], ['Black', 'Green', 'Red', 'Black', 'Green', 'Yellow'], [], ['Red', 'White', 'Yellow', 'Black', 'Green', 'White'], [], ['Blue', 'Blue', 'Black', 'Green', 'Red', 'Yellow']]", "{0: 11, 1: 5, 2: 9, 3: 5, 4: 2, 5: 2, 6: 6, 7: 6, 8: 6, 9: 2}", "6", "5"]
70
Using the provided matrix map of a city, where numbers represent travel time in minutes (all numbers are positive integers) and 'x' marks closed workshops, find the quickest route for Ben to travel from his current workshop at index (5, 1) to his destination workshop at index (2, 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 1, district 2 covering rows 2 to 5, and district 3 covering rows 6 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. [13 x 10 17 x 4 8 x 7 x 12 19 4] [17 x 8 11 7 x x 19 x 11 x 13 18] [15 6 2 12 16 7 x 14 x 2 x 14 4] [x 18 4 x x x 13 14 2 4 20 10 7] [7 2 19 16 x x x 18 x x x 2 2] [10 17 14 7 17 3 3 19 x 19 x x 9] [9 x x x 5 18 13 6 x x x 19 10] [x x x x x 2 7 4 x x x x x] [x x 6 3 x 1 x x 14 x 18 x 1] [14 x 4 18 14 12 x x x x 2 x 13] [12 x 3 1 12 9 x 6 x x 16 x 18] [13 x 11 5 3 4 x x x x x x 18] [15 9 9 1 x 6 x x 14 x x 1 14]
traffic
pathfinding
5
[[5, 1], [5, 2], [5, 3], [5, 4], [5, 5], [5, 6], [6, 6], [5, 6], [5, 7], [4, 7], [3, 7], [3, 8], [3, 9], [2, 9], [1, 9], [2, 9], [3, 9], [3, 10], [3, 11], [2, 11]]
180
0.020688772201538086
20
4
4
[[["13", "x", "10", "17", "x", "4", "8", "x", "7", "x", "12", "19", "4"], ["17", "x", "8", "11", "7", "x", "x", "19", "x", "11", "x", "13", "18"], ["15", "6", "2", "12", "16", "7", "x", "14", "x", "2", "x", "14", "4"], ["x", "18", "4", "x", "x", "x", "13", "14", "2", "4", "20", "10", "7"], ["7", "2", "19", "16", "x", "x", "x", "18", "x", "x", "x", "2", "2"], ["10", "17", "14", "7", "17", "3", "3", "19", "x", "19", "x", "x", "9"], ["9", "x", "x", "x", "5", "18", "13", "6", "x", "x", "x", "19", "10"], ["x", "x", "x", "x", "x", "2", "7", "4", "x", "x", "x", "x", "x"], ["x", "x", "6", "3", "x", "1", "x", "x", "14", "x", "18", "x", "1"], ["14", "x", "4", "18", "14", "12", "x", "x", "x", "x", "2", "x", "13"], ["12", "x", "3", "1", "12", "9", "x", "6", "x", "x", "16", "x", "18"], ["13", "x", "11", "5", "3", "4", "x", "x", "x", "x", "x", "x", "18"], ["15", "9", "9", "1", "x", "6", "x", "x", "14", "x", "x", "1", "14"]]]
[[["13", "x", "10", "17", "x", "4", "8", "x", "7", "x", "12", "19", "4"], ["17", "x", "8", "11", "7", "x", "x", "19", "x", "11", "x", "13", "18"], ["15", "6", "2", "12", "16", "7", "x", "14", "x", "2", "x", "14", "4"], ["x", "18", "4", "x", "x", "x", "13", "14", "2", "4", "20", "10", "7"], ["7", "2", "19", "16", "x", "x", "x", "18", "x", "x", "x", "2", "2"], ["10", "17", "14", "7", "17", "3", "3", "19", "x", "19", "x", "x", "9"], ["9", "x", "x", "x", "5", "18", "13", "6", "x", "x", "x", "19", "10"], ["x", "x", "x", "x", "x", "2", "7", "4", "x", "x", "x", "x", "x"], ["x", "x", "6", "3", "x", "1", "x", "x", "14", "x", "18", "x", "1"], ["14", "x", "4", "18", "14", "12", "x", "x", "x", "x", "2", "x", "13"], ["12", "x", "3", "1", "12", "9", "x", "6", "x", "x", "16", "x", "18"], ["13", "x", "11", "5", "3", "4", "x", "x", "x", "x", "x", "x", "18"], ["15", "9", "9", "1", "x", "6", "x", "x", "14", "x", "x", "1", "14"]], [5, 1], [2, 11], 1, 5]
["[['13', 'x', '10', '17', 'x', '4', '8', 'x', '7', 'x', '12', '19', '4'], ['17', 'x', '8', '11', '7', 'x', 'x', '19', 'x', '11', 'x', '13', '18'], ['15', '6', '2', '12', '16', '7', 'x', '14', 'x', '2', 'x', '14', '4'], ['x', '18', '4', 'x', 'x', 'x', '13', '14', '2', '4', '20', '10', '7'], ['7', '2', '19', '16', 'x', 'x', 'x', '18', 'x', 'x', 'x', '2', '2'], ['10', '17', '14', '7', '17', '3', '3', '19', 'x', '19', 'x', 'x', '9'], ['9', 'x', 'x', 'x', '5', '18', '13', '6', 'x', 'x', 'x', '19', '10'], ['x', 'x', 'x', 'x', 'x', '2', '7', '4', 'x', 'x', 'x', 'x', 'x'], ['x', 'x', '6', '3', 'x', '1', 'x', 'x', '14', 'x', '18', 'x', '1'], ['14', 'x', '4', '18', '14', '12', 'x', 'x', 'x', 'x', '2', 'x', '13'], ['12', 'x', '3', '1', '12', '9', 'x', '6', 'x', 'x', '16', 'x', '18'], ['13', 'x', '11', '5', '3', '4', 'x', 'x', 'x', 'x', 'x', 'x', '18'], ['15', '9', '9', '1', 'x', '6', 'x', 'x', '14', 'x', 'x', '1', '14']]", "(5, 1)", "(2, 11)", "1", "5"]
70
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, 8) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (10, 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 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 1 0 1 1 1 1 1 0 0 1 0 0 1 0 0 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 1 0 1 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 1 1 0 1 0 0 1 1 0 1 1 0 0 1 1 1 1 1 0 1 0 1 0 0 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 1 1 1 0 0 1 1 1 0 0 1 1 0 1 1 1 1 1 1 0 1 0
trampoline_matrix
pathfinding
13
[[1, 8], [2, 7], [1, 6], [1, 5], [2, 5], [2, 4], [3, 3], [4, 3], [5, 3], [6, 3], [7, 3], [7, 2], [8, 2], [9, 1], [9, 0], [10, 0]]
16
0.026613712310791016
16
8
2
["[[1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1], [1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1], [1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1], [1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0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, 1, 1, 0, 0, 0, 0, 0], [1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0], [1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1], [0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0], [0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0]]", "(1, 8)", "(10, 0)", "4"]
70
Given 5 labeled water jugs with capacities 44, 128, 127, 85, 40, 125 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 283, 295, 428, 428 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
5
[["+", 44, 4], ["+", 128, 4], ["+", 128, 4], ["+", 128, 4], ["+", 44, 3], ["+", 128, 3], ["+", 128, 3], ["+", 128, 3], ["+", 127, 2], ["+", 128, 2], ["+", 40, 2], ["+", 40, 1], ["+", 40, 1], ["+", 40, 1], ["+", 40, 1], ["+", 40, 1], ["-", 44, 1], ["+", 127, 1]]
18
0.03569626808166504
18
48
3
[[44, 128, 127, 85, 40, 125], [283, 295, 428, 428]]
[[44, 128, 127, 85, 40, 125], [283, 295, 428, 428]]
["[44, 128, 127, 85, 40, 125]", "[283, 295, 428, 428]"]
71
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: [[91, 86, 16, 48, 81], [13, 89, 5, '_', 58], [54, 22, 36, 37, 31]]
8_puzzle
puzzle
5
[37, 36, 5, 16, 86, 89, 13, 54, 22, 13, 16, 37, 48, 86, 37, 48, 36, 5, 13, 16, 48, 37, 86, 81, 58, 31]
26
0.15856218338012695
26
4
15
[[[91, 86, 16, 48, 81], [13, 89, 5, "_", 58], [54, 22, 36, 37, 31]]]
[[[91, 86, 16, 48, 81], [13, 89, 5, "_", 58], [54, 22, 36, 37, 31]]]
["[[91, 86, 16, 48, 81], [13, 89, 5, '_', 58], [54, 22, 36, 37, 31]]"]
71
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: nab, gull, book, talc, flob The initial board: [['u', 'n', 'a', 'b'], ['g', 'b', 'l', 'l'], ['a', 'o', '_', 'k'], ['t', 'o', 'l', 'c'], ['f', 'l', 'o', 'b']]
8_puzzle_words
puzzle
2
["down-left", "up-left", "up-right", "up-left"]
4
0.1806783676147461
4
4
20
[[["u", "n", "a", "b"], ["g", "b", "l", "l"], ["a", "o", "_", "k"], ["t", "o", "l", "c"], ["f", "l", "o", "b"]]]
[[["u", "n", "a", "b"], ["g", "b", "l", "l"], ["a", "o", "_", "k"], ["t", "o", "l", "c"], ["f", "l", "o", "b"]], ["nab", "gull", "book", "talc", "flob"]]
["[['u', 'n', 'a', 'b'], ['g', 'b', 'l', 'l'], ['a', 'o', '_', 'k'], ['t', 'o', 'l', 'c'], ['f', 'l', 'o', 'b']]", "['nab', 'gull', 'book', 'talc', 'flob']"]
71
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 'K'. Our task is to visit city F 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 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. E V G W U F S H K B Z N L J E 0 1 0 0 0 1 0 0 0 1 0 0 0 1 V 0 0 1 0 0 0 0 0 0 0 0 0 0 1 G 0 0 0 0 1 1 0 0 0 0 0 1 0 0 W 1 1 0 0 1 1 0 0 0 1 0 0 0 0 U 1 1 0 0 0 1 0 0 0 0 0 0 0 0 F 0 0 0 1 0 0 0 1 0 1 0 1 1 0 S 0 0 1 0 0 0 0 1 0 1 0 0 1 0 H 1 0 0 0 0 0 0 0 0 0 0 0 0 1 K 1 1 1 0 0 0 1 0 0 0 0 0 0 0 B 0 0 0 0 0 0 0 1 1 0 0 1 0 0 Z 0 1 1 0 0 0 1 1 0 0 0 1 0 1 N 0 1 0 0 0 0 1 0 1 0 1 0 1 0 L 0 1 0 1 0 0 0 0 0 0 0 0 0 1 J 0 0 0 0 0 0 0 0 0 0 1 0 0 0
city_directed_graph
pathfinding
14
["K", "E", "F", "N", "Z", "J", "Z", "G", "F"]
9
0.031167984008789062
9
14
17
[[[0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0], [1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 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], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0]], ["E", "V", "G", "W", "U", "F", "S", "H", "K", "B", "Z", "N", "L", "J"], "K", "F", "Z"]
["[[0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0], [1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0], [1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0], [0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0], [0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1], [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0]]", "['E', 'V', 'G', 'W', 'U', 'F', 'S', 'H', 'K', 'B', 'Z', 'N', 'L', 'J']", "['K']", "['F', 'Z']"]
71
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [18, 11, 14, 3, 7, 18, 40, 3, 35, 30, 24, 29, 34, 11, 17, 14, 14, 10, 5, 40, 4, 31, 25, 14, 39, 12, 26, 24, 3, 8, 34, 2, 22, 189, 40], such that the sum of the chosen coins adds up to 400. 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 {29: 9, 40: 8, 30: 5, 17: 16, 3: 3, 5: 3, 2: 2, 22: 17, 11: 1, 14: 4, 8: 5, 18: 11, 26: 8, 39: 15, 7: 1, 31: 2, 24: 17, 189: 5, 12: 4, 25: 10, 35: 18, 10: 1, 4: 3, 34: 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
22
[7, 11, 11, 31, 30, 14, 189, 40, 14, 10, 29, 14]
45
0.04481005668640137
12
35
35
[[18, 11, 14, 3, 7, 18, 40, 3, 35, 30, 24, 29, 34, 11, 17, 14, 14, 10, 5, 40, 4, 31, 25, 14, 39, 12, 26, 24, 3, 8, 34, 2, 22, 189, 40]]
[[18, 11, 14, 3, 7, 18, 40, 3, 35, 30, 24, 29, 34, 11, 17, 14, 14, 10, 5, 40, 4, 31, 25, 14, 39, 12, 26, 24, 3, 8, 34, 2, 22, 189, 40], {"29": 9, "40": 8, "30": 5, "17": 16, "3": 3, "5": 3, "2": 2, "22": 17, "11": 1, "14": 4, "8": 5, "18": 11, "26": 8, "39": 15, "7": 1, "31": 2, "24": 17, "189": 5, "12": 4, "25": 10, "35": 18, "10": 1, "4": 3, "34": 16}, 400]
["[18, 11, 14, 3, 7, 18, 40, 3, 35, 30, 24, 29, 34, 11, 17, 14, 14, 10, 5, 40, 4, 31, 25, 14, 39, 12, 26, 24, 3, 8, 34, 2, 22, 189, 40]", "{29: 9, 40: 8, 30: 5, 17: 16, 3: 3, 5: 3, 2: 2, 22: 17, 11: 1, 14: 4, 8: 5, 18: 11, 26: 8, 39: 15, 7: 1, 31: 2, 24: 17, 189: 5, 12: 4, 25: 10, 35: 18, 10: 1, 4: 3, 34: 16}", "400"]
71
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', 'Blue', 'Blue', 'Blue', 'Green'], ['Red', 'Green', 'Green', 'Red', 'Green'], ['Red', 'Red', 'Blue', 'Green', 'Blue']]
color_sorting
sorting
9
[[0, 2], [1, 2], [0, 1], [0, 1], [0, 1], [0, 1], [2, 0], [2, 0], [2, 0], [2, 0], [1, 0], [2, 1], [2, 0], [1, 2], [1, 2], [1, 2], [1, 2], [1, 0], [1, 0], [1, 2], [0, 1], [0, 1], [0, 1], [0, 1], [2, 0]]
25
59.01675891876221
25
6
15
[[["Red", "Blue", "Blue", "Blue", "Green"], ["Red", "Green", "Green", "Red", "Green"], ["Red", "Red", "Blue", "Green", "Blue"]], 8]
[[["Red", "Blue", "Blue", "Blue", "Green"], ["Red", "Green", "Green", "Red", "Green"], ["Red", "Red", "Blue", "Green", "Blue"]], 8]
["[['Red', 'Blue', 'Blue', 'Blue', 'Green'], ['Red', 'Green', 'Green', 'Red', 'Green'], ['Red', 'Red', 'Blue', 'Green', 'Blue']]", "8"]
71
We have a 4x4 numerical grid, with numbers ranging from 25 to 70 (25 included in the range but 70 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' '40' 'x' '65'] ['34' 'x' '53' 'x'] ['x' 'x' 'x' '63'] ['x' '56' 'x' '62']]
consecutive_grid
underdetermined_system
14
[[0, 0, 28], [1, 0, 29], [1, 1, 55], [1, 3, 73], [2, 3, 75], [3, 3, 77]]
734
0.5243852138519287
6
45
16
["[['', '53', '60', '67'], ['', '', '72', ''], ['50', '56', '74', ''], ['54', '65', '76', '']]", 28, 78]
["[['', '53', '60', '67'], ['', '', '72', ''], ['50', '56', '74', ''], ['54', '65', '76', '']]", 28, 78]
["[['', '53', '60', '67'], ['', '', '72', ''], ['50', '56', '74', ''], ['54', '65', '76', '']]", "28", "78"]
71
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 28 to 64. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 218, 203, None for columns 1 to 2 respectively, and the sums of rows must be None, 186, 174, 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 221. 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: [['55' 'x' '53' 'x'] ['x' '50' '52' 'x'] ['x' 'x' 'x' '35'] ['x' '62' 'x' 'x']]
magic_square
underdetermined_system
10
[[0, 1, 43], [0, 3, 45], [1, 0, 30], [1, 3, 54], [2, 0, 29], [2, 1, 63], [2, 2, 47], [3, 0, 61], [3, 2, 51], [3, 3, 28]]
758
77.56224489212036
10
26
16
["[['55', '', '53', ''], ['', '50', '52', ''], ['', '', '', '35'], ['', '62', '', '']]", 4, 28, 64]
["[['55', '', '53', ''], ['', '50', '52', ''], ['', '', '', '35'], ['', '62', '', '']]", 28, 64, [1, 3], [1, 3], [218, 203], [186, 174], 221]
["[['55', '', '53', ''], ['', '50', '52', ''], ['', '', '', '35'], ['', '62', '', '']]", "28", "64", "[None, 218, 203, None]", "[None, 186, 174, None]", "221"]
71
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: 4, 1: 1, 2: 1, 3: 9, 4: 2, 5: 9, 6: 1, 7: 9, 8: 6, 9: 4}, 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', 'Yellow', 'Yellow', 'Green', 'Blue', 'Green'], ['Red', 'Yellow', 'White', 'Blue', 'Black', 'Black'], ['Black', 'Red', 'Blue', 'Black', 'Green', 'Green'], ['Green', 'Black', 'Yellow', 'Red', 'White', 'Red'], ['White', 'Blue', 'Red', 'Blue', 'White', 'Yellow'], [], [], []]
restricted_sorting
sorting
3
[[2, 8], [6, 8], [3, 0], [6, 9], [6, 0], [6, 9], [6, 8], [3, 6], [3, 8], [4, 1], [4, 0], [4, 9], [4, 1], [5, 4], [5, 1], [5, 6], [5, 0], [5, 8], [3, 9], [5, 0], [2, 6], [2, 6], [2, 4], [2, 9], [2, 4], [3, 1], [3, 1]]
85
78.48496198654175
27
90
30
[[[], [], ["White", "Yellow", "Yellow", "Green", "Blue", "Green"], ["Red", "Yellow", "White", "Blue", "Black", "Black"], ["Black", "Red", "Blue", "Black", "Green", "Green"], ["Green", "Black", "Yellow", "Red", "White", "Red"], ["White", "Blue", "Red", "Blue", "White", "Yellow"], [], [], []], 6, {"0": 4, "1": 1, "2": 1, "3": 9, "4": 2, "5": 9, "6": 1, "7": 9, "8": 6, "9": 4}]
[[[], [], ["White", "Yellow", "Yellow", "Green", "Blue", "Green"], ["Red", "Yellow", "White", "Blue", "Black", "Black"], ["Black", "Red", "Blue", "Black", "Green", "Green"], ["Green", "Black", "Yellow", "Red", "White", "Red"], ["White", "Blue", "Red", "Blue", "White", "Yellow"], [], [], []], 6, {"0": 4, "1": 1, "2": 1, "3": 9, "4": 2, "5": 9, "6": 1, "7": 9, "8": 6, "9": 4}, 5]
["[[], [], ['White', 'Yellow', 'Yellow', 'Green', 'Blue', 'Green'], ['Red', 'Yellow', 'White', 'Blue', 'Black', 'Black'], ['Black', 'Red', 'Blue', 'Black', 'Green', 'Green'], ['Green', 'Black', 'Yellow', 'Red', 'White', 'Red'], ['White', 'Blue', 'Red', 'Blue', 'White', 'Yellow'], [], [], []]", "{0: 4, 1: 1, 2: 1, 3: 9, 4: 2, 5: 9, 6: 1, 7: 9, 8: 6, 9: 4}", "6", "5"]
71
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, 12) to his destination workshop at index (4, 1), indexing from 0. Ben's car can move north, south, east, or west from a given crossroad, provided there's no x in that direction. Also, there are 3 districts in the city with district 1 covering rows 0 to 4, district 2 covering rows 5 to 5, and district 3 covering rows 6 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 12 x x x 5 9 14 6 x 3 14 x] [x x 3 x 11 x 13 x x x x 9 8] [x 18 x x x 13 4 5 x x x 13 x] [10 4 x x x x x 18 x 15 x x x] [x 1 7 x 7 6 x 3 x 2 x x 5] [x 15 5 x x 10 x 19 x x x 10 6] [x 18 1 2 x 7 16 19 x x 10 8 8] [8 x x 6 2 x x x 7 11 5 11 2] [x 4 1 1 5 12 3 6 2 1 x 3 8] [x x 5 5 14 15 7 x x 11 x 7 9] [x 6 12 16 17 x x 4 x 19 9 5 x] [12 x 4 x 8 4 x 5 x x x 5 x] [x 5 x x x x x 7 x x 11 x x]
traffic
pathfinding
5
[[6, 12], [7, 12], [7, 11], [7, 10], [7, 9], [8, 9], [8, 8], [8, 7], [8, 6], [8, 5], [8, 4], [8, 3], [7, 3], [6, 3], [6, 2], [5, 2], [4, 2], [4, 1]]
81
0.021131515502929688
18
4
4
[[["x", "12", "x", "x", "x", "5", "9", "14", "6", "x", "3", "14", "x"], ["x", "x", "3", "x", "11", "x", "13", "x", "x", "x", "x", "9", "8"], ["x", "18", "x", "x", "x", "13", "4", "5", "x", "x", "x", "13", "x"], ["10", "4", "x", "x", "x", "x", "x", "18", "x", "15", "x", "x", "x"], ["x", "1", "7", "x", "7", "6", "x", "3", "x", "2", "x", "x", "5"], ["x", "15", "5", "x", "x", "10", "x", "19", "x", "x", "x", "10", "6"], ["x", "18", "1", "2", "x", "7", "16", "19", "x", "x", "10", "8", "8"], ["8", "x", "x", "6", "2", "x", "x", "x", "7", "11", "5", "11", "2"], ["x", "4", "1", "1", "5", "12", "3", "6", "2", "1", "x", "3", "8"], ["x", "x", "5", "5", "14", "15", "7", "x", "x", "11", "x", "7", "9"], ["x", "6", "12", "16", "17", "x", "x", "4", "x", "19", "9", "5", "x"], ["12", "x", "4", "x", "8", "4", "x", "5", "x", "x", "x", "5", "x"], ["x", "5", "x", "x", "x", "x", "x", "7", "x", "x", "11", "x", "x"]]]
[[["x", "12", "x", "x", "x", "5", "9", "14", "6", "x", "3", "14", "x"], ["x", "x", "3", "x", "11", "x", "13", "x", "x", "x", "x", "9", "8"], ["x", "18", "x", "x", "x", "13", "4", "5", "x", "x", "x", "13", "x"], ["10", "4", "x", "x", "x", "x", "x", "18", "x", "15", "x", "x", "x"], ["x", "1", "7", "x", "7", "6", "x", "3", "x", "2", "x", "x", "5"], ["x", "15", "5", "x", "x", "10", "x", "19", "x", "x", "x", "10", "6"], ["x", "18", "1", "2", "x", "7", "16", "19", "x", "x", "10", "8", "8"], ["8", "x", "x", "6", "2", "x", "x", "x", "7", "11", "5", "11", "2"], ["x", "4", "1", "1", "5", "12", "3", "6", "2", "1", "x", "3", "8"], ["x", "x", "5", "5", "14", "15", "7", "x", "x", "11", "x", "7", "9"], ["x", "6", "12", "16", "17", "x", "x", "4", "x", "19", "9", "5", "x"], ["12", "x", "4", "x", "8", "4", "x", "5", "x", "x", "x", "5", "x"], ["x", "5", "x", "x", "x", "x", "x", "7", "x", "x", "11", "x", "x"]], [6, 12], [4, 1], 4, 5]
["[['x', '12', 'x', 'x', 'x', '5', '9', '14', '6', 'x', '3', '14', 'x'], ['x', 'x', '3', 'x', '11', 'x', '13', 'x', 'x', 'x', 'x', '9', '8'], ['x', '18', 'x', 'x', 'x', '13', '4', '5', 'x', 'x', 'x', '13', 'x'], ['10', '4', 'x', 'x', 'x', 'x', 'x', '18', 'x', '15', 'x', 'x', 'x'], ['x', '1', '7', 'x', '7', '6', 'x', '3', 'x', '2', 'x', 'x', '5'], ['x', '15', '5', 'x', 'x', '10', 'x', '19', 'x', 'x', 'x', '10', '6'], ['x', '18', '1', '2', 'x', '7', '16', '19', 'x', 'x', '10', '8', '8'], ['8', 'x', 'x', '6', '2', 'x', 'x', 'x', '7', '11', '5', '11', '2'], ['x', '4', '1', '1', '5', '12', '3', '6', '2', '1', 'x', '3', '8'], ['x', 'x', '5', '5', '14', '15', '7', 'x', 'x', '11', 'x', '7', '9'], ['x', '6', '12', '16', '17', 'x', 'x', '4', 'x', '19', '9', '5', 'x'], ['12', 'x', '4', 'x', '8', '4', 'x', '5', 'x', 'x', 'x', '5', 'x'], ['x', '5', 'x', 'x', 'x', 'x', 'x', '7', 'x', 'x', '11', 'x', 'x']]", "(6, 12)", "(4, 1)", "4", "5"]
71
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 (12, 0) (positions are counted from 0, left to right, top to bottom) and wants to reach the trampoline at position (1, 6). What is the shortest sequence of trampolines he should jump on to reach his destination (including the first and final trampolines)? The answer should be a list of tuples, in Python syntax, indicating the row and column of each trampoline Alex jumps on. 1 1 1 1 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0 1 0 0 1 0 1 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1 0 0 1 0 0 1 0 1 1 0 0 1 1 1 1 1 0 1 0 0 1 0 1 1 0 1 1 1 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 0 1 1 0 1 0
trampoline_matrix
pathfinding
13
[[12, 0], [11, 0], [10, 1], [9, 2], [8, 3], [8, 4], [8, 5], [7, 6], [6, 6], [5, 6], [4, 6], [3, 6], [2, 6], [1, 6]]
14
0.024829626083374023
14
8
2
["[[1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1], [1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1], [1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0], [0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0], [1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1], [1, 0, 1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, 1, 0, 1], [1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1], [0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1], [0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0], [0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0]]", "(12, 0)", "(1, 6)", "4"]
71
Given 5 labeled water jugs with capacities 141, 92, 12, 77, 49, 140 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 304, 333, 349, 413 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
5
[["+", 77, 4], ["+", 92, 4], ["+", 92, 4], ["+", 140, 4], ["+", 12, 4], ["+", 12, 3], ["+", 92, 3], ["+", 92, 3], ["+", 12, 3], ["+", 141, 3], ["+", 77, 2], ["+", 140, 2], ["+", 12, 2], ["+", 12, 2], ["+", 92, 2], ["+", 12, 1], ["+", 140, 1], ["+", 140, 1], ["+", 12, 1]]
19
0.04270505905151367
19
48
3
[[141, 92, 12, 77, 49, 140], [304, 333, 349, 413]]
[[141, 92, 12, 77, 49, 140], [304, 333, 349, 413]]
["[141, 92, 12, 77, 49, 140]", "[304, 333, 349, 413]"]
72
In the 8-puzzle game, you are given a grid with numbered square tiles arranged randomly and one tile missing. The goal is to arrange the tiles in descending order by sliding them into the empty space. The tiles can move in 4 directions: left, right, up, and down. Given the initial state of the puzzle below, where the empty spot is represented as “_”, provide the shortest list of tiles that need to be swapped with the empty spot to achieve the goal state. The goal state is when all tiles are in descending order, with the largest number in the top left corner, and the empty spot is in the bottom right corner. The solution should be a list of numbers in Python format, where each number represents the number on the tile that the empty spot is swapped with at each turn. Initial state of the puzzle: [['_', 92, 90, 50, 40], [52, 39, 31, 83, 16], [36, 56, 51, 70, 49]]
8_puzzle
puzzle
5
[52, 39, 56, 51, 31, 56, 51, 36, 39, 52, 92, 90, 50, 83, 56, 50, 83, 56, 70, 49, 16, 40, 56, 70, 49, 16]
26
0.03201866149902344
26
4
15
[[["_", 92, 90, 50, 40], [52, 39, 31, 83, 16], [36, 56, 51, 70, 49]]]
[[["_", 92, 90, 50, 40], [52, 39, 31, 83, 16], [36, 56, 51, 70, 49]]]
["[['_', 92, 90, 50, 40], [52, 39, 31, 83, 16], [36, 56, 51, 70, 49]]"]
72
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: lit, poor, kirk, cake, slam The initial board: [['o', 'l', '_', 't'], ['p', 'r', 'o', 'a'], ['e', 'i', 'k', 'k'], ['c', 'i', 'k', 'a'], ['s', 'l', 'r', 'm']]
8_puzzle_words
puzzle
2
["down-right", "down-left", "down-left", "up-left", "up-right", "up-right", "down-right", "down-left", "down-left", "down-right", "up-right", "up-left", "down-left", "up-left", "up-right", "up-right", "down-right", "down-left", "down-left", "up-left", "up-right", "up-left"]
22
0.3410513401031494
22
4
20
[[["o", "l", "_", "t"], ["p", "r", "o", "a"], ["e", "i", "k", "k"], ["c", "i", "k", "a"], ["s", "l", "r", "m"]]]
[[["o", "l", "_", "t"], ["p", "r", "o", "a"], ["e", "i", "k", "k"], ["c", "i", "k", "a"], ["s", "l", "r", "m"]], ["lit", "poor", "kirk", "cake", "slam"]]
["[['o', 'l', '_', 't'], ['p', 'r', 'o', 'a'], ['e', 'i', 'k', 'k'], ['c', 'i', 'k', 'a'], ['s', 'l', 'r', 'm']]", "['lit', 'poor', 'kirk', 'cake', 'slam']"]
72
We have a map of cities, each represented by a letter, and they are connected by one-way roads. The adjacency matrix below shows the connections between the cities. Each row and column represents a city, and a '1' signifies a direct road from the city of the row to the city of the column. The travel time between any two directly connected cities is the same. Currently, we are located in city 'Q'. Our task is to visit city M 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 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. F Z M Q I V L C J D N E B O F 0 1 1 1 0 0 0 0 1 0 1 0 0 0 Z 0 0 0 1 0 0 0 0 0 0 0 1 0 1 M 0 1 0 0 0 0 0 1 1 0 1 1 1 0 Q 0 0 0 0 0 0 0 1 0 1 0 0 0 0 I 0 0 0 0 0 0 1 0 0 1 0 0 0 0 V 1 0 0 0 0 0 0 0 0 1 0 0 0 0 L 0 1 0 1 0 1 0 0 0 0 0 0 0 0 C 1 1 0 0 0 0 0 0 1 1 0 0 1 0 J 0 1 0 1 0 0 1 0 0 1 0 0 1 1 D 1 0 1 0 0 1 0 0 0 0 1 0 0 0 N 0 0 0 0 1 1 1 0 0 0 0 1 0 0 E 0 0 0 0 1 1 1 1 0 0 0 0 0 0 B 1 1 1 1 1 0 1 0 0 0 1 1 0 0 O 0 0 1 0 0 1 1 0 0 1 0 0 0 0
city_directed_graph
pathfinding
14
["Q", "D", "M", "B", "L", "V", "F", "M", "E", "L"]
10
0.07921767234802246
10
14
17
[[[0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0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 0, 1, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0], [0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0]], ["F", "Z", "M", "Q", "I", "V", "L", "C", "J", "D", "N", "E", "B", "O"], "Q", "M", "L"]
["[[0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1], [0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0], [0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1], [1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0], [0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0]]", "['F', 'Z', 'M', 'Q', 'I', 'V', 'L', 'C', 'J', 'D', 'N', 'E', 'B', 'O']", "['Q']", "['M', 'L']"]
72
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [13, 3, 34, 36, 19, 31, 6, 7, 10, 24, 92, 3, 24, 33, 33, 22, 93, 13, 17, 28, 25, 16, 21, 16, 20, 26, 24, 16, 11, 18, 2, 30, 25, 23, 28, 21], such that the sum of the chosen coins adds up to 384. 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: 1, 23: 1, 34: 8, 17: 14, 20: 16, 11: 5, 28: 7, 13: 3, 22: 19, 16: 4, 26: 20, 93: 7, 31: 11, 6: 2, 36: 12, 33: 15, 18: 1, 19: 2, 7: 7, 21: 7, 10: 9, 24: 11, 30: 4, 25: 7, 2: 2, 92: 19}, where the tax for coins of the same value is the same. Also, if the coin chosen is smaller than the previous one, it must have an even value, otherwise, if the coin is larger than or equal to the previous coin chosen, it must have an odd value. The objective is to determine which subset of coins should be selected to minimize the total tax paid. The solution should be presented as a list of numbers, representing the value of the coins chosen in order, with the first coins chosen being in index 0, formatted in Python syntax.
coin_exchange
subset_sum
23
[18, 19, 16, 23, 93, 92, 34, 30, 28, 6, 25]
62
0.052675724029541016
11
36
36
[[13, 3, 34, 36, 19, 31, 6, 7, 10, 24, 92, 3, 24, 33, 33, 22, 93, 13, 17, 28, 25, 16, 21, 16, 20, 26, 24, 16, 11, 18, 2, 30, 25, 23, 28, 21]]
[[13, 3, 34, 36, 19, 31, 6, 7, 10, 24, 92, 3, 24, 33, 33, 22, 93, 13, 17, 28, 25, 16, 21, 16, 20, 26, 24, 16, 11, 18, 2, 30, 25, 23, 28, 21], {"3": 1, "23": 1, "34": 8, "17": 14, "20": 16, "11": 5, "28": 7, "13": 3, "22": 19, "16": 4, "26": 20, "93": 7, "31": 11, "6": 2, "36": 12, "33": 15, "18": 1, "19": 2, "7": 7, "21": 7, "10": 9, "24": 11, "30": 4, "25": 7, "2": 2, "92": 19}, 384]
["[13, 3, 34, 36, 19, 31, 6, 7, 10, 24, 92, 3, 24, 33, 33, 22, 93, 13, 17, 28, 25, 16, 21, 16, 20, 26, 24, 16, 11, 18, 2, 30, 25, 23, 28, 21]", "{3: 1, 23: 1, 34: 8, 17: 14, 20: 16, 11: 5, 28: 7, 13: 3, 22: 19, 16: 4, 26: 20, 93: 7, 31: 11, 6: 2, 36: 12, 33: 15, 18: 1, 19: 2, 7: 7, 21: 7, 10: 9, 24: 11, 30: 4, 25: 7, 2: 2, 92: 19}", "384"]
72
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', 'Green', 'Red'], ['Blue', 'Green', 'Green', 'Red', 'Red'], ['Blue', 'Blue', 'Green', 'Green', 'Blue']]
color_sorting
sorting
9
[[1, 0], [2, 0], [2, 0], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 1], [0, 1], [0, 2], [1, 2], [0, 1], [0, 2], [1, 0], [1, 2], [1, 0], [1, 0], [1, 0], [1, 0], [2, 1], [2, 1], [2, 1]]
23
30.480061292648315
23
6
15
[[["Red", "Red", "Blue", "Green", "Red"], ["Blue", "Green", "Green", "Red", "Red"], ["Blue", "Blue", "Green", "Green", "Blue"]], 8]
[[["Red", "Red", "Blue", "Green", "Red"], ["Blue", "Green", "Green", "Red", "Red"], ["Blue", "Blue", "Green", "Green", "Blue"]], 8]
["[['Red', 'Red', 'Blue', 'Green', 'Red'], ['Blue', 'Green', 'Green', 'Red', 'Red'], ['Blue', 'Blue', 'Green', 'Green', 'Blue']]", "8"]
72
We have a 4x4 numerical grid, with numbers ranging from 9 to 54 (9 included in the range but 54 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: [['24' 'x' 'x' '53'] ['25' '31' 'x' 'x'] ['26' '29' '31' 'x'] ['x' 'x' 'x' 'x']]
consecutive_grid
underdetermined_system
14
[[0, 1, 26], [0, 2, 27], [1, 3, 59], [2, 1, 47], [2, 3, 60], [3, 1, 48]]
577
5.510742425918579
6
45
16
["[['25', '', '', '57'], ['39', '45', '56', ''], ['43', '', '58', ''], ['46', '', '65', '69']]", 21, 71]
["[['25', '', '', '57'], ['39', '45', '56', ''], ['43', '', '58', ''], ['46', '', '65', '69']]", 21, 71]
["[['25', '', '', '57'], ['39', '45', '56', ''], ['43', '', '58', ''], ['46', '', '65', '69']]", "21", "71"]
72
In the magic square problem, a 4x4 grid is filled with unique integers ranging from 28 to 64. Some numbers are already given, while others are unknown and represented as 'x'. The sums of columns must be None, 157, 200, None for columns 1 to 2 respectively, and the sums of rows must be None, 193, 158, 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 183. 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' '60' '63'] ['35' 'x' 'x' 'x'] ['x' 'x' 'x' '50'] ['34' 'x' '37' 'x']]
magic_square
underdetermined_system
10
[[0, 0, 28], [0, 1, 32], [1, 1, 62], [1, 2, 56], [1, 3, 40], [2, 0, 31], [2, 1, 30], [2, 2, 47], [3, 1, 33], [3, 3, 29]]
667
42.7963764667511
10
26
16
["[['', '', '60', '63'], ['35', '', '', ''], ['', '', '', '50'], ['34', '', '37', '']]", 4, 28, 64]
["[['', '', '60', '63'], ['35', '', '', ''], ['', '', '', '50'], ['34', '', '37', '']]", 28, 64, [1, 3], [1, 3], [157, 200], [193, 158], 183]
["[['', '', '60', '63'], ['35', '', '', ''], ['', '', '', '50'], ['34', '', '37', '']]", "28", "64", "[None, 157, 200, None]", "[None, 193, 158, None]", "183"]
72
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: 10, 2: 9, 3: 8, 4: 8, 5: 7, 6: 6, 7: 9, 8: 2, 9: 8}, 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', 'Blue', 'Blue', 'Green', 'Black', 'Red'], [], ['Red', 'Black', 'Blue', 'White', 'Blue', 'Yellow'], ['Yellow', 'White', 'Green', 'Black', 'Yellow', 'Red'], [], [], ['White', 'Black', 'White', 'White', 'Black', 'Red'], ['Red', 'Green', 'Green', 'Yellow', 'Yellow', 'Green']]
restricted_sorting
sorting
3
[[4, 0], [9, 0], [4, 3], [8, 6], [8, 3], [8, 6], [8, 6], [8, 3], [8, 0], [5, 8], [5, 6], [5, 7], [5, 3], [5, 8], [5, 0], [4, 5], [4, 6], [4, 5], [2, 5], [2, 5], [2, 5], [2, 7], [2, 1], [9, 7], [9, 7], [9, 4], [9, 4], [9, 7], [1, 3], [2, 0], [4, 8], [4, 8], [4, 8]]
201
0.46176815032958984
33
90
30
[[[], [], ["Blue", "Blue", "Blue", "Green", "Black", "Red"], [], ["Red", "Black", "Blue", "White", "Blue", "Yellow"], ["Yellow", "White", "Green", "Black", "Yellow", "Red"], [], [], ["White", "Black", "White", "White", "Black", "Red"], ["Red", "Green", "Green", "Yellow", "Yellow", "Green"]], 6, {"0": 3, "1": 10, "2": 9, "3": 8, "4": 8, "5": 7, "6": 6, "7": 9, "8": 2, "9": 8}]
[[[], [], ["Blue", "Blue", "Blue", "Green", "Black", "Red"], [], ["Red", "Black", "Blue", "White", "Blue", "Yellow"], ["Yellow", "White", "Green", "Black", "Yellow", "Red"], [], [], ["White", "Black", "White", "White", "Black", "Red"], ["Red", "Green", "Green", "Yellow", "Yellow", "Green"]], 6, {"0": 3, "1": 10, "2": 9, "3": 8, "4": 8, "5": 7, "6": 6, "7": 9, "8": 2, "9": 8}, 5]
["[[], [], ['Blue', 'Blue', 'Blue', 'Green', 'Black', 'Red'], [], ['Red', 'Black', 'Blue', 'White', 'Blue', 'Yellow'], ['Yellow', 'White', 'Green', 'Black', 'Yellow', 'Red'], [], [], ['White', 'Black', 'White', 'White', 'Black', 'Red'], ['Red', 'Green', 'Green', 'Yellow', 'Yellow', 'Green']]", "{0: 3, 1: 10, 2: 9, 3: 8, 4: 8, 5: 7, 6: 6, 7: 9, 8: 2, 9: 8}", "6", "5"]
72
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, 12) to his destination workshop at index (5, 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 5, and district 3 covering rows 6 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 x x x 9 1 14 x x x 11 15 12] [2 x 18 x 14 x 11 3 x x x x x] [10 x 3 x x x 8 6 x 10 9 7 x] [1 18 2 6 x x 1 5 x x 6 x x] [4 14 12 3 2 2 15 8 19 3 18 x x] [5 6 2 2 13 x 7 3 12 x 16 10 5] [x 2 13 x x 9 5 x x x 7 10 11] [17 10 3 11 4 x x 19 x 5 x x 9] [13 x x x x 9 13 4 7 x 13 10 x] [x x x 9 x 8 8 14 x x 19 x x] [6 x x x x x 1 11 x 4 13 x x] [x x x 11 11 x 9 16 12 x 6 x 5] [16 19 14 x 5 13 x x x x x 13 x]
traffic
pathfinding
5
[[6, 12], [5, 12], [5, 11], [5, 10], [4, 10], [4, 9], [4, 8], [4, 7], [3, 7], [3, 6], [4, 6], [4, 5], [4, 4], [4, 3], [5, 3], [5, 2], [5, 1], [5, 0]]
122
0.020214080810546875
18
4
4
[[["x", "x", "x", "x", "9", "1", "14", "x", "x", "x", "11", "15", "12"], ["2", "x", "18", "x", "14", "x", "11", "3", "x", "x", "x", "x", "x"], ["10", "x", "3", "x", "x", "x", "8", "6", "x", "10", "9", "7", "x"], ["1", "18", "2", "6", "x", "x", "1", "5", "x", "x", "6", "x", "x"], ["4", "14", "12", "3", "2", "2", "15", "8", "19", "3", "18", "x", "x"], ["5", "6", "2", "2", "13", "x", "7", "3", "12", "x", "16", "10", "5"], ["x", "2", "13", "x", "x", "9", "5", "x", "x", "x", "7", "10", "11"], ["17", "10", "3", "11", "4", "x", "x", "19", "x", "5", "x", "x", "9"], ["13", "x", "x", "x", "x", "9", "13", "4", "7", "x", "13", "10", "x"], ["x", "x", "x", "9", "x", "8", "8", "14", "x", "x", "19", "x", "x"], ["6", "x", "x", "x", "x", "x", "1", "11", "x", "4", "13", "x", "x"], ["x", "x", "x", "11", "11", "x", "9", "16", "12", "x", "6", "x", "5"], ["16", "19", "14", "x", "5", "13", "x", "x", "x", "x", "x", "13", "x"]]]
[[["x", "x", "x", "x", "9", "1", "14", "x", "x", "x", "11", "15", "12"], ["2", "x", "18", "x", "14", "x", "11", "3", "x", "x", "x", "x", "x"], ["10", "x", "3", "x", "x", "x", "8", "6", "x", "10", "9", "7", "x"], ["1", "18", "2", "6", "x", "x", "1", "5", "x", "x", "6", "x", "x"], ["4", "14", "12", "3", "2", "2", "15", "8", "19", "3", "18", "x", "x"], ["5", "6", "2", "2", "13", "x", "7", "3", "12", "x", "16", "10", "5"], ["x", "2", "13", "x", "x", "9", "5", "x", "x", "x", "7", "10", "11"], ["17", "10", "3", "11", "4", "x", "x", "19", "x", "5", "x", "x", "9"], ["13", "x", "x", "x", "x", "9", "13", "4", "7", "x", "13", "10", "x"], ["x", "x", "x", "9", "x", "8", "8", "14", "x", "x", "19", "x", "x"], ["6", "x", "x", "x", "x", "x", "1", "11", "x", "4", "13", "x", "x"], ["x", "x", "x", "11", "11", "x", "9", "16", "12", "x", "6", "x", "5"], ["16", "19", "14", "x", "5", "13", "x", "x", "x", "x", "x", "13", "x"]], [6, 12], [5, 0], 3, 5]
["[['x', 'x', 'x', 'x', '9', '1', '14', 'x', 'x', 'x', '11', '15', '12'], ['2', 'x', '18', 'x', '14', 'x', '11', '3', 'x', 'x', 'x', 'x', 'x'], ['10', 'x', '3', 'x', 'x', 'x', '8', '6', 'x', '10', '9', '7', 'x'], ['1', '18', '2', '6', 'x', 'x', '1', '5', 'x', 'x', '6', 'x', 'x'], ['4', '14', '12', '3', '2', '2', '15', '8', '19', '3', '18', 'x', 'x'], ['5', '6', '2', '2', '13', 'x', '7', '3', '12', 'x', '16', '10', '5'], ['x', '2', '13', 'x', 'x', '9', '5', 'x', 'x', 'x', '7', '10', '11'], ['17', '10', '3', '11', '4', 'x', 'x', '19', 'x', '5', 'x', 'x', '9'], ['13', 'x', 'x', 'x', 'x', '9', '13', '4', '7', 'x', '13', '10', 'x'], ['x', 'x', 'x', '9', 'x', '8', '8', '14', 'x', 'x', '19', 'x', 'x'], ['6', 'x', 'x', 'x', 'x', 'x', '1', '11', 'x', '4', '13', 'x', 'x'], ['x', 'x', 'x', '11', '11', 'x', '9', '16', '12', 'x', '6', 'x', '5'], ['16', '19', '14', 'x', '5', '13', 'x', 'x', 'x', 'x', 'x', '13', 'x']]", "(6, 12)", "(5, 0)", "3", "5"]
72
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 (8, 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. 0 0 0 1 0 0 0 1 1 1 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 1 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 1 1 1 0 0 1 0 0 1 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 1 1 0 0 1 1 1 1 0 1 1 1 1 0 1 0 1 1 0 1 0 0 1 1 0 0 1
trampoline_matrix
pathfinding
13
[[8, 12], [7, 11], [6, 10], [5, 10], [4, 9], [3, 9], [3, 8], [2, 8], [2, 7], [2, 6], [2, 5], [1, 4], [1, 3], [1, 2], [1, 1]]
15
0.02518010139465332
15
8
2
["[[0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1], [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 0, 0, 0, 0, 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0, 1, 0, 0, 0, 0, 0, 1, 0, 1], [1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1], [0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0], [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0], [1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], [1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1], [1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1], [1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0], [1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1]]", "(8, 12)", "(1, 1)", "4"]
72
Given 5 labeled water jugs with capacities 57, 98, 149, 99, 105, 28 liters, we aim to fill 4 unlabeled buckets, numbered 1 to 4 and arranged in a line in ascending order, with 281, 401, 423, 427 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
5
[["+", 98, 4], ["+", 98, 4], ["+", 98, 4], ["+", 105, 4], ["+", 28, 4], ["+", 98, 3], ["+", 99, 3], ["+", 99, 3], ["+", 99, 3], ["+", 28, 3], ["+", 98, 2], ["+", 99, 2], ["+", 99, 2], ["+", 105, 2], ["+", 28, 1], ["+", 98, 1], ["+", 98, 1], ["+", 57, 1]]
18
0.04359149932861328
18
48
3
[[57, 98, 149, 99, 105, 28], [281, 401, 423, 427]]
[[57, 98, 149, 99, 105, 28], [281, 401, 423, 427]]
["[57, 98, 149, 99, 105, 28]", "[281, 401, 423, 427]"]
73
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: [[96, 93, '_', 26, 66], [46, 59, 38, 92, 50], [27, 7, 39, 77, 18]]
8_puzzle
puzzle
6
[26, 92, 50, 18, 77, 39, 38, 59, 46, 96, 93, 46, 59, 26, 46, 93, 96, 59, 26, 50, 18, 77, 39, 38, 7, 26, 50, 18, 77, 39, 38, 7, 18, 46, 92, 77, 39, 38]
38
20.599369525909424
38
4
15
[[[96, 93, "_", 26, 66], [46, 59, 38, 92, 50], [27, 7, 39, 77, 18]]]
[[[96, 93, "_", 26, 66], [46, 59, 38, 92, 50], [27, 7, 39, 77, 18]]]
["[[96, 93, '_', 26, 66], [46, 59, 38, 92, 50], [27, 7, 39, 77, 18]]"]
73
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: trag, hoped, shelf, neath, farse The initial board: [['o', 't', 'f', 'a', 'g'], ['h', 'r', 'p', 'r', 'd'], ['s', 'h', '_', 'l', 't'], ['n', 'e', 'a', 'e', 'h'], ['f', 'a', 'e', 's', 'e']]
8_puzzle_words
puzzle
3
["up-right", "down-right", "down-left", "up-left", "down-left", "down-right", "up-right", "up-right", "up-left", "up-left", "down-left", "down-right", "down-right", "up-right", "up-left", "down-left", "up-left", "up-left"]
18
0.3264577388763428
18
4
25
[[["o", "t", "f", "a", "g"], ["h", "r", "p", "r", "d"], ["s", "h", "_", "l", "t"], ["n", "e", "a", "e", "h"], ["f", "a", "e", "s", "e"]]]
[[["o", "t", "f", "a", "g"], ["h", "r", "p", "r", "d"], ["s", "h", "_", "l", "t"], ["n", "e", "a", "e", "h"], ["f", "a", "e", "s", "e"]], ["trag", "hoped", "shelf", "neath", "farse"]]
["[['o', 't', 'f', 'a', 'g'], ['h', 'r', 'p', 'r', 'd'], ['s', 'h', '_', 'l', 't'], ['n', 'e', 'a', 'e', 'h'], ['f', 'a', 'e', 's', 'e']]", "['trag', 'hoped', 'shelf', 'neath', 'farse']"]
73
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 S and city K excatly twice. Determine the quickest route that allows us to visit both these destination cities, ensuring that we stop at the two destinations twice on our path. The sequence in which we visit the destination cities is not important. However, apart from K and 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. K N S Y O I T D M Z R B E F K 0 1 0 0 0 1 0 1 0 0 1 0 0 1 N 0 0 0 0 0 0 0 0 1 0 0 1 0 0 S 0 0 0 0 1 0 0 0 0 0 1 1 0 0 Y 0 0 0 0 0 0 0 0 0 0 1 0 0 0 O 1 0 0 0 0 0 0 0 0 1 0 0 0 0 I 1 0 0 0 1 0 1 0 0 0 0 0 1 0 T 0 0 0 1 0 0 0 1 0 1 0 0 0 1 D 1 0 0 0 0 1 1 0 0 1 0 0 0 0 M 1 0 1 1 0 1 0 0 0 1 0 0 0 0 Z 0 0 0 0 1 1 0 0 0 0 1 0 0 0 R 0 1 0 0 0 0 0 1 0 0 0 0 1 0 B 1 0 0 1 1 1 1 0 0 1 0 0 1 0 E 1 0 0 0 0 0 1 0 1 1 0 0 0 1 F 0 0 1 1 0 1 0 0 0 0 0 1 0 0
city_directed_graph
pathfinding
14
["Y", "R", "E", "M", "S", "B", "K", "F", "S", "O", "K"]
11
0.052919864654541016
11
14
17
[[[0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1], [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, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0], [1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0], [1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1], [0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0]], ["K", "N", "S", "Y", "O", "I", "T", "D", "M", "Z", "R", "B", "E", "F"], "S", "K"]
[[[0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1], [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, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1,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 0, 0, 1, 0, 0]]", "['K', 'N', 'S', 'Y', 'O', 'I', 'T', 'D', 'M', 'Z', 'R', 'B', 'E', 'F']", "['Y']", "['S', 'K']"]
73
In the 'taxed coin exchange' problem, you are required to choose a subset of coins from this list [15, 2, 37, 38, 21, 30, 19, 28, 3, 35, 16, 32, 3, 28, 24, 27, 10, 1, 14, 3, 33, 6, 18, 37, 20, 19, 4, 31, 34, 39, 7, 13, 29, 38, 34, 14, 29, 13, 5, 33, 31, 24], 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 {33: 10, 13: 12, 6: 1, 15: 2, 20: 15, 4: 3, 27: 7, 35: 5, 19: 18, 14: 13, 16: 4, 2: 2, 39: 19, 21: 18, 3: 2, 37: 14, 10: 1, 24: 3, 32: 2, 7: 4, 1: 1, 5: 4, 31: 4, 34: 7, 30: 8, 28: 11, 18: 9, 29: 2, 38: 1}, where the tax for coins of the same value is the same. Also, if the coin chosen is smaller than the previous one, it must have an even value, otherwise, if the coin is larger than or equal to the previous coin chosen, it must have an odd value. The objective is to determine which subset of coins should be selected to minimize the total tax paid. The solution should be presented as a list of numbers, representing the value of the coins chosen in order, with the first coins chosen being in index 0, formatted in Python syntax.
coin_exchange
subset_sum
24
[38, 32, 24, 29, 24, 10, 15, 29, 31, 31, 6, 27, 35, 34, 30, 2]
54
0.053344011306762695
16
42
42
[[15, 2, 37, 38, 21, 30, 19, 28, 3, 35, 16, 32, 3, 28, 24, 27, 10, 1, 14, 3, 33, 6, 18, 37, 20, 19, 4, 31, 34, 39, 7, 13, 29, 38, 34, 14, 29, 13, 5, 33, 31, 24]]
[[15, 2, 37, 38, 21, 30, 19, 28, 3, 35, 16, 32, 3, 28, 24, 27, 10, 1, 14, 3, 33, 6, 18, 37, 20, 19, 4, 31, 34, 39, 7, 13, 29, 38, 34, 14, 29, 13, 5, 33, 31, 24], {"33": 10, "13": 12, "6": 1, "15": 2, "20": 15, "4": 3, "27": 7, "35": 5, "19": 18, "14": 13, "16": 4, "2": 2, "39": 19, "21": 18, "3": 2, "37": 14, "10": 1, "24": 3, "32": 2, "7": 4, "1": 1, "5": 4, "31": 4, "34": 7, "30": 8, "28": 11, "18": 9, "29": 2, "38": 1}, 397]
["[15, 2, 37, 38, 21, 30, 19, 28, 3, 35, 16, 32, 3, 28, 24, 27, 10, 1, 14, 3, 33, 6, 18, 37, 20, 19, 4, 31, 34, 39, 7, 13, 29, 38, 34, 14, 29, 13, 5, 33, 31, 24]", "{33: 10, 13: 12, 6: 1, 15: 2, 20: 15, 4: 3, 27: 7, 35: 5, 19: 18, 14: 13, 16: 4, 2: 2, 39: 19, 21: 18, 3: 2, 37: 14, 10: 1, 24: 3, 32: 2, 7: 4, 1: 1, 5: 4, 31: 4, 34: 7, 30: 8, 28: 11, 18: 9, 29: 2, 38: 1}", "397"]
73
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', 'Green', 'Red', 'Blue', 'Green'], ['Red', 'Blue', 'Green', 'Blue', 'Blue'], ['Green', 'Red', 'Red', 'Green', 'Blue']]
color_sorting
sorting
9
[[1, 0], [2, 1], [2, 0], [2, 0], [2, 1], [2, 1], [0, 2], [0, 2], [0, 2], [0, 2], [0, 1], [0, 2], [0, 2], [1, 0], [1, 2], [1, 0], [1, 0], [1, 2], [1, 0], [2, 1], [2, 1], [2, 1]]
22
15.575777530670166
22
6
15
[[["Red", "Green", "Red", "Blue", "Green"], ["Red", "Blue", "Green", "Blue", "Blue"], ["Green", "Red", "Red", "Green", "Blue"]], 8]
[[["Red", "Green", "Red", "Blue", "Green"], ["Red", "Blue", "Green", "Blue", "Blue"], ["Green", "Red", "Red", "Green", "Blue"]], 8]
["[['Red', 'Green', 'Red', 'Blue', 'Green'], ['Red', 'Blue', 'Green', 'Blue', 'Blue'], ['Green', 'Red', 'Red', 'Green', 'Blue']]", "8"]
73
We have a 4x4 numerical grid, with numbers ranging from 22 to 67 (22 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: [['22' 'x' 'x' '66'] ['x' 'x' 'x' 'x'] ['50' '52' 'x' '57'] ['x' '55' 'x' 'x']]
consecutive_grid
underdetermined_system
15
[[2, 0, 21], [2, 1, 22], [3, 0, 20], [3, 1, 19], [3, 2, 18], [3, 3, 17]]
508
8.582459211349487
6
45
16
["[['39', '40', '44', '62'], ['29', '33', '38', '61'], ['', '', '35', '59'], ['', '', '', '']]", 17, 67]
["[['39', '40', '44', '62'], ['29', '33', '38', '61'], ['', '', '35', '59'], ['', '', '', '']]", 17, 67]
["[['39', '40', '44', '62'], ['29', '33', '38', '61'], ['', '', '35', '59'], ['', '', '', '']]", "17", "67"]
73
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, 144, 76, None for columns 1 to 2 respectively, and the sums of rows must be None, 116, 124, 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 75. The goal is to find unique integers (ie each number can be in the final grid only once) in the given range to replace with ‘x’s in the grid below such that the sum of the specified rows, columns, and diagonal equals the given amounts and the sum of all of the numbers in the grid is as low as possible. The solution should be provided as a list of tuples in Python syntax. Each tuple should contain three numbers for each 'x' position: the row index, the column index (both starting from 0), and the value of the unique integer replaced with 'x' at that position. Grid: [['x' 'x' 'x' 'x'] ['x' '41' '17' 'x'] ['x' 'x' '13' '43'] ['9' '24' '27' '11']]
magic_square
underdetermined_system
7
[[0, 0, 6], [0, 1, 37], [0, 2, 19], [0, 3, 7], [1, 0, 12], [1, 3, 46], [2, 0, 26], [2, 1, 42]]
380
156.1415274143219
8
31
16
["[['', '', '', ''], ['', '41', '17', ''], ['', '', '13', '43'], ['9', '24', '27', '11']]", 4, 6, 47]
["[['', '', '', ''], ['', '41', '17', ''], ['', '', '13', '43'], ['9', '24', '27', '11']]", 6, 47, [1, 3], [1, 3], [144, 76], [116, 124], 75]
["[['', '', '', ''], ['', '41', '17', ''], ['', '', '13', '43'], ['9', '24', '27', '11']]", "6", "47", "[None, 144, 76, None]", "[None, 116, 124, None]", "75"]
73
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: 11, 1: 8, 2: 4, 3: 6, 4: 4, 5: 3, 6: 6, 7: 9, 8: 5, 9: 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? [['Black', 'Red', 'Black', 'Green', 'Blue', 'Yellow'], ['Yellow', 'Yellow', 'Black', 'Blue', 'Red', 'Green'], [], [], [], [], ['Yellow', 'Black', 'White', 'Yellow', 'Red', 'Black'], ['Green', 'Blue', 'Green', 'White', 'Blue', 'Green'], ['Red', 'White', 'Blue', 'White', 'White', 'Red'], []]
restricted_sorting
sorting
3
[[6, 5], [8, 2], [1, 5], [1, 5], [1, 4], [1, 3], [1, 2], [0, 4], [0, 2], [0, 4], [0, 1], [0, 3], [7, 1], [7, 3], [6, 4], [6, 9], [6, 5], [6, 2], [6, 4], [8, 6], [8, 3], [8, 6], [8, 6], [8, 2], [7, 8], [7, 6], [7, 3], [7, 1], [8, 1], [9, 6], [0, 5]]
162
0.21412134170532227
31
90
30
[[["Black", "Red", "Black", "Green", "Blue", "Yellow"], ["Yellow", "Yellow", "Black", "Blue", "Red", "Green"], [], [], [], [], ["Yellow", "Black", "White", "Yellow", "Red", "Black"], ["Green", "Blue", "Green", "White", "Blue", "Green"], ["Red", "White", "Blue", "White", "White", "Red"], []], 6, {"0": 11, "1": 8, "2": 4, "3": 6, "4": 4, "5": 3, "6": 6, "7": 9, "8": 5, "9": 10}]
[[["Black", "Red", "Black", "Green", "Blue", "Yellow"], ["Yellow", "Yellow", "Black", "Blue", "Red", "Green"], [], [], [], [], ["Yellow", "Black", "White", "Yellow", "Red", "Black"], ["Green", "Blue", "Green", "White", "Blue", "Green"], ["Red", "White", "Blue", "White", "White", "Red"], []], 6, {"0": 11, "1": 8, "2": 4, "3": 6, "4": 4, "5": 3, "6": 6, "7": 9, "8": 5, "9": 10}, 5]
["[['Black', 'Red', 'Black', 'Green', 'Blue', 'Yellow'], ['Yellow', 'Yellow', 'Black', 'Blue', 'Red', 'Green'], [], [], [], [], ['Yellow', 'Black', 'White', 'Yellow', 'Red', 'Black'], ['Green', 'Blue', 'Green', 'White', 'Blue', 'Green'], ['Red', 'White', 'Blue', 'White', 'White', 'Red'], []]", "{0: 11, 1: 8, 2: 4, 3: 6, 4: 4, 5: 3, 6: 6, 7: 9, 8: 5, 9: 10}", "6", "5"]