結果

問題 No.1046 Fruits Rush
ユーザー taktak
提出日時 2020-06-25 12:39:07
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 372 bytes
コンパイル時間 3,536 ms
コンパイル使用メモリ 161,040 KB
実行使用メモリ 25,080 KB
最終ジャッジ日時 2023-09-16 22:35:56
合計ジャッジ時間 6,164 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 88 ms
22,832 KB
testcase_02 AC 89 ms
24,908 KB
testcase_03 AC 91 ms
24,908 KB
testcase_04 WA -
testcase_05 AC 91 ms
20,824 KB
testcase_06 AC 92 ms
22,792 KB
testcase_07 AC 92 ms
22,852 KB
testcase_08 AC 91 ms
24,920 KB
testcase_09 WA -
testcase_10 AC 91 ms
22,924 KB
testcase_11 AC 92 ms
22,868 KB
testcase_12 AC 93 ms
22,940 KB
testcase_13 AC 93 ms
22,844 KB
testcase_14 AC 90 ms
22,872 KB
testcase_15 AC 90 ms
24,920 KB
testcase_16 AC 90 ms
24,900 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

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 
        |> Array.where(fun x -> x > 0)
    Array.fold(fun acc x -> acc + x) a.[0] t 
|> printfn "%i"
0