結果

問題 No.143 豆
ユーザー chike_plus
提出日時 2019-03-19 12:12:53
言語 F#
(F# 4.0)
結果
AC  
実行時間 57 ms / 1,000 ms
コード長 355 bytes
コンパイル時間 9,794 ms
コンパイル使用メモリ 185,816 KB
実行使用メモリ 31,104 KB
最終ジャッジ日時 2024-07-23 11:11:17
合計ジャッジ時間 11,623 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (241 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

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