結果

問題 No.143 豆
ユーザー _Clay____
提出日時 2018-09-13 21:04:23
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 339 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2024-07-23 11:04:08
合計ジャッジ時間 1,149 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

(let* ((l1 (string-split (read-line) " "))
       (l2 (string-split (read-line) " "))
       (k (string->number (car l1)))
       (n (string->number (cadr l1)))
       (f (string->number (caddr l1)))
       (a (map string->number l2))
       (s (fold (lambda (x y) (+ x y)) 0 a))
       (r (- (* k n) s)))
 (print (if (negative? r) -1 r)))
0