|
@@ -1,7 +1,5 @@
|
|
|
#!/usr/bin/env python3
|
|
#!/usr/bin/env python3
|
|
|
-import re
|
|
|
|
|
from collections import namedtuple
|
|
from collections import namedtuple
|
|
|
-from itertools import chain
|
|
|
|
|
from queue import PriorityQueue
|
|
from queue import PriorityQueue
|
|
|
|
|
|
|
|
State = namedtuple('State', 'floors elevator')
|
|
State = namedtuple('State', 'floors elevator')
|
|
@@ -73,7 +71,6 @@ def min_steps(initial):
|
|
|
worklist = PriorityQueue()
|
|
worklist = PriorityQueue()
|
|
|
seen = {initial}
|
|
seen = {initial}
|
|
|
worklist.put((get_score(initial), 0, initial))
|
|
worklist.put((get_score(initial), 0, initial))
|
|
|
- nprocessed = 0
|
|
|
|
|
while not worklist.empty():
|
|
while not worklist.empty():
|
|
|
score, steps, state = worklist.get()
|
|
score, steps, state = worklist.get()
|
|
|
if score == (0, 0):
|
|
if score == (0, 0):
|