結果

問題 No.851 テストケース
ユーザー xsdxsd
提出日時 2020-06-20 00:05:40
言語 OCaml
(5.1.0)
結果
AC  
実行時間 3 ms / 3,153 ms
コード長 495 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 22,000 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 09:00:16
合計ジャッジ時間 1,089 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 3 ms
6,944 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Scanf.sscanf (read_line ()) "%d" (fun n ->
    try
        let a = Array.init n (fun _ -> Scanf.sscanf (read_line ()) "%d" (fun a -> a)) in
        let module S = Set.Make (struct type t = int let compare = compare end) in
        let s = S.add (a.(0) + a.(1)) S.empty in
        let s = S.add (a.(1) + a.(2)) s in
        let s = S.add (a.(2) + a.(0)) s in
        let c = S.max_elt (S.remove (S.max_elt s) s) in
        Printf.printf "%d\n" c
    with _ ->
        print_endline "\"assert\""
)
0