結果
| 問題 | No.1046 Fruits Rush |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-11 10:44:50 |
| 言語 | OCaml (5.2.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 346 bytes |
| 記録 | |
| コンパイル時間 | 276 ms |
| コンパイル使用メモリ | 21,448 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-09 01:00:17 |
| 合計ジャッジ時間 | 903 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 1 WA * 13 |
コンパイルメッセージ
File "Main.ml", line 8, characters 4-30:
8 | List.fast_sort compare lst;
^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning 10 [non-unit-statement]: this expression should have type unit.
ソースコード
open Array
let () =
let n, k = Scanf.scanf "%d %d\n" @@ fun a b -> a, b in
let lst = to_list (init n @@ fun _ -> Scanf.scanf "%d " @@ fun d -> d) in
let rec f lst k = if k = 0 then 0 else match lst with
| [] -> 0
| h :: t -> if h > 0 then h + f t (k-1) else 0 in
List.fast_sort compare lst;
print_int (f lst k)