結果

問題 No.851 テストケース
ユーザー xsd
提出日時 2020-06-20 00:05:40
言語 OCaml
(5.2.1)
結果
AC  
実行時間 2 ms / 3,153 ms
コード長 495 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 22,000 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-09 01:27:19
合計ジャッジ時間 1,103 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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