結果
問題 |
No.143 豆
|
ユーザー |
![]() |
提出日時 | 2017-05-04 16:27:15 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 287 bytes |
コンパイル時間 | 4,317 ms |
コンパイル使用メモリ | 169,216 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-23 10:45:17 |
合計ジャッジ時間 | 2,620 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Prelude main :: IO () main = do [k, n, _] <- map read . words <$> getLine as <- map read . words <$> getLine print $ calc k n as calc :: Int -> Int -> [Int] -> Int calc k n as = let ms = k * n ts = sum as in if ms < ts then -1 else ms - ts