diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-12-05 09:39:07 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-12-05 09:39:07 +0100 |
commit | 4f8745c22e16c7923047f02c405f4a6bf0be1a5d (patch) | |
tree | 2a8aa7dd4d01535148bf494f8fb191b9c5a58778 /2024 | |
parent | 74226de3f925ce8314f06fe7fdb05dd42c0f434b (diff) |
Add 2024 day 5 solutions
Diffstat (limited to '2024')
-rw-r--r-- | 2024/05/input | 1371 | ||||
-rwxr-xr-x | 2024/05/puzzle-1.awk | 18 | ||||
-rwxr-xr-x | 2024/05/puzzle-2.awk | 34 |
3 files changed, 1423 insertions, 0 deletions
diff --git a/2024/05/input b/2024/05/input new file mode 100644 index 0000000..04a287c --- /dev/null +++ b/2024/05/input @@ -0,0 +1,1371 @@ +59|55 +48|63 +48|74 +26|77 +26|54 +26|99 +63|43 +63|65 +63|11 +63|42 +91|64 +91|77 +91|71 +91|42 +91|33 +46|63 +46|48 +46|72 +46|21 +46|12 +46|82 +21|32 +21|11 +21|52 +21|64 +21|59 +21|34 +21|33 +99|82 +99|37 +99|21 +99|27 +99|92 +99|79 +99|56 +99|12 +38|51 +38|47 +38|77 +38|88 +38|34 +38|52 +38|32 +38|11 +38|64 +33|42 +33|54 +33|56 +33|47 +33|93 +33|31 +33|52 +33|99 +33|34 +33|77 +32|52 +32|88 +32|56 +32|45 +32|77 +32|18 +32|42 +32|46 +32|71 +32|47 +32|33 +96|45 +96|31 +96|11 +96|74 +96|59 +96|55 +96|42 +96|71 +96|39 +96|43 +96|44 +96|32 +77|71 +77|54 +77|93 +77|81 +77|72 +77|15 +77|64 +77|88 +77|76 +77|56 +77|31 +77|92 +77|84 +27|44 +27|96 +27|18 +27|91 +27|37 +27|59 +27|77 +27|12 +27|55 +27|39 +27|26 +27|57 +27|21 +27|32 +76|92 +76|57 +76|12 +76|15 +76|44 +76|82 +76|11 +76|61 +76|38 +76|74 +76|96 +76|65 +76|51 +76|37 +76|91 +79|16 +79|92 +79|58 +79|48 +79|12 +79|96 +79|63 +79|76 +79|38 +79|57 +79|61 +79|37 +79|27 +79|51 +79|65 +79|91 +93|58 +93|54 +93|12 +93|48 +93|16 +93|38 +93|92 +93|56 +93|57 +93|15 +93|74 +93|37 +93|61 +93|91 +93|65 +93|76 +93|51 +84|27 +84|38 +84|59 +84|63 +84|91 +84|12 +84|44 +84|37 +84|57 +84|82 +84|11 +84|61 +84|15 +84|92 +84|58 +84|51 +84|39 +84|65 +45|56 +45|57 +45|65 +45|27 +45|48 +45|61 +45|63 +45|81 +45|99 +45|79 +45|72 +45|54 +45|84 +45|92 +45|12 +45|76 +45|93 +45|88 +45|16 +16|27 +16|59 +16|34 +16|18 +16|26 +16|51 +16|58 +16|38 +16|33 +16|11 +16|21 +16|61 +16|96 +16|39 +16|57 +16|43 +16|12 +16|44 +16|37 +16|55 +57|39 +57|34 +57|58 +57|74 +57|51 +57|71 +57|33 +57|77 +57|55 +57|96 +57|91 +57|47 +57|18 +57|43 +57|44 +57|37 +57|42 +57|21 +57|11 +57|64 +57|32 +15|33 +15|32 +15|63 +15|16 +15|65 +15|27 +15|44 +15|38 +15|58 +15|59 +15|11 +15|21 +15|37 +15|92 +15|96 +15|91 +15|18 +15|57 +15|39 +15|61 +15|12 +15|43 +55|34 +55|52 +55|84 +55|31 +55|15 +55|48 +55|79 +55|71 +55|77 +55|46 +55|45 +55|99 +55|88 +55|76 +55|47 +55|81 +55|93 +55|64 +55|82 +55|56 +55|54 +55|72 +55|26 +88|76 +88|81 +88|65 +88|16 +88|54 +88|82 +88|57 +88|63 +88|31 +88|12 +88|46 +88|72 +88|99 +88|92 +88|27 +88|61 +88|93 +88|52 +88|84 +88|56 +88|15 +88|48 +88|79 +88|58 +72|91 +72|38 +72|61 +72|92 +72|93 +72|56 +72|82 +72|16 +72|12 +72|65 +72|76 +72|57 +72|37 +72|54 +72|51 +72|58 +72|15 +72|63 +72|84 +72|96 +72|48 +72|21 +72|74 +72|27 +31|54 +31|65 +31|16 +31|91 +31|61 +31|46 +31|58 +31|57 +31|92 +31|99 +31|15 +31|63 +31|56 +31|81 +31|76 +31|93 +31|79 +31|84 +31|48 +31|12 +31|72 +31|82 +31|27 +31|52 +51|55 +51|33 +51|59 +51|44 +51|47 +51|32 +51|99 +51|39 +51|64 +51|52 +51|26 +51|71 +51|45 +51|77 +51|43 +51|81 +51|18 +51|11 +51|31 +51|42 +51|88 +51|74 +51|46 +51|34 +34|84 +34|52 +34|77 +34|71 +34|92 +34|56 +34|45 +34|26 +34|93 +34|54 +34|15 +34|31 +34|64 +34|48 +34|82 +34|76 +34|47 +34|79 +34|99 +34|81 +34|88 +34|63 +34|46 +34|72 +47|46 +47|63 +47|72 +47|45 +47|52 +47|31 +47|93 +47|71 +47|56 +47|15 +47|48 +47|84 +47|65 +47|79 +47|76 +47|27 +47|16 +47|81 +47|82 +47|92 +47|88 +47|54 +47|61 +47|99 +71|16 +71|79 +71|15 +71|81 +71|63 +71|27 +71|52 +71|82 +71|65 +71|12 +71|88 +71|54 +71|45 +71|99 +71|93 +71|56 +71|92 +71|48 +71|31 +71|61 +71|76 +71|84 +71|72 +71|46 +58|51 +58|37 +58|39 +58|21 +58|33 +58|38 +58|55 +58|74 +58|59 +58|44 +58|71 +58|43 +58|32 +58|77 +58|96 +58|47 +58|91 +58|64 +58|42 +58|11 +58|18 +58|26 +58|34 +58|45 +82|12 +82|27 +82|32 +82|39 +82|43 +82|92 +82|58 +82|11 +82|44 +82|57 +82|15 +82|74 +82|37 +82|63 +82|51 +82|91 +82|65 +82|59 +82|96 +82|33 +82|38 +82|61 +82|21 +82|16 +44|39 +44|47 +44|99 +44|55 +44|79 +44|32 +44|33 +44|64 +44|31 +44|46 +44|52 +44|42 +44|26 +44|77 +44|45 +44|43 +44|93 +44|72 +44|34 +44|11 +44|71 +44|81 +44|18 +44|88 +74|33 +74|32 +74|44 +74|81 +74|34 +74|79 +74|42 +74|45 +74|26 +74|18 +74|71 +74|99 +74|31 +74|64 +74|88 +74|77 +74|11 +74|55 +74|52 +74|47 +74|59 +74|43 +74|46 +74|39 +18|71 +18|79 +18|84 +18|31 +18|55 +18|48 +18|99 +18|42 +18|77 +18|76 +18|26 +18|47 +18|34 +18|82 +18|88 +18|56 +18|52 +18|45 +18|46 +18|93 +18|72 +18|64 +18|81 +18|54 +39|46 +39|72 +39|71 +39|34 +39|31 +39|88 +39|32 +39|33 +39|26 +39|45 +39|42 +39|55 +39|77 +39|54 +39|99 +39|64 +39|43 +39|52 +39|47 +39|93 +39|79 +39|56 +39|18 +39|81 +61|55 +61|18 +61|32 +61|91 +61|34 +61|57 +61|77 +61|58 +61|39 +61|43 +61|64 +61|37 +61|26 +61|33 +61|74 +61|21 +61|38 +61|51 +61|96 +61|42 +61|12 +61|11 +61|59 +61|44 +92|38 +92|51 +92|18 +92|27 +92|65 +92|96 +92|39 +92|33 +92|61 +92|58 +92|91 +92|57 +92|59 +92|43 +92|74 +92|32 +92|16 +92|12 +92|11 +92|55 +92|44 +92|21 +92|42 +92|37 +12|43 +12|74 +12|37 +12|21 +12|51 +12|58 +12|44 +12|77 +12|64 +12|34 +12|38 +12|32 +12|33 +12|26 +12|59 +12|42 +12|18 +12|11 +12|47 +12|96 +12|91 +12|55 +12|57 +12|39 +37|34 +37|96 +37|26 +37|33 +37|55 +37|42 +37|39 +37|74 +37|21 +37|11 +37|38 +37|64 +37|18 +37|71 +37|43 +37|32 +37|77 +37|31 +37|88 +37|59 +37|47 +37|51 +37|45 +37|44 +54|51 +54|61 +54|58 +54|92 +54|84 +54|21 +54|96 +54|38 +54|74 +54|59 +54|57 +54|37 +54|27 +54|82 +54|91 +54|63 +54|12 +54|15 +54|76 +54|44 +54|65 +54|16 +54|48 +54|56 +42|52 +42|64 +42|46 +42|88 +42|56 +42|72 +42|26 +42|34 +42|31 +42|99 +42|15 +42|77 +42|81 +42|84 +42|71 +42|93 +42|79 +42|82 +42|48 +42|54 +42|76 +42|47 +42|55 +42|45 +81|82 +81|79 +81|92 +81|57 +81|76 +81|99 +81|63 +81|52 +81|46 +81|37 +81|93 +81|56 +81|72 +81|84 +81|54 +81|48 +81|61 +81|65 +81|12 +81|15 +81|91 +81|58 +81|16 +81|27 +56|27 +56|91 +56|15 +56|74 +56|21 +56|57 +56|84 +56|16 +56|38 +56|59 +56|96 +56|76 +56|82 +56|12 +56|61 +56|37 +56|48 +56|44 +56|63 +56|65 +56|92 +56|51 +56|11 +56|58 +52|93 +52|16 +52|27 +52|91 +52|61 +52|58 +52|84 +52|15 +52|72 +52|99 +52|57 +52|56 +52|82 +52|46 +52|48 +52|96 +52|65 +52|76 +52|12 +52|79 +52|92 +52|37 +52|63 +52|54 +11|18 +11|33 +11|77 +11|99 +11|46 +11|45 +11|32 +11|52 +11|64 +11|72 +11|47 +11|88 +11|93 +11|34 +11|79 +11|26 +11|55 +11|42 +11|31 +11|39 +11|54 +11|81 +11|71 +11|43 +64|56 +64|52 +64|31 +64|27 +64|63 +64|65 +64|46 +64|76 +64|48 +64|88 +64|45 +64|82 +64|79 +64|93 +64|47 +64|15 +64|71 +64|81 +64|84 +64|72 +64|16 +64|92 +64|54 +64|99 +43|31 +43|93 +43|56 +43|81 +43|88 +43|71 +43|26 +43|42 +43|72 +43|46 +43|76 +43|48 +43|54 +43|45 +43|77 +43|18 +43|33 +43|52 +43|47 +43|79 +43|34 +43|64 +43|99 +43|55 +65|96 +65|37 +65|59 +65|44 +65|18 +65|34 +65|32 +65|51 +65|55 +65|11 +65|27 +65|33 +65|21 +65|57 +65|91 +65|58 +65|74 +65|12 +65|43 +65|42 +65|38 +65|39 +65|61 +65|16 +59|72 +59|64 +59|52 +59|34 +59|88 +59|11 +59|45 +59|31 +59|77 +59|71 +59|42 +59|18 +59|46 +59|44 +59|99 +59|81 +59|43 +59|39 +59|47 +59|79 +59|26 +59|33 +59|32 +48|12 +48|16 +48|59 +48|92 +48|44 +48|65 +48|91 +48|15 +48|84 +48|38 +48|39 +48|82 +48|51 +48|96 +48|32 +48|58 +48|21 +48|57 +48|27 +48|11 +48|37 +48|61 +26|72 +26|93 +26|82 +26|76 +26|15 +26|88 +26|71 +26|45 +26|92 +26|84 +26|64 +26|79 +26|31 +26|65 +26|48 +26|46 +26|63 +26|52 +26|81 +26|47 +26|56 +63|59 +63|37 +63|12 +63|27 +63|92 +63|91 +63|51 +63|32 +63|57 +63|16 +63|18 +63|33 +63|21 +63|44 +63|61 +63|38 +63|39 +63|96 +63|74 +63|58 +91|74 +91|55 +91|39 +91|34 +91|38 +91|11 +91|32 +91|51 +91|18 +91|45 +91|59 +91|47 +91|88 +91|37 +91|26 +91|43 +91|96 +91|44 +91|21 +46|96 +46|56 +46|37 +46|91 +46|84 +46|93 +46|92 +46|99 +46|57 +46|16 +46|76 +46|79 +46|15 +46|65 +46|54 +46|27 +46|61 +46|58 +21|74 +21|55 +21|51 +21|45 +21|42 +21|26 +21|38 +21|81 +21|71 +21|31 +21|47 +21|77 +21|18 +21|44 +21|39 +21|43 +21|88 +99|58 +99|93 +99|84 +99|96 +99|54 +99|91 +99|48 +99|16 +99|61 +99|65 +99|38 +99|72 +99|15 +99|63 +99|76 +99|57 +38|43 +38|46 +38|26 +38|71 +38|59 +38|31 +38|44 +38|18 +38|39 +38|74 +38|33 +38|55 +38|42 +38|45 +38|81 +33|84 +33|71 +33|88 +33|64 +33|81 +33|45 +33|72 +33|46 +33|55 +33|18 +33|76 +33|79 +33|48 +33|26 +32|72 +32|26 +32|93 +32|54 +32|34 +32|81 +32|79 +32|55 +32|64 +32|31 +32|43 +32|76 +32|99 +96|21 +96|33 +96|88 +96|18 +96|81 +96|47 +96|34 +96|77 +96|51 +96|64 +96|26 +96|38 +77|48 +77|99 +77|46 +77|52 +77|65 +77|79 +77|82 +77|63 +77|16 +77|45 +77|47 +27|42 +27|11 +27|51 +27|38 +27|58 +27|74 +27|43 +27|33 +27|61 +27|34 +76|63 +76|27 +76|16 +76|84 +76|48 +76|21 +76|59 +76|58 +76|39 +79|21 +79|82 +79|84 +79|15 +79|56 +79|93 +79|54 +79|72 +93|59 +93|27 +93|63 +93|96 +93|84 +93|82 +93|21 +84|74 +84|21 +84|96 +84|43 +84|16 +84|32 +45|15 +45|82 +45|31 +45|52 +45|46 +16|74 +16|42 +16|32 +16|91 +57|38 +57|26 +57|59 +15|51 +15|74 +55|63 + +79,99,31,72,34,11,43,42,39,52,32,77,93 +34,88,46,72,93,56,63 +15,12,99,92,84,48,76,82,79,81,61,31,56,63,46,45,72 +46,79,54,76,27,37,96 +42,34,79,72,54,76,48 +93,72,82,81,46,16,45,92,65,47,27,88,15,63,76,79,84,52,56 +71,46,55,18,34,64,42,77,11,31,51,26,45,43,44,47,88,33,32 +21,38,74,61,82,51,39,65,91,96,16,32,15,58,63,37,43 +31,56,48,63,16,61,12 +65,27,12,37,96,21,51,74,59,11,39,33,55 +57,44,43,74,11,64,12 +45,31,59,71,88,21,34,26,96,11,47 +18,42,55,77,64,47,71,45,88,31,52,46,99,79,72,93,54,56,76,48,84 +59,11,39,32,33,18,42,77,45,81,52,99,79 +12,57,91,37,96,74,59,44,11,43,33,18,42,55,34,77,64 +38,59,33,18,71,45,88 +21,37,58,91,15,44,12 +34,46,26,88,72,71,52,93,47 +33,26,77,64,47,52,46,79,93,76,48 +45,88,99,15,48,77,31,81,76,26,93,52,47,84,56,54,79,82,64,55,71,34,46 +48,93,47,34,54,42,46,76,99,26,84,71,88,45,56,81,52,18,64,55,77,31,72 +56,55,52,71,33,64,99,93,76,18,31,26,46,34,79,42,45,77,72 +96,43,18,92,57,42,74,37,33,59,38,51,11,61,58,21,12,27,44,16,91 +64,47,99,48,84 +56,76,48,84,82,15,63,92,65,61,12,57,58,91,37,96,21,38,51,59,44 +27,59,65,51,16,57,43,12,18,91,61,96,37,39,58,63,21 +45,52,99,79,48,82,63,65,16,61,12 +58,37,96,21,38,74,59,44,32,43,33,18,34,26,77,64,71 +96,63,82,58,12,51,92,91,37,59,57,61,15,11,16,27,44,84,38,74,39,21,48 +56,93,52,16,72,61,82,46,27,54,48,84,79 +54,93,15,63,38,76,82,21,65,37,91,84,57,92,61,16,58,56,48 +21,84,59,61,15,12,57,74,44,96,16,38,63,51,32,27,82,58,65 +93,76,48,52,65,37,58,27,99,15,61,84,63,92,16,56,91,82,72 +48,82,12,91,21,51,39 +44,33,37,34,59,32,96,18,55,58,38,39,47,21,26 +16,27,61,12,91,96,21,51,74,59,32,33,18,42,34 +32,74,42,59,51,34,96,91,43,39,44,57,27 +31,46,84,99,15,64,48,81,55,82,45 +15,27,61,12,37,96,38,74,44 +43,34,71,88,81,72,54,56,76 +51,74,21,96,71,34,26,59,38,42,64,11,18,37,45,43,39 +45,88,31,81,52,79,72,54,56,76,84,15,63,65,16,61,12 +58,48,21,56,92,51,38,54,84,72,96,93,63,65,57,27,76,61,12,15,37,82,91 +82,79,16,48,91,12,15,57,76,56,96,58,63,72,99,61,37,93,65,54,27,92,84 +93,91,65,58,81,46,12 +48,15,63,92,74,11,39 +92,27,42,21,11,12,44,32,96,51,74,16,61,33,58,91,38,57,59,65,18 +56,61,72,15,12,51,57,27,48,76,96 +63,56,79,93,58,84,46,76,72,82,57,27,54,15,92 +45,48,84,31,15,88,81,64,26,92,63,99,79,52,82,47,54,56,46 +47,71,45,88,31,52,46,99,79,93,54,56,48,84,82,15,63,92,65,16,27 +91,84,15,99,93,72,79,61,27,46,65,81,76,54,12,52,57 +76,64,34,48,99 +18,64,26,46,42,99,45,43,81,34,74,11,47 +33,34,26,71,52,72,54,56,48 +42,47,11,45,77,32,43,64,44,79,72,33,52 +16,99,92,27,65,31,47,82,79,63,46 +12,81,91,61,56,15,65,93,57 +58,37,96,21,38,51,74,59,11,39,32,43,18,42,77,47,71 +96,38,51,74,59,44,11,39,32,33,18,55,34,26,77,47,45,88,31 +63,92,65,16,27,61,12,57,58,91,37,96,21,38,51,74,59,44,11,39,43,33,18 +43,33,79,45,81,54,34,88,64,18,52,99,76,93,77 +58,91,37,96,21,38,51,74,44,11,39,32,43,33,18,42,55,34,26,77,64,47,71 +81,15,55,56,48,26,54 +52,46,99,79,72,54,56,48,82,15,63,92,65,16,27,61,12,57,58,91,37 +71,45,79,72,56 +63,46,76,56,16,71,45,47,92,48,52,81,88,27,93,99,79,84,65,54,31 +59,44,32,55,47,45,79 +76,81,92,45,52,72,15,48,64,26,54 +79,72,54,56,48,84,15,65,16,27,61,12,57,58,91,37,96,21,38 +79,93,84,63,92,65,61,57,58,96,38 +81,99,93,54,56,27,91 +99,79,72,93,54,56,76,48,84,15,63,92,65,16,61,12,91,37,21 +96,61,65,21,91,54,99 +64,72,46,11,26,77,18,44,79,52,33 +51,74,59,11,39,32,43,34,26,64,46 +21,92,63,57,91,38,58,54,84,74,15,59,16,27,96,51,82,56,48 +91,56,76,58,99,72,93,54,61,52,79,48,46 +63,91,16,59,18,32,39 +33,11,74,71,31,51,96 +63,91,37,96,44,32,18 +72,93,76,48,84,82,15,63,92,65,16,27,61,12,58,91,96 +43,82,65,59,63,37,74,11,61,39,91,58,16 +39,51,44,92,43,96,57,12,42,16,32,38,91,21,74 +58,91,16,43,63,96,18,37,65 +33,72,54,34,77,99,31,26,88,39,81 +16,27,56,93,82,92,84,31,76,65,46,52,57,58,81 +54,56,76,48,84,82,15,63,92,65,27,61,12,57,58,37,21,38,51,74,59 +99,79,72,93,76,48,84,82,15,92,16,27,12,57,58,91,37,96,21 +32,33,18,12,39,77,34,96,61,74,44,21,91,37,42,57,51,26,58,11,38,55,59 +44,18,55,12,34,58,51,59,33 +82,21,59,16,96,15,44,84,74,63,92,51,39,37,61,27,91,38,32 +57,58,91,37,38,51,44,11,39,32,43,33,18,42,55,34,77,64,47 +39,32,18,42,55,34,26,77,64,71,45,88,31,81,52,99,79,93,54 +99,65,52,77,81,71,93 +81,79,47,99,18,42,59,77,52,44,55,64,11,34,26 +33,77,47,71,88,79,48 +16,27,61,57,58,91,37,96,51,74,59,44,11,39,32,43,33,18,42,55,34 +37,57,91,27,12,96,65,61,51,39,58,59,44,21,15,92,32,43,11,38,33,16,63 +48,84,15,92,16,27,61,12,57,91,21,38,51,59,44,11,39 +65,27,61,12,37,38,59 +42,26,47,71,88,81,52,46,79,72,54,48,82 +64,18,33,88,51,81,38,47,52,71,34,26,55,11,31 +34,26,64,47,71,45,88,81,52,46,79,72,93,56,48,84,82,15,63 +47,45,81,46,72,54,56,84,15,63,92,65,27 +99,71,79,81,92,45,82,54,31,47,88,63,93 +79,72,93,56,76,48,84,82,15,92,65,27,12,57,58,91,96,21,38 +71,44,31,11,46,88,55,33,18,39,52,79,34,47,64,45,77 +57,91,37,38,51,43,18,55,34 +72,93,54,56,76,48,84,15,92,16,61,57,58,91,37,96,21,38,51 +65,56,48,63,46,79,72,88,15,99,64,45,71,84,16 +77,64,47,71,45,88,31,81,52,46,99,79,72,54,56,76,48,84,82,15,63,92,65 +11,57,42,91,58,18,51,61,12,43,27,32,92 +65,91,63,51,39,58,57,84,92,48,12 +79,93,54,56,82,15,92,27,61,12,37,96,21 +79,46,76,26,47,99,54,43,71,45,34 +48,31,54,52,46,63,15,92,88,56,77,47,72,65,64,79,81,71,99 +59,81,51,39,38,33,71,74,55,64,26,45,52 +34,88,47,56,15,72,26,79,77,45,71,93,63,76,84 +21,38,51,74,59,11,43,18,47,31,81 +65,33,39,21,91,11,37,59,58,44,63,74,16,18,57,12,43,92,61,27,32,51,96 +72,82,65,15,79,63,46,52,54,93,16,56,48,12,61,76,84,99,92 +57,91,61,96,84,46,54,16,63,99,48,92,37,56,58 +42,71,26,45,51,11,32,33,81,43,77,18,64,21,55,34,31,88,59,47,39,44,38 +82,48,76,37,61,57,63,84,58,15,56,79,27,72,91,54,12,21,99 +54,63,96,74,58,59,37,84,27,57,91 +47,84,82,77,71,88,15,31,52,56,65,92,72,63,64,81,48,54,93,45,46,79,99 +55,43,44,18,58 +44,11,39,18,77,71,45,79,72 +79,46,56,72,84,31,88,52,99,93,71,61,16,76,63,54,65,45,27 +93,47,52,64,84 +18,55,26,47,46,99,93 +12,15,63,74,27,82,43,37,38,21,51,96,39,32,59,61,16 +45,88,31,81,52,46,99,79,72,93,54,56,76,48,84,82,15,63,92,65,16,27,12 +16,27,61,12,57,58,91,37,96,21,38,51,59,11,39,32,43,33,18,42,34 +16,59,12,57,27,65,38,61,48,74,91,82,84,21,51 +92,58,15,61,43,32,37,21,44,91,16,27,96,57,51,12,59,65,39,11,33 +37,44,32,33,42,55,26,64,88 +64,72,71,45,55,42,46,79,81,32,93,77,54,34,31,47,26,39,18,33,88 +84,46,72,37,15,76,65,79,58,16,96,54,57,48,82,92,61 +71,92,79,16,31,61,63,76,99,84,82,46,72,27,81,56,54,48,88 +55,79,26,32,33,45,31,56,64,46,77 +96,38,74,11,39,32,33,18,55,34,64 +61,65,38,58,39,15,91,12,21 +33,18,42,55,26,77,64,47,71,45,88,31,81,52,46,99,79,72,93,54,48 +57,48,76,61,91,37,21,82,58,38,84,96,72,16,54,12,79,56,15,63,65 +27,72,61,54,57,52,56,99,88,84,76,46,79,48,16 +42,47,88,31,52,46,72,93,76 +77,71,31,99,93,56,48,84,65 +77,64,71,52,46,99,79,82,15,63,92 +56,76,48,84,82,15,92,65,16,27,61,12,57,58,91,37,96,51,74,59,44 +88,16,48,57,65,27,82 +82,15,63,65,16,27,61,12,57,58,37,96,21,38,51,74,59,44,11,39,32 +21,38,51,74,59,44,39,32,43,33,18,42,34,77,64,47,81 +16,27,61,12,91,96,21,51,74,59,44,11,43,33,18,42,34 +33,38,12,44,55,91,27,43,37,59,18,26,51,11,34,58,21,32,61,42,57 +64,77,46,56,88 +34,26,45,31,99,79,93,76,48 +44,37,96,43,51,34,32,58,33,26,27 +91,92,65,21,51,58,59,57,96,32,74,12,27 +72,48,15,65,96 +58,51,39,18,59,55,34,12,16,42,74 +59,44,11,39,32,43,33,18,42,55,34,26,77,64,71,45,88,31,81,52,46,99,79 +56,57,96,74,15,82,21,63,92,65,84,76,91,61,48,44,16,38,59 +88,99,84,15,63,79,45,61,27,93,46,65,12 +57,51,61,55,43,12,77 +15,63,92,65,16,27,61,12,58,91,37,96,21,38,51,74,59,44,11,39,32,43,33 +46,81,55,76,15,45,52 +58,92,16,57,48,61,38,82,72,51,54,56,63,93,37,12,84,91,96,15,21,65,76 +33,43,42,34,38,51,59,55,64,74,31,52,18,47,39,88,44,26,32,77,71 +82,55,56,52,48,71,34,26,42,93,45,77,79 +32,33,42,64,47,88,31,81,79,72,56 +39,71,96,59,21,11,43,18,77,42,45,51,88,44,33,74,31,64,47 +99,72,71,77,48,26,46,76,47,64,56,92,52,45,54,82,31,88,15 +96,61,15,82,92,27,72,58,79,38,65,48,57,91,84,63,21 +33,26,31,42,18,55,99,39,54,45,93,72,71,79,81,88,77,52,47,46,43 +65,56,58,12,27,52,54,91,46,99,16,82,72,92,81 +32,43,42,26,64,47,71,45,88,31,81,46,99,79,72,54,56 +42,55,64,45,46,93,76,84,82 +59,11,39,43,33,18,42,34,77,64,47,71,45,88,31,52,46,99,79 +44,42,26,77,47,71,45,88,31,81,52,99,72 +34,64,47,31,52,46,93,76,63 +82,32,96,74,12,15,38,43,57,63,91 +72,56,76,48,84,82,15,63,92,65,16,27,61,12,57,58,91,37,96,38,51 +74,59,44,11,39,43,33,55,34,77,64,47,71,88,31,81,52,46,99 +45,88,31,81,52,46,99,79,93,54,56,76,48,84,82,15,63,92,65,16,27,61,12 +96,21,51,74,44,11,43,33,18,77,64,47,71,88,31 +27,61,57,58,91,37,96,21,38,51,74,59,44,11,32,43,33,18,55,34,26 +92,65,57,21,38,11,39,32,43,33,42 +32,55,47,31,71,52,39,42,79,11,45,93,72,18,26,99,34,88,81,46,43,77,33 +91,16,57,82,93,96,48,37,38,21,56,58,61,15,92,74,84 +92,61,12,57,21,39,42 +91,37,96,21,38,51,74,11,43,33,42,55,77,64,45 +46,99,79,72,93,54,76,84,82,15,63,92,65,16,27,12,57,58,91,37,96
\ No newline at end of file diff --git a/2024/05/puzzle-1.awk b/2024/05/puzzle-1.awk new file mode 100755 index 0000000..bd9ed68 --- /dev/null +++ b/2024/05/puzzle-1.awk @@ -0,0 +1,18 @@ +#!/usr/bin/awk -f + +BEGIN { FS = "[|,]" } + +/\|/ { rules[$1][$2] = 1 } +/,/ { + delete seen + for (i = 1; i <= NF; i++) { + for (j in seen) { + if (j in rules[$i]) + next + } + seen[$i] = 1 + } + mid += $(i / 2) +} + +END { print mid }
\ No newline at end of file diff --git a/2024/05/puzzle-2.awk b/2024/05/puzzle-2.awk new file mode 100755 index 0000000..a76c96a --- /dev/null +++ b/2024/05/puzzle-2.awk @@ -0,0 +1,34 @@ +#!/usr/bin/awk -f + +function sort_page_numbers(i1, v1, i2, v2) +{ + if (v1 in rules[v2]) + return +1 + if (v2 in rules[v1]) + return -1 + return 0 +} + +BEGIN { FS = "[|,]" } + +/\|/ { rules[$1][$2] = 1 } +/,/ { + delete seen + badent = 0 + + for (i = 1; i <= NF; i++) { + for (j in seen) { + if (j in rules[$i]) + badent = 1 + } + seen[$i] = 1 + } + if (!badent) + next + + split($0, xs) + asort(xs, xs, "sort_page_numbers") + mid += xs[(NF + 1) / 2] +} + +END { print mid }
\ No newline at end of file |