-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.fs
36 lines (31 loc) · 855 Bytes
/
Program.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Learn more about F# at http://fsharp.org
open System
open System.Collections.Generic
let [<Literal>] NO = "NO"
let [<Literal>] YES = "YES"
let [<Literal>] Whitespace = " "
let testCase() =
let n = Console.ReadLine() |> int
let rec xy i =
let data = Whitespace |> Console.ReadLine().Split
match i with
| 1 -> [(data.[0], data.[1])]
| _ -> [(data.[0], data.[1])] @ xy(i-1)
let tuples = xy n
let dc = tuples |> dict
match dc.Keys.Count <> tuples.Length with
| true -> NO
| false -> YES
|> printfn "%s"
()
[<EntryPoint>]
let main argv =
let t = Console.ReadLine() |> int
let rec loop i =
match i with
| 0 -> ()
| _ ->
testCase()
loop (i-1)
loop t
0 // return an integer exit code