You are viewing a single comment's thread. Return to all comments →
Haskell. Didn't feel like a 50 point problem, but I'll take it /shrug
module Main where import qualified Data.Set as S solve :: Int -> [Int] -> Int solve k ns = let s = S.fromList ns s' = S.map (+ k) s in S.size $ S.intersection s s' main :: IO () main = do [_, k] <- fmap (map read . words) getLine :: IO [Int] ns <- fmap (map read . words) getLine :: IO [Int] print $ solve k ns
Seems like cookies are disabled on this browser, please enable them to open this website
Pairs
You are viewing a single comment's thread. Return to all comments →
Haskell. Didn't feel like a 50 point problem, but I'll take it /shrug