Cleaner 06, thanks Jacky and Lumi
This commit is contained in:
parent
4ffa71e1cc
commit
75639dcf20
|
@ -18,7 +18,7 @@ main = do
|
||||||
lns <- lines <$> getContents
|
lns <- lines <$> getContents
|
||||||
print
|
print
|
||||||
$ product
|
$ product
|
||||||
$ (\(time, dist) -> (\x -> floor (time / 2 + x) - ceiling (time / 2 - x) + 1) . subtract 0.000001 . sqrt . subtract dist . (**2) . (/2) $ time)
|
$ (\(time, dist) -> (\x -> ceiling (time / 2 + x) - floor (time / 2 - x) - 1) . sqrt . subtract dist . (**2) . (/2) $ time)
|
||||||
<$> ((bimap (fromIntegral @_ @Double) (fromIntegral @_ @Double)
|
<$> ((bimap (fromIntegral @_ @Double) (fromIntegral @_ @Double)
|
||||||
. parseRace <$>)
|
. parseRace <$>)
|
||||||
. drop 1
|
. drop 1
|
||||||
|
|
|
@ -17,8 +17,7 @@ main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
lns <- lines <$> getContents
|
lns <- lines <$> getContents
|
||||||
print
|
print
|
||||||
$ (\(time, dist) -> (\x -> floor (time / 2 + x) - ceiling (time / 2 - x) + 1)
|
$ (\(time, dist) -> (\x -> ceiling (time / 2 + x) - floor (time / 2 - x) - 1)
|
||||||
. subtract 0.000001
|
|
||||||
. sqrt
|
. sqrt
|
||||||
. subtract dist
|
. subtract dist
|
||||||
. (**2)
|
. (**2)
|
||||||
|
|
Loading…
Reference in New Issue