Submission #5567283


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 a2s = Array.init n @@ fun i -> a_s.(i * 2 + 1) in
  Array.fold_left (+) 0 a2s |> Printf.printf "%d\n"

Submission Info

Submission Time
Task A - AtCoder Group Contest
User lbr
Language OCaml (4.02.3)
Score 300
Code Size 268 Byte
Status
Exec Time 186 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 12 ms 2816 KB
06.txt 181 ms 5760 KB
07.txt 136 ms 5760 KB
08.txt 186 ms 5760 KB
09.txt 184 ms 5760 KB
10.txt 184 ms 6144 KB