This commit is contained in:
Jonathan Chan 2017-12-18 23:45:10 -08:00
parent 87c7cf68c8
commit 14fb48f3a1
3 changed files with 237 additions and 0 deletions

35
19.hs Normal file
View File

@ -0,0 +1,35 @@
import Data.List (elemIndex)
import Data.Matrix (Matrix, fromLists, (!))
type Grid = Matrix Char
data Direction = North | South | West | East | Stop deriving Eq
data State = State (Int, Int) Direction [Char] Int
nextState :: String -> Grid -> State -> State
nextState letters grid (State (r, c) dir seen count) =
let (nextR, nextC) = case dir of
North -> (r - 1, c)
South -> (r + 1, c)
West -> (r, c - 1)
East -> (r, c + 1)
nextChar = grid ! (nextR, nextC)
nextDir = case nextChar of
'+' -> if dir `elem` [North, South]
then if grid ! (nextR, nextC - 1) == '-' then West else East
else if grid ! (nextR - 1, nextC) == '|' then North else South
' ' -> Stop
_ -> dir
nextSeen = if nextChar `elem` letters then nextChar : seen else seen
in State (nextR, nextC) nextDir nextSeen (count + 1)
traverseGrid :: String -> Grid -> State -> (String, Int)
traverseGrid _ _ (State _ Stop seen count) = (reverse seen, count)
traverseGrid letters grid state = traverseGrid letters grid $ nextState letters grid state
main :: IO ()
main = do
input <- readFile "19.txt"
let rows = lines input
Just start = (+1) <$> (elemIndex '|' $ head rows)
letters = filter (not . (`elem` " +|-\n")) input
print $ traverseGrid letters (fromLists rows) (State (1, start) South [] 0)

201
19.txt Normal file
View File

@ -0,0 +1,201 @@
|
+-------------------+ +-+ +-------+ +-------------------+ | +---+ +-----+ +---+
| | | | | | | | | | | | | | |
| +---+ | +---------------|-------|-----------------------+ +-----------------------------+ | | | | | |
| | | | | | | | | | | | | | | | | | | | |
| | +---------------------|-----------------------------------|-------------------------------------------------------------------|-----------------+ +-----------------------+ |
| | | | | | | | | | | | | | | | | | | | |
| | | +-------------|-|---------------|---------------|---|---------------------------|-------------------------+ | | | +-|---------|-------------+ |
| | | | | | | | | | | | | | | | | | | | | | |
| +-------------------------------|-----------|-------|---------------|---|---------------------|-----|-----------------------------------|---|-------------+ +-------+ | +-----|---+ | |
| | | | | | | | | | | | | | | | | | | | | | |
| +-+ | | | | | | | +-+ | | | +---------------------------------|---|---------------+ | | | | +-+
| | | | | | | | | | | | | | | | | | | | |
| | | | | | | +---|-------|-------------------|---------------------|-----|-|---------------------------+ | +-|-------------+ | +-----+ | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| +---|-------------------------------|-|---------------|---------------+ | +---------------------+ +-------+ +-|-|-------------------------|-|-----|---------------|---+
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | +---|-------------------------|---|---|-------------------------------|-+ +-----+ +-|-----------------------------|-------|---------------|-----------|-|-----+ | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | +---+ | +-+ | | | | | | | +-----------|-+ | +-|-----|---------------+ | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | +---+ | | | | | | | | | +---------|---|---|-|---------------|-----------------|---|-|-------------|-------------|---------+ +-|-+ | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | +-+ | | | | | | | +-+ | | | | | | | | | | | | | | | | | | | | | | | | +-----------+ | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | +-----|-|-+ | | | +-|-|-|-------+ | | | +---+ | | | | | | +-----------------------+ | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | +-|---------|---|---|-|-|-|---|---|---+ | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | +-+ | | +-----|-|-------|-------------|-----|-----------------|---|-|-----|-----------|-|-----|-------|-----------------------------------|---------------|---------+ |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | +-----|-|---|-------------|-|-------------------|-------------|---|-|-----------|---------|---------|-----------------------------+ | +-|---------------|-+ +---------------|---|-|-------+ |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| +-|-----|-|-------|-----|-----|-+ | | +-----|-|-------|---------------------------+ | | | | | | | | | | | | | | | | +-----|-+ | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | +------I|---|-------|-----------|-|---------------------|---------------|-------|---|-+ +-------+ | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | +-|---|-|-|-----+ | | | | | | | | | | | | | | +---|-------|----Z------------|-------------|-----------|-----------|-+ | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | +-|---------------|-----|---|-|-----|---+ | | | | | | | | | | | | | | | | | +-----------|-------------|-------------|-+ | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | +---|-|-----------+ | +-|-------+ | | +-------------|-------|---|-----|---------|---|-|-------------------|-|---------------|-------|-----+ | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | +-|---|---------------|-------|---|-------|-------|---|-----------+ +---------------------------+ | | | +-|---|-|-|-+ | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | +-----|---|-|---------|-|-|---------|-----------|---------|-------------|-------------------+ | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-|-----+ | | | | | +-------------|-------|-|-|-+ | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+---------|-----|---------|-|-----|-|-|-------------------------|-|---------|---------|-----------|-|---|---------|---|-------|-------------|-|-|---------+ | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-+ | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | +-|-|---|-------|-----------------------|---------------------|-+ | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | M | | | | | | | | | | | | | | | | | | | | |
+---|-------|---|-----------------|---|-|---|-----------|-------------------|---------------------|-----|---------|---|-------|-|-|-----------+ | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | +-|-----+ | | | | | | | | | +---+ | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | +-------|---------------------|-+ | | | | | | | | | | | | | | | +-+ +-------------------|-+ | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| +-+ | | | | | | +-----+ | | | | | | +-|-----------|---------------------|-----------------------------|-------|-|-----|-------------|-------|-----------------------|-+ | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| +-|-----|-------|-----|---|-----|-|-----|---------|-----+ | | | | | +-----|-|-----|---|-+ | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | +---+ | | | +---+ | | | | | | | +---|---------|-|---|---------|---+ | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | +---|---|-----|-----|-+ | | | | | | | | | | | | | | | | | | | +-|---|---------|-----------------------------------|---+ | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| +-----------------|-------|-----|---------------|-|-------|---|-----------+ +-----|-+ | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | +---|---+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | +-|-----------------|-|---|---+ | | | | | | | | | | | | +-------|-------|-------------|-|-----|-------|---------|---------|-----|-----------|-----------+ | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | +-|-|-|-------|-|-----|-|-|---|-|-----------+ | | | | | | +-------|-------|---------|---------|-----+ | | +-|-+ | | +---+ | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | +-|-|-----|-----|-|-------|-------|-------------------------+ | | | | | | | | +---------|-----------+ | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | +---|-------+ | | +-+ | | | | | | | | | | | +-|-------------|-------------|---------|---------+ | +-------|---|-------|---|---------|-----------------------------|-----+ | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | +-|-|-+ +-|---|-------|-----|---+ | | | +-----------|-----|-------------|---|-|-----------------------|-|---------------------|---|-------|---------------|-|-------+ | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | +---|-+ | | | | | | +-----|-|---|-|-----------|-------+ | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | +-+ | | | | | +-----|-----|-+ | | | | | | | | | | +---|-|-|-----+ | | | +---|-------|-------|-----------|---+ | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-+
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | +---|-|-|-------|-------|-------------|-|-----------------|-------------------+ | | | | | | | | | +-|-|-|-------|-------------------------------------|-----+
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | +-|-------------+ O | +---|-|---------|-+ | | | | | | | | | | | | | | | | | | | | | +-+ | +-|-|-----------+ | | | | | +-+
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | +-|-------|---|-------|-|---|-------------|---|-|-------|-------------------|-|-----|---------+ | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | +-|-----|-----|-|---|---|---|-----+ | | | +-------|-+ | | | | | | +---------|-------|-|---|-----|-|-+ | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | +---+ | | | +-|-----|-|---------|-------------------------------------|---------|---|-------|-----|---+ | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | +-|-|---|---|-|-|-------------|---------------|-----------------|-|-----|-----------|---|-------|-------+ | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | +-------------|-|-----|---|-|---|-------------|---|---+ | | | | | | | | | +-------|-----------|-|-------|-|---|-----|-----|-+ | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-|-+ | | | | | | | | | | | | | | | | | +---|-|---|-|-|---------|-----|-------|-------------------------------------|---------|---------------|-----|-|---------------|---------+ | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | +-|-------------|-|-----------|-------------|---------------------------------|---|-|-----------------------|-----|-----------------|---+ | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | +-|-|-------|---|-|-------------|-------------|-------------------------------------+ | +-|---|-------|-----|-----------|---+ | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | +-------+ | | +-----|-----+ | | | | | | | | | | | | | | +--N|-----|-----|-----|---+ | +-------|-+ | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| +-+ | | | | | +---------|-----|-|-------+ | | | +-|---+ | | | +-|-----|-----------|---------------------|---|-------|-----|-----------|-----|-+ | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | +---|-------|-|---|-|---------|-|-------+ | | | +-------|-|-----------------|-----|-----------|-------------|-------------|-------+ | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | +-|-------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------|---|---|-|-----------|-----|-----------|---|---+ | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | +-------|-|-------|-|-------------------|-|-------|-------------------------------------------------|-----|-|-----------|-|---|-----|-----------|---|-|-----------+ | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | +---|-------|-------------------|-|-------|---|-|-----------------+ | | | | +---+ | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | +---|-----+ | | | | | | | | | | | | | | | | | +-------|-|---|-----|-----------|-------------------|-----+ | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | +-|-----------------|-+ | | | | | | | | | | | | | | | | | | | | | | | | | | +-----|-----|-+ | | +-+ | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-------|-|-----|-|---|---|---------|-|-----|---|---|-----|-|---|---|---------------|-------|-----------|-------------|-------------------|-----------------------|-|-|-----|---------|-|---------|-+
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | +-|-|-----|-|---------|-------|-------------------------------|-|-----|-----------------|---------------------|-----|-+ | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | +---------------------|---|-------------|---|---|-|-|-+ +-+ | | | | | | +-------------------------------|---------|---+ | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | +---|---------|-----|-|---|-+ | | +---------|-----|---------+ | | | | +-|-------+ | | | | | | | | | | | | | | | |
| | J | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+---+ | | | | | | | | | | | | | | | | | | | | +-------------------|---------|-------------|---|---------|-|-------------+ | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | +-|-|--C--------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-------------------|---------------|---------|-|-|---------------------------------|-----|-|-------------------------------|-|-----|-------------|-------------|---|-----|-----|---|-----------+ |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | +-------------|-----------------------|-|-|-|-------|---------+ | | +-----|-------------|-------------|---|-------------|-|-+ | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | +-------|---|---------|---+ | | | | +-------------------|-|-----------|-----------|---------+ | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | +---+ | | | | | | | | | +---+ | +---|-----------------------------------------|-+ | | | | | | | | | | | | | | | +-------|-----------+ |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | +-+ | | | | | +-|---|-------|-----|-------|---------------|-----------------------|---|-+ | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | +-|-----------------------------------------+ | | | | | +-|-+ | | | +-----+ | +-----|-----------|---------|-----+ | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | +-------------------------------|---------------+ | +-|-----------------|-----|-----------------|-|-----|-------------------+ |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-+ | | | +-----|-----------+ | | | +-|-----|---|---|-----------------|-------------|-|-----------------------+ +---|---+ | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | +-+ | | +-|-----------------------------|-----------------|-------------|-------|---------------|---|---+ | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-|---------------|-|---|-|---------|---+ | +-------|-------------------|-------+ | | +---+ | | | | | | | | +-------------+ | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-----|---|-+ | | | | | | | | | | | | | +-------------|-------------|---|---|-------|---------+ | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | +---|-------|-------|-|---|-------|-----------|---|---------------------------|---|-----------|---------|---|-----------+ |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | +-------+ | | | +-------|-|-------------|-|-----+ | | | | | +-----|-|-|-----------------------|---|---------|---+ | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | +---------|-+ | | | +-+ | | | +-------|-------------|-|-------|---------------------------------|-----|-|-+ | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-+ +-+ +-----------|-+ | | | | | | | | | +-------------|-+ | | | | | | | | | | | | | | | +---|-|-----|-------+ | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | S | | | | | | | |
| +-+ | | | | | | | | | | | +-----------------------------|---|-----------+ | +-------|-----|-----|-+ | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+-+ | | | | | | | | | | | | | | +-------|-------|-----------------|-----+ | +-----|-----|-------+ | | | | | | | +-------|-+ |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | +-----------------+ | +-----------------|---------------------|-----------|---------|-----|-----+ | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | +-------------|---|--U--------------------|-+ | +-------------|-------------------------------------------------------|---+ | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | +-------------|-----------------------------|-----------------------------------------|---------+ | +-|-+ |
| | | | | | | | | | | | | | | | | | | | | | | | | |
+---+ +-------|-------|-------|-----------------|---------------------------------------------|-------------------------------------------|---------------------|---|-|---------------|-----+ | | |
| | | | | | | | | | | | | | | | | | | | | | | |
| +-----|-+ | +---------+ | | | | +-----------+ | | | | +---------+ | | | | | |
| | | | | | | | | | | | | | | | | |
| | | +-------------------------|-------------------|---------|---------------------------|---------------------------------+ | +-----+ |
| | | | | | | | | | | | | | | |
| | | +---------------------------------------------+ | | +---------------------------+ +---+ | |
| | | | | | | | | |
+-------------------+ +----------------------------------------T------------------------------------------------------------------|-------------------------------------------------+ | |
| | | | | | | |
+-------------------|-------------------------------+ | | +-|---+
| | | | | |
+-----------------------------+ +-----+ +---------------------------------------------------+

View File

@ -27,6 +27,7 @@ These are the runtimes of only one trial but the variances are fairly small and
| 16 | 0.462 |
| 17 | 6.753 | 1.865
| 18 | 0.118 |
| 19 | 0.026 |
Problems that should be optimized further: 15