結果

問題 No.1046 Fruits Rush
コンテスト
ユーザー tak
提出日時 2020-06-25 12:39:48
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 211 ms / 2,000 ms
+ 602µs
コード長 378 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,821 ms
コンパイル使用メモリ 211,128 KB
実行使用メモリ 37,796 KB
最終ジャッジ日時 2026-08-05 11:37:56
合計ジャッジ時間 9,597 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (173 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

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"
0