From ba0a8ca20cd5c1b675c53c8a80419172407d3b3e Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Wed, 20 Dec 2023 05:53:28 +0100 Subject: [PATCH 1/2] Implement aoc2023 day18 --- src/Visp.Compiler/Syntax/SynWriter.fs | 2 +- visp/examples/aoc2023/day18.visp | 363 +++++++++++ visp/examples/aoc2023/inputs/day18.txt | 602 ++++++++++++++++++ .../examples/aoc2023/inputs/day18_example.txt | 14 + 4 files changed, 980 insertions(+), 1 deletion(-) create mode 100644 visp/examples/aoc2023/day18.visp create mode 100644 visp/examples/aoc2023/inputs/day18.txt create mode 100644 visp/examples/aoc2023/inputs/day18_example.txt diff --git a/src/Visp.Compiler/Syntax/SynWriter.fs b/src/Visp.Compiler/Syntax/SynWriter.fs index 7ce3700..0653c21 100644 --- a/src/Visp.Compiler/Syntax/SynWriter.fs +++ b/src/Visp.Compiler/Syntax/SynWriter.fs @@ -171,7 +171,7 @@ module Write = let reservedWords = - [ "fun"; "then"; "done"; "val"; "end"; "begin"; "mod"; "to"; "with" ] + [ "fun"; "then"; "done"; "val"; "end"; "begin"; "mod"; "to"; "with"; "fixed" ] |> Set.ofList let escapableChars = [ '?'; '-'; '+'; '*'; '/'; '!'; ':' ] |> Set.ofList diff --git a/visp/examples/aoc2023/day18.visp b/visp/examples/aoc2023/day18.visp new file mode 100644 index 0000000..ecf0d2e --- /dev/null +++ b/visp/examples/aoc2023/day18.visp @@ -0,0 +1,363 @@ + +;; Copyright 2023 Ville Penttinen +;; Distributed under the MIT License. +;; https://github.com/vipentti/visp-fs/blob/main/LICENSE.md +;; +;; for basic syntax highlighting +;; vim: set syntax=clojure: +(require SpanUtils "0.4.0") + +(open System) +(open System.Collections.Generic) +(open System.Text.RegularExpressions) +(open SpanUtils.Extensions) + +(fn WriteResult (part value ex) + (printfn "%s: %A %A" part value (= value ex))) + +(let splitOptions StringSplitOptions.TrimEntries) + +(fn SplitLines ([text: string]) + (.EnumerateSplitSubstrings text [| #\lf #\cr |] splitOptions)) + +(fn SpanSplitChars ([ch: array] [text: ReadOnlySpan]) + (.EnumerateSplitSubstrings text ch splitOptions)) + +(fn SpanEq [(lhs: ReadOnlySpan) (s: string)] + (.Equals lhs (.AsSpan s) System.StringComparison.Ordinal)) + +(let example (not (Array.contains "full" ARGV))) +(let day "day18") +(let filepath (String.concat "" [| "./inputs/" day (if example "_example" "") ".txt" |])) +(printfn "file: %s" filepath) + +(let fileText (System.IO.File.ReadAllText filepath)) + +(module Array2D + (fn ToSeq ([arr: ^T[,]]) + (seq-> + (let h (dec (Array2D.length1 arr))) + (let w (dec (Array2D.length2 arr))) + (for/to [y (0 to h)] + (for/to [x (0 to w)] + (yield (.[y, x] arr)) + ) + ))) +) + +(union Dir + Up + Left + Down + Right) + +(typedef Pos int * int) + +(fn inline LeftOf ([(x, y): Pos]) ((dec x), y)) +(fn inline RightOf ([(x, y): Pos]) ((inc x), y)) +(fn inline UpOf ([(x, y): Pos]) (x, (dec y))) +(fn inline DownOf ([(x, y): Pos]) (x, (inc y))) + +(fn inline GetDirFun ([d: Dir]) + (match d + [Up UpOf] + [Down DownOf] + [Left LeftOf] + [Right RightOf] + )) + +(record Ins [dir: Dir] [amt: int] [col: string]) + +(fn GetFixedIns ([ins: Ins]) + (let col (+col ins)) + (let hex (.Substring col 1 5)) + + (let dir (match (.[6] col) + [#\0 Dir.Right] + [#\1 Dir.Down] + [#\2 Dir.Left] + [#\3 Dir.Up] + [_ (failwithf "unreachable")] + )) + + (let amt (System.Int32.Parse (hex, System.Globalization.NumberStyles.HexNumber))) + + ;; (printfn "%A %A" dir amt) + + {| dir dir amt amt col col |} +) + +(fn ParseFile ([text: string]) + (mut lines (SplitLines text)) + + (let res (!vec)) + + (while (.MoveNext lines) + (let line (+Current lines)) + (unless (+IsEmpty line) + (mut parts (SpanSplitChars [| #\space |] line)) + (let _ (.MoveNext parts)) + (let dir_ (+Current parts)) + (let dir (cond_ + [(SpanEq dir_ "R") Dir.Right] + [(SpanEq dir_ "L") Dir.Left] + [(SpanEq dir_ "U") Dir.Up] + [(SpanEq dir_ "D") Dir.Down] + )) + + (let _ (.MoveNext parts)) + (let amount (span->int32 (+Current parts))) + + (let _ (.MoveNext parts)) + (let color (.ToString (.Trim (+Current parts) [| #\( #\) |]))) + + ;; (printfn "%A %A %A" dir amount color) + + (.Add res {| dir dir amt amount col color |}) + ()) + ()) + + (.ToArray res) +) + +(fn Display ([gr: char[,]]) + (let sb (new System.Text.StringBuilder)) + + (for/to [y (0 to (dec (Array2D.length1 gr)))] + (for/to [x (0 to (dec (Array2D.length2 gr)))] + (let _ (.Append sb (.[y, x] gr))) + ()) + (let _ (.AppendLine sb)) + ()) + + (.ToString sb) +) + +(fn IsDot ([gr: char[,]] [y: int] [x: int]) + (= (.[y, x] gr) #\.) +) + +(let OFFSETS [| + (-1, -1) + (0, -1) + (1, -1) + (-1, 0) + (1, 0) + (-1, 1) + (0, 1) + (1, 1) +|]) + +(fn FindFillStart ([grid: char[,]]) + (fn rec inner ([grid: char[,]] [line_idx: int]) + (let row (.[line_idx, *] grid)) + (mut first (Array.findIndex #(= %1 #\#) row)) + (let last (Array.findIndexBack #(= %1 #\#) row)) + + (mut looping true) + (mut found None) + (while (and looping (< first last)) + (cond_ + [(= #\. (.[first] row)) + (set! found (Some (first, line_idx))) + (set! looping false) + ] + [_ + (set! first (inc first)) + ])) + + (match found + [(Some it) it] + [None (inner grid (inc line_idx))] + )) + + (inner grid 0) +) + +(fn FloodFill ([grid: char[,]] [start: Pos]) + (let queue (new Queue<_>)) + + (fn inline Push (p) (.Enqueue queue p)) + (fn inline Pop () (.Dequeue queue)) + (fn inline IsEmpty () (= 0 (+Count queue))) + + (Push start) + + (let HEIGHT (Array2D.length1 grid)) + (let WIDTH (Array2D.length2 grid)) + + (while (not (IsEmpty)) + (let (x, y) (Pop)) + + (cond_ + [(= #\# (.[y, x] grid)) ()] + [_ + (set! (.[y, x] grid) #\#) + + (for/in [(ox, oy) OFFSETS] + (let (nx, ny) ((+ x ox) , (+ y oy))) + + (cond_ + [(and + (and (>= nx 0) (< nx WIDTH)) + (and (>= ny 0) (< ny HEIGHT)) + (= #\. (.[ny, nx] grid)) + ) + (Push (nx, ny)) + ()] + [_ + () + ] + ) + ) + ] + ) + ) + + + () +) + +(fn GetPositions ([instructions: array]) + + (let positions (!vec)) + + (mut current (0, 0)) + (mut first true) + + (for/in [ins instructions] + (let color (+col ins)) + (let amount (+amt ins)) + (let dir (+dir ins)) + + (cond_ + [first + (set! first false) + (.Add positions (current . color)) + ] + [_ () ]) + + (let dirfun (GetDirFun dir)) + + (for/to [_ (1 to amount)] + (let next (->> current (dirfun))) + + (.Add positions (next . color)) + + (set! current next) + ) + () + ) + + (.ToArray positions)) + +(fn Part1 ([instructions: array]) + (let positions (!vec)) + + (mut current (0, 0)) + (mut first true) + (for/in [ins instructions] + (let color (+col ins)) + (let amount (+amt ins)) + (let dir (+dir ins)) + + (cond_ + [first + (set! first false) + (.Add positions (current . color)) + ] + [_ () ]) + + (let dirfun (GetDirFun dir)) + + (for/to [_ (1 to amount)] + (let next (->> current (dirfun))) + + (.Add positions (next . color)) + + (set! current next) + ) + () + ) + + (let minX (->> positions (Seq.map fst) (Seq.map fst) (Seq.min))) + (let maxX (->> positions (Seq.map fst) (Seq.map fst) (Seq.max))) + (let minY (->> positions (Seq.map fst) (Seq.map snd) (Seq.min))) + (let maxY (->> positions (Seq.map fst) (Seq.map snd) (Seq.max))) + (printfn "SIZE: %A" (minX, maxX, minY, maxY)) + + (let diffX (- maxX minX)) + (let diffY (- maxY minY)) + + (let poly (->> positions (Seq.map fst) (Seq.map #(begin + (let (ox, oy) %1) + ((+ (abs minX) ox) , (+ (abs minY) oy)) + )) (Set.ofSeq))) + + (let grid (Array2D.create (inc (- maxY minY)) (inc (- maxX minX)) #\.)) + + (let HEIGHT (Array2D.length1 grid)) + (let WIDTH (Array2D.length2 grid)) + (printfn "(H, W) %A" (HEIGHT, WIDTH)) + + (for/in [((x, y) . _) positions] + (set! (.[(+ y (abs minY)), (+ x (abs minX))] grid) #\#)) + + ;; (printfn "%A" poly) + ;; (printfn "%s" (Display grid)) + + (let start (FindFillStart grid)) + (printfn "%A" start) + + (FloodFill grid start) + + (->> (Array2D.ToSeq grid) + (Seq.fold #(match %2 + [#\# (inc %1)] + [_ %1] + ) 0L) + )) + + +(fn Part2 ([instructions: array]) + (fn Shoelace ([vs: array]) + (let area + (->> vs + (Seq.windowed 2) + (Seq.map #(begin + (let (p0x, p0y) (.[0] %1)) + (let (p1x, p1y) (.[1] %1)) + (int64 (+ + (- (* p0x p1y) (* p0y p1x)) + (abs (- p0x p1x)) + (abs (- p0y p1y)) + )) + )) + (Seq.reduce add)) + ) + + (let (fx, fy) (.[0] vs)) + (let (lx, ly) (.[(dec (+Length vs))] vs)) + + (let area (+ area (int64 (abs (- (* lx fy) (* ly lx)))))) + + (inc (/ area 2L)) + ) + + (let vertices (Array.map fst (GetPositions instructions))) + + (Shoelace vertices)) + +(let parsed (ParseFile fileText)) + +;; (printfn "%A" parsed) + +(let part1 (Part1 parsed)) + +(WriteResult "part1" part1 (if example 62 62573)) + +(let part2 (->> parsed (Array.map GetFixedIns) (Part2))) + +(WriteResult "part2" part2 (if example 952408144115L 54662804037719L)) + +() diff --git a/visp/examples/aoc2023/inputs/day18.txt b/visp/examples/aoc2023/inputs/day18.txt new file mode 100644 index 0000000..663a43e --- /dev/null +++ b/visp/examples/aoc2023/inputs/day18.txt @@ -0,0 +1,602 @@ +L 2 (#002a22) +U 4 (#21c3f1) +L 6 (#07c2e2) +U 12 (#2cd611) +L 6 (#4355a2) +U 11 (#3f2bd1) +L 3 (#0a4352) +U 8 (#10c6f1) +L 4 (#3442d2) +U 2 (#070681) +L 9 (#56c582) +U 8 (#0ca523) +L 5 (#0616d2) +U 4 (#2d5303) +L 2 (#1f1792) +U 8 (#05a201) +L 5 (#068db2) +U 7 (#4133a1) +L 4 (#49d012) +U 3 (#2b27d1) +L 5 (#023822) +U 3 (#71fd73) +L 2 (#1b8302) +U 3 (#1a1473) +L 12 (#7202a0) +U 5 (#367ad3) +R 9 (#1b2dd0) +U 3 (#1b0be3) +R 5 (#41bc92) +U 6 (#3d8d63) +R 2 (#459972) +U 6 (#349ac3) +R 7 (#28f782) +U 7 (#27c4b3) +L 8 (#146482) +U 6 (#164a63) +L 3 (#158830) +U 5 (#593d23) +R 11 (#0d6890) +U 3 (#5cd343) +L 7 (#35dab0) +U 4 (#13d183) +L 8 (#34ed40) +U 10 (#232873) +L 6 (#320120) +U 4 (#588393) +L 2 (#0d0c10) +U 9 (#341f93) +L 6 (#18dfb0) +U 3 (#6b8a31) +R 5 (#00cb50) +U 4 (#0674c1) +R 7 (#4dbc70) +D 4 (#30a451) +R 3 (#563bc0) +U 7 (#2a4081) +L 3 (#134d10) +U 5 (#223dd1) +L 6 (#4404c2) +D 5 (#18f693) +L 6 (#238f52) +U 6 (#18f691) +R 3 (#507c82) +U 3 (#02f741) +R 9 (#737440) +U 7 (#2e5781) +R 4 (#523d40) +D 5 (#536503) +R 10 (#34c2a0) +D 3 (#1defa3) +R 4 (#3ae9c0) +D 6 (#0d5f21) +R 7 (#1858f0) +U 9 (#0d5f23) +R 3 (#349620) +U 4 (#0802d3) +R 11 (#22c370) +D 4 (#77f983) +R 4 (#16b6f0) +U 8 (#5d4b03) +R 2 (#304a82) +U 6 (#2c2dc3) +R 4 (#2020a0) +D 7 (#126323) +R 2 (#2f9700) +D 7 (#67dbd3) +R 3 (#3f9bf0) +U 5 (#038713) +R 5 (#6f32f2) +U 9 (#066153) +R 4 (#2020a2) +U 2 (#3c9d43) +R 5 (#304a80) +U 5 (#5b8693) +R 3 (#3f1852) +U 4 (#328121) +R 7 (#494a12) +U 3 (#2d0991) +R 7 (#494a10) +U 2 (#3a2981) +R 8 (#43b132) +U 5 (#18b871) +R 6 (#0a4db2) +U 4 (#0f0ef3) +R 5 (#128162) +U 6 (#374b23) +L 7 (#05f030) +U 5 (#260453) +R 7 (#05f032) +U 4 (#2e8073) +R 6 (#128160) +U 5 (#143d53) +R 3 (#2fea12) +U 11 (#035083) +R 3 (#391492) +D 3 (#375983) +R 7 (#187560) +D 5 (#5ae143) +L 7 (#4cae90) +D 6 (#583a03) +R 5 (#4a6d40) +D 3 (#583a01) +R 4 (#25e680) +D 5 (#4514a3) +R 2 (#48cba0) +D 9 (#227de3) +R 6 (#3376b0) +D 4 (#4025b3) +R 10 (#691440) +D 7 (#433043) +R 8 (#1142c0) +U 5 (#0ea5e3) +R 7 (#14a570) +U 4 (#0df2b3) +R 8 (#564330) +U 6 (#0df2b1) +L 8 (#222bc0) +U 8 (#4932d3) +R 4 (#297c50) +U 5 (#057773) +R 4 (#210c70) +U 8 (#15ec73) +R 7 (#33c252) +U 6 (#443093) +L 4 (#33c250) +U 6 (#237083) +R 4 (#15cac0) +U 6 (#5ab1b1) +R 5 (#180860) +D 3 (#1f6cc3) +R 5 (#638750) +U 7 (#3eece3) +R 4 (#288f80) +U 9 (#5e59a1) +R 7 (#188370) +U 4 (#5ab1b3) +R 3 (#407ba0) +D 9 (#6703e3) +R 2 (#1b6532) +D 7 (#19ab13) +R 7 (#468da2) +D 4 (#3ca881) +R 3 (#474eb2) +D 3 (#1c4c31) +L 3 (#2e0d52) +D 4 (#58f4b3) +R 7 (#036e32) +D 6 (#19ab11) +L 7 (#382c02) +D 5 (#4a1ff3) +L 7 (#17eb60) +U 5 (#327ea3) +L 6 (#6a30b0) +U 4 (#1f7fd3) +R 6 (#657632) +U 6 (#2f4e23) +L 6 (#0acea2) +D 3 (#2c35d1) +L 5 (#36b3d2) +D 8 (#3296d1) +L 6 (#27a1c2) +D 5 (#3296d3) +L 4 (#25d792) +D 4 (#2c35d3) +R 2 (#043ca2) +D 3 (#1969c3) +R 10 (#1322f0) +D 3 (#422c63) +R 4 (#1322f2) +D 8 (#2822d3) +R 3 (#37fc92) +D 4 (#4dfa93) +R 5 (#3be5e0) +D 10 (#41c4d1) +R 7 (#2f7cb0) +D 5 (#286dd3) +R 9 (#529280) +D 2 (#286dd1) +R 2 (#12ebd0) +D 6 (#41c4d3) +R 7 (#5fca40) +D 9 (#2c20f3) +L 7 (#18f480) +D 10 (#252743) +R 7 (#0e4450) +D 9 (#014981) +L 8 (#471910) +D 3 (#37ac31) +L 5 (#3cc3b0) +D 6 (#213a51) +L 2 (#20a282) +D 4 (#475d31) +L 12 (#20a280) +D 3 (#16fb41) +R 8 (#152570) +D 5 (#3abf63) +R 3 (#0e6b80) +D 3 (#0dbbb1) +R 10 (#1212c0) +U 8 (#6a64b1) +R 6 (#1f8bd0) +D 8 (#71a5c3) +R 4 (#27a980) +D 7 (#067aa3) +R 6 (#443f10) +U 11 (#3b0783) +R 3 (#0da262) +U 5 (#1678b1) +L 4 (#437c52) +U 5 (#075b71) +R 4 (#2acd82) +U 5 (#075b73) +R 3 (#292482) +D 6 (#1678b3) +R 3 (#06e1f2) +D 3 (#417813) +R 3 (#2b8890) +D 12 (#3785b1) +R 6 (#39a1a0) +D 5 (#06ed61) +R 4 (#525f00) +D 5 (#4c1641) +R 5 (#3d6020) +D 10 (#173333) +R 2 (#447560) +D 3 (#173331) +R 5 (#70ff20) +U 5 (#420931) +R 13 (#27f5e2) +U 2 (#3e8533) +L 13 (#757bf2) +U 6 (#3e8531) +R 6 (#5551a2) +U 5 (#21cb81) +R 11 (#001132) +U 3 (#54e9f1) +R 4 (#4130d0) +U 8 (#324771) +R 8 (#702282) +D 11 (#3bc3c1) +R 8 (#40caf2) +U 9 (#39f341) +R 5 (#34d172) +U 5 (#54c081) +R 6 (#07a110) +D 6 (#012761) +R 9 (#1fa950) +D 3 (#4514d1) +L 9 (#3fab02) +D 5 (#4014c1) +R 3 (#3fab00) +D 6 (#18d141) +R 6 (#4337e0) +D 7 (#12db51) +R 10 (#21a050) +D 5 (#281921) +R 3 (#599c50) +D 9 (#05bf01) +R 3 (#5e5870) +D 8 (#47b271) +R 5 (#401b52) +D 2 (#381331) +R 13 (#0ab252) +D 5 (#475721) +L 5 (#3fcf02) +D 5 (#047601) +R 4 (#41ece2) +D 6 (#29e121) +L 4 (#0da7e2) +D 3 (#66a441) +L 3 (#498272) +U 3 (#069331) +L 3 (#0b2202) +U 11 (#367d01) +L 3 (#5f8b10) +D 5 (#25fd71) +L 6 (#5f8b12) +D 5 (#2222a1) +L 6 (#0b2200) +D 11 (#2ed1e1) +L 3 (#5c4d10) +U 11 (#3b3981) +L 5 (#0d8dd0) +D 5 (#180611) +L 2 (#07ee00) +D 7 (#66bc21) +R 3 (#4ed0f0) +D 5 (#17aeb1) +R 10 (#014240) +D 3 (#0abf41) +R 3 (#146980) +D 9 (#323e93) +L 8 (#473242) +D 6 (#2e90f3) +L 5 (#473240) +U 10 (#285a93) +L 6 (#302c30) +D 10 (#390351) +L 4 (#0268f0) +D 5 (#06bb31) +L 3 (#574450) +D 9 (#555641) +L 10 (#574452) +D 9 (#282581) +L 4 (#1ad920) +D 8 (#40ed61) +L 8 (#0b97a0) +D 3 (#50e773) +L 12 (#5b8610) +U 6 (#50e771) +L 7 (#14c0c0) +U 8 (#173931) +L 3 (#245c50) +U 2 (#32fb81) +L 4 (#426df0) +U 11 (#2bd621) +L 3 (#40e1f0) +U 6 (#3c7811) +L 2 (#381e20) +U 6 (#684e33) +R 3 (#1aa6f0) +U 4 (#3724e1) +R 7 (#0cbd52) +U 6 (#3fc731) +R 6 (#0cbd50) +U 3 (#01d961) +R 4 (#262240) +U 11 (#2192b1) +R 3 (#04cf80) +U 3 (#295c71) +L 7 (#1fbfd0) +U 3 (#40ee81) +L 6 (#2734d0) +U 5 (#16cf01) +L 10 (#48c230) +U 5 (#57bd83) +L 4 (#1114c0) +D 12 (#0bcd91) +R 3 (#09b9b0) +D 2 (#0f9203) +R 6 (#03f7c2) +D 10 (#1cb9d3) +L 5 (#3a2170) +D 4 (#440f53) +L 4 (#3a2172) +D 11 (#22ca73) +L 2 (#03f7c0) +D 4 (#5d6da3) +L 2 (#0306f0) +D 9 (#11ea73) +L 6 (#02b380) +D 6 (#472453) +L 8 (#1b9a90) +D 8 (#39d3d3) +R 10 (#2e0920) +D 3 (#3f08b1) +R 6 (#25d5e0) +D 7 (#41ef71) +L 5 (#1ac880) +D 10 (#4913c1) +L 9 (#3b51c0) +D 6 (#32f633) +L 7 (#34e9b0) +D 9 (#33f583) +L 4 (#540c00) +D 8 (#142393) +L 5 (#2c6dc0) +D 3 (#44dc13) +L 6 (#0b5020) +D 9 (#0eb4f1) +L 3 (#4646a0) +D 4 (#6d0261) +L 3 (#4646a2) +D 4 (#113dd1) +L 11 (#1df850) +D 6 (#32f631) +L 9 (#22fe70) +D 4 (#0160f1) +L 7 (#39bdd0) +D 4 (#34e8f1) +L 6 (#2929e2) +D 8 (#34bab1) +L 7 (#546d62) +D 8 (#362201) +R 8 (#5172e2) +D 6 (#281741) +R 8 (#43b292) +U 9 (#34c571) +R 4 (#63fd32) +U 3 (#3e02b1) +R 5 (#6f7d50) +U 5 (#2c87a1) +R 9 (#01ea20) +D 8 (#3454a1) +R 8 (#2dce30) +D 2 (#10cfd1) +R 9 (#3691d0) +D 7 (#10cfd3) +R 6 (#1e69e0) +D 13 (#2438d1) +L 4 (#5899f2) +D 4 (#4b11a1) +R 4 (#3e0152) +D 4 (#1deb21) +R 8 (#19e2c2) +D 2 (#595793) +R 8 (#42c692) +D 4 (#595791) +R 8 (#28b622) +D 10 (#1f7fc1) +L 9 (#2c8152) +D 10 (#283163) +L 9 (#4dd072) +U 6 (#1afb73) +L 6 (#203f22) +U 4 (#3f7cb1) +L 4 (#5e3c42) +D 4 (#3f7cb3) +L 7 (#0fc372) +U 4 (#10a8b3) +L 6 (#1d6262) +U 8 (#53d581) +L 5 (#34d752) +D 8 (#38ea91) +L 6 (#625922) +U 5 (#3721e1) +L 2 (#1dcbd2) +U 6 (#487a21) +L 5 (#0027d2) +U 9 (#29a381) +L 8 (#4bf4b2) +D 10 (#53de61) +L 3 (#1ba852) +D 9 (#5fd731) +L 3 (#215f90) +D 5 (#43bcf1) +L 6 (#291920) +U 13 (#52f531) +L 6 (#291922) +U 4 (#252861) +L 7 (#215f92) +D 4 (#2070d1) +L 6 (#4df172) +U 4 (#1f3291) +L 4 (#0ae8c2) +D 4 (#5f0e01) +L 4 (#0ab912) +U 10 (#248281) +R 7 (#100f72) +U 5 (#145ba1) +R 5 (#00b332) +U 7 (#0b56f1) +R 4 (#4564a2) +D 9 (#69dfa1) +R 2 (#0268a2) +D 3 (#04d221) +R 9 (#1d9602) +U 5 (#0c6b03) +L 5 (#295dd2) +U 7 (#3d6103) +L 2 (#555272) +U 5 (#244ac3) +R 6 (#585222) +U 4 (#36ddf3) +L 6 (#4aaf52) +U 7 (#0d0773) +L 7 (#1a26a2) +U 3 (#0525a1) +L 6 (#5f4ca2) +D 8 (#0525a3) +L 5 (#1d9c82) +U 8 (#4ced73) +L 4 (#1f1740) +U 6 (#384503) +L 8 (#528ce0) +U 9 (#1dadd3) +L 8 (#386ae0) +U 6 (#4574b3) +L 4 (#0a7440) +U 3 (#155343) +L 11 (#63f600) +U 8 (#155341) +L 2 (#2f3e70) +U 7 (#0ad913) +L 8 (#263e60) +U 4 (#61c343) +L 4 (#001bf2) +D 4 (#058193) +L 9 (#26dbd2) +U 4 (#61f213) +L 9 (#2bec82) +U 5 (#05f063) +L 8 (#22d622) +U 9 (#6d6401) +L 2 (#303192) +U 5 (#472873) +R 5 (#1dfb22) +D 6 (#392d23) +R 5 (#2d3e70) +U 12 (#01b0b3) +R 7 (#62c3c0) +D 12 (#29d613) +R 7 (#0426d2) +D 2 (#26dd63) +R 7 (#2bc7f2) +U 8 (#069683) +R 3 (#155b82) +D 7 (#1cbdd3) +R 2 (#2c7922) +D 8 (#2d4cc3) +R 3 (#40de32) +U 3 (#263333) +R 6 (#240212) +U 2 (#0ab653) +R 6 (#399eb2) +U 6 (#243d93) +R 4 (#3b5352) +U 4 (#4362e3) +R 4 (#5dfc22) +D 11 (#081f51) +R 6 (#5c76d2) +D 4 (#10e731) +R 5 (#151cf2) +U 3 (#135d31) +R 9 (#0d9a00) +U 2 (#61ab51) +R 4 (#072810) +U 3 (#0e8631) +L 10 (#5c9c80) +U 4 (#141c81) +L 3 (#003530) +U 3 (#0e43e1) +R 3 (#5f1a82) +U 4 (#108761) +L 10 (#3193f2) +U 9 (#142323) +L 5 (#0f7062) +U 7 (#67daa1) +L 6 (#44d032) +U 5 (#67daa3) +L 7 (#34f9d2) +U 10 (#4ae8b3) +L 2 (#61b820) +D 10 (#020743) +L 8 (#278240) +U 6 (#32a623) +L 6 (#2800b2) +U 9 (#2c2a83) +R 10 (#065c42) +U 2 (#436b51) +R 5 (#3a2b32) +U 11 (#436b53) +L 8 (#3af482) +U 6 (#1729d1) +L 7 (#148c52) +U 10 (#2f1fb1) +L 6 (#0f9f12) +D 5 (#363bb1) +L 11 (#0f9f10) +D 4 (#2ba701) +L 6 (#148c50) +D 2 (#17b781) +L 4 (#0909b2) +D 9 (#108763) +L 7 (#53a312) +D 6 (#3d7893) +L 4 (#474fd2) +D 8 (#2b7143) +L 3 (#10fbf2) +D 7 (#53fcb3) +R 5 (#584bc0) +D 6 (#020f13) +R 4 (#2c93f2) +D 7 (#3f5603) +R 3 (#4c06f2) +D 6 (#13d4d3) +L 2 (#4d2ed2) +D 2 (#13d4d1) +L 10 (#1c37f2) +D 3 (#0f99d3) +L 4 (#3988e2) +U 10 (#702653) diff --git a/visp/examples/aoc2023/inputs/day18_example.txt b/visp/examples/aoc2023/inputs/day18_example.txt new file mode 100644 index 0000000..fc7612e --- /dev/null +++ b/visp/examples/aoc2023/inputs/day18_example.txt @@ -0,0 +1,14 @@ +R 6 (#70c710) +D 5 (#0dc571) +L 2 (#5713f0) +D 2 (#d2c081) +R 2 (#59c680) +D 2 (#411b91) +L 5 (#8ceee2) +U 2 (#caa173) +L 1 (#1b58a2) +U 2 (#caa171) +R 2 (#7807d2) +U 3 (#a77fa3) +L 2 (#015232) +U 2 (#7a21e3) From 89d0408aeb2ee9d0b02dcccafbb0de37c49284e1 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Wed, 20 Dec 2023 05:53:44 +0100 Subject: [PATCH 2/2] Implement aoc2023 day19 --- visp/examples/aoc2023/day19.visp | 323 +++++++ visp/examples/aoc2023/inputs/day19.txt | 792 ++++++++++++++++++ .../examples/aoc2023/inputs/day19_example.txt | 17 + 3 files changed, 1132 insertions(+) create mode 100644 visp/examples/aoc2023/day19.visp create mode 100644 visp/examples/aoc2023/inputs/day19.txt create mode 100644 visp/examples/aoc2023/inputs/day19_example.txt diff --git a/visp/examples/aoc2023/day19.visp b/visp/examples/aoc2023/day19.visp new file mode 100644 index 0000000..a0e8698 --- /dev/null +++ b/visp/examples/aoc2023/day19.visp @@ -0,0 +1,323 @@ + +;; Copyright 2023 Ville Penttinen +;; Distributed under the MIT License. +;; https://github.com/vipentti/visp-fs/blob/main/LICENSE.md +;; +;; for basic syntax highlighting +;; vim: set syntax=clojure: +(require SpanUtils "0.4.0") + +(open System) +(open System.Collections.Generic) +(open System.Text.RegularExpressions) +(open SpanUtils.Extensions) + +(fn WriteResult (part value ex) + (printfn "%s: %A %A" part value (= value ex))) + +(let splitOptions StringSplitOptions.TrimEntries) + +(fn SplitLines ([text: string]) + (.EnumerateSplitSubstrings text [| #\lf #\cr |] splitOptions)) + +(fn SpanSplitChars ([text: ReadOnlySpan] [ch: array] ) + (.EnumerateSplitSubstrings text ch splitOptions)) + +(let example (not (Array.contains "full" ARGV))) +(let day "day19") +(let filepath (String.concat "" [| "./inputs/" day (if example "_example" "") ".txt" |])) +(printfn "file: %s" filepath) + +(let fileText (System.IO.File.ReadAllText filepath)) + +(union Op Gt Lt) +(union Cat X M A S) + +(record Condition + [cat: Cat] + [op: Op] + [value: int]) + +(record Workflow + [condition: Option] + [target: string]) + +(typedef Workflows array) + +(fn DefaultTarget ([flows: Workflows]) + (->> flows + (Seq.pick #(match (+condition %1) + [None (Some (+target %1))] + [_ None] + )) + )) + +(record Ratings + [X: int] + [M: int] + [A: int] + [S: int]) + +(typedef Pos int * int) + +(fn inline SumRatings ([r: Ratings]) + (+ (+X r) (+M r) (+A r) (+S r))) + +(fn inline Select ([cat: Cat] [r: Ratings]) + (match cat + [X (+X r)] + [M (+M r)] + [A (+A r)] + [S (+S r)] + )) + +(fn inline MatchesCond ([cnd: Condition] [r: Ratings]) + (let val (Select (+cat cnd) r)) + (match (+op cnd) + [Lt (< val (+value cnd))] + [Gt (> val (+value cnd))] + )) + +(fn ParseFile ([text: string]) + (mut lines (SplitLines text)) + + (mut looping true) + ;; Parse workflows + (mut result (!map)) + + (while (and looping (.MoveNext lines)) + (let line (+Current lines)) + (cond_ + [(+IsEmpty line) (set! looping false)] + [_ + (let lbrace (.IndexOf line #\{ )) + (let rbrace (.IndexOf line #\} )) + (let name (.ToString (.Slice line 0 lbrace))) + + (let flowParts (.Slice line (inc lbrace) (dec (- rbrace lbrace)))) + + ;; (printfn "%A" name) + ;; (printfn "%A" (.ToString flowParts)) + + (mut flowEnu (SpanSplitChars flowParts [|#\,|])) + + (let steps (!vec)) + + (while (.MoveNext flowEnu) + (let part (+Current flowEnu)) + (cond_ + [(.Contains part #\:) + (let partIndex (.IndexOf part #\:)) + + (let conditionParts (.Slice part 0 partIndex)) + + ;; (printfn "condition %A" (.ToString conditionParts)) + + (let catCahr (.[0] conditionParts)) + (let condCh (.[1] conditionParts)) + (let condVal (span->int32 (.Slice conditionParts 2))) + + (let condition + {| + cat (match catCahr + [#\a Cat.A] + [#\x Cat.X] + [#\s Cat.S] + [#\m Cat.M] + [_ (failwith "unreachable")] + ) + op (match condCh + [#\< Op.Lt] + [#\> Op.Gt] + [_ (failwith "unreachable")] + ) + value condVal + |}) + (let target (.Slice part (inc partIndex))) + (let flow {| condition (Some condition) target (.ToString target) |}) + ;; (printfn "%A" flow) + (.Add steps flow) + ] + [_ + (let target part) + (let flow {| condition None target (.ToString target) |}) + ;; (printfn "no cond") + (.Add steps flow) + ] + ) + () + ) + + (set! result (Map.add name (.ToArray steps) result)) + ] + )) + + (let ratingParts (!vec)) + + (while (.MoveNext lines) + (let line (+Current lines)) + (unless (+IsEmpty line) + (let trimmed (.Trim line [| #\{ #\} |])) + ;; (printfn "%A" (.ToString trimmed)) + + (mut partsEnu (SpanSplitChars trimmed [|#\,|])) + + (let _ (.MoveNext partsEnu)) + (let X (span->int32 (.Slice (+Current partsEnu) 2))) + (let _ (.MoveNext partsEnu)) + (let M (span->int32 (.Slice (+Current partsEnu) 2))) + (let _ (.MoveNext partsEnu)) + (let A (span->int32 (.Slice (+Current partsEnu) 2))) + (let _ (.MoveNext partsEnu)) + (let S (span->int32 (.Slice (+Current partsEnu) 2))) + + (let rex {| X X M M A A S S }) + + (.Add ratingParts rex) + + )) + + (result . (.ToArray ratingParts)) +) + +(fn ApplyWorkflow ([flows: array] (ratings: Ratings)) + (mut looping true) + (mut result None) + (mut enu (->> (Seq.ofArray flows) .GetEnumerator)) + (while (and looping (.MoveNext enu)) + (let flow (+Current enu)) + (match (+condition flow) + [(Some cnd) + (when_ (MatchesCond cnd ratings) + (set! result (Some (+target flow))) + (set! looping false) + ) + ] + [None + (set! result (Some (+target flow))) + (set! looping false) + ])) + + result +) + +(fn ApplyWorkflows [(flows: Map < string, Workflows >) (ratings: Ratings)] + (mut currentFlow (Map.find "in" flows)) + (mut isAccepted false) + (mut looping true) + + (while looping + (match (ApplyWorkflow currentFlow ratings) + [(Some "R") + (set! looping false) + ] + [(Some "A") + (set! isAccepted true) + (set! looping false) + ] + [(Some other) + (set! currentFlow (Map.find other flows)) + ] + [None + (set! looping false) + ] + )) + + isAccepted) + +(let g_SpanIndex (!map (Cat.X , 0) (Cat.M , 1) (Cat.A , 2) (Cat.S, 3))) +(fn inline CatToIndex (c) (Map.find c g_SpanIndex)) + +(fn Part2Combinations ([flows: Map < string, Workflows >] [dest: string] [spans: array]) + + (fn rec InnerLoop ([flows: Map < string, Workflows >] [dest: string] [spans: array] [ind: int]) + (cond_ + [(= dest "A") + (->> spans (Seq.map #(begin (let (s, e) %1) (int64 (inc (- e s))))) (Seq.reduce mul)) + ] + [(= dest "R") 0L] + + [_ + (let rules (Map.find dest flows)) + + (cond_ + [(< ind (+Length rules)) + (let flow (.[ind] rules)) + + (match (+condition flow) + [(Some rule) + (let ruleIndex (CatToIndex (+cat rule))) + (let (start, end) (.[ruleIndex] spans)) + + (let op (+op rule)) + (let value (+value rule)) + + (cond_ + [(or (and (= op Op.Lt) (>= start value)) + (and (= op Op.Gt) (<= end value))) + (InnerLoop flows dest spans (inc ind)) + ] + [(or (and (= op Op.Lt) (< end value)) + (and (= op Op.Gt) (> start value))) + (InnerLoop flows (+target flow) spans 0) + ] + [(= op Op.Lt) + (let lhs (start, (dec value))) + (let rhs (value, end)) + + (let lowers (Array.copy spans)) + (let higher (Array.copy spans)) + + (set! (.[ruleIndex] lowers) lhs) + (set! (.[ruleIndex] higher) rhs) + + (+ + (InnerLoop flows (+target flow) lowers 0) + (InnerLoop flows dest higher 0) + ) + ] + [_ + (let lhs (start, value)) + (let rhs ((inc value), end)) + + (let lowers (Array.copy spans)) + (let higher (Array.copy spans)) + + (set! (.[ruleIndex] lowers) lhs) + (set! (.[ruleIndex] higher) rhs) + + (+ + (InnerLoop flows dest lowers 0) + (InnerLoop flows (+target flow) higher 0) + ) + ] + ) + ] + [None (InnerLoop flows (+target flow) spans 0)] + )] + + [_ + (InnerLoop flows (DefaultTarget rules) spans 0) + ]) + ] + ) + ) + + (InnerLoop flows dest spans 0) +) + +(let (flows, parts) (ParseFile fileText)) + +(let part1 (->> parts + (Array.filter (ApplyWorkflows flows)) + (Array.map SumRatings) + (Array.reduce add) +)) + +(WriteResult "part1" part1 (if example 19114 346230)) + +(let part2 (Part2Combinations flows "in" [| (1, 4000) (1, 4000) (1, 4000) (1, 4000) |])) + +(WriteResult "part2" part2 (if example 167409079868000L 124693661917133L)) + +() diff --git a/visp/examples/aoc2023/inputs/day19.txt b/visp/examples/aoc2023/inputs/day19.txt new file mode 100644 index 0000000..045f411 --- /dev/null +++ b/visp/examples/aoc2023/inputs/day19.txt @@ -0,0 +1,792 @@ +tjt{s<421:R,m<858:R,R} +pn{m<2884:vzk,kv} +btq{x>3525:tmv,a>1758:rz,A} +blz{m<1251:A,A} +cq{s>2177:A,m<2653:xr,jhd} +ng{a>813:A,x>2371:A,s<2625:R,A} +vhb{x<870:A,x<956:R,x<992:R,A} +vgh{x>1126:A,m>3898:A,ktl} +lpl{x<241:mrx,npk} +sj{a<1405:R,x>749:nk,lrb} +lxb{x>2186:R,A} +hct{x>3522:R,a<3394:A,R} +hx{x>1130:A,R} +fb{s<3662:R,a>292:A,x<2915:A,R} +dd{s>2482:R,gpv} +bqp{x>2128:A,x<2009:R,s<1930:pvj,qx} +nn{m<463:R,x>1071:R,R} +fgk{s>1034:jzq,a>355:R,a<225:jzx,jsx} +vsx{s<1042:snp,m<3046:R,x<441:kl,A} +qcc{m<511:R,A} +xh{x<499:rn,jbt} +dc{a<3590:A,m<3779:A,R} +vr{a>3273:vb,x>2285:R,R} +bds{s<306:A,s>499:A,x<3062:A,A} +vjd{a>1008:dm,s>2534:xvk,a>402:ln,cs} +hts{m>2416:mt,m>2241:fn,fv} +zc{x>3475:A,m>2255:A,R} +qk{a>1936:R,m<3811:R,R} +txx{x>882:R,A} +ldj{a<1754:R,a>2649:R,x>2067:A,A} +jhd{x<2035:R,a>703:A,A} +vdp{x>324:A,x<146:R,A} +xz{m<1071:R,A} +ln{a<754:czt,a<875:R,m<651:js,R} +nlp{s>3695:xrj,x>3520:fr,s<3466:R,jmr} +bj{m>3673:R,x>767:R,R} +nb{m>3141:xtt,m<2506:xcc,cg} +fnq{m<1510:R,s<1712:A,s<1937:A,A} +gl{s<539:A,a<3836:A,R} +zlp{s>3294:A,x>874:R,A} +fsc{m>1216:A,R} +gjg{x>444:bdb,A} +xxt{a<2333:A,R} +qp{a<2914:A,R} +hrx{a>1154:R,R} +rjt{s<1369:jgx,m<3621:lc,jsv} +qhf{m>2169:R,m>2072:A,s>3461:A,A} +tx{a>1460:xm,x>2396:nh,x<2185:zhj,plc} +plc{s>1858:gp,tz} +zgl{x>1997:qcz,m<2077:bm,km} +svt{m>2677:mxg,a<1592:tm,qh} +vb{x<1656:A,x>2605:A,s>1065:R,R} +ddc{m>1102:A,A} +hv{x<582:pv,x<782:mh,x<935:R,A} +fx{a<398:A,a<628:R,A} +mt{a<1608:R,mrn} +dz{s>2542:sq,s<2394:ph,bxq} +qqb{x>3766:A,R} +px{m<994:A,A} +qlb{x<3607:A,m<2674:R,a<909:R,A} +mz{s>3811:R,x>3162:A,s<3637:A,R} +dj{m>837:A,m>493:R,R} +vd{m>3712:R,x>1536:R,a>2397:R,R} +hgq{s<2327:qs,x<3642:blz,cfz} +fqf{x>3166:A,R} +bqg{a<3089:pz,s>1067:R,m<3491:cz,R} +jj{x<876:A,A} +dbf{x>2283:R,R} +lc{a<1673:kvn,s>1698:gn,lrd} +sll{m<2418:A,a>2690:R,A} +jn{s>3300:A,s>2865:R,a<2377:R,R} +rmt{x>1029:R,a>1892:A,txx} +tb{a>2179:A,m<336:R,x>1273:R,R} +xmj{m>2340:fsl,x<3545:mfk,x>3768:mns,dtl} +bsq{m>754:R,m>413:A,A} +tl{x<2667:ppg,A} +qsp{m<2595:hvh,s<3649:R,s>3703:pkt,A} +qpr{m>1689:A,a<839:R,a>1009:A,R} +lhz{m<994:A,m>1143:A,R} +bnh{s>3147:vs,A} +fz{x<356:R,R} +lnz{x>3018:R,m<1045:A,R} +gh{m>482:A,x>1100:A,R} +nks{a>1858:A,m>243:R,x<2127:rpr,vkd} +jx{a>2810:fzb,R} +prp{x>1299:tjt,m<670:ddx,cr} +sgk{s>2056:cxr,m>3706:A,a<692:vcm,bj} +vjg{m>759:A,s>346:fqf,m>369:A,qq} +nbj{a>3394:A,nz} +lh{m>2524:pn,m>2280:mbg,ll} +sbf{s>1028:kxn,gd} +zrf{a>592:R,R} +jv{m<861:R,s>3550:R,R} +qg{x>1202:R,x<1117:ncr,a<1728:mfh,dgt} +hth{a>3474:R,A} +vrb{x<2884:R,m<1345:R,m>1634:R,R} +pc{s>1715:R,a<222:R,R} +zsj{m<2564:R,s>1964:rnk,zl} +lm{m>2198:R,m>2054:A,A} +jjt{m>1059:qd,xcb} +xgv{m<3861:A,s>3759:R,A} +qvj{s>2100:clf,bg} +ct{m<2821:A,R} +xm{m>2251:zsj,x>2394:mk,a<3040:bqp,df} +gdb{m<2361:pcn,ct} +psr{m<3379:A,a<1343:R,s>2860:R,R} +tc{m>1272:A,x<1039:md,lhz} +xxl{s>3601:qpr,s>3355:hnh,s<3240:A,R} +vnf{s<2572:A,m<2644:R,s>2645:A,A} +dxz{a>252:A,a<116:R,s<3838:R,R} +dbs{a>364:fns,s>2273:R,m<2302:gk,nx} +kgc{a>3320:hzt,x>2939:jx,s<3689:ms,fhz} +mxd{a>1547:gkl,x>3257:zh,a>611:mgp,nc} +gz{m<3730:A,R} +jg{s<3383:R,x>368:R,R} +qhl{m>3242:R,x<1109:A,a>2067:A,A} +mf{x<2058:R,A} +lv{x<2643:A,R} +gv{s>3910:zsf,R} +qgj{s>1303:gdb,a<1335:zkd,bsj} +vnk{s>3307:hmp,a>982:gb,s<3157:A,A} +pt{a>2908:A,s>2716:A,R} +bd{x>560:R,R} +cs{x<3526:R,R} +zq{s<2032:zfj,a<3301:bnh,vxz} +ppg{m>1031:A,a<2235:A,x>1671:A,R} +vg{m<1396:tpq,s<3801:tgx,a>3156:tq,rv} +db{x>3085:R,vq} +zqz{x>1179:R,s<3716:A,m<1413:R,R} +hmj{m>502:R,R} +xv{a>3405:R,m<2078:A,a>3335:R,R} +pr{x<1735:A,x<1798:A,m>2560:dt,A} +bsj{s>711:R,x>534:R,fqx} +mm{a<1003:tk,a<1264:R,R} +rfv{m<3548:gjg,s>2637:nxp,jp} +tdn{x>389:ht,m<3308:ft,dq} +jpm{s<238:A,R} +vq{x<2985:A,s>2381:A,m>3114:R,R} +fp{a<1734:dsq,a<2115:bkr,grk} +cls{s>2735:R,s>1889:R,R} +dm{x>3413:R,R} +lk{x>1667:qk,a<1962:kb,a>2237:vd,R} +zhj{m>2389:cq,a<817:rxr,zgl} +tpt{a<816:fx,s>3338:bdd,a<1152:R,A} +qzq{x>2078:hvj,fgk} +bmx{s<2549:R,x<1371:R,a>2370:R,A} +ps{m<3675:A,R} +hvh{x<1782:A,m<2172:R,A} +hbg{s>3071:A,R} +mfh{x<1154:A,x>1170:R,A} +snv{m<875:R,A} +rnk{x>2433:R,m<2710:R,R} +qx{a<2188:A,m<2110:A,R} +hp{m<3515:A,m>3557:A,R} +bjl{s>3846:R,A} +mqn{m>1440:R,xdf} +kj{s>465:A,A} +lrd{a<2245:A,x>1164:A,a>2433:A,R} +pkt{s<3726:R,x<1775:R,R} +fpp{s<3396:R,R} +zzr{a<3362:jrf,nm} +kcc{x<2914:bkc,m<3270:db,x<3026:fnt,phn} +cz{x<462:R,R} +hqt{x>83:R,s>585:R,A} +dk{x>1956:qrl,a>2615:A,R} +vj{s>286:R,s<144:A,nn} +zsf{s<3966:A,A} +kxn{s<1212:R,a>3263:A,R} +qbt{x>3615:A,s<295:R,a<436:A,R} +zkh{m<940:gj,x>3262:R,m>1437:ggs,vnn} +qhs{m<2086:A,zf} +bcr{x>3749:R,a<3037:A,A} +sx{m<3285:mgb,sfv} +ht{s>3015:R,s<2964:R,A} +fv{m<2086:A,a<1592:jj,s<3712:R,R} +qrl{a<2133:R,R} +fhz{a<2838:R,sf} +qsl{s>1107:tl,dxm} +dtl{m<2090:sg,A} +nk{x>1247:R,m>3578:A,A} +lnv{m>655:A,a>779:R,qm} +ktl{m>3829:R,x<733:R,s<2065:A,A} +qpk{a>689:A,m>3804:fz,x<406:dxz,R} +pvq{s<3169:cp,a<3568:psk,a<3839:dfn,hv} +xn{a>2674:lhp,s<2442:lqv,m<661:nck,qr} +bm{m>1977:A,A} +vvz{a>3595:gnm,A} +xnq{s>3370:lk,x<1662:vgs,x>1737:qmc,kz} +jdb{s<3625:R,a>2035:R,m<3572:fs,fh} +svv{s<3721:R,A} +tsp{a<3645:R,s<187:A,R} +vqb{s<3393:R,s>3497:A,R} +rhs{m<2149:A,a>3124:R,R} +crf{m<808:zgp,a>1617:rcp,m<1404:khj,tpt} +cbb{x<2260:R,s>2215:A,A} +kl{s>1705:A,m<3101:A,m>3117:R,R} +sg{m<1969:R,A} +mr{m<3104:gtb,x<740:jb,m>3548:znz,tt} +vgs{s<2697:R,a<1874:R,R} +ll{a>3520:qhs,x>591:vc,a<3205:kg,pg} +khj{x>1884:R,m>1045:fsc,vbb} +km{x<1946:R,R} +pbv{a>3212:A,R} +bc{m<678:kxt,x<3883:bcr,jv} +qkf{s>3282:jdb,m<3517:tdn,a<2262:gq,lnd} +gtb{s>3374:hts,x<947:hc,plx} +npl{x>632:A,R} +zgp{m>501:A,x>1884:A,A} +qq{s<173:R,s>264:A,R} +kgh{x<3627:A,m<797:R,a>617:qqb,A} +hmp{s<3601:A,s<3817:A,x<264:R,R} +jkd{x<3229:R,a<1551:R,s>539:R,R} +hmx{a<2979:A,R} +lx{s<3161:A,m>2319:R,m<2304:R,R} +fd{s>1204:vdp,A} +hvp{x>1719:qbg,a<3333:nnn,x>1628:dxr,bb} +sv{s<3604:A,a>3068:R,a<2721:R,A} +lhp{a<3538:xvl,gss} +zl{m>2704:R,R} +ctb{a>1176:A,A} +vhf{x<3088:A,s<3834:R,a>3560:R,R} +jp{a>865:xgn,m<3742:tp,rj} +ntr{x<2919:R,m>1236:R,R} +ds{s<519:R,s<878:A,s<1172:fcj,tlh} +vv{x<252:R,a<2541:R,m>3735:R,A} +gg{s>3328:R,A} +sxq{s<751:bzm,a<2688:qsl,csc} +szk{s<2549:R,s>2614:A,a>2001:R,A} +hf{x<3805:xd,x>3921:R,vrf} +ddx{m>287:R,R} +hg{a<3498:R,m<1783:A,x>3275:A,A} +dq{s>3044:A,a>2039:A,x>144:A,A} +rxr{s<2105:mf,s<2899:R,qhf} +nr{a>1144:lgd,x>719:sxb,vgp} +zlc{m>509:R,hct} +dx{m<1025:hmj,a<1400:bds,s<347:khk,kj} +phn{m<3669:R,mll} +trj{s>1845:R,a<2260:R,R} +dlq{x>1984:A,a<251:A,R} +zkd{x>349:R,x>191:dnq,m<2574:A,hqt} +bkc{s>1996:A,a<1391:A,s>1219:R,fpq} +bq{m>3698:R,A} +gxm{m<438:A,blq} +kxt{a>3248:R,s<3556:R,a<2744:R,R} +qlv{x<1354:A,A} +shq{a>926:lv,x<3143:dtk,lnv} +qgk{x<1658:R,x<1692:R,A} +rq{a<1045:A,a<1256:R,R} +lnx{m>607:A,x<2899:R,A} +ft{s>3044:A,x>232:R,s>2971:R,R} +bg{m>1166:fnq,ldc} +ljj{m<3829:R,R} +mkc{s>3828:A,R} +fpq{m<3563:A,a<2319:R,A} +sf{m>620:R,x<2753:A,R} +pnr{m>3713:tn,gqz} +tj{a<1737:R,s<3703:R,x>1093:A,R} +tm{x<1528:R,A} +hbs{s<3431:R,a>3711:A,R} +ql{m>2548:R,s<3880:A,A} +xdz{a<3296:R,m>3507:A,s>3467:A,R} +nq{a>1904:qxl,ch} +nh{a<756:dbs,s<1486:mm,qt} +ncr{x>1054:R,x<1031:R,m>2717:R,R} +xdf{a<966:A,s<2678:A,x>207:R,R} +vkd{s<3723:R,s<3777:A,A} +qr{s>3234:zqz,x<1219:A,m>1136:rfb,hl} +sq{s>2676:A,a<810:A,m>2571:A,A} +hl{a>2312:A,x>1386:R,R} +qt{x<2687:qzj,m>2371:A,x>2952:rq,R} +gqz{m<3658:R,x<1571:A,R} +zvr{a<1449:A,a<1537:R,a>1559:R,A} +gss{m<946:R,R} +rlf{s<3122:zj,x<2623:kf,a<2439:mxd,bp} +kd{s<860:jjt,qzq} +frg{m<721:R,s<495:jpm,s<594:R,hth} +jc{x>3005:kqz,fb} +ttx{m>1178:R,a>3549:A,s>3699:R,R} +ks{x>3192:qdl,m<2843:tx,jm} +rcc{m<135:bd,s>2351:plk,tbs} +gc{x>1252:R,x<1124:R,vnf} +tbs{s>1831:A,m<183:R,x>626:R,A} +bdd{a>1139:R,A} +rbb{a>2469:svv,R} +mc{x<161:bvc,m<386:A,m<743:znm,snv} +gn{s>2004:R,x>791:A,m>3451:trj,zp} +bkr{m<3830:A,m>3911:R,R} +mrn{a<1992:R,a>2373:A,a<2163:R,A} +kxj{a<2179:A,m<592:A,A} +xcb{a<346:R,x<2443:A,x>3253:qbt,A} +ns{m>3727:A,m>3650:A,x>267:hbg,A} +jbk{m>2388:R,x>502:lx,bts} +zf{a<3796:R,m<2198:A,a>3900:R,R} +rl{a>1132:A,a<412:pc,a>747:tr,R} +plx{s>2748:svt,a<1262:dz,a<2131:gc,ftq} +fth{s>3415:A,x>3229:A,m>837:A,A} +qh{x>1311:A,R} +cfz{x<3876:A,m<1394:R,A} +zj{x<3033:qvj,a<2496:vjd,sz} +tkp{m>1232:zvr,a<1388:vj,gxm} +jgt{m>536:A,R} +jgx{s>740:sj,lg} +rr{s<1225:A,x>943:R,a<1252:R,R} +nz{x>1618:A,s<3666:A,m>2719:R,R} +pcn{x<342:R,s>1843:A,A} +tk{a>857:R,s>708:A,s>398:R,A} +rpn{a<3305:fth,x<3457:fpp,R} +fns{x>2771:A,R} +bb{m>3739:A,zkv} +zkv{m<3489:R,a>3597:R,x>1601:A,A} +lnd{a>2476:vv,qnc} +nft{a<3516:R,x>1811:R,A} +mll{s<1685:A,A} +xb{s<1337:ds,s<2861:ghx,vbg} +sgp{a<1631:mv,lcf} +rbh{s>275:A,s<173:R,x>3194:R,R} +rk{x<359:mqn,m<1432:jq,zr} +ldc{x>2015:R,a<2608:R,R} +rx{m>3449:A,x>1235:A,R} +gb{m<3258:A,a<1246:R,R} +kb{m<3770:R,R} +tgx{x>3342:R,s<3664:R,A} +xg{s<2660:A,x>939:R,A} +vt{x<2340:prp,lf} +clf{s<2555:ttq,a<1704:A,s>2807:gtx,dbf} +bl{x<395:mc,m>560:bz,m>209:rm,rcc} +tv{a>3024:nqp,s<3413:A,a>2798:R,sll} +zfj{m<2880:R,m>3308:zk,m>3029:A,A} +cnd{m>1268:R,a<2716:R,m<1141:A,R} +bnb{a<3079:xh,pvq} +cr{a>972:R,A} +gj{x>3483:A,m<417:R,x>2977:A,A} +dxr{x>1672:R,R} +tn{m>3866:A,s<3107:A,A} +fqv{x>635:R,x>537:R,R} +tt{s>3362:sgp,sx} +gpv{x>1132:R,A} +gtx{x<2263:A,x<2606:A,R} +jzq{m>923:A,s<1232:A,s<1307:R,A} +csc{m<846:vr,sbf} +bnl{a>1592:sxq,a<587:kd,s>673:ccz,rb} +vc{s<3106:A,m<2054:A,m<2146:R,A} +hh{a<3653:vrb,s<403:vhc,gl} +xbt{a>3730:R,s<3499:R,x>757:R,R} +hnh{a>951:R,x<2772:A,s<3460:A,A} +lmz{m>1632:R,A} +snp{m<3008:R,a>3166:A,A} +lcf{m<3345:qhl,rx} +ch{x>770:jfx,m<1079:bl,rk} +xvl{x>1269:R,s<2919:R,s>3313:R,R} +mp{x<1027:R,a>1993:bq,A} +kqd{a<3553:A,x>1491:A,m<3290:R,R} +jsx{a>281:A,R} +rpd{a>242:A,A} +rjh{m<2862:A,a>3060:R,R} +rg{m<3849:A,s>1590:hq,R} +mfk{m<2148:A,x>3408:zc,R} +st{x<3546:R,a<3778:A,qlf} +ftq{m<2410:bmx,x<1478:cc,R} +lt{a>3327:R,x<632:vkc,s<1431:skh,qp} +qb{s>3719:R,m>2287:R,R} +qdl{m>3083:xb,xmj} +gpk{x>164:A,a>3716:A,R} +xgn{s<2433:R,s<2503:R,R} +bsd{x>3244:A,a>1518:A,s<240:R,R} +frr{m>1227:R,s>1077:A,A} +zk{s>1157:R,A} +jbt{x<788:A,a>2772:A,A} +rv{s<3917:bjl,xlq} +vnn{m<1170:A,A} +nc{x<2861:kk,m<797:jc,mht} +sfv{x>1230:psr,xg} +vsn{a>3227:A,a<2959:R,a<3095:R,A} +khk{m>1512:A,x>3003:R,s<191:R,R} +rn{a>2760:R,a>2685:A,R} +jzx{m<1200:A,R} +vcz{s>1081:A,m<2683:A,s<526:mx,td} +xlq{s>3969:R,a<2883:R,m<1695:A,A} +qcz{x<2078:A,A} +cb{x<470:gz,m>3778:qxh,a<983:fqv,R} +vgp{x<418:frr,m<1057:sc,A} +dxm{s>963:A,a>2021:mpj,R} +znm{a>1088:R,R} +cd{a<3298:A,m>2726:R,a>3599:R,A} +rm{a<946:A,m<378:R,A} +jb{s<2872:rfv,a<1688:dlk,qkf} +tpq{s>3763:A,a<3073:cnd,s<3644:A,ttx} +pq{a<1250:R,A} +gkl{a<1946:btq,a>2250:nqn,m>956:gmb,zs} +jsv{s<1865:rg,m>3758:vgh,a<1555:sgk,mp} +mv{s<3613:A,x>1133:cx,A} +mgp{a>1171:ntr,x>3038:xz,m>1255:xxl,zz} +fgs{s<3470:pr,x<1668:nbj,s>3751:vnh,qsp} +kz{a>1899:R,A} +qbg{s<1443:R,a>3515:A,pt} +jm{x<2632:gvb,kcc} +qxl{x<833:qrf,xn} +sc{a<774:A,x<538:R,A} +blq{x<1591:R,a<1517:A,A} +zr{a>997:A,m>1741:R,lmz} +zt{s<212:A,R} +czt{m<1048:R,R} +mht{m<1519:rpd,s<3483:A,lvp} +zbq{a>2959:R,x<2796:R,R} +fvg{x<1054:gg,ps} +pvj{s>762:A,x<2058:R,R} +skv{x>303:A,m<1222:dp,a<2430:R,A} +vbb{a<577:R,a<1073:R,m>904:R,R} +ph{a>597:R,s>2332:A,A} +mb{s>3687:snz,x<3662:jgt,s<3584:bc,rqx} +mxg{s<3157:A,s<3246:A,s<3324:R,R} +znz{a<1063:jxk,x<1435:hxf,xnq} +df{a>3410:pk,x>2036:R,zm} +zs{a>2098:kxj,m>416:rc,rrt} +td{x<1619:R,a<1141:A,x>1769:R,A} +dgt{m<2569:R,m<2884:A,s<815:R,R} +vcm{s<1944:A,a<317:R,R} +vbg{m<3690:qhc,xxt} +vs{x<1249:A,s>3443:A,s>3317:R,R} +ccz{x<1743:nr,shq} +fr{m>416:R,x<3686:A,m<249:R,A} +bdb{a<1316:A,R} +rfb{s>2777:R,m>1529:R,a>2216:A,A} +nck{x>1220:A,m>360:jn,R} +dsq{s>3244:A,a<1311:R,a<1534:R,A} +qrf{a<2715:skv,fdk} +hq{s<1695:A,A} +xnc{m>1175:A,s<3693:ldj,x>2143:cnv,A} +qnc{x>254:A,R} +mpj{m<923:A,A} +dtk{x>2279:R,R} +qhc{s>3289:A,a>2521:A,s>3046:R,A} +mrx{s>2922:R,a>1296:A,R} +xt{x>1034:sqq,s<2245:nb,m>3279:bnb,lh} +tlh{a>2441:A,x>3502:A,A} +vkc{m<2389:R,s<838:A,R} +jrf{m>2378:rjh,lm} +tz{s<1103:R,s<1546:zg,zqd} +lf{a>991:rbh,m<1007:R,A} +scg{x<288:A,a<2867:R,x>456:R,A} +zp{a<2075:R,a<2344:A,m<3366:A,R} +fvs{m<3396:A,a>743:R,R} +cnv{a>2244:R,s>3771:A,s<3731:R,A} +npk{s<2848:R,A} +vnh{x>1769:nft,m>2654:A,m<2371:rhs,ql} +mk{m<2094:zbq,R} +kg{m<2126:scg,hmx} +vz{s>396:jkd,m<848:A,bsd} +rrt{s>3534:A,a<2047:R,a>2076:R,A} +nnn{m<3633:A,a>2882:ljj,m>3833:R,qgk} +cfb{s>449:R,tsp} +bvc{m<424:A,a>1241:A,a>502:R,A} +qlf{x>3848:A,m<1570:R,a<3855:A,R} +snz{m>622:A,m>253:R,vsn} +lg{m>3549:ctb,s<397:zt,R} +hvj{s<1094:A,lnz} +vm{s>3321:rpn,zkh} +xd{s>382:R,x>3636:A,s>248:A,A} +qmc{a>2003:R,R} +rcp{x>1894:vqb,a<3205:R,hbs} +grk{m<3723:R,s<3188:R,A} +xtt{a<3359:bqg,vvz} +qrm{s>3415:A,R} +gd{m>1233:A,x<2420:R,a<3384:A,A} +rpr{m>134:A,m>85:R,R} +fcj{s<1040:A,A} +kf{s>3600:gmm,crf} +dh{x<1458:qg,vcz} +vhc{m<1441:R,R} +dlk{m<3550:vnk,s<3253:ns,s<3619:cb,qpk} +ms{x>2795:qcc,A} +xvk{m>825:A,s<2904:sfq,R} +ghx{m>3617:A,s<2307:A,m<3433:R,hp} +kqz{s<3515:A,s<3683:A,a<373:A,R} +js{s<1867:A,a<944:A,A} +hzt{x<2981:A,a<3743:mz,A} +rj{x<394:R,A} +bxq{m<2516:R,x>1257:A,A} +skh{m<2320:A,R} +kvn{x>1223:fvs,s<1861:A,a>944:A,R} +sp{s>3139:R,A} +fs{a>1908:A,s>3771:R,R} +mx{m<2933:A,A} +rqx{s<3624:sv,R} +gvb{a>2099:cbb,m>3240:rl,lxb} +pk{a>3721:A,m>2085:R,R} +in{m>1908:zd,xj} +gk{a<203:R,s<1291:A,A} +rc{s>3557:A,A} +zm{m>2088:A,s>2070:A,s<1076:A,R} +fn{m>2347:A,qb} +jcv{m>3599:A,x>1350:A,m>3575:A,R} +mh{a<3920:R,x>657:R,x>620:A,A} +zg{m<2228:A,A} +fdk{m<1255:A,cls} +nqn{s>3426:px,ddc} +vzk{m<2674:pbv,R} +gmb{s>3693:mkc,a>2114:th,a>2036:R,R} +qdx{s<3509:tfm,m>1437:A,s>3765:A,A} +tfm{x>3620:R,x>3474:R,R} +fzb{x>3167:A,A} +xcc{m>2208:lt,x>597:vhb,fd} +bp{s<3507:vm,m>1018:vg,x>3419:mb,kgc} +bts{s>3241:R,x<313:A,a<3709:A,R} +zqq{m<2799:A,a<1129:R,s<2654:R,A} +pg{s<3014:xv,x<264:R,A} +cx{m<3390:R,x<1569:R,x<1704:R,A} +kp{s>3356:A,R} +kk{x<2759:dj,m>1236:R,bsq} +gnm{m<3634:R,s<778:R,A} +rb{a<1231:vt,x>2612:rxp,tkp} +sfq{m<482:A,A} +mpq{s>3642:R,s>3564:R,m>3713:A,R} +ggs{a>3083:A,R} +rz{a<1824:R,A} +qzj{a>1057:A,a<865:A,R} +zqd{x>2291:R,R} +nx{a>209:R,R} +jfx{m<795:gh,tc} +xr{s<1204:R,A} +jq{s<2305:fmx,m>1240:R,m>1155:R,A} +cg{m>2865:vsx,mbm} +tmc{m<3261:vl,rjt} +fmx{s<1877:R,s<2044:R,R} +tq{s<3868:vhf,m<1604:A,s<3954:hg,A} +ttq{m>831:R,A} +gmm{s>3818:gv,m>724:xnc,m<412:nks,rbb} +mbm{s<755:cd,s<1467:A,A} +hqv{s<1551:R,R} +pz{x>614:R,x<313:A,A} +vl{x<1000:qgj,dh} +kv{s<2925:A,m<3109:jg,x>589:kp,A} +nzx{s<2975:A,a>1918:R,s>3047:A,R} +rtx{s>3393:xgv,hx} +kt{x<493:A,R} +fqx{m<2698:A,x>280:A,s>261:A,R} +sxb{a>851:R,a<763:A,a>814:A,qlv} +th{s<3462:R,m>1300:A,R} +cp{a<3491:A,m<3630:A,a<3753:dc,kt} +qd{s<462:A,s>596:dlq,s<514:A,A} +dnq{a<619:R,A} +vrf{m<832:R,x<3864:A,m<1232:R,R} +nqp{s<3390:R,x<638:R,R} +sz{m<916:zlc,a>3338:st,hgq} +qxh{s>3465:A,x<581:A,x>685:R,A} +cxr{s>2134:R,m<3676:R,R} +dfn{x>464:xbt,m<3652:A,gpk} +bz{s>2613:A,npl} +rxp{a>1468:vz,a<1313:vjg,x>3459:hf,dx} +tp{a>501:A,s<2404:A,A} +djj{m>2363:zqq,s<2638:A,R} +qs{a>2876:R,A} +dt{x<1825:R,s<2978:A,a<3128:A,A} +zd{x>1846:ks,a>2593:xt,s>2220:mr,tmc} +nxp{x>451:R,A} +zz{a>832:qrm,lnx} +hc{x<589:lpl,djj} +md{m>994:R,a<901:A,m<864:R,A} +hxf{s<2974:dd,s<3412:fp,m<3807:jt,rmt} +lvp{m<1760:R,A} +lrb{s>982:R,m<3511:A,m>3731:A,R} +xj{s<1372:bnl,x<1496:nq,rlf} +cc{s<2457:R,m>2782:A,R} +gp{s>3008:A,x>2320:ng,zrf} +gq{s>3138:R,a>2036:A,m>3755:nzx,R} +jt{m<3637:tj,x<1151:R,a>1926:mpq,R} +mns{m>2063:A,R} +jxk{x>1423:pnr,m>3731:rtx,m<3625:kxm,fvg} +qm{m<293:R,a<662:R,x<3520:A,A} +fnt{m>3590:hqv,A} +bzm{a<3161:dk,x<2018:frg,m<931:cfb,hh} +psk{m>3644:R,xdz} +dp{m>722:A,m<254:R,x>144:R,A} +tmv{a>1725:R,a>1636:R,A} +mgb{m>3218:hrx,a<1434:cj,s>2727:sp,szk} +kxm{x<996:zlp,x>1252:jcv,x>1126:A,R} +zh{m>1012:qdx,m>658:kgh,nlp} +lgd{a>1440:R,s>1098:rr,pq} +jmr{s>3574:R,s>3521:A,a>997:R,A} +lqv{m<984:tb,R} +xrj{x>3743:R,A} +sqq{x<1560:zq,m>3274:hvp,s>2447:fgs,zzr} +tr{s>2047:A,m>3516:A,x>2251:A,R} +vxz{x<1363:R,kqd} +mbg{a<3311:tv,jbk} +plk{a>971:R,R} +cj{m>3143:R,A} +fh{m>3798:R,s>3768:R,A} +fsl{a>1382:A,qlb} +nm{m<2569:A,R} +pv{a<3901:A,A} + +{x=653,m=2123,a=2908,s=577} +{x=716,m=172,a=813,s=2294} +{x=417,m=2371,a=1280,s=962} +{x=1465,m=1705,a=1990,s=994} +{x=2864,m=2720,a=2250,s=94} +{x=667,m=1887,a=29,s=368} +{x=909,m=1113,a=1133,s=309} +{x=1709,m=1903,a=349,s=1399} +{x=217,m=858,a=140,s=762} +{x=49,m=57,a=22,s=74} +{x=104,m=2238,a=445,s=148} +{x=992,m=317,a=2051,s=1054} +{x=2280,m=513,a=60,s=649} +{x=703,m=2595,a=350,s=50} +{x=67,m=622,a=266,s=1573} +{x=1610,m=418,a=156,s=1751} +{x=597,m=1377,a=564,s=386} +{x=151,m=85,a=2961,s=1226} +{x=1086,m=2255,a=705,s=651} +{x=157,m=719,a=368,s=1381} +{x=283,m=1416,a=662,s=201} +{x=1749,m=89,a=211,s=1525} +{x=133,m=17,a=105,s=1602} +{x=1323,m=2909,a=302,s=21} +{x=188,m=308,a=1025,s=795} +{x=1945,m=69,a=32,s=568} +{x=3019,m=1357,a=2218,s=618} +{x=949,m=837,a=16,s=1019} +{x=454,m=55,a=1604,s=304} +{x=315,m=108,a=1116,s=17} +{x=1034,m=888,a=1699,s=632} +{x=3,m=616,a=2316,s=338} +{x=208,m=95,a=1263,s=1580} +{x=294,m=1270,a=2738,s=288} +{x=64,m=247,a=253,s=386} +{x=9,m=631,a=908,s=1226} +{x=1188,m=172,a=121,s=1148} +{x=610,m=65,a=913,s=2053} +{x=1567,m=461,a=2775,s=147} +{x=330,m=3786,a=108,s=948} +{x=778,m=1962,a=418,s=2863} +{x=31,m=888,a=1748,s=2452} +{x=2099,m=784,a=401,s=540} +{x=526,m=1971,a=2175,s=1614} +{x=83,m=1704,a=1814,s=11} +{x=3004,m=692,a=1596,s=934} +{x=210,m=3170,a=2656,s=791} +{x=1393,m=284,a=1697,s=144} +{x=66,m=302,a=1099,s=257} +{x=3224,m=867,a=747,s=2028} +{x=1664,m=136,a=750,s=433} +{x=257,m=934,a=1979,s=502} +{x=1477,m=2175,a=713,s=539} +{x=1579,m=2499,a=731,s=2714} +{x=1088,m=1224,a=29,s=1016} +{x=2851,m=593,a=423,s=92} +{x=735,m=968,a=1797,s=1930} +{x=2093,m=1750,a=640,s=113} +{x=913,m=1935,a=755,s=944} +{x=39,m=3312,a=1625,s=2902} +{x=1970,m=1790,a=1015,s=262} +{x=1530,m=177,a=513,s=1271} +{x=1723,m=2294,a=810,s=269} +{x=3074,m=1687,a=1536,s=1460} +{x=931,m=1410,a=181,s=504} +{x=31,m=48,a=756,s=597} +{x=2122,m=51,a=243,s=45} +{x=1819,m=2167,a=1980,s=2367} +{x=362,m=34,a=970,s=739} +{x=58,m=356,a=1237,s=792} +{x=151,m=791,a=1301,s=128} +{x=234,m=1612,a=732,s=724} +{x=880,m=1064,a=2516,s=517} +{x=2439,m=2327,a=1240,s=49} +{x=44,m=424,a=265,s=41} +{x=2197,m=1459,a=434,s=684} +{x=2438,m=1031,a=2381,s=137} +{x=715,m=2707,a=21,s=1413} +{x=138,m=422,a=107,s=851} +{x=571,m=612,a=3453,s=509} +{x=53,m=972,a=3387,s=87} +{x=100,m=1043,a=170,s=807} +{x=2073,m=241,a=1203,s=987} +{x=498,m=1015,a=566,s=1516} +{x=2088,m=91,a=1818,s=2569} +{x=1,m=2829,a=583,s=96} +{x=716,m=34,a=221,s=1568} +{x=467,m=373,a=957,s=12} +{x=3060,m=998,a=495,s=1261} +{x=1641,m=864,a=567,s=724} +{x=310,m=12,a=522,s=325} +{x=1719,m=1436,a=136,s=1801} +{x=715,m=1518,a=301,s=2449} +{x=3087,m=2379,a=2336,s=283} +{x=611,m=2457,a=237,s=833} +{x=1276,m=629,a=647,s=1357} +{x=45,m=96,a=280,s=3606} +{x=2449,m=685,a=147,s=2275} +{x=957,m=1008,a=395,s=1066} +{x=512,m=2032,a=876,s=2495} +{x=13,m=376,a=209,s=543} +{x=164,m=1368,a=1942,s=2209} +{x=1170,m=1887,a=96,s=556} +{x=37,m=1989,a=873,s=1150} +{x=205,m=1001,a=250,s=465} +{x=253,m=922,a=2099,s=1045} +{x=2653,m=1301,a=106,s=2071} +{x=1671,m=189,a=60,s=1399} +{x=1037,m=778,a=2274,s=627} +{x=370,m=226,a=2577,s=1976} +{x=1136,m=1548,a=665,s=273} +{x=9,m=297,a=1347,s=624} +{x=1950,m=973,a=3265,s=36} +{x=403,m=2917,a=678,s=1115} +{x=761,m=326,a=1344,s=2437} +{x=986,m=57,a=910,s=2503} +{x=655,m=1023,a=103,s=1116} +{x=1177,m=154,a=588,s=764} +{x=1614,m=3095,a=386,s=28} +{x=885,m=554,a=1505,s=752} +{x=4,m=94,a=1467,s=307} +{x=903,m=1937,a=372,s=1197} +{x=1354,m=366,a=853,s=3003} +{x=334,m=1998,a=653,s=2571} +{x=2104,m=2863,a=704,s=2427} +{x=10,m=426,a=92,s=6} +{x=758,m=1006,a=2284,s=2275} +{x=543,m=2193,a=171,s=2384} +{x=184,m=34,a=3133,s=42} +{x=2069,m=498,a=409,s=2148} +{x=266,m=1811,a=2888,s=1243} +{x=304,m=1626,a=1465,s=1352} +{x=146,m=2885,a=805,s=300} +{x=1136,m=672,a=1532,s=1319} +{x=65,m=5,a=334,s=2949} +{x=598,m=3629,a=843,s=258} +{x=882,m=155,a=1547,s=727} +{x=94,m=1054,a=940,s=1200} +{x=3184,m=393,a=2129,s=146} +{x=1022,m=2,a=1420,s=8} +{x=887,m=1093,a=1568,s=2510} +{x=580,m=2140,a=226,s=2581} +{x=1273,m=1454,a=799,s=621} +{x=231,m=952,a=569,s=453} +{x=1765,m=1013,a=1154,s=90} +{x=718,m=241,a=266,s=280} +{x=51,m=2166,a=760,s=40} +{x=962,m=967,a=574,s=40} +{x=1198,m=1260,a=1163,s=31} +{x=629,m=2546,a=262,s=123} +{x=662,m=94,a=1095,s=817} +{x=117,m=674,a=366,s=337} +{x=5,m=1324,a=915,s=315} +{x=2380,m=975,a=2390,s=1736} +{x=939,m=3955,a=656,s=1483} +{x=2678,m=315,a=968,s=105} +{x=549,m=1294,a=1915,s=1389} +{x=354,m=748,a=41,s=2723} +{x=699,m=648,a=347,s=82} +{x=645,m=26,a=174,s=734} +{x=3129,m=1205,a=85,s=1282} +{x=676,m=1450,a=243,s=551} +{x=185,m=745,a=237,s=1204} +{x=1426,m=654,a=2556,s=2850} +{x=517,m=1666,a=56,s=967} +{x=2336,m=444,a=8,s=1924} +{x=335,m=531,a=1601,s=111} +{x=867,m=3714,a=1654,s=339} +{x=2647,m=1651,a=3014,s=690} +{x=1466,m=381,a=691,s=2321} +{x=1994,m=200,a=2717,s=871} +{x=677,m=110,a=173,s=814} +{x=216,m=469,a=679,s=2511} +{x=343,m=236,a=674,s=798} +{x=2087,m=102,a=570,s=1988} +{x=465,m=1032,a=1562,s=3001} +{x=2396,m=979,a=507,s=543} +{x=40,m=185,a=269,s=169} +{x=39,m=103,a=586,s=1223} +{x=433,m=51,a=2600,s=413} +{x=553,m=975,a=141,s=82} +{x=23,m=55,a=2416,s=419} +{x=1925,m=3478,a=2,s=256} +{x=1083,m=434,a=3094,s=1865} +{x=2112,m=796,a=1106,s=1006} +{x=2300,m=602,a=1575,s=1639} +{x=724,m=7,a=1448,s=868} +{x=1531,m=155,a=345,s=1354} +{x=3454,m=494,a=1290,s=303} +{x=1466,m=1085,a=876,s=1313} +{x=1481,m=8,a=935,s=1313} +{x=703,m=1294,a=1,s=748} +{x=72,m=828,a=6,s=708} +{x=603,m=2090,a=1134,s=134} +{x=696,m=884,a=41,s=684} +{x=2768,m=436,a=294,s=203} +{x=2621,m=610,a=1095,s=1719} +{x=1155,m=3187,a=1420,s=694} +{x=5,m=2757,a=101,s=114} +{x=95,m=3009,a=1070,s=786} diff --git a/visp/examples/aoc2023/inputs/day19_example.txt b/visp/examples/aoc2023/inputs/day19_example.txt new file mode 100644 index 0000000..e5b5d64 --- /dev/null +++ b/visp/examples/aoc2023/inputs/day19_example.txt @@ -0,0 +1,17 @@ +px{a<2006:qkq,m>2090:A,rfg} +pv{a>1716:R,A} +lnx{m>1548:A,A} +rfg{s<537:gd,x>2440:R,A} +qs{s>3448:A,lnx} +qkq{x<1416:A,crn} +crn{x>2662:A,R} +in{s<1351:px,qqz} +qqz{s>2770:qs,m<1801:hdj,R} +gd{a>3333:R,R} +hdj{m>838:A,pv} + +{x=787,m=2655,a=1222,s=2876} +{x=1679,m=44,a=2067,s=496} +{x=2036,m=264,a=79,s=2244} +{x=2461,m=1339,a=466,s=291} +{x=2127,m=1623,a=2188,s=1013}