結果

問題 No.143 豆
ユーザー nohopen
提出日時 2019-02-11 15:41:51
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 26 ms / 1,000 ms
コード長 323 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 6,820 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2024-07-23 11:07:43
合計ジャッジ時間 1,256 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (mame K N lis)
  (let* ((result (- (* K N) (fold + 0 lis))))
    (if (< result 0) -1
        result)))

(define (create-list n)
  (if (= n 0) '()
      (cons (read) (create-list (- n 1)))))

(define (main args)
  (let* ((K (read))
         (N (read))
         (F (read)))
    (print (mame K N (create-list F)))) 0)
0