You are viewing a single comment's thread. Return to all comments →
haskell without DP
import Data.List (intercalate) choose (n, k) = let k' = min k (n-k) in product [n-k'+1..n] `div` product [1..k'] `mod` 100000007 intpair l = (head z, z !! 1) where z = map read $ words l main = do cont <- getContents let ls = tail $ lines cont putStrLn $ intercalate "\n" $ map (show . choose . intpair) ls
Seems like cookies are disabled on this browser, please enable them to open this website
Different Ways
You are viewing a single comment's thread. Return to all comments →
haskell without DP