Submission #1680308


Source Code Expand

let () =
  let n = Scanf.scanf "%d\n" (fun n -> n) in
  let as_ = Array.init n (fun _ -> Scanf.scanf "%d\n" (fun a -> a)) in
  Array.to_list as_
  |> (fun (a :: as_) -> List.fold_left (fun (acc, prev) a ->
      (acc + min prev a + (prev - min prev a) / 2, a - min prev a)) (0, a) as_)
  |> fst
  |> Printf.printf "%d\n"

Submission Info

Submission Time
Task B - Simplified mahjong
User fetburner
Language OCaml (4.02.3)
Score 0
Code Size 327 Byte
Status WA
Exec Time 37 ms
Memory 6400 KB

Compile Error

File "./Main.ml", line 5, characters 5-141:
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
[]

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 2
AC × 10
WA × 14
Set Name Test Cases
Sample s1.txt, s2.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, s1.txt, s2.txt
Case Name Status Exec Time Memory
01.txt WA 36 ms 4992 KB
02.txt WA 37 ms 6016 KB
03.txt WA 36 ms 5632 KB
04.txt WA 33 ms 5504 KB
05.txt WA 32 ms 5632 KB
06.txt WA 31 ms 5376 KB
07.txt WA 34 ms 5632 KB
08.txt WA 35 ms 5504 KB
09.txt WA 37 ms 5504 KB
10.txt WA 36 ms 5888 KB
11.txt AC 26 ms 5760 KB
12.txt WA 37 ms 6144 KB
13.txt AC 36 ms 6144 KB
14.txt AC 36 ms 6272 KB
15.txt AC 27 ms 6400 KB
16.txt WA 36 ms 4992 KB
17.txt WA 37 ms 6400 KB
18.txt AC 1 ms 384 KB
19.txt AC 1 ms 384 KB
20.txt WA 1 ms 384 KB
21.txt AC 1 ms 384 KB
22.txt AC 1 ms 384 KB
s1.txt AC 1 ms 384 KB
s2.txt AC 1 ms 384 KB