結果
問題 | No.191 供託金 |
ユーザー |
|
提出日時 | 2020-06-15 20:16:28 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 332 bytes |
コンパイル時間 | 351 ms |
コンパイル使用メモリ | 21,572 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 01:17:11 |
合計ジャッジ時間 | 1,637 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
Scanf.scanf "%d" (fun n -> let c = Array.init n (fun _ -> Scanf.scanf " %d" (fun c -> c)) in let s = Array.fold_left (+) 0 c in let rec loop i sum = if i = n then sum else if c.(i) * 10 <= s then loop (i + 1) (sum + 30) else loop (i + 1) sum in loop 0 0 |> Printf.printf "%d\n" )