結果

問題 No.143 豆
ユーザー nohopennohopen
提出日時 2019-02-11 15:41:51
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 21 ms / 1,000 ms
コード長 323 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 5,228 KB
実行使用メモリ 11,916 KB
最終ジャッジ日時 2023-09-30 17:25:23
合計ジャッジ時間 1,517 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
11,916 KB
testcase_01 AC 19 ms
11,860 KB
testcase_02 AC 19 ms
11,680 KB
testcase_03 AC 19 ms
11,872 KB
testcase_04 AC 18 ms
11,680 KB
testcase_05 AC 19 ms
11,732 KB
testcase_06 AC 20 ms
11,792 KB
testcase_07 AC 18 ms
11,916 KB
testcase_08 AC 19 ms
11,648 KB
testcase_09 AC 21 ms
11,732 KB
testcase_10 AC 20 ms
11,856 KB
testcase_11 AC 19 ms
11,852 KB
testcase_12 AC 19 ms
11,864 KB
testcase_13 AC 19 ms
11,656 KB
testcase_14 AC 19 ms
11,788 KB
testcase_15 AC 19 ms
11,724 KB
testcase_16 AC 19 ms
11,644 KB
権限があれば一括ダウンロードができます

ソースコード

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