-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMIMEType.fs
More file actions
21 lines (16 loc) · 752 Bytes
/
Copy pathMIMEType.fs
File metadata and controls
21 lines (16 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(* Auto-generated code below aims at helping you parse *)
(* the standard input according to the problem statement. *)
module MIMEType
open System
let N = int(Console.In.ReadLine()) (* Number of elements which make up the association table. *)
let Q = int(Console.In.ReadLine()) (* Number Q of file names to be analyzed. *)
let map = dict [for i in 0 .. N - 1 do
let token = (Console.In.ReadLine()).Split [|' '|]
yield (token.[0].ToLower(), token.[1])]
for i in 0 .. Q - 1 do
let file = (Console.In.ReadLine().Split [|'.'|])
if file.Length > 1 && map.ContainsKey(file.[file.Length - 1].ToLower()) then
printfn "%s" map.[file.[file.Length - 1].ToLower()]
else
printfn "UNKNOWN"
()