結果
| 問題 | No.1046 Fruits Rush |
| コンテスト | |
| ユーザー |
tak
|
| 提出日時 | 2020-06-25 12:39:48 |
| 言語 | F# (F# 10.0) |
| 結果 |
AC
|
| 実行時間 | 215 ms / 2,000 ms |
| コード長 | 378 bytes |
| 記録 | |
| コンパイル時間 | 4,818 ms |
| コンパイル使用メモリ | 209,672 KB |
| 実行使用メモリ | 37,336 KB |
| 最終ジャッジ日時 | 2026-03-25 04:34:45 |
| 合計ジャッジ時間 | 9,275 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (165 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
open System
let (N, K) =
let t = Console.ReadLine().Split() |> Array.map int
t.[0], t.[1]
let A = Console.ReadLine().Split() |> Array.map int
A
|> Array.sortDescending
|> Array.splitAt 1
|> fun (a, b) ->
let t =
b
|> Array.truncate (K - 1)
|> Array.where(fun x -> x > 0)
Array.fold(fun acc x -> acc + x) a.[0] t
|> printfn "%i"
tak