結果

問題 No.143 豆
ユーザー chike_pluschike_plus
提出日時 2019-03-19 12:12:53
言語 F#
(F# 4.0)
結果
AC  
実行時間 63 ms / 1,000 ms
コード長 355 bytes
コンパイル時間 4,094 ms
コンパイル使用メモリ 165,108 KB
実行使用メモリ 24,500 KB
最終ジャッジ日時 2023-09-30 17:29:22
合計ジャッジ時間 5,985 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
22,492 KB
testcase_01 AC 61 ms
20,464 KB
testcase_02 AC 60 ms
22,272 KB
testcase_03 AC 60 ms
22,520 KB
testcase_04 AC 60 ms
22,420 KB
testcase_05 AC 62 ms
22,408 KB
testcase_06 AC 62 ms
22,580 KB
testcase_07 AC 63 ms
24,500 KB
testcase_08 AC 63 ms
22,332 KB
testcase_09 AC 60 ms
24,432 KB
testcase_10 AC 62 ms
22,396 KB
testcase_11 AC 61 ms
22,432 KB
testcase_12 AC 60 ms
22,468 KB
testcase_13 AC 61 ms
22,456 KB
testcase_14 AC 59 ms
22,548 KB
testcase_15 AC 61 ms
24,428 KB
testcase_16 AC 60 ms
22,420 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 K, N, F = Console.ReadLine().Split(' ')
              |> fun args -> args.[0] |> int, args.[1] |> int, args.[2] |> int
let As = Console.ReadLine().Split(' ')
         |> Array.map (fun a -> a |> int)
         |> Array.toList

let mutable sum =  K * N

for A in As do
  sum <- sum - A

if sum < 0 
  then -1
  else sum
|> Console.WriteLine
0