mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2026-04-09 02:23:36 +00:00
add day-16 part2 + benchmarks
This commit is contained in:
6
day-16/internal/one/benchmark
Normal file
6
day-16/internal/one/benchmark
Normal file
@@ -0,0 +1,6 @@
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: github.com/onyx-and-iris/aoc2024/day-16/internal/one
|
||||
cpu: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
|
||||
BenchmarkSolve-12 1000000000 0.01081 ns/op
|
||||
ok github.com/onyx-and-iris/aoc2024/day-16/internal/one 0.078s
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const turnCost int = 1000
|
||||
|
||||
type graph struct {
|
||||
start node
|
||||
end node
|
||||
@@ -36,6 +34,7 @@ func (g *graph) dijkstra() (int, error) {
|
||||
visited := make(map[node]struct{})
|
||||
costs := make(map[node]int)
|
||||
prev := make(map[node]node)
|
||||
const turnCost int = 1000
|
||||
|
||||
for heap.Len() > 0 {
|
||||
current := hp.Pop(heap).(move)
|
||||
|
||||
Reference in New Issue
Block a user