結果

問題 No.191 供託金
ユーザー maimai8maimai8
提出日時 2020-07-05 14:28:38
言語 OCaml
(5.2.1)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 266 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 21,448 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 01:47:35
合計ジャッジ時間 1,174 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

let () =
  Scanf.scanf "%d\n" @@ fun n ->
  let crr = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ fun d -> d in
  let ok = (Array.fold_left (+) 0 crr) / 10 in
  let ans = Array.fold_left (fun s c -> if c > ok then s else s + 30) 0 crr in
  Printf.printf "%d\n" ans
0