結果

問題 No.143 豆
コンテスト
ユーザー nohopen
提出日時 2019-02-11 15:41:51
言語 Scheme
(Gauche-0.9.15)
コンパイル:
true
実行:
gosh _filename_
結果
AC  
実行時間 17 ms / 1,000 ms
+ 606µs
コード長 323 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 18 ms
コンパイル使用メモリ 6,272 KB
実行使用メモリ 16,256 KB
最終ジャッジ日時 2026-08-24 00:20:34
合計ジャッジ時間 1,658 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

(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