From f57e712d38da1d96e15031ecc22237b844f3cd90 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Tue, 7 Dec 2021 08:40:17 +0100 Subject: [PATCH] day 7 --- day_7/code | Bin 28256 -> 32768 bytes day_7/code.hi | Bin 985 -> 1018 bytes day_7/code.hs | 10 ++++++---- day_7/code.o | Bin 19880 -> 21256 bytes 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/day_7/code b/day_7/code index 0dbb9f9b94697e2e613f2712e675d78bb5adb79b..9476f103bbd5b4c9081861cf0844b1fb4ca8407a 100644 GIT binary patch literal 32768 zcmeHweRNz`b?=oN#R{<{CB{UFEiy?YP{2|o$2Q7`laXX8GtI~rmXZj6WHi!@q`{+^ z$$Vg0?P^7w5Dybky$7q+EB}~B+oe)gQ6Dc4Qv!9C^C3zX6|}Gn6e=hm3IwW<5EN1} z{q6HHchA*5wgddpx0a5U=G^l;`|Q2XKKq<|&bc$^{!v$;yS%K-(xKeC%c9i0$15QD zX<28Fi=@KZtT$O+>jukXT@K_j{Ch!2!Uvgc_fK*zd%x5T1Ddv@It3pd50@$5v? zMBARGJ-eFIiRPWcUc{f;>Yn}g36+SA)|CLd_TZm`v>I=W@xvK56dvE{8zxddW@~8i#|G{x&83XaX+9j9T&kb(_ew7Qo-+;#r_(u%* z=M4DQ4fv`7-;Rp8>ABZ{-*3Pt4fvlL@J|`=XAJna4EV1Mcs=@!TfOcu;O{ozaRdIx z2K;Xf_&*u&6$5@19Mw(#w;AwV27K6nKWf1Lw*i0BfPcq;Uxp6nrhmNw?=av;4EUo4 z{38bZQwIDi2K?s+ybJ@5TfJ%wc&h>LGvHYR{)hqpa|8Z=4EQq!{6z!488-#D`rd57 zyAAlT0skWd{!s(|2?Kt{fPWdd+xYx71O4j;{Oudv?XU;92V<)<^cwJ(0lygxYOF1m zH{vZ}^%&?0Z+GCouW%>56%69eIvh-ALa9t}JQR&v_XPYMoxz>WJDYb~lt(w&JytLh z4rM~tSXvT=BO{?~EORiE?o7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96nGt diff --git a/day_7/code.hs b/day_7/code.hs index 70e0db5..b163651 100644 --- a/day_7/code.hs +++ b/day_7/code.hs @@ -26,6 +26,8 @@ minimumsSnd [] = [] minimumsSnd xs = filter ((==) minsnd . snd) xs where minsnd = minimum (map snd xs) +sumK n = ((n+1)*n) `div` 2 + main :: IO () main = do input <- getContents @@ -35,11 +37,11 @@ main = do splitStr "," input } let cases = do { - map (\x -> (x, sum (map (\y -> do { - sum [1..((abs (y-x)))] - }) crabs))) [(minimum crabs)..(maximum crabs)] + map + (\x -> (x, sum (map (\y -> sumK (abs (y-x))) crabs))) + [(minimum crabs)..(maximum crabs)] } let min = minimumsSnd putStrLn $ show $ snd $ head $ min cases -- ans to part 2 --- C'est un code pas du tout efficace \ No newline at end of file +-- Gross, but it works \ No newline at end of file diff --git a/day_7/code.o b/day_7/code.o index baa859e28918969ab2b00c713456e87aa7aeebe2..756f16b8c56517f97809091d9ace035c58cbd44b 100644 GIT binary patch delta 4997 zcma)Z`8N2u0`R{EZdxe(M%O;vI;x1p1mO)wV|0oaiJ2jE?pCo$mROf$cVS~ zK9I*9tlkX}bRCa7b@sCKeB-tU{%;vwIxHWKnp3e~_03~k7<-}@3R zj$u`;FqHMk)_8bPl(Z~XePP|IVQ0OmBvX|05GYcWYr1?-mv?mexh^-ulF*juGOWukU0%}VbzR=l z<$^9Z!2Bjv$=7A6E?af^j4nrY`BPo~Mwg%J(gJrjtD<0(dv*Cel%AP~ES8NH#WL#_ zy@}CdTr7jS_Rm7=vZPq9*a*{Q9JPTD$v5IL@KMr!L|(T|UjINZuOron>C|`l|Ke^H z+zF#h4$~Q>U7m%v9?%u95 zmZ#d!b+$D|>Ib^l4DbdL+k&x^r%nv?Jk@=&_vs$Pl2D)|s&a-XW(Y6z3dd*RU zNn6+1Gd)>DLY`LMD^|z zDKJKO&%Y!Eaem;gkV7Jl%?SXpF*O}dDx?#6nTz0|xfqdlxd=h9=egb<++mwI9 z)zY2HHn>?D%=L-014r@0#&w6dYzI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