Submission #5566590


Source Code Expand

Copy
(* O(n log n) *)
Scanf.scanf "%d" @@ fun n ->
  let a_s = Array.init (3 * n) @@ fun _ -> Scanf.scanf " %d" @@ (+) 0 in
  Array.sort (fun x y -> y - x) a_s;
  let f (i, acc) a = i + 1, acc + if i <= 2 * n && i mod 2 = 0 then a else 0 in
  Array.fold_left f (1, 0) a_s |> snd |> Printf.printf "%d\n"

Submission Info

Submission Time
Task A - AtCoder Group Contest
User lbr
Language OCaml (4.02.3)
Score 300
Code Size 302 Byte
Status
Exec Time 183 ms
Memory 6144 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 00_example_01.txt, 00_example_02.txt
All 300 / 300 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt
Case Name Status Exec Time Memory
00_example_01.txt 1 ms 384 KB
00_example_02.txt 1 ms 384 KB
01.txt 1 ms 384 KB
02.txt 1 ms 384 KB
03.txt 1 ms 384 KB
04.txt 1 ms 384 KB
05.txt 11 ms 2816 KB
06.txt 176 ms 6144 KB
07.txt 134 ms 6016 KB
08.txt 182 ms 5248 KB
09.txt 183 ms 6144 KB
10.txt 183 ms 5376 KB