結果

問題 No.143 豆
ユーザー hum_ophum_op
提出日時 2016-04-14 20:32:00
言語 F#
(F# 4.0)
結果
AC  
実行時間 86 ms / 1,000 ms
コード長 364 bytes
コンパイル時間 3,374 ms
コンパイル使用メモリ 163,048 KB
実行使用メモリ 24,956 KB
最終ジャッジ日時 2023-09-30 16:44:48
合計ジャッジ時間 5,686 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
22,928 KB
testcase_01 AC 70 ms
22,192 KB
testcase_02 AC 84 ms
22,852 KB
testcase_03 AC 85 ms
22,740 KB
testcase_04 AC 86 ms
24,764 KB
testcase_05 AC 69 ms
24,364 KB
testcase_06 AC 70 ms
24,324 KB
testcase_07 AC 70 ms
22,472 KB
testcase_08 AC 69 ms
22,372 KB
testcase_09 AC 84 ms
22,828 KB
testcase_10 AC 69 ms
22,140 KB
testcase_11 AC 84 ms
22,900 KB
testcase_12 AC 85 ms
22,996 KB
testcase_13 AC 84 ms
20,956 KB
testcase_14 AC 84 ms
24,956 KB
testcase_15 AC 86 ms
24,796 KB
testcase_16 AC 86 ms
22,932 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 No143 () =
    let IN = Console.ReadLine().Split(' ')
    let B = (Int32.Parse IN.[0]) * (Int32.Parse IN.[1])
    let last n = 
        if B - n < 0 then
            printfn "-1"
        else
            printfn "%d" (B - n)

    Console.ReadLine().Split(' ')
    |> Array.map (fun e -> Int32.Parse e)
    |> Array.sum
    |> last
    ()

No143 ()
0