Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.47 KB | None | 0 0
  1. open System
  2. open System.Text
  3. open System.Text.RegularExpressions
  4. open Microsoft.FSharp.Reflection
  5.  
  6. [<EntryPoint>]
  7. let main argv =
  8.     let n = Console.ReadLine() |> int
  9.     let ar = Console.ReadLine().Split([|' '|], StringSplitOptions.RemoveEmptyEntries) |> Array.map int
  10.     let counts = Array.zeroCreate 101
  11.     ar |> Array.iter (fun s -> (counts.[s] <- counts.[s] + 1))
  12.     let result = counts |> Array.reduce (fun s x -> s + x / 2)
  13.     printf "%d" result
  14.     0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement